8360406: [21u] Disable logic for attaching type annotations to class files until 8359336 is fixed

Reviewed-by: sgehwolf
This commit is contained in:
Liam Miller-Cushon
2025-06-25 16:32:59 +00:00
committed by Vitaly Provodin
parent 5cedbb3fd5
commit 8587e037a3
3 changed files with 9 additions and 3 deletions

View File

@@ -131,6 +131,8 @@ public class ClassReader {
*/
public boolean saveParameterNames;
private final boolean addTypeAnnotationsToSymbol;
/**
* The currently selected profile.
*/
@@ -297,6 +299,8 @@ public class ClassReader {
lintClassfile = Lint.instance(context).isEnabled(LintCategory.CLASSFILE);
addTypeAnnotationsToSymbol = options.getBoolean("addTypeAnnotationsToSymbol", false);
initAttributeReaders();
}
@@ -2258,7 +2262,9 @@ public class ClassReader {
currentClassFile = classFile;
List<Attribute.TypeCompound> newList = deproxyTypeCompoundList(proxies);
sym.setTypeAttributes(newList.prependList(sym.getRawTypeAttributes()));
addTypeAnnotationsToSymbol(sym, newList);
if (addTypeAnnotationsToSymbol) {
addTypeAnnotationsToSymbol(sym, newList);
}
} finally {
currentClassFile = previousClassFile;
}

View File

@@ -80,7 +80,7 @@ public class CompletionErrorOnEnclosingType {
new JavacTask(tb)
.outdir(out)
.classpath(out)
.options("-XDrawDiagnostics")
.options("-XDrawDiagnostics", "-XDaddTypeAnnotationsToSymbol=true")
.files(src.resolve("C.java"))
.run(Expect.FAIL)
.writeAll()

View File

@@ -33,7 +33,7 @@
* jdk.compiler/com.sun.tools.javac.util
* @build JavacTestingAbstractProcessor DPrinter BasicAnnoTests
* @compile/process -XDaccessInternalAPI -processor BasicAnnoTests -proc:only BasicAnnoTests.java
* @compile/process -XDaccessInternalAPI -processor BasicAnnoTests -proc:only BasicAnnoTests
* @compile/process -XDaccessInternalAPI -XDaddTypeAnnotationsToSymbol=true -processor BasicAnnoTests -proc:only BasicAnnoTests
*/
import java.io.PrintWriter;