62 for(Boolean[] bCombo : bRepeat) { |
75 for(Boolean[] bCombo : bRepeat) { |
63 As=bCombo[0]; BDs=bCombo[1]; ABMix=bCombo[2]; |
76 As=bCombo[0]; BDs=bCombo[1]; ABMix=bCombo[2]; |
64 for(String et : ETypes) { |
77 for(String et : ETypes) { |
65 switch(et) { |
78 switch(et) { |
66 case "METHOD": |
79 case "METHOD": |
67 test( 8, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src1); |
80 test( 8, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src1); |
68 test(10, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src2); |
81 test(10, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src2); |
69 test( 8, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src4); |
82 test( 6, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src3); |
70 test(10, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src6); |
83 test(10, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src5); |
71 test( 0, 8, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, src1); |
84 test( 0, 8, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src1); |
72 test( 0, 10, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, src2); |
85 test( 0, 10, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src2); |
73 test( 0, 8, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, src4); |
86 test( 0, 6, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src3); |
74 test( 0, 10, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, src6); |
87 test( 0, 10, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src5); |
75 break; |
88 break; |
76 case "CONSTRUCTOR": |
89 case "CONSTRUCTOR": |
77 case "FIELD": |
90 case "FIELD": |
78 test( 8, 0, 4, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src1); |
91 test( 8, 0, 4, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src1); |
79 test( 6, 0, 3, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src5); |
92 test( 6, 0, 3, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src4); |
80 test( 9, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src7); |
93 test( 9, 0, 0, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src6); |
81 test( 0, 8, 0, 4, As, BDs, ABMix, "RUNTIME", et, ++testrun, src1); |
94 test( 0, 8, 0, 4, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src1); |
82 test( 0, 6, 0, 3, As, BDs, ABMix, "RUNTIME", et, ++testrun, src5); |
95 test( 0, 6, 0, 3, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src4); |
83 test( 0, 9, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, src7); |
96 test( 0, 9, 0, 0, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src6); |
84 break; |
97 break; |
85 default:/*TYPE,PARAMETER,LOCAL_VARIABLE,ANNOTATION_TYPE,PACKAGE*/ |
98 default:/*TYPE,PARAMETER,LOCAL_VARIABLE,ANNOTATION_TYPE,PACKAGE*/ |
86 test( 8, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src1); |
99 test( 8, 0, 2, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src1); |
87 test( 6, 0, 3, 0, As, BDs, ABMix, "CLASS", et, ++testrun, src5); |
100 test( 6, 0, 3, 0, As, BDs, ABMix, "CLASS", et, ++testrun, srce.src4); |
88 test( 0, 8, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, src1); |
101 test( 0, 8, 0, 2, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src1); |
89 test( 0, 6, 0, 3, As, BDs, ABMix, "RUNTIME", et, ++testrun, src5); |
102 test( 0, 6, 0, 3, As, BDs, ABMix, "RUNTIME", et, ++testrun, srce.src4); |
90 } |
103 } |
91 } |
104 } |
92 } |
105 } |
93 } |
106 } |
94 |
107 |
95 public void test(int tinv, int tvis, int inv, int vis, Boolean Arepeats, |
108 public void test(int tinv, int tvis, int inv, int vis, Boolean Arepeats, |
96 Boolean BDrepeats, Boolean ABmix, String rtn, String et2, |
109 Boolean BDrepeats, Boolean ABmix, String rtn, String et2, |
97 Integer N, int source) throws Exception { |
110 Integer N, srce source) throws Exception { |
98 ++testcount; |
111 ++testcount; |
99 expected_tvisibles = tvis; |
112 expected_tvisibles = tvis; |
100 expected_tinvisibles = tinv; |
113 expected_tinvisibles = tinv; |
101 expected_visibles = vis; |
114 expected_visibles = vis; |
102 expected_invisibles = inv; |
115 expected_invisibles = inv; |
216 * Object o = new String [3]; |
230 * Object o = new String [3]; |
217 * return (String) null; |
231 * return (String) null; |
218 * }} |
232 * }} |
219 */ |
233 */ |
220 source = new String( |
234 source = new String( |
221 "// (repeating) type annotations at class level. \n" + |
235 "// " + src.description + "\n" + |
222 "_As_ _Bs_ class " + testname + " {\n" + |
236 "_As_ _Bs_ class " + testname + " {\n" + |
223 "_As_ _Bs_ " + testname +"(){} \n" + |
237 "_As_ _Bs_ " + testname +"(){} \n" + |
224 "_As_ _Bs_ Integer i1 = 0; \n" + |
238 "_As_ _Bs_ Integer i1 = 0; \n" + |
225 "String _As_ _Bs_ [] _As_ _Bs_ [] sa = null; \n" + |
239 "String _As_ _Bs_ [] _As_ _Bs_ [] sa = null; \n" + |
226 "// type usage in method body \n" + |
240 "// type usage in method body \n" + |
227 "String test("+testname+" this, " + |
241 "String test("+testname+" this, " + |
228 "String param, String ... vararg) { \n" + |
242 "String param, String ... vararg) { \n" + |
229 " Object o = new String [3]; \n" + |
243 " Object o = new String [3]; \n" + |
230 " return (String) null; \n" + |
244 " return (String) null; \n" + |
231 "} \n" + |
245 "}\n" + |
232 "} \n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
246 "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
233 "\n\n"; |
247 "\n"; |
234 break; |
248 break; |
235 case 2: // (repeating) type annotations on method. |
249 case src2: // (repeating) type annotations on method. |
236 /* |
250 /* |
237 * class Test12 { |
251 * class Test12 { |
238 * Test12(){} |
252 * Test12(){} |
239 * // type usage on method |
253 * // type usage on method |
240 * @A @B String test(@A @B Test12 this, @A @B String param, @A @B String @A @B ... vararg) { |
254 * @A @B String test(@A @B Test12 this, @A @B String param, @A @B String @A @B ... vararg) { |
241 * Object o = new String [3]; |
255 * Object o = new String [3]; |
242 * return (String) null; |
256 * return (String) null; |
243 * }} |
257 * }} |
244 */ |
258 */ |
245 source = new String( |
259 source = new String( |
246 "// (repeating) type annotations on method. \n" + |
260 "// " + src.description + "\n" + |
247 "class " + testname + " {\n" + |
261 "class " + testname + " {\n" + |
248 testname +"(){} \n" + |
262 testname +"(){} \n" + |
249 "// type usage on method \n" + |
263 "// type usage on method \n" + |
250 "_As_ _Bs_ String test(_As_ _Bs_ "+testname+" this, " + |
264 "_As_ _Bs_ String test(_As_ _Bs_ "+testname+" this, " + |
251 "_As_ _Bs_ String param, _As_ _Bs_ String _As_ _Bs_ ... vararg) { \n" + |
265 "_As_ _Bs_ String param, _As_ _Bs_ String _As_ _Bs_ ... vararg) { \n" + |
252 " Object o = new String [3]; \n" + |
266 " Object o = new String [3]; \n" + |
253 " return (String) null; \n" + |
267 " return (String) null; \n" + |
254 "} \n" + |
268 "}\n" + |
255 "} \n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
269 "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
256 "\n\n"; |
270 "\n"; |
257 break; |
271 break; |
258 case 4: //(repeating) annotations on wildcard, type arguments in anonymous class. |
272 case src3: //(repeating) annotations on wildcard, type arguments in anonymous class. |
259 /* |
273 /* |
260 * class Test13<T extends Object> { |
274 * class Test13<T extends Object> { |
261 * public T data = null; |
275 * public T data = null; |
262 * T getData() { return data;} |
276 * T getData() { return data;} |
263 * String mtest( Test13<String> t){ return t.getData(); } |
277 * String mtest( Test13<String> t){ return t.getData(); } |
264 * public void test() { |
278 * public void test() { |
265 * mtest( new Test13<@A @B String>() { |
279 * mtest( new Test13<String>() { |
266 * void m1(List<@A @B ? extends @A @B Object> lst) {} |
280 * void m1(List<@A @B ? extends @A @B Object> lst) {} |
267 * void m2() throws@A @B Exception { } |
281 * void m2() throws@A @B Exception { } |
268 * }); |
282 * }); |
269 * } |
283 * } |
270 * } |
284 * } |
271 */ |
285 */ |
272 source = new String( source + |
286 source = new String( source + |
273 "// (repeating) annotations on wildcard, type arguments in anonymous class. \n" + |
287 "// " + src.description + "\n" + |
274 "class " + testname + "<T extends Object> {\n" + |
288 "class " + testname + "<T extends Object> {\n" + |
275 " public T data = null;\n" + |
289 " public T data = null;\n" + |
276 " T getData() { return data;}\n" + |
290 " T getData() { return data;}\n" + |
277 " String mtest( " + testname + "<String> t){ return t.getData(); }\n" + |
291 " String mtest( " + testname + "<String> t){ return t.getData(); }\n" + |
278 " public void test() {\n" + |
292 " public void test() {\n" + |
279 " mtest( new " + testname + "<_As_ _Bs_ String>() {\n" + |
293 " mtest( new " + testname + "<String>() {\n" + |
280 " void m1(List<_As_ _Bs_ ? extends _As_ _Bs_ Object> lst) {}\n" + |
294 " void m1(List<_As_ _Bs_ ? extends _As_ _Bs_ Object> lst) {}\n" + |
281 " void m2() throws_As_ _Bs_ Exception { }\n" + |
295 " void m2() throws_As_ _Bs_ Exception { }\n" + |
282 " });\n" + |
296 " });\n" + |
283 " }\n" + |
297 " }\n" + |
284 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + "\n\n"; |
298 "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs) + |
285 hasInnerClass=true; |
299 "\n"; |
286 innerClassname="$1"; |
300 hasInnerClass=true; |
|
301 innerClassname="$1"; |
287 break; |
302 break; |
288 case 5: // (repeating)annotations on type parameters, bounds and type arguments on class decl. |
303 case src4: // (repeating)annotations on type parameters, bounds and type arguments on class decl. |
289 /* |
304 /* |
290 * @A @B @D |
305 * @A @B @D |
291 * class Test2<@A @B @C @D T extends @A @B Object> { |
306 * class Test2<@A @B @C @D T extends @A @B Object> { |
292 * Map<List<String>, Integer> map = |
307 * Map<List<String>, Integer> map = |
293 * new HashMap<List< String>, Integer>(); |
308 * new HashMap<List< String>, Integer>(); |
295 * String test(Test2<T> this) { return null;} |
310 * String test(Test2<T> this) { return null;} |
296 * <T> String genericMethod(T t) { return null; } |
311 * <T> String genericMethod(T t) { return null; } |
297 * } |
312 * } |
298 */ |
313 */ |
299 source = new String( source + |
314 source = new String( source + |
300 "// (repeating)annotations on type parameters, bounds and type arguments on class decl. \n" + |
315 "// " + src.description + "\n" + |
301 "_As_ _Bs_ _Ds_\n" + //8004829: A and B on type parameter below. |
316 "_As_ _Bs_ _Ds_\n" + //8004829: A and B on type parameter below. |
302 "class " + testname + "<_As_ _Bs_ @C _Ds_ T extends _As_ _Bs_ Object> {\n" + |
317 "class " + testname + "<_As_ _Bs_ @C _Ds_ T extends _As_ _Bs_ Object> {\n" + |
303 " Map<List<String>, Integer> map =\n" + |
318 " Map<List<String>, Integer> map =\n" + |
304 " new HashMap<List< String>, Integer>();\n" + |
319 " new HashMap<List< String>, Integer>();\n" + |
305 " Map<List<String>,Integer> map2 = new HashMap<>();\n" + |
320 " Map<List<String>,Integer> map2 = new HashMap<>();\n" + |
306 " String test(" + testname + "<T> this) { return null;}\n" + |
321 " String test(" + testname + "<T> this) { return null;}\n" + |
307 " <T> String genericMethod(T t) { return null; }\n" + |
322 " <T> String genericMethod(T t) { return null; }\n" + |
308 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + |
323 "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + |
309 "\n\n"; |
324 "\n"; |
310 break; |
325 break; |
311 case 6: // (repeating) annotations on type parameters, bounds and type arguments on method. |
326 case src5: // (repeating) annotations on type parameters, bounds and type arguments on method. |
312 /* |
327 /* |
313 * class Test14<T extends Object> { |
328 * class Test14<T extends Object> { |
314 * Map<List<String>, Integer> map = |
329 * Map<List<String>, Integer> map = |
315 * new HashMap<List<String>, Integer>(); |
330 * new HashMap<List<String>, Integer>(); |
316 * Map<List<String>, Integer> map2 = new HashMap<>(); |
331 * Map<List<String>, Integer> map2 = new HashMap<>(); |
317 * String test(@A @B Test14<@D T> this) { return null;} |
332 * String test(@A @B Test14<@D T> this) { return null;} |
318 * <@C @D T> @A @B String genericMethod(@A @B @D T t) { return null; } |
333 * <@C @D T> @A @B String genericMethod(@A @B @D T t) { return null; } |
319 * } |
334 * } |
320 */ |
335 */ |
321 source = new String( source + |
336 source = new String( source + |
322 "// (repeating) annotations on type parameters, bounds and type arguments on method. \n" + |
337 "// " + src.description + "\n" + |
323 "class " + testname + "<T extends Object> {\n" + |
338 "class " + testname + "<T extends Object> {\n" + |
324 " Map<List<String>, Integer> map =\n" + |
339 " Map<List<String>, Integer> map =\n" + |
325 " new HashMap<List<String>, Integer>();\n" + |
340 " new HashMap<List<String>, Integer>();\n" + |
326 " Map<List<String>, Integer> map2 = new HashMap<>();\n" + |
341 " Map<List<String>, Integer> map2 = new HashMap<>();\n" + |
327 " String test(_As_ _Bs_ " + testname + "<_Ds_ T> this) { return null;}\n" + |
342 " String test(_As_ _Bs_ " + testname + "<_Ds_ T> this) { return null;}\n" + |
328 " <@C _Ds_ T> _As_ _Bs_ String genericMethod(_As_ _Bs_ _Ds_ T t) { return null; }\n" + |
343 " <@C _Ds_ T> _As_ _Bs_ String genericMethod(_As_ _Bs_ _Ds_ T t) { return null; }\n" + |
329 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + |
344 "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + |
330 "\n\n"; |
345 "\n"; |
331 break; |
346 break; |
332 case 7: // repeating annotations on type parameters, bounds and type arguments in method. |
347 case src6: // repeating annotations on type parameters, bounds and type arguments in method. |
333 /* |
348 /* |
334 * class Test7{ |
349 * class Test7{ |
335 * <E extends Comparable> Map<List<E>, E > foo(E e) { |
350 * <E extends Comparable> Map<List<E>, E > foo(E e) { |
336 * class maptest <@A @B @D E> { |
351 * class maptest <@A @B @D E> { |
337 * Map<List<@A @B @D E>,@A @B @D E> getMap() { |
352 * Map<List<@A @B @D E>,@A @B @D E> getMap() { |