diff --git a/arduino-core/src/processing/app/debug/LegacyTargetBoard.java b/arduino-core/src/processing/app/debug/LegacyTargetBoard.java index 9481e48b9..16770a635 100644 --- a/arduino-core/src/processing/app/debug/LegacyTargetBoard.java +++ b/arduino-core/src/processing/app/debug/LegacyTargetBoard.java @@ -20,27 +20,21 @@ */ package processing.app.debug; -import static processing.app.I18n.tr; -import static processing.app.I18n.format; +import processing.app.helpers.PreferencesMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; -import processing.app.helpers.PreferencesMap; - public class LegacyTargetBoard implements TargetBoard { - private String id; - private PreferencesMap prefs; - private Map menuOptions = new LinkedHashMap(); - private TargetPlatform containerPlatform; + private final String id; + private final PreferencesMap prefs; + private Map menuOptions = new LinkedHashMap<>(); + private final TargetPlatform containerPlatform; /** * Create a TargetBoard based on preferences passed as argument. - * - * @param _prefs - * @return */ public LegacyTargetBoard(String _id, PreferencesMap _prefs, TargetPlatform parent) { @@ -58,10 +52,6 @@ public class LegacyTargetBoard implements TargetBoard { String board = containerPlatform.getId() + "_" + id; board = board.toUpperCase(); prefs.put("build.board", board); - System.err - .println(format(tr("Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}"), - containerPlatform.getContainerPackage().getId(), - containerPlatform.getId(), id, board)); } } diff --git a/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java b/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java index 036860832..65e4d4fdc 100644 --- a/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java +++ b/arduino-core/src/processing/app/debug/LegacyTargetPlatform.java @@ -21,7 +21,6 @@ package processing.app.debug; import processing.app.BaseNoGui; -import processing.app.I18n; import processing.app.helpers.PreferencesMap; import java.io.File; @@ -30,24 +29,24 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; -import static processing.app.I18n.tr; import static processing.app.I18n.format; +import static processing.app.I18n.tr; public class LegacyTargetPlatform implements TargetPlatform { - private String id; - private File folder; + private final String id; + private final File folder; - private TargetPackage containerPackage; - protected PreferencesMap preferences = new PreferencesMap(); + private final TargetPackage containerPackage; + private final PreferencesMap preferences = new PreferencesMap(); - private Map boards = new LinkedHashMap(); + private final Map boards = new LinkedHashMap<>(); private TargetBoard defaultBoard; /** * Contains preferences for every defined programmer */ - private Map programmers = new LinkedHashMap(); + private Map programmers = new LinkedHashMap<>(); /** * Contains labels for top level menus @@ -162,15 +161,9 @@ public class LegacyTargetPlatform implements TargetPlatform { PreferencesMap oldProps = platformRewriteProps.subTree("old"); PreferencesMap newProps = platformRewriteProps.subTree("new"); - String platformName = preferences.get("name"); - if (platformName == null) { - platformName = folder.getAbsolutePath(); - } - for (Map.Entry entry : oldProps.entrySet()) { String preferencesKey = entry.getKey().substring(entry.getKey().indexOf(".") + 1); if (preferences.containsKey(preferencesKey) && entry.getValue().equals(preferences.get(preferencesKey))) { - System.err.println(I18n.format(tr("Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core."), platformName, preferencesKey + "=" + entry.getValue(), preferencesKey + "=" + newProps.get(entry.getKey()))); preferences.put(preferencesKey, newProps.get(entry.getKey())); } } @@ -182,7 +175,6 @@ public class LegacyTargetPlatform implements TargetPlatform { String keyToAddFirstLevel = keyToAddParts[0]; String keyToAddSecondLevel = keyToAddParts[0] + "." + keyToAddParts[1]; if (!preferences.subTree(keyToAddFirstLevel).isEmpty() && !preferences.subTree(keyToAddSecondLevel).isEmpty() && !preferences.containsKey(keyToAdd)) { - System.err.println(I18n.format(tr("Warning: platform.txt from core '{0}' misses property {1}, automatically set to {2}. Consider upgrading this core."), platformName, keyToAdd, entry.getValue())); preferences.put(keyToAdd, entry.getValue()); } } diff --git a/arduino-core/src/processing/app/packages/UserLibrary.java b/arduino-core/src/processing/app/packages/UserLibrary.java index 10d5d64e6..c621a6e17 100644 --- a/arduino-core/src/processing/app/packages/UserLibrary.java +++ b/arduino-core/src/processing/app/packages/UserLibrary.java @@ -31,7 +31,6 @@ package processing.app.packages; import cc.arduino.Constants; import cc.arduino.contributions.libraries.ContributedLibrary; import cc.arduino.contributions.libraries.ContributedLibraryReference; -import processing.app.helpers.FileUtils; import processing.app.helpers.PreferencesMap; import java.io.File; @@ -91,11 +90,6 @@ public class UserLibrary extends ContributedLibrary { if (srcFolder.exists() && srcFolder.isDirectory()) { // Layout with a single "src" folder and recursive compilation layout = LibraryLayout.RECURSIVE; - - File utilFolder = new File(libFolder, "utility"); - if (utilFolder.exists() && utilFolder.isDirectory()) { - throw new IOException("Library can't use both 'src' and 'utility' folders."); - } } else { // Layout with source code on library's root and "utility" folders layout = LibraryLayout.FLAT; @@ -106,13 +100,6 @@ public class UserLibrary extends ContributedLibrary { if (files == null) { throw new IOException("Unable to list files of library in " + libFolder); } - for (File file : files) { - if (file.isDirectory() && FileUtils.isSCCSOrHiddenFile(file)) { - if (!FileUtils.isSCCSFolder(file) && FileUtils.isHiddenFile(file)) { - System.out.println("WARNING: Spurious " + file.getName() + " folder in '" + properties.get("name") + "' library"); - } - } - } // Extract metadata info String architectures = properties.get("architectures"); @@ -123,10 +110,10 @@ public class UserLibrary extends ContributedLibrary { archs.add(arch.trim()); String category = properties.get("category"); - if (category == null) + if (category == null) { category = "Uncategorized"; + } if (!Constants.LIBRARY_CATEGORIES.contains(category)) { - System.out.println("WARNING: Category '" + category + "' in library " + properties.get("name") + " is not valid. Setting to 'Uncategorized'"); category = "Uncategorized"; }