Thu, 30 Jul 2009 10:29:53 +0100
6827648: Extremely slow compilation time for visitor pattern code + generics
Summary: Javac unnecessarily recomputates type-substitutions multiple times
Reviewed-by: jjg
1 /**
2 * @test /nodynamiccopyright/
3 * @bug 4986256
4 * @compile/ref=Deprecation.noLint.out -XDstdout -XDrawDiagnostics Deprecation.java
5 * @compile/ref=Deprecation.lintDeprecation.out -XDstdout -Xlint:deprecation -XDrawDiagnostics Deprecation.java
6 * @compile/ref=Deprecation.lintAll.out -XDstdout -Xlint:all,-path -XDrawDiagnostics Deprecation.java
7 */
9 @Deprecated
10 class Deprecation
11 {
12 }
14 // control: this class should generate warnings
15 class Deprecation2
16 {
17 void m() {
18 Object d = new Deprecation();
19 }
20 }
22 // tests: the warnings that would otherwise be generated should all be suppressed
23 @SuppressWarnings("deprecation")
24 class Deprecation3
25 {
26 void m() {
27 Object d = new Deprecation();
28 }
29 }
31 class Deprecation4
32 {
33 @SuppressWarnings("deprecation")
34 void m() {
35 Object d = new Deprecation();
36 }
37 }
39 class Deprecation5
40 {
41 void m() {
42 @SuppressWarnings("deprecation")
43 class Inner {
44 void m() {
45 Object d = new Deprecation();
46 }
47 }
48 }
49 }
51 // this class should produce warnings because @SuppressWarnings should not be inherited
52 class Deprecation6 extends Deprecation3
53 {
54 void m() {
55 Object d = new Deprecation();
56 }
57 }