Support configuring individual lint categories as errors

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: None
    • Component/s: tools
    • None
    • b19

      Currently the -Werror flag will cause compilations to fail if any warnings are emitted. This enhancement proposes a configuration flag that makes specific lint categories errors.

      It might look similar to the `Xlint:[-]key(,[-]key)*` flag, where the following compilation would report all supported warnings but only fail if unchecked or rawtypes warnings were present:

      javac -Xlint:all -Werror:unchecked,rawtypes ...

      In general, the use-case for this is getting the benefit of -Werror for specific warnings, without having to clean up all warnings in a codebase.

      One specific use-case is sunapi diagnostics (see JDK-8349846). Since sunapi is intended to be a 'mandatory' unsuppressible diagnostic it is not possible to use -Werror in compilations with any sunapi warnings, this feature would allow enabling some warnings as errors in a compilation where sunapi warnings were present.

            Assignee:
            Archie Cobbs
            Reporter:
            Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: