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

javac to flag where warning suppression is not required

XMLWordPrintable

    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      modify the javac compiler so that the standard behavior, or the behavior with an additional qualifier is that when a @SuppressWarnings() annotation is encountered, and the annotation does not suppress any warnings that a warning message may be generated to flag this redundancy

      JUSTIFICATION :
      if @SuppressWarnings is specified at some time then the reason for the suppression is eliminated, for example due to an underlying API be generified, then the annotation can be removed. There is no easy way to detect this condition, so the annotation stays, and may mask potential issues in the future

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      javac -Xlint unchecked -XWarnOnSupressionNotUsed ...
      Warning xxx line 34: unchecked warning suppressed but none are generated
      ACTUAL -
      no indication

      CUSTOMER SUBMITTED WORKAROUND :
      try removing each of the @suppressWarnings and see if warnings are generated

            jlahoda Jan Lahoda
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: