File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm
test/langtools/tools/javac
annotations/typeAnnotations Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff line change 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
3939import java .io .PrintWriter ;
You can’t perform that action at this time.
0 commit comments