@@ -55,17 +55,23 @@ static void process(String[] values, String[] rootsValues, String[] viewerValues
55
55
56
56
57
57
private static final void setValue (String value ) throws CommandException {
58
- try (InputStreamReader isr = new InputStreamReader (new FileInputStream (value ), "UTF-8" )) { // NOI18N
59
- Properties props = new Properties ();
60
- props .load (isr );
61
-
62
- String sourceRoots = props .getProperty (SourceRootsArgument .LONG_NAME );
63
- if (sourceRoots != null ) SourceRootsArgument .setValue (sourceRoots );
64
-
65
- String sourceViewer = props .getProperty (SourceViewerArgument .LONG_NAME );
66
- if (sourceViewer != null ) SourceViewerArgument .setValue (sourceViewer );
67
- } catch (IOException e ) {
68
- throw new CommandException (0 , "--" + LONG_NAME + " failed to read config " + value + ": " + e .getMessage ()); // NOI18N
58
+ if (value != null ) value = value .trim ();
59
+ if (value == null || value .isEmpty ()) {
60
+ SourceRootsArgument .setValue (null );
61
+ SourceViewerArgument .setValue (null );
62
+ } else {
63
+ try (InputStreamReader isr = new InputStreamReader (new FileInputStream (value ), "UTF-8" )) { // NOI18N
64
+ Properties props = new Properties ();
65
+ props .load (isr );
66
+
67
+ String sourceRoots = props .getProperty (SourceRootsArgument .LONG_NAME );
68
+ if (sourceRoots != null ) SourceRootsArgument .setValue (sourceRoots );
69
+
70
+ String sourceViewer = props .getProperty (SourceViewerArgument .LONG_NAME );
71
+ if (sourceViewer != null ) SourceViewerArgument .setValue (sourceViewer );
72
+ } catch (IOException e ) {
73
+ throw new CommandException (0 , "--" + LONG_NAME + " failed to read config " + value + ": " + e .getMessage ()); // NOI18N
74
+ }
69
75
}
70
76
}
71
77
0 commit comments