From 636f93058b48c1b712dc91b74757a7914f4145d3 Mon Sep 17 00:00:00 2001 From: Mattia Bertorello Date: Fri, 12 Jul 2019 15:11:40 +0200 Subject: [PATCH] Fix linter problems --- .../arduino/utils/network/FileDownloaderCache.java | 14 +++++++------- arduino-core/src/processing/app/Platform.java | 4 +--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arduino-core/src/cc/arduino/utils/network/FileDownloaderCache.java b/arduino-core/src/cc/arduino/utils/network/FileDownloaderCache.java index d55d5f1ef..4fe38689f 100644 --- a/arduino-core/src/cc/arduino/utils/network/FileDownloaderCache.java +++ b/arduino-core/src/cc/arduino/utils/network/FileDownloaderCache.java @@ -117,13 +117,13 @@ public class FileDownloaderCache { } } - static Optional getFileCached(final URL remoteURL) + public static Optional getFileCached(final URL remoteURL) throws URISyntaxException, NoSuchMethodException, ScriptException, IOException { return getFileCached(remoteURL, true); } - static Optional getFileCached(final URL remoteURL, boolean enableCache) + public static Optional getFileCached(final URL remoteURL, boolean enableCache) throws URISyntaxException, NoSuchMethodException, ScriptException, IOException { // Return always and empty file if the cache is not enable @@ -305,7 +305,7 @@ public class FileDownloaderCache { } @JsonIgnore - Optional getFileFromCache() { + public Optional getFileFromCache() { if (md5Check()) { 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); // 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); Files.deleteIfExists(Paths.get(localPath)); } @@ -356,7 +356,7 @@ public class FileDownloaderCache { } @JsonIgnore - boolean md5Check() { + public boolean md5Check() { try { return !Objects.isNull(getMD5()) && Objects.equals(calculateMD5(), getMD5()); } catch (Exception e) { @@ -366,7 +366,7 @@ public class FileDownloaderCache { } @JsonIgnore - LocalDateTime getExpiresTime() { + public LocalDateTime getExpiresTime() { final int maxAge; if (cacheControl != null) { maxAge = cacheControl.getMaxAge(); diff --git a/arduino-core/src/processing/app/Platform.java b/arduino-core/src/processing/app/Platform.java index b2b0bdf22..5e8056364 100644 --- a/arduino-core/src/processing/app/Platform.java +++ b/arduino-core/src/processing/app/Platform.java @@ -257,11 +257,9 @@ public class Platform { } public static class BoardCloudAPIid { - public BoardCloudAPIid() { - } - private String name; private String fqbn; + private String name; private String architecture; private String id;