test/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest1.java

changeset 1755
ddb4a2bfcd82
parent 1721
abd153854f16
child 2525
2eb010b6cb22
equal deleted inserted replaced
1754:0384683c64be 1755:ddb4a2bfcd82
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 8005085 8005877 8004829 8005681 8006734 8006775 26 * @bug 8005085 8005877 8004829 8005681 8006734 8006775
27 * @ignore 8013409: test failures for type annotations
28 * @summary Combinations of Target ElementTypes on (repeated)type annotations. 27 * @summary Combinations of Target ElementTypes on (repeated)type annotations.
29 */ 28 */
30 29
31 import com.sun.tools.classfile.*; 30 import com.sun.tools.classfile.*;
32 import java.io.File; 31 import java.io.File;
33 32
34 public class CombinationsTargetTest1 extends ClassfileTestHelper { 33 public class CombinationsTargetTest1 extends ClassfileTestHelper {
35 // Helps identify test case in event of failure. 34
35 // Test count helps identify test case in event of failure.
36 int testcount = 0; 36 int testcount = 0;
37 int src1 = 1, src2 = 2, src4 = 4, 37
38 src5 = 5, src6 = 6, src7 = 7; 38 // Base test case template descriptions
39 enum srce {
40 src1("(repeating) type annotations at class level"),
41 src2("(repeating) type annotations on method"),
42 src3("(repeating) type annotations on wildcard, type arguments in anonymous class"),
43 src4("(repeating) type annotations on type parameters, bounds and type arguments on class decl"),
44 src5("(repeating) type annotations on type parameters, bounds and type arguments on method"),
45 src6("(repeating) type annotations on type parameters, bounds and type arguments in method");
46
47 String description;
48
49 srce(String desc) {
50 this.description = this + ": " +desc;
51 }
52 }
39 53
40 String[] ETypes={"TYPE", "FIELD", "METHOD", "PARAMETER", "CONSTRUCTOR", 54 String[] ETypes={"TYPE", "FIELD", "METHOD", "PARAMETER", "CONSTRUCTOR",
41 "LOCAL_VARIABLE", "ANNOTATION_TYPE", "PACKAGE"}; 55 "LOCAL_VARIABLE", "ANNOTATION_TYPE", "PACKAGE"};
42 56
43 // local class tests will have an inner class. 57 // local class tests will have an inner class.
50 64
51 void run() throws Exception { 65 void run() throws Exception {
52 // Determines which repeat and order in source(ABMix). 66 // Determines which repeat and order in source(ABMix).
53 Boolean As= false, BDs=true, ABMix=false; 67 Boolean As= false, BDs=true, ABMix=false;
54 int testrun=0; 68 int testrun=0;
55 // A repeats and/or B/D repeats, ABMix for order of As and Bs.
56 Boolean [][] bRepeat = new Boolean[][]{{false,false,false},//no repeats 69 Boolean [][] bRepeat = new Boolean[][]{{false,false,false},//no repeats
57 {true,false,false}, //repeat @A 70 {true,false,false}, //repeat @A
58 {false,true,false}, //repeat @B 71 {false,true,false}, //repeat @B
59 {true,true,false}, //repeat both 72 {true,true,false}, //repeat both
60 {false,false,true} //repeat mix 73 {false,false,true} //repeat mix
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;
123 throw err; 136 throw err;
124 } 137 }
125 //if sourcString() set hasInnerClass it also set innerClassname. 138 //if sourcString() set hasInnerClass it also set innerClassname.
126 if(hasInnerClass) { 139 if(hasInnerClass) {
127 StringBuffer sb = new StringBuffer(classFile.getAbsolutePath()); 140 StringBuffer sb = new StringBuffer(classFile.getAbsolutePath());
128 classFile=new File(sb.insert(sb.lastIndexOf(".class"),innerClassname).toString()); 141 classFile=new File(sb.insert(sb.lastIndexOf(".class"),
142 innerClassname).toString());
129 } 143 }
130 ClassFile cf = ClassFile.read(classFile); 144 ClassFile cf = ClassFile.read(classFile);
131 145
132 //Test class,fields and method counts. 146 //Test class,fields and method counts.
133 test(cf); 147 test(cf);
150 // 164 //
151 // Source for test cases 165 // Source for test cases
152 // 166 //
153 String sourceString(String testname, String retentn, String annot2, 167 String sourceString(String testname, String retentn, String annot2,
154 Boolean Arepeats, Boolean BDrepeats, Boolean ABmix, 168 Boolean Arepeats, Boolean BDrepeats, Boolean ABmix,
155 int src) { 169 srce src) {
156 170
157 String As = "@A", Bs = "@B", Ds = "@D"; 171 String As = "@A", Bs = "@B", Ds = "@D";
158 if(Arepeats) As = "@A @A"; 172 if(Arepeats) As = "@A @A";
159 if(BDrepeats) { 173 if(BDrepeats) {
160 Bs = "@B @B"; 174 Bs = "@B @B";
199 "@Repeatable(DC.class)\n" + 213 "@Repeatable(DC.class)\n" +
200 "@interface D { }\n\n" + 214 "@interface D { }\n\n" +
201 215
202 "@Retention("+retentn+")\n" + 216 "@Retention("+retentn+")\n" +
203 "@Target({TYPE_USE,TYPE_PARAMETER,_OTHER_})\n" + 217 "@Target({TYPE_USE,TYPE_PARAMETER,_OTHER_})\n" +
204 "@interface DC { D[] value(); }\n\n"); 218 "@interface DC { D[] value(); }\n");
205 219
206 // Test case sources with sample generated source. 220 // Test case sources with sample generated source.
207 switch(src) { 221 switch(src) {
208 case 1: // repeating type annotations at class level 222 case src1: // repeating type annotations at class level
209 /* 223 /*
210 * @A @B class Test1 { 224 * @A @B class Test1 {
211 * @A @B Test1(){} 225 * @A @B Test1(){}
212 * @A @B Integer i1 = 0; 226 * @A @B Integer i1 = 0;
213 * String @A @B [] @A @B [] sa = null; 227 * String @A @B [] @A @B [] sa = null;
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() {
342 * } 357 * }
343 * Map<List<String>,String> shm = foo(new String("hello")); 358 * Map<List<String>,String> shm = foo(new String("hello"));
344 * } 359 * }
345 */ 360 */
346 source = new String( source + 361 source = new String( source +
347 "// (repeating)annotations on type parameters of class, method return value in method. \n" + 362 "// " + src.description + "\n" +
348 "class "+ testname + "{\n" + 363 "class "+ testname + "{\n" +
349 " <E extends Comparable> Map<List<E>, E > foo(E e) {\n" + 364 " <E extends Comparable> Map<List<E>, E > foo(E e) {\n" +
350 " class maptest <_As_ _Bs_ _Ds_ E> {\n" + // inner class $1maptest 365 " class maptest <_As_ _Bs_ _Ds_ E> {\n" + // inner class $1maptest
351 " Map<List<_As_ _Bs_ _Ds_ E>,_As_ _Bs_ _Ds_ E> getMap() { \n" + 366 " Map<List<_As_ _Bs_ _Ds_ E>,_As_ _Bs_ _Ds_ E> getMap() { \n" +
352 " return new HashMap<List<E>,E>();\n" + 367 " return new HashMap<List<E>,E>();\n" +
353 " }\n" + 368 " }\n" +
354 " }\n" + 369 " }\n" +
355 " return new maptest<E>().getMap();\n" + 370 " return new maptest<E>().getMap();\n" +
356 " }\n" + 371 " }\n" +
357 " Map<List<String>,String> shm = foo(new String(\"hello\"));\n" + 372 " Map<List<String>,String> shm = foo(new String(\"hello\"));\n" +
358 "}\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) + 373 "}\n\n").concat(sourceBase).replace("_OTHER_", annot2).replace("_As_",As).replace("_Bs_",Bs).replace("_Ds_",Ds) +
359 "\n\n"; 374 "\n";
360 hasInnerClass=true; 375 hasInnerClass=true;
361 innerClassname="$1maptest"; 376 innerClassname="$1maptest";
362 break; 377 break;
363 } 378 }
364 return imports + source; 379 return imports + source;
365 } 380 }
366 } 381 }

mercurial