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

Missing unchecked warning

XMLWordPrintable

    • generic
    • generic

      This should cause a warning.

      class Pair<X,Y> {}

      class ObjectPair extends Pair<Object,Object> {}

      class Test<X,Y>{
          public Pair<X,Y> m() {
              return (Pair<X,Y>)new ObjectPair(); // warning missing here
          }

          public static void main(String[] args) {
              Test<String,String> t = new Test<String,String>();
              Pair<String,String> pss = t.m();
          }
      }

            Unassigned Unassigned
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: