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
import picocli.CommandLine;
import picocli.CommandLine.Option;
public class A {
@Option(names = { "-u", "--user" }, required = true, description = "user id")
private String user;
@Option(names = { "-p", "--password" }, required = true, description = "password")
private String password;
public static void main(String[] args) {
A a = new A();
CommandLine commandLine = new CommandLine(a);
commandLine.parse("-u", "foo");
}
}
Leads to the following exception on run:
Exception in thread "main" java.lang.NullPointerException
at picocli.CommandLine$PositionalParametersSorter.compare(CommandLine.java:1581)
at picocli.CommandLine$PositionalParametersSorter.compare(CommandLine.java:1579)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
at java.util.TimSort.sort(TimSort.java:220)
at java.util.Arrays.sort(Arrays.java:1512)
at java.util.ArrayList.sort(ArrayList.java:1454)
at java.util.Collections.sort(Collections.java:175)
at picocli.CommandLine$Interpreter.parse(CommandLine.java:1097)
at picocli.CommandLine$Interpreter.parse(CommandLine.java:1090)
at picocli.CommandLine.parse(CommandLine.java:191)
at com.bmo.channels.bitbucket.A.main(A.java:16)
The text was updated successfully, but these errors were encountered:
The issue has been fixed and is included in the new 0.9.7 release.
The example will now throw a MissingParameterException "Missing required option 'password'", which I believe is correct behaviour.
Leads to the following exception on run:
The text was updated successfully, but these errors were encountered: