langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java
changeset 15564 6d8db91563a7
parent 15385 ee1eebe7e210
child 15719 6b64cf96346b
equal deleted inserted replaced
15563:7f7adda30698 15564:6d8db91563a7
   494             l.append(t.tsym);
   494             l.append(t.tsym);
   495         }
   495         }
   496         return l.toList();
   496         return l.toList();
   497     }
   497     }
   498 
   498 
   499     public static class DelegatedSymbol extends Symbol {
   499     public static class DelegatedSymbol<T extends Symbol> extends Symbol {
   500         protected Symbol other;
   500         protected T other;
   501         public DelegatedSymbol(Symbol other) {
   501         public DelegatedSymbol(T other) {
   502             super(other.kind, other.flags_field, other.name, other.type, other.owner);
   502             super(other.kind, other.flags_field, other.name, other.type, other.owner);
   503             this.other = other;
   503             this.other = other;
   504         }
   504         }
   505         public String toString() { return other.toString(); }
   505         public String toString() { return other.toString(); }
   506         public Symbol location() { return other.location(); }
   506         public Symbol location() { return other.location(); }
   529             return other.accept(v, p);
   529             return other.accept(v, p);
   530         }
   530         }
   531 
   531 
   532         public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
   532         public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
   533             return v.visitSymbol(other, p);
   533             return v.visitSymbol(other, p);
       
   534         }
       
   535 
       
   536         public T getUnderlyingSymbol() {
       
   537             return other;
   534         }
   538         }
   535     }
   539     }
   536 
   540 
   537     /** A class for type symbols. Type variables are represented by instances
   541     /** A class for type symbols. Type variables are represented by instances
   538      *  of this class, classes and packages by instances of subclasses.
   542      *  of this class, classes and packages by instances of subclasses.