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

type parameter referenced in static inner class improperly allowed!

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b54
    • CPU:
      generic
    • OS:
      solaris_8

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gafter Neal Gafter
                Reporter:
                gafter Neal Gafter
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: