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

javac ignores @SuppressWarnings("all")

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 7u4
    • tools
    • None
    • generic
    • os_x

      javac ignores the @SuppressWarnings("all") annotation in 1.7.0-u4-b07. See example below:

      import java.util.ArrayList;

      // Works:
      // @SuppressWarnings("rawtypes")

      // Doesn't work; worked in Java 6:
      @SuppressWarnings("all")
      public class Test {
          private ArrayList list = new ArrayList();
      }

      To test:
      javac -Xlint Test.java

      Output:
      Test.java:9: warning: [rawtypes] found raw type: ArrayList
          private ArrayList list = new ArrayList();
                  ^
        missing type arguments for generic class ArrayList<E>
        where E is a type-variable:
          E extends Object declared in class ArrayList
      Test.java:9: warning: [rawtypes] found raw type: ArrayList
          private ArrayList list = new ArrayList();
                                       ^
        missing type arguments for generic class ArrayList<E>
        where E is a type-variable:
          E extends Object declared in class ArrayList
      2 warnings

      Changing the value of the annotation to "rawtypes" does work.

            jlahoda Jan Lahoda
            gkbrown Greg Brown (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: