< prev index next >

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

Print this page

        

@@ -357,10 +357,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() {

@@ -389,10 +393,14 @@
 
     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() {

@@ -1520,10 +1528,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);
         }

@@ -1550,10 +1560,27 @@
 
         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);
+                if (!accessors.isEmpty()) {
+                    for (Pair<Accessors.Kind, MethodSymbol> accessorPair : accessors) {
+                        if (accessorPair.fst == Accessors.Kind.GET) {
+                            ((MethodType)accessorPair.snd.type).restype = erasure_field;
+                        } else {
+                            // set accessors are not yet generated
+                        }
+                    }
+                }
+            }
+            return erasure_field;
+        }
+
         @DefinedBy(Api.LANGUAGE_MODEL)
         public ElementKind getKind() {
             long flags = flags();
             if ((flags & PARAMETER) != 0) {
                 if (isExceptionParameter())
< prev index next >