generic interface in generic class

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.4.0
    • Affects Version/s: 1.4.0
    • Component/s: tools
    • beta2
    • generic
    • solaris_7
    • Verified

      This is a problem in the prototype for jsr14 generics:

      frog$ cat -n T.java
           1 interface Iterator<E> {
           2 }
           3
           4 class Set<E> {
           5 Iterator<E> iterator() { return null; }
           6 }
           7
           8 interface Map<K,V> {
           9 public interface Entry<K,V> {
          10 }
          11 public Set<Entry<K,V>> entrySet();
          12 }
          13
          14 class Hashtable<K,V> implements Map<K,V> {
          15 public Set<Entry<K,V>> entrySet() { return null; }
          16
          17 public synchronized String toString() {
          18 Iterator<Map.Entry<K,V>> it = entrySet().iterator();
          19 }
          20 }
      frog$ make
      /java/jdk/ws/tools/jsr14/build/solaris-sparc/bin/javac -gj *.java
      T.java:18: incompatible types
      found : Iterator<Map<K,V>.Entry<K,V>>
      required: Iterator<Map.Entry<K,V>>
              Iterator<Map.Entry<K,V>> it = entrySet().iterator();
                                                               ^
      1 error
      *** Error code 1
      make: Fatal error: Command failed for target `all'
      frog$

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: