1
1
package io .sloeber .core .api ;
2
2
3
+ import static io .sloeber .core .Messages .*;
3
4
import static io .sloeber .core .common .Common .*;
4
5
import static io .sloeber .core .common .Const .*;
5
6
22
23
import org .eclipse .core .runtime .preferences .InstanceScope ;
23
24
24
25
import io .sloeber .core .Activator ;
25
- import io .sloeber .core .Messages ;
26
26
import io .sloeber .core .common .Common ;
27
27
import io .sloeber .core .common .ConfigurationPreferences ;
28
28
import io .sloeber .core .managers .ArduinoPlatform ;
37
37
38
38
public class BoardDescription {
39
39
// Important constants to avoid having to add the class
40
- private static final String TOOL_ID = Messages .TOOL ;
41
- private static final String BOARD_ID = Messages .BOARD ;
42
- private static final String FILE_ID = Messages .FILE ;
43
40
private static final String VendorArduino = ARDUINO ;
44
41
45
42
/*
@@ -204,9 +201,9 @@ private void ParseSection() {
204
201
myReferencedCorePlatformPath = InternalPackageManager .getPlatformInstallPath (refVendor , architecture );
205
202
if (this .myReferencedCorePlatformPath == null ) {
206
203
Common .log (new Status (IStatus .ERROR , CORE_PLUGIN_ID ,
207
- Messages . Helpers_tool_reference_missing .replace (TOOL_ID , core )
208
- .replace (FILE_ID , getReferencingBoardsFile ().toString ())
209
- .replace (BOARD_ID , getBoardID ())));
204
+ Helpers_tool_reference_missing .replace (TOOL_TAG , core )
205
+ .replace (FILE_TAG , getReferencingBoardsFile ().toString ())
206
+ .replace (BOARD_TAG , getBoardID ())));
210
207
return ;
211
208
}
212
209
} else if (valueSplit .length == 4 ) {
@@ -219,9 +216,9 @@ private void ParseSection() {
219
216
refVersion );
220
217
if (this .myReferencedCorePlatformPath == null ) {
221
218
Common .log (new Status (IStatus .ERROR , CORE_PLUGIN_ID ,
222
- Messages . Helpers_tool_reference_missing .replace (TOOL_ID , core )
223
- .replace (FILE_ID , getReferencingBoardsFile ().toString ())
224
- .replace (BOARD_ID , getBoardID ())));
219
+ Helpers_tool_reference_missing .replace (TOOL_TAG , core )
220
+ .replace (FILE_TAG , getReferencingBoardsFile ().toString ())
221
+ .replace (BOARD_TAG , getBoardID ())));
225
222
return ;
226
223
}
227
224
} else {
@@ -238,9 +235,9 @@ private void ParseSection() {
238
235
architecture );
239
236
if (this .myReferencedBoardVariantPlatformPath == null ) {
240
237
Common .log (new Status (IStatus .ERROR , CORE_PLUGIN_ID ,
241
- Messages . Helpers_tool_reference_missing .replace (TOOL_ID , variant )
242
- .replace (FILE_ID , getReferencingBoardsFile ().toString ())
243
- .replace (BOARD_ID , getBoardID ())));
238
+ Helpers_tool_reference_missing .replace (TOOL_TAG , variant )
239
+ .replace (FILE_TAG , getReferencingBoardsFile ().toString ())
240
+ .replace (BOARD_TAG , getBoardID ())));
244
241
return ;
245
242
}
246
243
} else if (valueSplit .length == 4 ) {
@@ -258,9 +255,9 @@ private void ParseSection() {
258
255
}
259
256
if (this .myReferencedBoardVariantPlatformPath == null ) {
260
257
Common .log (new Status (IStatus .ERROR , CORE_PLUGIN_ID ,
261
- Messages . Helpers_tool_reference_missing .replace (TOOL_ID , variant )
262
- .replace (FILE_ID , getReferencingBoardsFile ().toString ())
263
- .replace (BOARD_ID , getBoardID ())));
258
+ Helpers_tool_reference_missing .replace (TOOL_TAG , variant )
259
+ .replace (FILE_TAG , getReferencingBoardsFile ().toString ())
260
+ .replace (BOARD_TAG , getBoardID ())));
264
261
return ;
265
262
}
266
263
} else {
@@ -277,9 +274,9 @@ private void ParseSection() {
277
274
architecture );
278
275
if (this .myReferencedUploadToolPlatformPath == null ) {
279
276
Common .log (new Status (IStatus .ERROR , CORE_PLUGIN_ID ,
280
- Messages . Helpers_tool_reference_missing .replace (TOOL_ID , upload )
281
- .replace (FILE_ID , getReferencingBoardsFile ().toString ())
282
- .replace (BOARD_ID , getBoardID ())));
277
+ Helpers_tool_reference_missing .replace (TOOL_TAG , upload )
278
+ .replace (FILE_TAG , getReferencingBoardsFile ().toString ())
279
+ .replace (BOARD_TAG , getBoardID ())));
283
280
return ;
284
281
}
285
282
} else if (valueSplit .length == 4 ) {
@@ -292,9 +289,9 @@ private void ParseSection() {
292
289
refArchitecture , refVersion );
293
290
if (this .myReferencedUploadToolPlatformPath == null ) {
294
291
Common .log (new Status (IStatus .ERROR , CORE_PLUGIN_ID ,
295
- Messages . Helpers_tool_reference_missing .replace (TOOL_ID , upload )
296
- .replace (FILE_ID , getReferencingBoardsFile ().toString ())
297
- .replace (BOARD_ID , getBoardID ())));
292
+ Helpers_tool_reference_missing .replace (TOOL_TAG , upload )
293
+ .replace (FILE_TAG , getReferencingBoardsFile ().toString ())
294
+ .replace (BOARD_TAG , getBoardID ())));
298
295
return ;
299
296
}
300
297
} else {
@@ -359,7 +356,7 @@ public BoardDescription(BoardDescription srcObject) {
359
356
myBoardID = srcObject .myBoardID ;
360
357
myUploadPort = srcObject .myUploadPort ;
361
358
myProgrammer = srcObject .myProgrammer ;
362
- myOptions = srcObject .myOptions ;
359
+ myOptions = new TreeMap <>( srcObject .myOptions ) ;
363
360
}
364
361
365
362
@@ -476,7 +473,7 @@ public void setreferencingBoardsFile(File boardsFile) {
476
473
return ;// ignore
477
474
}
478
475
/*
479
- * do not do this optimisation as workaround changes will not be captured if
476
+ * do not do this optimization as workaround changes will not be captured if
480
477
* (this.myreferencingBoardsFile.equals(resolvePathEnvironmentString(boardsFile)
481
478
* )) { return; }
482
479
*/
@@ -1013,7 +1010,7 @@ private Map<String, String> getEnvVarsPostProcessing(Map<String, String> vars) {
1013
1010
1014
1011
switch (recipeParts .length ) {
1015
1012
case 0 :
1016
- extraVars .put (recipeKey + DOT + '1' , "echo no command for \" {KEY}\" ." .replace (Messages . KEY , recipeKey )); //$NON-NLS-1$
1013
+ extraVars .put (recipeKey + DOT + '1' , "echo no command for \" {KEY}\" ." .replace (KEY_TAG , recipeKey )); //$NON-NLS-1$
1017
1014
break ;
1018
1015
case 1 :
1019
1016
extraVars .put (recipeKey + DOT + '1' , recipeParts [0 ]);
0 commit comments