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

type parameter referenced in static inner class improperly allowed!

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • tools
    • b54
    • generic
    • solaris_8

      The following should give an error: type parameters K and V aren't in scope
      in the extends clause of Bucket because Bucket is a static nested class. Yet
      the compiler allows it.



      import java.util.*;

      class MPair<A,B> {}

      class Test<K,V> {
          private static class Bucket extends LinkedList<MPair<K,V>> {}
          private Bucket[] buckets = new Test.Bucket[100];
      }

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: