I'm using "org.apache.commons.cli.*" library.
IDEA highlights code about OptionBuilder with "Static member accessed via instance interface".
When I press Alt-Enter, IDEA removes code .withArgName(), .hasArg(), etc ... and I can't Undo this.
private static Options getHelpOptions() {
Option help = new Option( "help", "print this message" );
Option version = new Option( "version", "print the version information and exit" );
Option urlparam = OptionBuilder.withArgName("urlparam")
.hasArg()
.withDescription( "to search only records like ?<urlparam>xxxx" )
.create( "urlparam");
Option hostname = OptionBuilder.withArgName( "hostname" )
.hasArg()
.withDescription( "hostname to print to report" )
.create( "hostname");
Options options = new Options();
options.addOption(help);
options.addOption(version);
options.addOption(urlparam);
options.addOption(hostname);
return options; }