src/share/classes/com/sun/tools/javac/code/Symbol.java

changeset 1571
af8417e590f4
parent 1565
d04960f05593
child 1607
bd49e0304281
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Feb 04 18:08:53 2013 -0500
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Sun Feb 17 16:44:55 2013 -0500
     1.3 @@ -217,6 +217,14 @@
     1.4          return (flags() & INTERFACE) != 0;
     1.5      }
     1.6  
     1.7 +    public boolean isPrivate() {
     1.8 +        return (flags_field & Flags.AccessFlags) == PRIVATE;
     1.9 +    }
    1.10 +
    1.11 +    public boolean isEnum() {
    1.12 +        return (flags() & ENUM) != 0;
    1.13 +    }
    1.14 +
    1.15      /** Is this symbol declared (directly or indirectly) local
    1.16       *  to a method or variable initializer?
    1.17       *  Also includes fields of inner classes which are in
    1.18 @@ -479,7 +487,7 @@
    1.19      }
    1.20  
    1.21      // This method is part of the javax.lang.model API, do not use this in javac code.
    1.22 -    public <A extends java.lang.annotation.Annotation> A[] getAnnotations(Class<A> annoType) {
    1.23 +    public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(Class<A> annoType) {
    1.24          return JavacElements.getAnnotations(this, annoType);
    1.25      }
    1.26  
    1.27 @@ -496,9 +504,9 @@
    1.28          return l.toList();
    1.29      }
    1.30  
    1.31 -    public static class DelegatedSymbol extends Symbol {
    1.32 -        protected Symbol other;
    1.33 -        public DelegatedSymbol(Symbol other) {
    1.34 +    public static class DelegatedSymbol<T extends Symbol> extends Symbol {
    1.35 +        protected T other;
    1.36 +        public DelegatedSymbol(T other) {
    1.37              super(other.kind, other.flags_field, other.name, other.type, other.owner);
    1.38              this.other = other;
    1.39          }
    1.40 @@ -532,6 +540,10 @@
    1.41          public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
    1.42              return v.visitSymbol(other, p);
    1.43          }
    1.44 +
    1.45 +        public T getUnderlyingSymbol() {
    1.46 +            return other;
    1.47 +        }
    1.48      }
    1.49  
    1.50      /** A class for type symbols. Type variables are represented by instances
    1.51 @@ -1078,6 +1090,9 @@
    1.52          /** The code of the method. */
    1.53          public Code code = null;
    1.54  
    1.55 +        /** The extra (synthetic/mandated) parameters of the method. */
    1.56 +        public List<VarSymbol> extraParams = List.nil();
    1.57 +
    1.58          /** The parameters of the method. */
    1.59          public List<VarSymbol> params = null;
    1.60  

mercurial