21
21
package processing .app .debug ;
22
22
23
23
import processing .app .BaseNoGui ;
24
- import processing .app .I18n ;
25
24
import processing .app .helpers .PreferencesMap ;
26
25
27
26
import java .io .File ;
30
29
import java .util .Map ;
31
30
import java .util .Set ;
32
31
33
- import static processing .app .I18n .tr ;
34
32
import static processing .app .I18n .format ;
33
+ import static processing .app .I18n .tr ;
35
34
36
35
public class LegacyTargetPlatform implements TargetPlatform {
37
36
38
- private String id ;
39
- private File folder ;
37
+ private final String id ;
38
+ private final File folder ;
40
39
41
- private TargetPackage containerPackage ;
42
- protected PreferencesMap preferences = new PreferencesMap ();
40
+ private final TargetPackage containerPackage ;
41
+ private final PreferencesMap preferences = new PreferencesMap ();
43
42
44
- private Map <String , TargetBoard > boards = new LinkedHashMap <String , TargetBoard >();
43
+ private final Map <String , TargetBoard > boards = new LinkedHashMap <>();
45
44
private TargetBoard defaultBoard ;
46
45
47
46
/**
48
47
* Contains preferences for every defined programmer
49
48
*/
50
- private Map <String , PreferencesMap > programmers = new LinkedHashMap <String , PreferencesMap >();
49
+ private Map <String , PreferencesMap > programmers = new LinkedHashMap <>();
51
50
52
51
/**
53
52
* Contains labels for top level menus
@@ -162,15 +161,9 @@ private void rewriteKeysOfOldPlatformsTxtAndWarnAboutIt() throws IOException {
162
161
PreferencesMap oldProps = platformRewriteProps .subTree ("old" );
163
162
PreferencesMap newProps = platformRewriteProps .subTree ("new" );
164
163
165
- String platformName = preferences .get ("name" );
166
- if (platformName == null ) {
167
- platformName = folder .getAbsolutePath ();
168
- }
169
-
170
164
for (Map .Entry <String , String > entry : oldProps .entrySet ()) {
171
165
String preferencesKey = entry .getKey ().substring (entry .getKey ().indexOf ("." ) + 1 );
172
166
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 ())));
174
167
preferences .put (preferencesKey , newProps .get (entry .getKey ()));
175
168
}
176
169
}
@@ -182,7 +175,6 @@ private void rewriteKeysOfOldPlatformsTxtAndWarnAboutIt() throws IOException {
182
175
String keyToAddFirstLevel = keyToAddParts [0 ];
183
176
String keyToAddSecondLevel = keyToAddParts [0 ] + "." + keyToAddParts [1 ];
184
177
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 ()));
186
178
preferences .put (keyToAdd , entry .getValue ());
187
179
}
188
180
}
0 commit comments