author | jjg |
Fri, 12 Aug 2016 17:45:31 -0700 | |
changeset 40316 | 20b50a99fe8d |
parent 26532 | aa84b6606229 |
permissions | -rw-r--r-- |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
1 |
/* |
40316 | 2 |
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
4 |
* |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
8 |
* |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
13 |
* accompanied this code). |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
14 |
* |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
18 |
* |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
21 |
* questions. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
22 |
*/ |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
23 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
24 |
/* |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
25 |
* @test |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
26 |
* @bug 8005220 |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
27 |
* @summary javap must display repeating annotations |
26532
aa84b6606229
8056021: checkin for JDK-8027262 breaks Checker Framework
jfranck
parents:
24895
diff
changeset
|
28 |
* @ignore 8057687 emit correct byte code an attributes for type annotations |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
29 |
*/ |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
30 |
import java.io.*; |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
31 |
import java.util.*; |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
32 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
33 |
/** |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
34 |
* This class extends the abstract {@link Tester} test-driver, and |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
35 |
* encapusulates a number of test-case classes (i.e. classes extending |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
36 |
* this class and annotated with {@code TestCase}). |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
37 |
* <p> |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
38 |
* By default (no argument), this test runs all test-cases, except |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
39 |
* if annotated with {@code ignore}. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
40 |
* <p> |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
41 |
* Individual test cases can be executed using a run action. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
42 |
* <p> |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
43 |
* Example: @run main RepeatingTypeAnnotations RepeatingTypeAnnotations$TC4 |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
44 |
* <p> |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
45 |
* Note: when specific test-cases are run, additional debug output is |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
46 |
* produced to help debugging. Test annotated with {@code ignore} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
47 |
* can be executed explicitly. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
48 |
*/ |
40316 | 49 |
public class RepeatingTypeAnnotations extends JavapTester { |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
50 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
51 |
/** |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
52 |
* Main method instantiates test and run test-cases. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
53 |
*/ |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
54 |
public static void main(String... args) throws Exception { |
40316 | 55 |
JavapTester tester = new RepeatingTypeAnnotations(); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
56 |
tester.run(args); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
57 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
58 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
59 |
/** |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
60 |
* Testcases are classes extending {@code RepeatingTypeAnnotations}, |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
61 |
* and calling {@link setSrc}, followed by one or more invocations |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
62 |
* of {@link verify} in the body of the constructor. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
63 |
*/ |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
64 |
public RepeatingTypeAnnotations() { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
65 |
setSrc(new TestSource(template)); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
66 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
67 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
68 |
/** |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
69 |
* Common template for test cases. The line TESTCASE is |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
70 |
* replaced with the specific lines of individual tests. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
71 |
*/ |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
72 |
private static final String[] template = { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
73 |
"import java.lang.annotation.*;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
74 |
"class Test {", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
75 |
" @Repeatable(As.class)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
76 |
" @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
77 |
" @Retention(RetentionPolicy.CLASS)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
78 |
" @interface A {", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
79 |
" Class f() default int.class;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
80 |
" }", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
81 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
82 |
" @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
83 |
" @Retention(RetentionPolicy.CLASS)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
84 |
" @interface As { A[] value(); }", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
85 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
86 |
" @Repeatable(Bs.class)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
87 |
" @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
88 |
" @Retention(RetentionPolicy.CLASS)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
89 |
" @interface B {", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
90 |
" Class f() default int.class;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
91 |
" }", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
92 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
93 |
" @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
94 |
" @Retention(RetentionPolicy.CLASS)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
95 |
" @interface Bs { B[] value(); }", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
96 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
97 |
" @Repeatable(Cs.class)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
98 |
" @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
99 |
" @Retention(RetentionPolicy.RUNTIME)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
100 |
" @interface C {", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
101 |
" Class f() default int.class;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
102 |
" }", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
103 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
104 |
" @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
105 |
" @Retention(RetentionPolicy.RUNTIME)", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
106 |
" @interface Cs { C[] value(); }", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
107 |
"TESTCASE", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
108 |
"}" |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
109 |
}; |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
110 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
111 |
/* |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
112 |
* The test cases covers annotation in the following locations: |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
113 |
* - static and non-static fields |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
114 |
* - local variables |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
115 |
* - constructor and method return type and parameter types |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
116 |
* - casts in class and method contexts. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
117 |
* For the above locations the test-cases covers: |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
118 |
* - single annotation type |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
119 |
* - two annotation types with same retention |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
120 |
* - two annotation types with different retention |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
121 |
* - three annotation types, two of same retention, one different. |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
122 |
*/ |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
123 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
124 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
125 |
public static class TC1 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
126 |
public TC1() { |
17578 | 127 |
setSrc(" /* TC1 */ ", |
128 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
129 |
" public @A @A @A Object o = (@A @A @A String) Test.so;"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
130 |
verify("RuntimeInvisibleTypeAnnotations", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
131 |
"0: #25(#26=[@#27(),@#27(),@#27()]): FIELD", |
17578 | 132 |
"0: #25(#26=[@#27(),@#27(),@#27()]): CAST, offset=5, type_index=0"); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
133 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
134 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
135 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
136 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
137 |
public static class TC2 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
138 |
public TC2() { |
17578 | 139 |
setSrc(" /* TC2 */ ", |
140 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
141 |
" public @A @B @A Object o = (@B @A @B String) Test.so;"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
142 |
verify("RuntimeInvisibleTypeAnnotations", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
143 |
"0: #25(#26=[@#27(),@#27()]): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
144 |
"1: #28(): FIELD", |
17578 | 145 |
"0: #36(#26=[@#28(),@#28()]): CAST, offset=5, type_index=0", |
146 |
"1: #27(): CAST, offset=5, type_index=0"); |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
147 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
148 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
149 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
150 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
151 |
public static class TC3 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
152 |
public TC3() { |
17578 | 153 |
setSrc(" /* TC3 */ ", |
154 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
155 |
" public @A @A @C Object o = (@B @C @B String) Test.so;"); |
17578 | 156 |
verify("RuntimeVisibleTypeAnnotations", |
157 |
"RuntimeInvisibleTypeAnnotations", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
158 |
"0: #25(): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
159 |
"0: #27(#28=[@#29(),@#29()]): FIELD", |
17578 | 160 |
"0: #25(): CAST, offset=5, type_index=0", |
161 |
"0: #37(#28=[@#38(),@#38()]): CAST, offset=5, type_index=0"); |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
162 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
163 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
164 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
165 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
166 |
public static class TC4 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
167 |
public TC4() { |
17578 | 168 |
setSrc(" /* TC4 */ ", |
169 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
170 |
" public @A @B @C Object o = (@C @B @A String) Test.so;"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
171 |
verify("RuntimeInvisibleTypeAnnotations", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
172 |
"RuntimeVisibleTypeAnnotations", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
173 |
"0: #25(): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
174 |
"0: #27(): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
175 |
"1: #28(): FIELD", |
17578 | 176 |
"0: #25(): CAST, offset=5, type_index=0", |
177 |
"0: #28(): CAST, offset=5, type_index=0", |
|
178 |
"1: #27(): CAST, offset=5, type_index=0"); |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
179 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
180 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
181 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
182 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
183 |
public static class TC5 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
184 |
public TC5() { |
17578 | 185 |
setSrc(" /* TC5 */ ", |
186 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
187 |
" public static @A @A @A Object o = (@B @B @B String) Test.so;"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
188 |
verify("RuntimeInvisibleTypeAnnotations", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
189 |
"0: #25(#26=[@#27(),@#27(),@#27()]): FIELD", |
17578 | 190 |
"0: #36(#26=[@#37(),@#37(),@#37()]): CAST, offset=5, type_index=0"); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
191 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
192 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
193 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
194 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
195 |
public static class TC6 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
196 |
public TC6() { |
17578 | 197 |
setSrc(" /* TC6 */ ", |
198 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
199 |
" public static @A @B @A Object o = (@B @A @B String) Test.so;"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
200 |
verify("RuntimeInvisibleTypeAnnotations", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
201 |
"0: #25(#26=[@#27(),@#27()]): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
202 |
"1: #28(): FIELD", |
17578 | 203 |
"0: #37(#26=[@#28(),@#28()]): CAST, offset=5, type_index=0", |
204 |
"1: #27(): CAST, offset=5, type_index=0"); |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
205 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
206 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
207 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
208 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
209 |
public static class TC7 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
210 |
public TC7() { |
17578 | 211 |
setSrc(" /* TC7 */ ", |
212 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
213 |
" public static @A @A @C Object o = (@B @C @B String) Test.so;"); |
17578 | 214 |
verify("RuntimeVisibleTypeAnnotations", |
215 |
"RuntimeInvisibleTypeAnnotations", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
216 |
"0: #25(): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
217 |
"0: #27(#28=[@#29(),@#29()]): FIELD", |
17578 | 218 |
"0: #25(): CAST, offset=5, type_index=0", |
219 |
"0: #38(#28=[@#39(),@#39()]): CAST, offset=5, type_index=0"); |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
220 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
221 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
222 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
223 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
224 |
public static class TC8 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
225 |
public TC8() { |
17578 | 226 |
setSrc(" /* TC8 */ ", |
227 |
" static String so = \"hello world\";", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
228 |
" public static @A @B @C Object o = (@C @B @A String) Test.so;"); |
17578 | 229 |
|
230 |
verify("RuntimeVisibleTypeAnnotations", |
|
231 |
"RuntimeInvisibleTypeAnnotations", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
232 |
"0: #25(): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
233 |
"0: #27(): FIELD", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
234 |
"1: #28(): FIELD", |
17578 | 235 |
"0: #25(): CAST, offset=5, type_index=0", |
236 |
"0: #28(): CAST, offset=5, type_index=0", |
|
237 |
"1: #27(): CAST, offset=5, type_index=0"); |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
238 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
239 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
240 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
241 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
242 |
public static class TC9 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
243 |
public TC9() { |
17578 | 244 |
setSrc(" /* TC9 */ ", |
245 |
" public Test(@A @A @A Object o, @A int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
246 |
" @A @A @A String ls = (@B @B @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
247 |
" }"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
248 |
verify("RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
249 |
"0: #34(#35=[@#36(),@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
250 |
"1: #37(#35=[@#38(),@#38(),@#38()]): CAST, offset=4, type_index=0", |
17578 | 251 |
"RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
252 |
"0: #36(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
253 |
"1: #34(#35=[@#36(),@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0"); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
254 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
255 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
256 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
257 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
258 |
public static class TC10 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
259 |
public TC10() { |
17578 | 260 |
setSrc(" /* TC10 */ ", |
261 |
" public Test(@A @A @B Object o, @A @B int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
262 |
" @A @A @B String ls = (@B @A @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
263 |
" }"); |
17578 | 264 |
verify("RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
265 |
"0: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
266 |
"1: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
267 |
"2: #38(#35=[@#37(),@#37()]): CAST, offset=4, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
268 |
"3: #36(): CAST, offset=4, type_index=0", |
17578 | 269 |
"RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
270 |
"0: #36(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
271 |
"1: #37(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
272 |
"2: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
273 |
"3: #37(): METHOD_FORMAL_PARAMETER, param_index=0"); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
274 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
275 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
276 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
277 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
278 |
public static class TC11 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
279 |
public TC11() { |
17578 | 280 |
setSrc(" /* TC11 */ ", |
281 |
" public Test(@C @C @A Object o, @A @B int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
282 |
" @C @C @A String ls = (@A @A @C String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
283 |
" }"); |
17578 | 284 |
verify("RuntimeVisibleTypeAnnotations", |
285 |
"RuntimeInvisibleTypeAnnotations", |
|
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
286 |
"0: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
287 |
"1: #36(): CAST, offset=4, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
288 |
"0: #38(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
289 |
"1: #39(#35=[@#38(),@#38()]): CAST, offset=4, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
290 |
"0: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
291 |
"0: #38(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
292 |
"1: #40(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
293 |
"2: #38(): METHOD_FORMAL_PARAMETER, param_index=0"); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
294 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
295 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
296 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
297 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
298 |
public static class TC12 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
299 |
public TC12() { |
17578 | 300 |
setSrc(" /* TC12 */ ", |
301 |
" public Test(@A @B @C Object o, @A @C int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
302 |
" @A @B @C String ls = (@C @A @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
303 |
" }"); |
17578 | 304 |
verify("RuntimeVisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
305 |
"0: #34(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
306 |
"1: #34(): CAST, offset=4, type_index=0", |
17578 | 307 |
"RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
308 |
"0: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
309 |
"1: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
310 |
"2: #36(): CAST, offset=4, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
311 |
"3: #37(): CAST, offset=4, type_index=0", |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
312 |
"0: #34(): METHOD_FORMAL_PARAMETER, param_index=0", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
313 |
"1: #34(): METHOD_FORMAL_PARAMETER, param_index=1", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
314 |
"0: #36(): METHOD_FORMAL_PARAMETER, param_index=0", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
315 |
"1: #37(): METHOD_FORMAL_PARAMETER, param_index=0", |
17578 | 316 |
"2: #36(): METHOD_FORMAL_PARAMETER, param_index=1"); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
317 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
318 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
319 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
320 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
321 |
public static class TC13 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
322 |
public TC13() { |
17578 | 323 |
setSrc(" /* TC13 */ ", |
324 |
" public @A @A @A String foo(@A @A @A Object o, @A int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
325 |
" @A @A @A String ls = (@B @B @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
326 |
" return (@A @A @A String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
327 |
" }"); |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
328 |
verify("RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
329 |
"0: #36(#37=[@#38(),@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
330 |
"1: #39(#37=[@#40(),@#40(),@#40()]): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
331 |
"2: #36(#37=[@#38(),@#38(),@#38()]): CAST, offset=6, type_index=0", |
17578 | 332 |
"RuntimeInvisibleTypeAnnotations", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
333 |
"0: #38(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
334 |
"1: #36(#37=[@#38(),@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
335 |
"2: #36(#37=[@#38(),@#38(),@#38()]): METHOD_RETURN" |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
336 |
); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
337 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
338 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
339 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
340 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
341 |
public static class TC14 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
342 |
public TC14() { |
17578 | 343 |
setSrc(" /* TC14 */ ", |
344 |
" public @A @B @B String foo(@A @A @B Object o, @A @B int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
345 |
" @A @A @B String ls = (@B @A @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
346 |
" return (@A @B @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
347 |
" }"); |
17578 | 348 |
verify( |
349 |
"RuntimeInvisibleTypeAnnotations:", |
|
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
350 |
"0: #36(#37=[@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
351 |
"1: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
352 |
"2: #40(#37=[@#39(),@#39()]): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
353 |
"3: #38(): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
354 |
"4: #38(): CAST, offset=6, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
355 |
"5: #40(#37=[@#39(),@#39()]): CAST, offset=6, type_index=0", |
17578 | 356 |
"RuntimeInvisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
357 |
"0: #38(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
358 |
"1: #39(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
359 |
"2: #36(#37=[@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
360 |
"3: #39(): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
361 |
"4: #38(): METHOD_RETURN", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
362 |
"5: #40(#37=[@#39(),@#39()]): METHOD_RETURN" |
17578 | 363 |
); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
364 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
365 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
366 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
367 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
368 |
public static class TC15 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
369 |
public TC15() { |
17578 | 370 |
setSrc(" /* TC15 */ ", |
371 |
" public @A @A @C String foo(@C @C @A Object o, @A @B int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
372 |
" @C @C @A String ls = (@A @A @C String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
373 |
" return (@C @B @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
374 |
" }"); |
17578 | 375 |
verify( |
376 |
"RuntimeVisibleTypeAnnotations:", |
|
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
377 |
"0: #36(#37=[@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
378 |
"1: #38(): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
379 |
"2: #38(): CAST, offset=6, type_index=0", |
17578 | 380 |
"RuntimeInvisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
381 |
"0: #40(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
382 |
"1: #41(#37=[@#40(),@#40()]): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
383 |
"2: #42(#37=[@#43(),@#43()]): CAST, offset=6, type_index=0", |
17578 | 384 |
"RuntimeVisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
385 |
"0: #36(#37=[@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
386 |
"1: #38(): METHOD_RETURN", |
17578 | 387 |
"RuntimeInvisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
388 |
"0: #40(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
389 |
"1: #43(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
390 |
"2: #40(): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
391 |
"3: #41(#37=[@#40(),@#40()]): METHOD_RETURN" |
17578 | 392 |
); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
393 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
394 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
395 |
|
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
396 |
@TestCase |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
397 |
public static class TC16 extends RepeatingTypeAnnotations { |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
398 |
public TC16() { |
17578 | 399 |
setSrc(" /* TC16 */ ", |
400 |
" public @A @B @C String foo(@A @B @C Object o, @A @C int i, long l) {", |
|
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
401 |
" @A @B @C String ls = (@C @A @B String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
402 |
" return (@B @A @C String) o;", |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
403 |
" }"); |
17578 | 404 |
verify( |
405 |
"RuntimeVisibleTypeAnnotations:", |
|
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
406 |
"0: #36(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
407 |
"1: #36(): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
408 |
"2: #36(): CAST, offset=6, type_index=0", |
17578 | 409 |
"RuntimeInvisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
410 |
"0: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
411 |
"1: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
412 |
"2: #38(): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
413 |
"3: #39(): CAST, offset=0, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
414 |
"4: #39(): CAST, offset=6, type_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
415 |
"5: #38(): CAST, offset=6, type_index=0", |
17578 | 416 |
"RuntimeVisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
417 |
"0: #36(): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
418 |
"1: #36(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
419 |
"2: #36(): METHOD_RETURN", |
17578 | 420 |
"RuntimeInvisibleTypeAnnotations:", |
24895
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
421 |
"0: #38(): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
422 |
"1: #39(): METHOD_FORMAL_PARAMETER, param_index=0", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
423 |
"2: #38(): METHOD_FORMAL_PARAMETER, param_index=1", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
424 |
"3: #38(): METHOD_RETURN", |
dd091d389fbf
8027262: Determine location for type annotations earlier in compiler pipeline
emc
parents:
17578
diff
changeset
|
425 |
"4: #39(): METHOD_RETURN" |
17578 | 426 |
); |
16555
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
427 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
428 |
} |
cc07dc956ff6
8005220: RFE to write javap tests for repeating annotations.
jjg
parents:
diff
changeset
|
429 |
} |