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

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

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      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

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

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: