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 {
131
131
*/
132
132
public boolean saveParameterNames ;
133
133
134
+ private final boolean addTypeAnnotationsToSymbol ;
135
+
134
136
/**
135
137
* The currently selected profile.
136
138
*/
@@ -297,6 +299,8 @@ protected ClassReader(Context context) {
297
299
298
300
lintClassfile = Lint .instance (context ).isEnabled (LintCategory .CLASSFILE );
299
301
302
+ addTypeAnnotationsToSymbol = options .getBoolean ("addTypeAnnotationsToSymbol" , false );
303
+
300
304
initAttributeReaders ();
301
305
}
302
306
@@ -2258,7 +2262,9 @@ public void run() {
2258
2262
currentClassFile = classFile ;
2259
2263
List <Attribute .TypeCompound > newList = deproxyTypeCompoundList (proxies );
2260
2264
sym .setTypeAttributes (newList .prependList (sym .getRawTypeAttributes ()));
2261
- addTypeAnnotationsToSymbol (sym , newList );
2265
+ if (addTypeAnnotationsToSymbol ) {
2266
+ addTypeAnnotationsToSymbol (sym , newList );
2267
+ }
2262
2268
} finally {
2263
2269
currentClassFile = previousClassFile ;
2264
2270
}
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ class C {
80
80
new JavacTask (tb )
81
81
.outdir (out )
82
82
.classpath (out )
83
- .options ("-XDrawDiagnostics" )
83
+ .options ("-XDrawDiagnostics" , "-XDaddTypeAnnotationsToSymbol=true" )
84
84
.files (src .resolve ("C.java" ))
85
85
.run (Expect .FAIL )
86
86
.writeAll ()
Original file line number Diff line number Diff line change 33
33
* jdk.compiler/com.sun.tools.javac.util
34
34
* @build JavacTestingAbstractProcessor DPrinter BasicAnnoTests
35
35
* @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
37
37
*/
38
38
39
39
import java .io .PrintWriter ;
You can’t perform that action at this time.
0 commit comments