Skip to content

Commit bb83d59

Browse files
cushonjerboaa
authored andcommitted
8360406: [21u] Disable logic for attaching type annotations to class files until 8359336 is fixed
Reviewed-by: sgehwolf
1 parent f4b3a70 commit bb83d59

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ public class ClassReader {
131131
*/
132132
public boolean saveParameterNames;
133133

134+
private final boolean addTypeAnnotationsToSymbol;
135+
134136
/**
135137
* The currently selected profile.
136138
*/
@@ -297,6 +299,8 @@ protected ClassReader(Context context) {
297299

298300
lintClassfile = Lint.instance(context).isEnabled(LintCategory.CLASSFILE);
299301

302+
addTypeAnnotationsToSymbol = options.getBoolean("addTypeAnnotationsToSymbol", false);
303+
300304
initAttributeReaders();
301305
}
302306

@@ -2258,7 +2262,9 @@ public void run() {
22582262
currentClassFile = classFile;
22592263
List<Attribute.TypeCompound> newList = deproxyTypeCompoundList(proxies);
22602264
sym.setTypeAttributes(newList.prependList(sym.getRawTypeAttributes()));
2261-
addTypeAnnotationsToSymbol(sym, newList);
2265+
if (addTypeAnnotationsToSymbol) {
2266+
addTypeAnnotationsToSymbol(sym, newList);
2267+
}
22622268
} finally {
22632269
currentClassFile = previousClassFile;
22642270
}

test/langtools/tools/javac/annotations/typeAnnotations/CompletionErrorOnEnclosingType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class C {
8080
new JavacTask(tb)
8181
.outdir(out)
8282
.classpath(out)
83-
.options("-XDrawDiagnostics")
83+
.options("-XDrawDiagnostics", "-XDaddTypeAnnotationsToSymbol=true")
8484
.files(src.resolve("C.java"))
8585
.run(Expect.FAIL)
8686
.writeAll()

test/langtools/tools/javac/processing/model/type/BasicAnnoTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* jdk.compiler/com.sun.tools.javac.util
3434
* @build JavacTestingAbstractProcessor DPrinter BasicAnnoTests
3535
* @compile/process -XDaccessInternalAPI -processor BasicAnnoTests -proc:only BasicAnnoTests.java
36-
* @compile/process -XDaccessInternalAPI -processor BasicAnnoTests -proc:only BasicAnnoTests
36+
* @compile/process -XDaccessInternalAPI -XDaddTypeAnnotationsToSymbol=true -processor BasicAnnoTests -proc:only BasicAnnoTests
3737
*/
3838

3939
import java.io.PrintWriter;

0 commit comments

Comments
 (0)