Skip to content

Commit af02774

Browse files
committed
SystemPropertyArgument: allow any string for keys
The previous regex was not allowing colons, which Java definitely allows. But after briefly trying to research what's allowed and what's not, I decided it doesn't really matter, and we should just try setting whatever the user is trying to set, and if it fails with an exception on the Java side, so be it -- but that's no reason not to eagerly reject the expression in this ConsoleArgument plugin.
1 parent c1849d7 commit af02774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/console/SystemPropertyArgument.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@Plugin(type = ConsoleArgument.class)
4545
public class SystemPropertyArgument extends AbstractConsoleArgument {
4646

47-
private static final String SYS_PROP_REGEX = "-D([\\w\\._-]+)(=(.*))?";
47+
private static final String SYS_PROP_REGEX = "-D([^=]+)(=(.*))?";
4848
private static final Pattern SYS_PROP_PAT = Pattern.compile(SYS_PROP_REGEX);
4949

5050
// -- Constructor --

0 commit comments

Comments
 (0)