Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public class ClassReader {
*/
public boolean saveParameterNames;

private final boolean addTypeAnnotationsToSymbol;

/**
* The currently selected profile.
*/
Expand Down Expand Up @@ -291,6 +293,8 @@ protected ClassReader(Context context) {

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

addTypeAnnotationsToSymbol = options.getBoolean("addTypeAnnotationsToSymbol", false);

initAttributeReaders();
}

Expand Down Expand Up @@ -2188,7 +2192,9 @@ public void run() {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class C {
new JavacTask(tb)
.outdir(out)
.classpath(out)
.options("-XDrawDiagnostics")
.options("-XDrawDiagnostics", "-XDaddTypeAnnotationsToSymbol=true")
.files(src.resolve("C.java"))
.run(Expect.FAIL)
.writeAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down