You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is intended but any empty <argument> tag adds null to String[] args.
I noticed this since it caused a NullPointerException when trying to parse arguments with Apache CLI. Stacktrace:
java.lang.NullPointerException
at org.apache.commons.cli.DefaultParser.handleToken (DefaultParser.java:237)
at org.apache.commons.cli.DefaultParser.parse (DefaultParser.java:120)
at org.apache.commons.cli.DefaultParser.parse (DefaultParser.java:76)
at org.apache.commons.cli.DefaultParser.parse (DefaultParser.java:60)
[...]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
at java.lang.Thread.run (Thread.java:834)
The reason for me occasionally using an empty <argument> tag is that I'm using a little workaround for combining CLI-arguments with arguments specified within pom.xml as such:
Which I don't like since the placeholder still gets passed on to the program. Shouldn't an empty <argument> tag not add anything to String[] args at all?
The text was updated successfully, but these errors were encountered:
Anders-E
changed the title
Empty <argument> tag throws NullPointerException
Empty <argument> tag not really empty?
May 16, 2019
Anders-E
changed the title
Empty <argument> tag not really empty?
Empty <argument> tag adds null to args
May 17, 2019
I'm not sure if this is intended but any empty
<argument>
tag addsnull
toString[] args
.I noticed this since it caused a
NullPointerException
when trying to parse arguments with Apache CLI. Stacktrace:The reason for me occasionally using an empty
<argument>
tag is that I'm using a little workaround for combining CLI-arguments with arguments specified withinpom.xml
as such:As of now, I have to keep a placeholder to avoid the crash:
Which I don't like since the placeholder still gets passed on to the program. Shouldn't an empty
<argument>
tag not add anything toString[] args
at all?The text was updated successfully, but these errors were encountered: