author | mchung |
Wed, 27 May 2015 13:25:18 -0700 | |
changeset 30846 | 2b3f379840f0 |
parent 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
15385 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
24896
diff
changeset
|
2 |
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. |
15385 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
import static com.sun.tools.classfile.TypeAnnotation.TargetType.*; |
|
25 |
||
26 |
/* |
|
27 |
* @test |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
28 |
* @bug 8042451 |
15385 | 29 |
* @summary Test population of reference info for type casts |
30846 | 30 |
* @modules jdk.jdeps/com.sun.tools.classfile |
15385 | 31 |
* @compile -g Driver.java ReferenceInfoUtil.java TypeCasts.java |
32 |
* @run main Driver TypeCasts |
|
33 |
*/ |
|
34 |
public class TypeCasts { |
|
35 |
||
15718 | 36 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
37 |
typeIndex = 0) |
|
15385 | 38 |
public String returnObject() { |
39 |
return "Object returnObject() { return (@TA String)null; }"; |
|
40 |
} |
|
41 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
42 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
43 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
44 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
45 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
46 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
47 |
@TADescription(annotation = "TC", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
48 |
genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
49 |
typeIndex = 0) |
15385 | 50 |
public String returnObjectArray() { |
51 |
return "Object returnObjectArray() { return (@TC String @TA [] @TB [])null; }"; |
|
52 |
} |
|
53 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
54 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
55 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
56 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
57 |
genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
58 |
typeIndex = 0) |
15385 | 59 |
public String returnObjectGeneric() { |
60 |
return "Object returnObjectGeneric() { return (@TA List<@TB String>)null; }"; |
|
61 |
} |
|
62 |
||
15718 | 63 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
64 |
typeIndex = 0) |
|
15385 | 65 |
public String returnPrim() { |
66 |
return "Object returnPrim() { return (@TA int)0; }"; |
|
67 |
} |
|
68 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
69 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
70 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
71 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
72 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
73 |
typeIndex = 0) |
15385 | 74 |
public String returnPrimArray() { |
75 |
return "Object returnPrimArray() { return (@TB int @TA [])null; }"; |
|
76 |
} |
|
77 |
||
15718 | 78 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
79 |
typeIndex = 0) |
|
15385 | 80 |
public String initObject() { |
81 |
return "void initObject() { Object a = (@TA String)null; }"; |
|
82 |
} |
|
83 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
84 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
85 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
86 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
87 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
88 |
typeIndex = 0) |
15385 | 89 |
public String initObjectArray() { |
90 |
return "void initObjectArray() { Object a = (@TB String @TA [])null; }"; |
|
91 |
} |
|
92 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
93 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
94 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
95 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
96 |
genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
97 |
typeIndex = 0) |
15385 | 98 |
public String initObjectGeneric() { |
99 |
return "void initObjectGeneric() { Object a = (@TA List<@TB String>)null; }"; |
|
100 |
} |
|
101 |
||
15718 | 102 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
103 |
typeIndex = 0) |
|
15385 | 104 |
public String initPrim() { |
105 |
return "void initPrim() { Object a = (@TA int)0; }"; |
|
106 |
} |
|
107 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
108 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
109 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
110 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
111 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
112 |
typeIndex = 0) |
15385 | 113 |
public String initPrimArray() { |
114 |
return "void initPrimArray() { Object a = (@TB int @TA [])null; }"; |
|
115 |
} |
|
116 |
||
15718 | 117 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
118 |
typeIndex = 0) |
|
15385 | 119 |
public String eqtestObject() { |
120 |
return "void eqtestObject() { if (null == (@TA String)null); }"; |
|
121 |
} |
|
122 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
123 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
124 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
125 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
126 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
127 |
typeIndex = 0) |
15385 | 128 |
public String eqtestObjectArray() { |
129 |
return "void eqtestObjectArray() { if (null == (@TB String @TA [])null); }"; |
|
130 |
} |
|
131 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
132 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
133 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
134 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
135 |
genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
136 |
typeIndex = 0) |
15385 | 137 |
public String eqtestObjectGeneric() { |
138 |
return "void eqtestObjectGeneric() { if (null == (@TA List<@TB String >)null); }"; |
|
139 |
} |
|
140 |
||
15718 | 141 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
142 |
typeIndex = 0) |
|
15385 | 143 |
// compiler optimizes away compile time constants casts |
144 |
public String eqtestPrim() { |
|
145 |
return "void eqtestPrim(int a) { if (0 == (@TA int)a); }"; |
|
146 |
} |
|
147 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
148 |
@TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
149 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
150 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
151 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
152 |
typeIndex = 0) |
15385 | 153 |
public String eqtestPrimArray() { |
154 |
return "void eqtestPrimArray() { if (null == (@TB int @TA [])null); }"; |
|
155 |
} |
|
156 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
157 |
@TADescription(annotation = "TA", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
158 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
159 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
160 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
161 |
@TADescription(annotation = "TC", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
162 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
163 |
genericLocation = {3, 0}) |
15718 | 164 |
public String intersection1() { |
165 |
return "void intersection() { Object o = (@TA String & @TB Comparable<@TC String>) null; }"; |
|
166 |
} |
|
167 |
||
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
168 |
@TADescription(annotation = "TA", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
169 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
170 |
@TADescription(annotation = "TB", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
171 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
172 |
@TADescription(annotation = "TC", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
173 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
174 |
genericLocation = {3, 0}) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
175 |
@TADescription(annotation = "TD", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
176 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 2) |
15718 | 177 |
public String intersection2() { |
178 |
return "void intersection() { Object o = (@TA String & @TB Comparable<@TC String> & @TD CharSequence) null; }"; |
|
179 |
} |
|
24896
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
180 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
181 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
182 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
183 |
public String returnObjectRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
184 |
return "Object returnObject() { return (@RTA @RTA String)null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
185 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
186 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
187 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
188 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
189 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
190 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
191 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
192 |
@TADescription(annotation = "RTCs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
193 |
genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
194 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
195 |
public String returnObjectArrayRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
196 |
return "Object returnObjectArray() { return (@RTC @RTC String @RTA @RTA [] @RTB @RTB [])null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
197 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
198 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
199 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
200 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
201 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
202 |
genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
203 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
204 |
public String returnObjectGenericRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
205 |
return "Object returnObjectGeneric() { return (@RTA @RTA List<@RTB @RTB String>)null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
206 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
207 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
208 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
209 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
210 |
public String returnPrimRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
211 |
return "Object returnPrim() { return (@RTA @RTA int)0; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
212 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
213 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
214 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
215 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
216 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
217 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
218 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
219 |
public String returnPrimArrayRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
220 |
return "Object returnPrimArray() { return (@RTB @RTB int @RTA @RTA [])null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
221 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
222 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
223 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
224 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
225 |
public String initObjectRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
226 |
return "void initObject() { Object a = (@RTA @RTA String)null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
227 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
228 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
229 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
230 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
231 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
232 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
233 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
234 |
public String initObjectArrayRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
235 |
return "void initObjectArray() { Object a = (@RTB @RTB String @RTA @RTA [])null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
236 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
237 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
238 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
239 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
240 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
241 |
genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
242 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
243 |
public String initObjectGenericRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
244 |
return "void initObjectGeneric() { Object a = (@RTA @RTA List<@RTB @RTB String>)null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
245 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
246 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
247 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
248 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
249 |
public String initPrimRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
250 |
return "void initPrim() { Object a = (@RTA @RTA int)0; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
251 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
252 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
253 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
254 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
255 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
256 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
257 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
258 |
public String initPrimArrayRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
259 |
return "void initPrimArray() { Object a = (@RTB @RTB int @RTA @RTA [])null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
260 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
261 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
262 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
263 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
264 |
public String eqtestObjectRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
265 |
return "void eqtestObject() { if (null == (@RTA @RTA String)null); }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
266 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
267 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
268 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
269 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
270 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
271 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
272 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
273 |
public String eqtestObjectArrayRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
274 |
return "void eqtestObjectArray() { if (null == (@RTB @RTB String @RTA @RTA [])null); }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
275 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
276 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
277 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
278 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
279 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
280 |
genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
281 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
282 |
public String eqtestObjectGenericRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
283 |
return "void eqtestObjectGeneric() { if (null == (@RTA @RTA List<@RTB @RTB String >)null); }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
284 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
285 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
286 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
287 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
288 |
// compiler optimizes away compile time constants casts |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
289 |
public String eqtestPrimRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
290 |
return "void eqtestPrim(int a) { if (0 == (@RTA @RTA int)a); }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
291 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
292 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
293 |
@TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
294 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
295 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
296 |
genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
297 |
typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
298 |
public String eqtestPrimArrayRepeatableAnnotation() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
299 |
return "void eqtestPrimArray() { if (null == (@RTB @RTB int @RTA @RTA [])null); }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
300 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
301 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
302 |
@TADescription(annotation = "RTAs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
303 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
304 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
305 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
306 |
@TADescription(annotation = "RTCs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
307 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
308 |
genericLocation = {3, 0}) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
309 |
public String intersectionRepeatableAnnotation1() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
310 |
return "void intersection() { Object o = (@RTA @RTA String & @RTB @RTB Comparable<@RTC @RTC String>) null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
311 |
} |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
312 |
|
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
313 |
@TADescription(annotation = "RTAs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
314 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
315 |
@TADescription(annotation = "RTBs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
316 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
317 |
@TADescription(annotation = "RTCs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
318 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
319 |
genericLocation = {3, 0}) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
320 |
@TADescription(annotation = "RTDs", type = CAST, |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
321 |
offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 2) |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
322 |
public String intersectionRepeatableAnnotation2() { |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
323 |
return "void intersection() { Object o = (@RTA @RTA String & @RTB @RTB Comparable<@RTC @RTC String> &" + |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
324 |
" @RTD @RTD CharSequence) null; }"; |
986d876a9121
8042451: Write tests for all possible kinds of type annotation
aeremeev
parents:
22448
diff
changeset
|
325 |
} |
15385 | 326 |
} |