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

Compiler should warn if a generic class extends or implements a raw type

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 7
    • tools
    • generic
    • generic

      Compiler should warn if a generic class extends or implements a raw type.


      import java.util.Collection;

      class Test<E> implements Int1 { // warning
           public void m2(Integer...c){}
           public void m1(Collection<Number> c){}
           // public void m1(Collection c){} // Replacing above line with this compiles.
      }
      interface Int1<T> {
          void m1(Collection <Number> c);
           void m2(Integer...c);
      }

            Unassigned Unassigned
            savadhansunw Seetharama Avadhanam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: