< prev index next >

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

Print this page

        

@@ -368,10 +368,14 @@
 
     public boolean isDeprecated() {
         return (flags_field & DEPRECATED) != 0;
     }
 
+    public boolean isRecord() {
+        return (flags_field & RECORD) != 0;
+    }
+
     public boolean hasDeprecatedAnnotation() {
         return (flags_field & DEPRECATED_ANNOTATION) != 0;
     }
 
     public boolean isDeprecatedForRemoval() {

@@ -400,18 +404,30 @@
 
     public boolean isInterface() {
         return (flags() & INTERFACE) != 0;
     }
 
+    public boolean isAbstract() {
+        return (flags() & ABSTRACT) != 0;
+    }
+
     public boolean isPrivate() {
         return (flags_field & Flags.AccessFlags) == PRIVATE;
     }
 
     public boolean isEnum() {
         return (flags() & ENUM) != 0;
     }
 
+    public boolean isSealed() {
+        return (flags_field & SEALED) != 0;
+    }
+
+    public boolean isFinal() {
+        return (flags_field & FINAL) != 0;
+    }
+
     /** Is this symbol declared (directly or indirectly) local
      *  to a method or variable initializer?
      *  Also includes fields of inner classes which are in
      *  turn local to a method or variable initializer.
      */

@@ -1427,10 +1443,12 @@
                 return ElementKind.ANNOTATION_TYPE;
             else if ((flags & INTERFACE) != 0)
                 return ElementKind.INTERFACE;
             else if ((flags & ENUM) != 0)
                 return ElementKind.ENUM;
+            else if ((flags & RECORD) != 0)
+                return ElementKind.RECORD;
             else
                 return ElementKind.CLASS;
         }
 
         @Override @DefinedBy(Api.LANGUAGE_MODEL)

@@ -1438,10 +1456,17 @@
             apiComplete();
             long flags = flags();
             return Flags.asModifierSet(flags & ~DEFAULT);
         }
 
+        @Override @DefinedBy(Api.LANGUAGE_MODEL)
+        public java.util.List<VariableElement> getStateComponents() {
+            apiComplete();
+            // Inital implementation
+            return javax.lang.model.util.ElementFilter.stateComponentsIn(getEnclosedElements());
+        }
+
         @DefinedBy(Api.LANGUAGE_MODEL)
         public NestingKind getNestingKind() {
             apiComplete();
             if (owner.kind == PCK)
                 return NestingKind.TOP_LEVEL;

@@ -1528,10 +1553,15 @@
         public void setAnnotationTypeMetadata(AnnotationTypeMetadata a) {
             Assert.checkNonNull(a);
             Assert.check(!annotationTypeMetadata.isMetadataForAnnotationType());
             this.annotationTypeMetadata = a;
         }
+
+        @DefinedBy(Api.LANGUAGE_MODEL)
+        public List<Type> getPermittedSubtypes() {
+            return ((ClassType)type).permitted;
+        }
     }
 
 
     /** A class for variable symbols
      */

@@ -1550,10 +1580,12 @@
          *  Code generation:
          *    If this is a local variable, its logical slot number.
          */
         public int adr = -1;
 
+        public List<Pair<Accessors.Kind, MethodSymbol>> accessors = List.nil();
+
         /** Construct a variable symbol, given its flags, name, type and owner.
          */
         public VarSymbol(long flags, Name name, Type type, Symbol owner) {
             super(VAR, flags, name, type, owner);
         }

@@ -1594,10 +1626,18 @@
 
         public Symbol asMemberOf(Type site, Types types) {
             return new VarSymbol(flags_field, name, types.memberType(site, this), owner);
         }
 
+        @Override
+        public Type erasure(Types types) {
+            if (erasure_field == null) {
+                erasure_field = types.erasure(type);
+            }
+            return erasure_field;
+        }
+
         @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             long flags = flags();
             if ((flags & PARAMETER) != 0) {
                 if (isExceptionParameter())

@@ -1778,10 +1818,14 @@
         public int poolTag() {
             return owner.isInterface() ?
                     ClassFile.CONSTANT_InterfaceMethodref : ClassFile.CONSTANT_Methodref;
         }
 
+        public boolean isDynamic() {
+            return false;
+        }
+
         public boolean isHandle() {
             return false;
         }
 
 

@@ -2158,10 +2202,11 @@
     /** A class for method handles.
      */
     public static class MethodHandleSymbol extends MethodSymbol implements LoadableConstant {
 
         private Symbol refSym;
+        // in case the simbol is a variable
         private boolean getter;
 
         public MethodHandleSymbol(Symbol msym) {
             this(msym, false);
         }
< prev index next >