< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java

Print this page

        

@@ -1172,11 +1172,11 @@
 
             new AttributeReader(names.SourceFile, V45_3, CLASS_ATTRIBUTE) {
                 protected void read(Symbol sym, int attrLen) {
                     ClassSymbol c = (ClassSymbol) sym;
                     Name n = readName(nextChar());
-                    c.sourcefile = new SourceFileObject(n);
+                    c.sourcefile = new SourceFileObject(n, c.flatname);
                     // If the class is a toplevel class, originating from a Java source file,
                     // but the class name does not match the file name, then it is
                     // an auxiliary class.
                     String sn = n.toString();
                     if (c.owner.kind == PCK &&

@@ -1637,11 +1637,13 @@
         if (annotations.isEmpty()) {
             return;
         }
         ListBuffer<CompoundAnnotationProxy> proxies = new ListBuffer<>();
         for (CompoundAnnotationProxy proxy : annotations) {
-            if (proxy.type.tsym.flatName() == syms.proprietaryType.tsym.flatName())
+            if (proxy.type.tsym == syms.dataAnnotationType.tsym) {
+                sym.flags_field |= RECORD;
+            } else if (proxy.type.tsym.flatName() == syms.proprietaryType.tsym.flatName())
                 sym.flags_field |= PROPRIETARY;
             else if (proxy.type.tsym.flatName() == syms.profileType.tsym.flatName()) {
                 if (profile != Profile.DEFAULT) {
                     for (Pair<Name, Attribute> v : proxy.values) {
                         if (v.fst == names.value && v.snd instanceof Attribute.Constant) {

@@ -2948,13 +2950,15 @@
     private static class SourceFileObject implements JavaFileObject {
 
         /** The file's name.
          */
         private final Name name;
+        private final Name flatname;
 
-        public SourceFileObject(Name name) {
+        public SourceFileObject(Name name, Name flatname) {
             this.name = name;
+            this.flatname = flatname;
         }
 
         @Override @DefinedBy(Api.COMPILER)
         public URI toUri() {
             try {
< prev index next >