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

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

    XMLWordPrintable

Details

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

    Description

      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);
      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: