Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8349847

Support configuring individual lint categories as errors

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • tools
    • None

      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.

            acobbs Archie Cobbs
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: