3
3
import java .io .File ;
4
4
import java .net .URI ;
5
5
import java .util .ArrayList ;
6
- import java .util .HashMap ;
7
6
import java .util .Map ;
8
7
import java .util .Map .Entry ;
9
8
import java .util .Set ;
@@ -108,7 +107,7 @@ protected BoardDescriptor(ICConfigurationDescription confdesc) {
108
107
this .myBoardID = Common .getBuildEnvironmentVariable (confdesc , Const .ENV_KEY_JANTJE_BOARD_ID , "" );
109
108
this .myTxtFile = new TxtFile (this .myBoardsFile );
110
109
111
- this .myOptions = new HashMap <>();
110
+ this .myOptions = new TreeMap <>(String . CASE_INSENSITIVE_ORDER );
112
111
IEnvironmentVariableManager envManager = CCorePlugin .getDefault ().getBuildEnvironmentManager ();
113
112
IContributedEnvironment contribEnv = envManager .getContributedEnvironment ();
114
113
IEnvironmentVariable [] curVariables = contribEnv .getVariables (confdesc );
@@ -128,7 +127,8 @@ protected BoardDescriptor(File boardsFile, String boardID, Map<String, String> o
128
127
this .myUploadPort = Const .EMPTY_STRING ;
129
128
this .myUploadProtocol = Defaults .getDefaultUploadProtocol ();
130
129
this .myBoardID = boardID ;
131
- this .myOptions = options ;
130
+ this .myOptions = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
131
+ this .myOptions .putAll (options );
132
132
this .myBoardsFile = boardsFile ;
133
133
this .myTxtFile = new TxtFile (this .myBoardsFile );
134
134
}
@@ -359,10 +359,16 @@ public void setBoardsFile(File boardsFile) {
359
359
}
360
360
361
361
public void setOptions (Map <String , String > options ) {
362
- this .myOptions = options ;
363
-
362
+ this .myOptions = new TreeMap <>( String . CASE_INSENSITIVE_ORDER ) ;
363
+ this . myOptions . putAll ( options );
364
364
}
365
365
366
+ /**
367
+ * Returns the options for this board This reflects the options selected
368
+ * through the menu functionality in the boards.txt
369
+ *
370
+ * @return a map of case insensitive ordered key value pairs
371
+ */
366
372
public Map <String , String > getOptions () {
367
373
return this .myOptions ;
368
374
}
@@ -440,7 +446,7 @@ private String menuOptionsToString() {
440
446
}
441
447
442
448
private void menuOptionsFromString (String options ) {
443
- this .myOptions = new HashMap <>();
449
+ this .myOptions = new TreeMap <>(String . CASE_INSENSITIVE_ORDER );
444
450
if (options != null ) {
445
451
String [] lines = options .split ("\n " ); //$NON-NLS-1$
446
452
for (String curLine : lines ) {
0 commit comments