The documentation for AbstractHelpFormatter.Builder.setComparator() says: "If 
set to null no sorting is performed."

But if you actually do that and try to get the HelpFormatter:
final Builder helpFormatterBuilder = HelpFormatter.builder();
helpFormatterBuilder.setComparator(null);
final HelpFormatter helpFormatter = helpFormatterBuilder.get();

it throws an exception:

java.lang.NullPointerException: comparator

                at java.util.Objects.requireNonNull(Objects.java:228)

                at 
org.apache.commons.cli.help.AbstractHelpFormatter.<init>(AbstractHelpFormatter.java:210)

                at 
org.apache.commons.cli.help.HelpFormatter.<init>(HelpFormatter.java:138)

                at 
org.apache.commons.cli.help.HelpFormatter$Builder.get(HelpFormatter.java:90)

                at my.code.main(Main.java:555)

It doesn't look like there is any code in HelpFormatter or 
AbstractHelpFormatter that functions as described in that documentation.

Reply via email to