javac ignores @SuppressWarnings("all")

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 7u4
    • Component/s: 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.

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

              Created:
              Updated:
              Imported:
              Indexed: