2121package processing .app .debug ;
2222
2323import processing .app .BaseNoGui ;
24- import processing .app .I18n ;
2524import processing .app .helpers .PreferencesMap ;
2625
2726import java .io .File ;
3029import java .util .Map ;
3130import java .util .Set ;
3231
33- import static processing .app .I18n .tr ;
3432import static processing .app .I18n .format ;
33+ import static processing .app .I18n .tr ;
3534
3635public class LegacyTargetPlatform implements TargetPlatform {
3736
38- private String id ;
39- private File folder ;
37+ private final String id ;
38+ private final File folder ;
4039
41- private TargetPackage containerPackage ;
42- protected PreferencesMap preferences = new PreferencesMap ();
40+ private final TargetPackage containerPackage ;
41+ private final PreferencesMap preferences = new PreferencesMap ();
4342
44- private Map <String , TargetBoard > boards = new LinkedHashMap <String , TargetBoard >();
43+ private final Map <String , TargetBoard > boards = new LinkedHashMap <>();
4544 private TargetBoard defaultBoard ;
4645
4746 /**
4847 * Contains preferences for every defined programmer
4948 */
50- private Map <String , PreferencesMap > programmers = new LinkedHashMap <String , PreferencesMap >();
49+ private Map <String , PreferencesMap > programmers = new LinkedHashMap <>();
5150
5251 /**
5352 * Contains labels for top level menus
@@ -162,15 +161,9 @@ private void rewriteKeysOfOldPlatformsTxtAndWarnAboutIt() throws IOException {
162161 PreferencesMap oldProps = platformRewriteProps .subTree ("old" );
163162 PreferencesMap newProps = platformRewriteProps .subTree ("new" );
164163
165- String platformName = preferences .get ("name" );
166- if (platformName == null ) {
167- platformName = folder .getAbsolutePath ();
168- }
169-
170164 for (Map .Entry <String , String > entry : oldProps .entrySet ()) {
171165 String preferencesKey = entry .getKey ().substring (entry .getKey ().indexOf ("." ) + 1 );
172166 if (preferences .containsKey (preferencesKey ) && entry .getValue ().equals (preferences .get (preferencesKey ))) {
173- 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 ())));
174167 preferences .put (preferencesKey , newProps .get (entry .getKey ()));
175168 }
176169 }
@@ -182,7 +175,6 @@ private void rewriteKeysOfOldPlatformsTxtAndWarnAboutIt() throws IOException {
182175 String keyToAddFirstLevel = keyToAddParts [0 ];
183176 String keyToAddSecondLevel = keyToAddParts [0 ] + "." + keyToAddParts [1 ];
184177 if (!preferences .subTree (keyToAddFirstLevel ).isEmpty () && !preferences .subTree (keyToAddSecondLevel ).isEmpty () && !preferences .containsKey (keyToAdd )) {
185- 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 ()));
186178 preferences .put (keyToAdd , entry .getValue ());
187179 }
188180 }
0 commit comments