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

javac to flag where warning suppression is not required

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: