Fwd: Re: Review request: 8003562: Provide a command-line tool to find static dependenciesh

Ulf Ulf.Zibis at CoSoCo.de
Fri Dec 21 12:19:45 UTC 2012


A little more verbose (as member of class JDepsTask):

enum Option {
     VERBOSE (false, "-v", "--verbose"),
     PACKAGE (true, "-p", "--package"),
     ...;
     private boolean hasParam;
     private String[] aliases;
     private Option (boolean hasParam, String aliases...) {
         ...;
     }
     process (String form, String param) {
         If (hasParam &&
                 (param == null || param.length == 0 || param.charAt(0) == '-'))
             throw new BadArgs("err.missing.arg", form).showUsage(true);
         switch (this) {
             case VERBOSE : verbose = Verbose.VERBOSE; break;
             case PACKAGE : packageNames.add(param); break;
             ...
         }
     }
}


-Ulf




More information about the core-libs-dev mailing list