1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-21 15:54:39 +01:00

Fix linter problems

This commit is contained in:
Mattia Bertorello 2019-07-12 15:11:40 +02:00
parent 4da41f7fa5
commit 636f93058b
No known key found for this signature in database
GPG Key ID: CE1FB2BE91770F24
2 changed files with 8 additions and 10 deletions

View File

@ -117,13 +117,13 @@ public class FileDownloaderCache {
} }
} }
static Optional<FileCached> getFileCached(final URL remoteURL) public static Optional<FileCached> getFileCached(final URL remoteURL)
throws URISyntaxException, NoSuchMethodException, ScriptException, throws URISyntaxException, NoSuchMethodException, ScriptException,
IOException { IOException {
return getFileCached(remoteURL, true); return getFileCached(remoteURL, true);
} }
static Optional<FileCached> getFileCached(final URL remoteURL, boolean enableCache) public static Optional<FileCached> getFileCached(final URL remoteURL, boolean enableCache)
throws URISyntaxException, NoSuchMethodException, ScriptException, throws URISyntaxException, NoSuchMethodException, ScriptException,
IOException { IOException {
// Return always and empty file if the cache is not enable // Return always and empty file if the cache is not enable
@ -305,7 +305,7 @@ public class FileDownloaderCache {
} }
@JsonIgnore @JsonIgnore
Optional<File> getFileFromCache() { public Optional<File> getFileFromCache() {
if (md5Check()) { if (md5Check()) {
return Optional.of(Paths.get(localPath).toFile()); return Optional.of(Paths.get(localPath).toFile());
} }
@ -313,7 +313,7 @@ public class FileDownloaderCache {
} }
synchronized void updateCacheFile(File fileToCache) throws Exception { public synchronized void updateCacheFile(File fileToCache) throws Exception {
Path cacheFilePath = Paths.get(localPath); Path cacheFilePath = Paths.get(localPath);
// If the cache directory does not exist create it // If the cache directory does not exist create it
@ -343,7 +343,7 @@ public class FileDownloaderCache {
} }
synchronized void invalidateCache() throws IOException { public synchronized void invalidateCache() throws IOException {
cachedFiles.remove(remoteURL); cachedFiles.remove(remoteURL);
Files.deleteIfExists(Paths.get(localPath)); Files.deleteIfExists(Paths.get(localPath));
} }
@ -356,7 +356,7 @@ public class FileDownloaderCache {
} }
@JsonIgnore @JsonIgnore
boolean md5Check() { public boolean md5Check() {
try { try {
return !Objects.isNull(getMD5()) && Objects.equals(calculateMD5(), getMD5()); return !Objects.isNull(getMD5()) && Objects.equals(calculateMD5(), getMD5());
} catch (Exception e) { } catch (Exception e) {
@ -366,7 +366,7 @@ public class FileDownloaderCache {
} }
@JsonIgnore @JsonIgnore
LocalDateTime getExpiresTime() { public LocalDateTime getExpiresTime() {
final int maxAge; final int maxAge;
if (cacheControl != null) { if (cacheControl != null) {
maxAge = cacheControl.getMaxAge(); maxAge = cacheControl.getMaxAge();

View File

@ -257,11 +257,9 @@ public class Platform {
} }
public static class BoardCloudAPIid { public static class BoardCloudAPIid {
public BoardCloudAPIid() {
}
private String name;
private String fqbn; private String fqbn;
private String name;
private String architecture; private String architecture;
private String id; private String id;