@@ -349,51 +349,50 @@ private void addDriverConfigs(
349
349
350
350
// get all driver configuration settings
351
351
config
352
- .getAll (NODE_SECTION , "driver-configuration" )
353
- // if settings exist
352
+ .getArray (NODE_SECTION , "driver-configuration" )
353
+ // if configurations exist
354
354
.ifPresent (
355
355
drivers -> {
356
- Map <String , String > configMap = new HashMap <>();
357
356
List <Map <String , String >> configList = new ArrayList <>();
358
357
359
- // iterate over driver settings
360
- for (String setting : drivers ) {
361
- // split this setting into key/value pair
362
- String [] values = setting .split ("=" , 2 );
363
- // if format is invalid
364
- if (values .length != 2 ) {
365
- throw new ConfigException (
366
- "Driver setting '"
367
- + setting
368
- + "' does not adhere to the required 'key=value' format!" );
369
- }
370
- // if this is a record separator
371
- if (values [0 ].equals (Config .DELIM_KEY )) {
372
- // if config lacks settings
373
- if (configMap .isEmpty ()) {
374
- throw new ConfigException ("Found config delimiter with no preceding settings!" );
375
- }
376
-
377
- // if config lacks 'display-name' setting
378
- if (!configMap .containsKey ("display-name" )) {
379
- throw new ConfigException (
380
- "Found config with no 'display-name' setting! " + configMap );
381
- }
358
+ // iterate over driver configurations
359
+ for (List <String > driver : drivers ) {
360
+ Map <String , String > configMap = new HashMap <>();
382
361
383
- // if config lacks 'stereotype' setting
384
- if (!configMap .containsKey ("stereotype" )) {
362
+ // iterate over driver settings
363
+ for (String setting : driver ) {
364
+ // split this setting into key/value pair
365
+ String [] values = setting .split ("=" , 2 );
366
+ // if format is invalid
367
+ if (values .length != 2 ) {
385
368
throw new ConfigException (
386
- "Found config with no 'stereotype' setting! " + configMap );
369
+ "Driver setting '"
370
+ + setting
371
+ + "' does not adhere to the required 'key=value' format!" );
387
372
}
388
-
389
- // add config to list
390
- configList .add (configMap );
391
- // prepare for next config
392
- configMap = new HashMap <>();
393
- } else {
394
373
// add setting to config
395
374
configMap .put (values [0 ], unquote (values [1 ]));
396
375
}
376
+
377
+ // if config lacks settings
378
+ if (configMap .isEmpty ()) {
379
+ throw new ConfigException ("Found config delimiter with no preceding settings!" );
380
+ }
381
+
382
+ // if config lacks 'display-name' setting
383
+ if (!configMap .containsKey ("display-name" )) {
384
+ throw new ConfigException (
385
+ "Found config with no 'display-name' setting! " + configMap );
386
+ }
387
+
388
+ // if config lacks 'stereotype' setting
389
+ if (!configMap .containsKey ("stereotype" )) {
390
+ throw new ConfigException (
391
+ "Found config with no 'stereotype' setting! " + configMap );
392
+ }
393
+
394
+ // add config to list
395
+ configList .add (configMap );
397
396
}
398
397
399
398
// if no configs were found
0 commit comments