11package io .sloeber .core .api ;
22
3+ import static io .sloeber .core .Messages .*;
34import static io .sloeber .core .common .Common .*;
45import static io .sloeber .core .common .Const .*;
56
2223import org .eclipse .core .runtime .preferences .InstanceScope ;
2324
2425import io .sloeber .core .Activator ;
25- import io .sloeber .core .Messages ;
2626import io .sloeber .core .common .Common ;
2727import io .sloeber .core .common .ConfigurationPreferences ;
2828import io .sloeber .core .managers .ArduinoPlatform ;
3737
3838public class BoardDescription {
3939 // 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 ;
4340 private static final String VendorArduino = ARDUINO ;
4441
4542 /*
@@ -204,9 +201,9 @@ private void ParseSection() {
204201 myReferencedCorePlatformPath = InternalPackageManager .getPlatformInstallPath (refVendor , architecture );
205202 if (this .myReferencedCorePlatformPath == null ) {
206203 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 ())));
210207 return ;
211208 }
212209 } else if (valueSplit .length == 4 ) {
@@ -219,9 +216,9 @@ private void ParseSection() {
219216 refVersion );
220217 if (this .myReferencedCorePlatformPath == null ) {
221218 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 ())));
225222 return ;
226223 }
227224 } else {
@@ -238,9 +235,9 @@ private void ParseSection() {
238235 architecture );
239236 if (this .myReferencedBoardVariantPlatformPath == null ) {
240237 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 ())));
244241 return ;
245242 }
246243 } else if (valueSplit .length == 4 ) {
@@ -258,9 +255,9 @@ private void ParseSection() {
258255 }
259256 if (this .myReferencedBoardVariantPlatformPath == null ) {
260257 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 ())));
264261 return ;
265262 }
266263 } else {
@@ -277,9 +274,9 @@ private void ParseSection() {
277274 architecture );
278275 if (this .myReferencedUploadToolPlatformPath == null ) {
279276 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 ())));
283280 return ;
284281 }
285282 } else if (valueSplit .length == 4 ) {
@@ -292,9 +289,9 @@ private void ParseSection() {
292289 refArchitecture , refVersion );
293290 if (this .myReferencedUploadToolPlatformPath == null ) {
294291 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 ())));
298295 return ;
299296 }
300297 } else {
@@ -359,7 +356,7 @@ public BoardDescription(BoardDescription srcObject) {
359356 myBoardID = srcObject .myBoardID ;
360357 myUploadPort = srcObject .myUploadPort ;
361358 myProgrammer = srcObject .myProgrammer ;
362- myOptions = srcObject .myOptions ;
359+ myOptions = new TreeMap <>( srcObject .myOptions ) ;
363360 }
364361
365362
@@ -476,7 +473,7 @@ public void setreferencingBoardsFile(File boardsFile) {
476473 return ;// ignore
477474 }
478475 /*
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
480477 * (this.myreferencingBoardsFile.equals(resolvePathEnvironmentString(boardsFile)
481478 * )) { return; }
482479 */
@@ -1013,7 +1010,7 @@ private Map<String, String> getEnvVarsPostProcessing(Map<String, String> vars) {
10131010
10141011 switch (recipeParts .length ) {
10151012 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$
10171014 break ;
10181015 case 1 :
10191016 extraVars .put (recipeKey + DOT + '1' , recipeParts [0 ]);
0 commit comments