Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8352612 No way to add back lint categories after "none"
  3. JDK-8356215

Release Note: The `-Xlint:none` compiler flag no longer implies `-nowarn`

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 25
    • tools
    • generic
    • generic

      The `-Xlint` command line flag for `javac` is used to enable or disable categories of lint warnings generated during compilation. For example, `-Xlint:all,-serial` enables all lint categories and then disables the `serial` category, while the converse `-Xlint:none,serial` disables all lint categories and then enables the `serial` category.

      For historical reasons, the appearance of `-Xlint:none` also had the invisible side effect of disabling _all_ non-mandatory warnings, exactly as if the flag `-nowarn` had also been given. As a result, the effect of a flag like `-Xlint:none,serial` was to simply disable all non-mandatory warnings; in particular, no warnings in the `serial` category would be generated.

      This invisible side-effect has been eliminated. Now `-Xlint:none` simply disables all lint categories, and a flag like `-Xlint:none,serial` will allow `serial` warnings to appear as expected.

            acobbs Archie Cobbs
            acobbs Archie Cobbs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: