Question on -Xlint:processing

Peng Li lipeng at
Wed Aug 20 10:18:24 PDT 2008


I noticed that the "-Xlint:processing" javac command line option is
broken in the recent openjdk7.  It was never a officially documented
feature before, but it has been a working feature in earlier JDKs and
there are people using it.

I investigated the issue and discovered several relevant facts in

(1) The following code assumes that Xlint:processing *is* a valid Xlint option:

     lint = options.lint("processing");

(2) The following code assumes that Xlint:processing is *not* a valid
Xlint option:

     public enum LintCategory

(3) In the old openjdk code (20071030 and earlier), all command line
options starting with "-Xlint:" are recogonized as valid Xlint
options: even "-Xlint:junkfsdjlmcasl" is OK. The relevant code is in

     new XOption(XLINT_CUSTOM,
"opt.Xlint.suboptlist") {
             public boolean matches(String s) {
                return s.startsWith("-Xlint:");

     A consequence is that, even though "-Xlint:processing" was not
enumerated as an valid option in code/, it was accepted as a
valid Xlint option and used in

(4) In the recent openjdk7 code, there is a change in the way valid
command line options are recognized:

     new XOption(XLINT_CUSTOM,
          Option.ChoiceKind.ANYOF, getXLintChoices()),

   This is apparently an improvement over the old openjdk code because
"-Xlint:junkfsdjlmcasl" will now be reported as an invalid option.
However, it also breaks all the software that uses the
"-Xlint:processing" feature:

    $ javac  -Xlint:processing
    javac: invalid flag: -Xlint:processing
    Usage: javac <options> <source files>
    use -help for a list of possible options

I hope this issue can be fixed in future openjdk versions.  The most
important question seems to be whether "-Xlint:processing" should be a
valid and supported option.  If yes, the problem can be fixed by
simply adding a line in code/ to recognize the option.  If
no, a clear-cut decision needs to be made and the code depending on
this option (for example, processing/
should be fixed to avoid confusion for developers and users.

Best regards,
Peng Li

More information about the compiler-dev mailing list