1 /*******************************************************************************
2  * Copyright (c) 2000, 2014 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.jdt.core.tests.compiler.parser;
15 
16 
17 import java.util.Map;
18 
19 import junit.framework.Test;
20 
21 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
22 
23 
24 
25 @SuppressWarnings({ "unchecked", "rawtypes" })
26 public class AnnotationCompletionParserTest extends AbstractCompletionTest {
27 static {
28 	//TESTS_NAMES= new String[]{"test0087"};
29 }
30 
AnnotationCompletionParserTest(String testName)31 public AnnotationCompletionParserTest(String testName) {
32 	super(testName);
33 }
suite()34 public static Test suite() {
35 	return buildAllCompliancesTestSuite(AnnotationCompletionParserTest.class);
36 }
37 
38 @Override
getCompilerOptions()39 protected Map getCompilerOptions() {
40 	Map options = super.getCompilerOptions();
41 	options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
42 	options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
43 	options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
44 	return options;
45 }
46 
test0001()47 public void test0001(){
48 	String str =
49 		"public @MyAnn class X {\n" +
50 		"}";
51 
52 
53 	String completeBehind = "MyAnn";
54 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
55 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
56 	String expectedParentNodeToString = "<NONE>";
57 	String completionIdentifier = "MyAnn";
58 	String expectedReplacedSource = "MyAnn";
59 	String expectedUnitDisplayString =
60 		"@<CompleteOnType:MyAnn>\n" +
61 		"class X {\n" +
62 		"  X() {\n" +
63 		"  }\n" +
64 		"}\n";
65 
66 	checkDietParse(
67 			str.toCharArray(),
68 			cursorLocation,
69 			expectedCompletionNodeToString,
70 			expectedParentNodeToString,
71 			expectedUnitDisplayString,
72 			completionIdentifier,
73 			expectedReplacedSource,
74 	"diet ast");
75 }
test0002()76 public void test0002(){
77 	String str =
78 		"public @MyAnn interface X {\n" +
79 		"}";
80 
81 
82 	String completeBehind = "MyAnn";
83 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
84 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
85 	String expectedParentNodeToString = "<NONE>";
86 	String completionIdentifier = "MyAnn";
87 	String expectedReplacedSource = "MyAnn";
88 	String expectedUnitDisplayString =
89 		"@<CompleteOnType:MyAnn>\n" +
90 		"interface X {\n" +
91 		"}\n";
92 
93 	checkDietParse(
94 			str.toCharArray(),
95 			cursorLocation,
96 			expectedCompletionNodeToString,
97 			expectedParentNodeToString,
98 			expectedUnitDisplayString,
99 			completionIdentifier,
100 			expectedReplacedSource,
101 	"diet ast");
102 }
test0003()103 public void test0003(){
104 	String str =
105 		"public @MyAnn enum X {\n" +
106 		"}";
107 
108 
109 	String completeBehind = "MyAnn";
110 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
111 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
112 	String expectedParentNodeToString = "<NONE>";
113 	String completionIdentifier = "MyAnn";
114 	String expectedReplacedSource = "MyAnn";
115 	String expectedUnitDisplayString =
116 		"@<CompleteOnType:MyAnn>\n" +
117 		"enum X {\n" +
118 		"  X() {\n" +
119 		"  }\n" +
120 		"  <clinit>() {\n" +
121 		"  }\n" +
122 		"}\n";
123 
124 	checkDietParse(
125 			str.toCharArray(),
126 			cursorLocation,
127 			expectedCompletionNodeToString,
128 			expectedParentNodeToString,
129 			expectedUnitDisplayString,
130 			completionIdentifier,
131 			expectedReplacedSource,
132 	"diet ast");
133 }
test0004()134 public void test0004(){
135 	String str =
136 		"public @MyAnn @interface X {\n" +
137 		"}";
138 
139 
140 	String completeBehind = "MyAnn";
141 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
142 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
143 	String expectedParentNodeToString = "<NONE>";
144 	String completionIdentifier = "MyAnn";
145 	String expectedReplacedSource = "MyAnn";
146 	String expectedUnitDisplayString =
147 		"@<CompleteOnType:MyAnn>\n" +
148 		"@interface X {\n" +
149 		"}\n";
150 
151 	checkDietParse(
152 			str.toCharArray(),
153 			cursorLocation,
154 			expectedCompletionNodeToString,
155 			expectedParentNodeToString,
156 			expectedUnitDisplayString,
157 			completionIdentifier,
158 			expectedReplacedSource,
159 	"diet ast");
160 }
test0005()161 public void test0005(){
162 	String str =
163 		"public @MyAnn class X\n" +
164 		"";
165 
166 
167 	String completeBehind = "MyAnn";
168 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
169 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
170 	String expectedParentNodeToString = "<NONE>";
171 	String completionIdentifier = "MyAnn";
172 	String expectedReplacedSource = "MyAnn";
173 	String expectedUnitDisplayString =
174 		"@<CompleteOnType:MyAnn>\n" +
175 		"class X {\n" +
176 		"  X() {\n" +
177 		"  }\n" +
178 		"}\n";
179 
180 	checkDietParse(
181 			str.toCharArray(),
182 			cursorLocation,
183 			expectedCompletionNodeToString,
184 			expectedParentNodeToString,
185 			expectedUnitDisplayString,
186 			completionIdentifier,
187 			expectedReplacedSource,
188 	"diet ast");
189 }
test0006()190 public void test0006(){
191 	String str =
192 		"public @MyAnn interface X\n" +
193 		"";
194 
195 
196 	String completeBehind = "MyAnn";
197 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
198 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
199 	String expectedParentNodeToString = "<NONE>";
200 	String completionIdentifier = "MyAnn";
201 	String expectedReplacedSource = "MyAnn";
202 	String expectedUnitDisplayString =
203 		"@<CompleteOnType:MyAnn>\n" +
204 		"interface X {\n" +
205 		"}\n";
206 
207 	checkDietParse(
208 			str.toCharArray(),
209 			cursorLocation,
210 			expectedCompletionNodeToString,
211 			expectedParentNodeToString,
212 			expectedUnitDisplayString,
213 			completionIdentifier,
214 			expectedReplacedSource,
215 	"diet ast");
216 }
test0007()217 public void test0007(){
218 	String str =
219 		"public @MyAnn enum X\n" +
220 		"";
221 
222 
223 	String completeBehind = "MyAnn";
224 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
225 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
226 	String expectedParentNodeToString = "<NONE>";
227 	String completionIdentifier = "MyAnn";
228 	String expectedReplacedSource = "MyAnn";
229 	String expectedUnitDisplayString =
230 		"@<CompleteOnType:MyAnn>\n" +
231 		"enum X {\n" +
232 		"  X() {\n" +
233 		"  }\n" +
234 		"  <clinit>() {\n" +
235 		"  }\n" +
236 		"}\n";
237 
238 	checkDietParse(
239 			str.toCharArray(),
240 			cursorLocation,
241 			expectedCompletionNodeToString,
242 			expectedParentNodeToString,
243 			expectedUnitDisplayString,
244 			completionIdentifier,
245 			expectedReplacedSource,
246 	"diet ast");
247 }
test0008()248 public void test0008(){
249 	String str =
250 		"public @MyAnn @interface X\n" +
251 		"";
252 
253 
254 	String completeBehind = "MyAnn";
255 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
256 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
257 	String expectedParentNodeToString = "<NONE>";
258 	String completionIdentifier = "MyAnn";
259 	String expectedReplacedSource = "MyAnn";
260 	String expectedUnitDisplayString =
261 		"@<CompleteOnType:MyAnn>\n" +
262 		"@interface X {\n" +
263 		"}\n";
264 
265 	checkDietParse(
266 			str.toCharArray(),
267 			cursorLocation,
268 			expectedCompletionNodeToString,
269 			expectedParentNodeToString,
270 			expectedUnitDisplayString,
271 			completionIdentifier,
272 			expectedReplacedSource,
273 	"diet ast");
274 }
test0009()275 public void test0009(){
276 	String str =
277 		"public @MyAnn\n" +
278 		"";
279 
280 
281 	String completeBehind = "MyAnn";
282 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
283 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
284 	String expectedParentNodeToString = "<NONE>";
285 	String completionIdentifier = "MyAnn";
286 	String expectedReplacedSource = "MyAnn";
287 	String expectedUnitDisplayString =
288 		"@<CompleteOnType:MyAnn>\n";
289 
290 	checkDietParse(
291 			str.toCharArray(),
292 			cursorLocation,
293 			expectedCompletionNodeToString,
294 			expectedParentNodeToString,
295 			expectedUnitDisplayString,
296 			completionIdentifier,
297 			expectedReplacedSource,
298 	"diet ast");
299 }
test0010()300 public void test0010(){
301 	String str =
302 		"public class X {\n" +
303 		"  public @MyAnn class Y {\n" +
304 		"  }\n" +
305 		"}";
306 
307 
308 	String completeBehind = "MyAnn";
309 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
310 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
311 	String expectedParentNodeToString = "<NONE>";
312 	String completionIdentifier = "MyAnn";
313 	String expectedReplacedSource = "MyAnn";
314 	String expectedUnitDisplayString =
315 		"public class X {\n" +
316 		"  @<CompleteOnType:MyAnn>\n" +
317 		"  class Y {\n" +
318 		"    Y() {\n" +
319 		"    }\n" +
320 		"  }\n" +
321 		"  public X() {\n" +
322 		"  }\n" +
323 		"}\n";
324 
325 	checkDietParse(
326 			str.toCharArray(),
327 			cursorLocation,
328 			expectedCompletionNodeToString,
329 			expectedParentNodeToString,
330 			expectedUnitDisplayString,
331 			completionIdentifier,
332 			expectedReplacedSource,
333 	"diet ast");
334 }
test0011()335 public void test0011(){
336 	String str =
337 		"public class X {\n" +
338 		"  public @MyAnn class Y\n" +
339 		"";
340 
341 
342 	String completeBehind = "MyAnn";
343 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
344 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
345 	String expectedParentNodeToString = "<NONE>";
346 	String completionIdentifier = "MyAnn";
347 	String expectedReplacedSource = "MyAnn";
348 	String expectedUnitDisplayString =
349 		"public class X {\n" +
350 		"  @<CompleteOnType:MyAnn>\n" +
351 		"  class Y {\n" +
352 		"    Y() {\n" +
353 		"    }\n" +
354 		"  }\n" +
355 		"  public X() {\n" +
356 		"  }\n" +
357 		"}\n";
358 
359 	checkDietParse(
360 			str.toCharArray(),
361 			cursorLocation,
362 			expectedCompletionNodeToString,
363 			expectedParentNodeToString,
364 			expectedUnitDisplayString,
365 			completionIdentifier,
366 			expectedReplacedSource,
367 	"diet ast");
368 }
test0012()369 public void test0012(){
370 	String str =
371 		"public class X {\n" +
372 		"  public @MyAnn\n" +
373 		"}";
374 
375 
376 	String completeBehind = "MyAnn";
377 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
378 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
379 	String expectedParentNodeToString = "<NONE>";
380 	String completionIdentifier = "MyAnn";
381 	String expectedReplacedSource = "MyAnn";
382 	String expectedUnitDisplayString =
383 		"public class X {\n" +
384 		"  @<CompleteOnType:MyAnn>\n" +
385 		"  public X() {\n" +
386 		"  }\n" +
387 		"}\n";
388 
389 	checkDietParse(
390 			str.toCharArray(),
391 			cursorLocation,
392 			expectedCompletionNodeToString,
393 			expectedParentNodeToString,
394 			expectedUnitDisplayString,
395 			completionIdentifier,
396 			expectedReplacedSource,
397 	"diet ast");
398 }
test0013_Diet()399 public void test0013_Diet(){
400 	String str =
401 		"public class X {\n" +
402 		"  public void foo() {\n" +
403 		"    @MyAnn class Y {\n" +
404 		"    }\n" +
405 		"  }\n" +
406 		"}";
407 
408 
409 	String completeBehind = "MyAnn";
410 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
411 	String expectedCompletionNodeToString = "<NONE>";
412 	String expectedParentNodeToString = "<NONE>";
413 	String completionIdentifier = "<NONE>";
414 	String expectedReplacedSource = "<NONE>";
415 	String expectedUnitDisplayString =
416 		"public class X {\n" +
417 		"  public X() {\n" +
418 		"  }\n" +
419 		"  public void foo() {\n" +
420 		"  }\n" +
421 		"}\n";
422 
423 	checkDietParse(
424 			str.toCharArray(),
425 			cursorLocation,
426 			expectedCompletionNodeToString,
427 			expectedParentNodeToString,
428 			expectedUnitDisplayString,
429 			completionIdentifier,
430 			expectedReplacedSource,
431 	"diet ast");
432 }
test0013_Method()433 public void test0013_Method(){
434 	String str =
435 		"public class X {\n" +
436 		"  public void foo() {\n" +
437 		"    @MyAnn class Y {\n" +
438 		"    }\n" +
439 		"  }\n" +
440 		"}";
441 
442 
443 	String completeBehind = "MyAnn";
444 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
445 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
446 	String expectedParentNodeToString = "<NONE>";
447 	String completionIdentifier = "MyAnn";
448 	String expectedReplacedSource = "MyAnn";
449 	String expectedUnitDisplayString =
450 			"public class X {\n" +
451 			"  public X() {\n" +
452 			"  }\n" +
453 			"  public void foo() {\n" +
454 			"    @<CompleteOnType:MyAnn>\n" +
455 			"  }\n" +
456 			"}\n";
457 
458 	checkMethodParse(
459 			str.toCharArray(),
460 			cursorLocation,
461 			expectedCompletionNodeToString,
462 			expectedParentNodeToString,
463 			expectedUnitDisplayString,
464 			completionIdentifier,
465 			expectedReplacedSource,
466 			"full ast");
467 }
test0014()468 public void test0014(){
469 	String str =
470 		"public @MyAnn(ZORK) class X {\n" +
471 		"}";
472 
473 
474 	String completeBehind = "MyAnn";
475 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
476 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
477 	String expectedParentNodeToString = "<NONE>";
478 	String completionIdentifier = "MyAnn";
479 	String expectedReplacedSource = "MyAnn";
480 	String expectedUnitDisplayString =
481 		"@<CompleteOnType:MyAnn>\n" +
482 		"class X {\n" +
483 		"  X() {\n" +
484 		"  }\n" +
485 		"}\n";
486 
487 	checkDietParse(
488 			str.toCharArray(),
489 			cursorLocation,
490 			expectedCompletionNodeToString,
491 			expectedParentNodeToString,
492 			expectedUnitDisplayString,
493 			completionIdentifier,
494 			expectedReplacedSource,
495 	"diet ast");
496 }
test0015()497 public void test0015(){
498 	String str =
499 		"public @MyAnn(ZORK) class X\n" +
500 		"";
501 
502 
503 	String completeBehind = "MyAnn";
504 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
505 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
506 	String expectedParentNodeToString = "<NONE>";
507 	String completionIdentifier = "MyAnn";
508 	String expectedReplacedSource = "MyAnn";
509 	String expectedUnitDisplayString =
510 		"@<CompleteOnType:MyAnn>\n" +
511 		"class X {\n" +
512 		"  X() {\n" +
513 		"  }\n" +
514 		"}\n";
515 
516 	checkDietParse(
517 			str.toCharArray(),
518 			cursorLocation,
519 			expectedCompletionNodeToString,
520 			expectedParentNodeToString,
521 			expectedUnitDisplayString,
522 			completionIdentifier,
523 			expectedReplacedSource,
524 	"diet ast");
525 }
test0016()526 public void test0016(){
527 	String str =
528 		"public @MyAnn(ZORK)\n" +
529 		"";
530 
531 
532 	String completeBehind = "MyAnn";
533 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
534 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
535 	String expectedParentNodeToString = "<NONE>";
536 	String completionIdentifier = "MyAnn";
537 	String expectedReplacedSource = "MyAnn";
538 	String expectedUnitDisplayString =
539 		"@<CompleteOnType:MyAnn>\n";
540 
541 	checkDietParse(
542 			str.toCharArray(),
543 			cursorLocation,
544 			expectedCompletionNodeToString,
545 			expectedParentNodeToString,
546 			expectedUnitDisplayString,
547 			completionIdentifier,
548 			expectedReplacedSource,
549 	"diet ast");
550 }
test0017()551 public void test0017(){
552 	String str =
553 		"public @MyAnn(v1=\"\", v2=\"\") class X {\n" +
554 		"}";
555 
556 
557 	String completeBehind = "MyAnn";
558 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
559 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
560 	String expectedParentNodeToString = "<NONE>";
561 	String completionIdentifier = "MyAnn";
562 	String expectedReplacedSource = "MyAnn";
563 	String expectedUnitDisplayString =
564 		"@<CompleteOnType:MyAnn>\n" +
565 		"class X {\n" +
566 		"  X() {\n" +
567 		"  }\n" +
568 		"}\n";
569 
570 	checkDietParse(
571 			str.toCharArray(),
572 			cursorLocation,
573 			expectedCompletionNodeToString,
574 			expectedParentNodeToString,
575 			expectedUnitDisplayString,
576 			completionIdentifier,
577 			expectedReplacedSource,
578 	"diet ast");
579 }
test0018()580 public void test0018(){
581 	String str =
582 		"public @MyAnn(v1=\"\", v2=\"\")) class X\n" +
583 		"";
584 
585 
586 	String completeBehind = "MyAnn";
587 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
588 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
589 	String expectedParentNodeToString = "<NONE>";
590 	String completionIdentifier = "MyAnn";
591 	String expectedReplacedSource = "MyAnn";
592 	String expectedUnitDisplayString =
593 		"@<CompleteOnType:MyAnn>\n" +
594 		"class X {\n" +
595 		"  X() {\n" +
596 		"  }\n" +
597 		"}\n";
598 
599 	checkDietParse(
600 			str.toCharArray(),
601 			cursorLocation,
602 			expectedCompletionNodeToString,
603 			expectedParentNodeToString,
604 			expectedUnitDisplayString,
605 			completionIdentifier,
606 			expectedReplacedSource,
607 	"diet ast");
608 }
test0019()609 public void test0019(){
610 	String str =
611 		"public @MyAnn(v1=\"\", v2=\"\")\n" +
612 		"";
613 
614 
615 	String completeBehind = "MyAnn";
616 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
617 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
618 	String expectedParentNodeToString = "<NONE>";
619 	String completionIdentifier = "MyAnn";
620 	String expectedReplacedSource = "MyAnn";
621 	String expectedUnitDisplayString =
622 		"@<CompleteOnType:MyAnn>\n";
623 
624 	checkDietParse(
625 			str.toCharArray(),
626 			cursorLocation,
627 			expectedCompletionNodeToString,
628 			expectedParentNodeToString,
629 			expectedUnitDisplayString,
630 			completionIdentifier,
631 			expectedReplacedSource,
632 	"diet ast");
633 }
test0020()634 public void test0020(){
635 	String str =
636 		"public @MyAnn(v1=\"\"";
637 
638 
639 	String completeBehind = "MyAnn";
640 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
641 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
642 	String expectedParentNodeToString = "<NONE>";
643 	String completionIdentifier = "MyAnn";
644 	String expectedReplacedSource = "MyAnn";
645 	String expectedUnitDisplayString =
646 		"@<CompleteOnType:MyAnn>\n";
647 
648 	checkDietParse(
649 			str.toCharArray(),
650 			cursorLocation,
651 			expectedCompletionNodeToString,
652 			expectedParentNodeToString,
653 			expectedUnitDisplayString,
654 			completionIdentifier,
655 			expectedReplacedSource,
656 	"diet ast");
657 }
test0021()658 public void test0021(){
659 	String str =
660 		"public class X {\n" +
661 		"  @MyAnn void foo() {}\n" +
662 		"}";
663 
664 
665 	String completeBehind = "MyAnn";
666 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
667 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
668 	String expectedParentNodeToString = "<NONE>";
669 	String completionIdentifier = "MyAnn";
670 	String expectedReplacedSource = "MyAnn";
671 	String expectedUnitDisplayString =
672 		"public class X {\n" +
673 		"  @<CompleteOnType:MyAnn>\n" +
674 		"  public X() {\n" +
675 		"  }\n" +
676 		"  void foo() {\n" +
677 		"  }\n" +
678 		"}\n";
679 
680 	checkDietParse(
681 			str.toCharArray(),
682 			cursorLocation,
683 			expectedCompletionNodeToString,
684 			expectedParentNodeToString,
685 			expectedUnitDisplayString,
686 			completionIdentifier,
687 			expectedReplacedSource,
688 	"diet ast");
689 }
test0022()690 public void test0022(){
691 	String str =
692 		"public class X {\n" +
693 		"  @MyAnn int var;\n" +
694 		"}";
695 
696 
697 	String completeBehind = "MyAnn";
698 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
699 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
700 	String expectedParentNodeToString = "<NONE>";
701 	String completionIdentifier = "MyAnn";
702 	String expectedReplacedSource = "MyAnn";
703 	String expectedUnitDisplayString =
704 		"public class X {\n" +
705 		"  @<CompleteOnType:MyAnn>\n" +
706 		"  int var;\n" +
707 		"  public X() {\n" +
708 		"  }\n" +
709 		"}\n";
710 
711 	checkDietParse(
712 			str.toCharArray(),
713 			cursorLocation,
714 			expectedCompletionNodeToString,
715 			expectedParentNodeToString,
716 			expectedUnitDisplayString,
717 			completionIdentifier,
718 			expectedReplacedSource,
719 	"diet ast");
720 }
test0023()721 public void test0023(){
722 	String str =
723 		"public class X {\n" +
724 		"  void foo(@MyAnn int i) {}\n" +
725 		"}";
726 
727 
728 	String completeBehind = "MyAnn";
729 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
730 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
731 	String expectedParentNodeToString = "<NONE>";
732 	String completionIdentifier = "MyAnn";
733 	String expectedReplacedSource = "MyAnn";
734 	String expectedUnitDisplayString =
735 		"public class X {\n" +
736 		"  @<CompleteOnType:MyAnn>\n" +
737 		"  public X() {\n" +
738 		"  }\n" +
739 		"  void foo() {\n" +
740 		"  }\n" +
741 		"}\n";
742 
743 	checkDietParse(
744 			str.toCharArray(),
745 			cursorLocation,
746 			expectedCompletionNodeToString,
747 			expectedParentNodeToString,
748 			expectedUnitDisplayString,
749 			completionIdentifier,
750 			expectedReplacedSource,
751 	"diet ast");
752 }
test0024_Diet()753 public void test0024_Diet(){
754 	String str =
755 		"public class X {\n" +
756 		"  void foo() {@MyAnn int i}\n" +
757 		"}";
758 
759 
760 	String completeBehind = "MyAnn";
761 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
762 	String expectedCompletionNodeToString = "<NONE>";
763 	String expectedParentNodeToString = "<NONE>";
764 	String completionIdentifier = "<NONE>";
765 	String expectedReplacedSource = "<NONE>";
766 	String expectedUnitDisplayString =
767 		"public class X {\n" +
768 		"  public X() {\n" +
769 		"  }\n" +
770 		"  void foo() {\n" +
771 		"  }\n" +
772 		"}\n";
773 
774 	checkDietParse(
775 			str.toCharArray(),
776 			cursorLocation,
777 			expectedCompletionNodeToString,
778 			expectedParentNodeToString,
779 			expectedUnitDisplayString,
780 			completionIdentifier,
781 			expectedReplacedSource,
782 	"diet ast");
783 }
test0024_Method()784 public void test0024_Method(){
785 	String str =
786 		"public class X {\n" +
787 		"  void foo() {@MyAnn int i}\n" +
788 		"}";
789 
790 
791 	String completeBehind = "MyAnn";
792 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
793 	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
794 	String expectedParentNodeToString = "<NONE>";
795 	String completionIdentifier = "MyAnn";
796 	String expectedReplacedSource = "MyAnn";
797 	String expectedUnitDisplayString =
798 			"public class X {\n" +
799 			"  public X() {\n" +
800 			"  }\n" +
801 			"  void foo() {\n" +
802 			"    @<CompleteOnType:MyAnn>\n" +
803 			"  }\n" +
804 			"}\n";
805 
806 	checkMethodParse(
807 			str.toCharArray(),
808 			cursorLocation,
809 			expectedCompletionNodeToString,
810 			expectedParentNodeToString,
811 			expectedUnitDisplayString,
812 			completionIdentifier,
813 			expectedReplacedSource,
814 			"full ast");
815 }
test0025()816 public void test0025(){
817 	String str =
818 		"@Annot(foo)\n" +
819 		"public class X {\n" +
820 		"}";
821 
822 
823 	String completeBehind = "foo";
824 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
825 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
826 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
827 	String completionIdentifier = "foo";
828 	String expectedReplacedSource = "foo";
829 	String expectedUnitDisplayString =
830 		"@Annot(<CompleteOnAttributeName:foo>)\n" +
831 		"public class X {\n" +
832 		"  public X() {\n" +
833 		"  }\n" +
834 		"}\n";
835 
836 	checkDietParse(
837 			str.toCharArray(),
838 			cursorLocation,
839 			expectedCompletionNodeToString,
840 			expectedParentNodeToString,
841 			expectedUnitDisplayString,
842 			completionIdentifier,
843 			expectedReplacedSource,
844 	"diet ast");
845 }
test0026()846 public void test0026(){
847 	String str =
848 		"public class X {\n" +
849 		"  @Annot(foo)\n" +
850 		"  void bar() {\n" +
851 		"  }\n" +
852 		"}";
853 
854 
855 	String completeBehind = "foo";
856 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
857 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
858 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
859 	String completionIdentifier = "foo";
860 	String expectedReplacedSource = "foo";
861 	String expectedUnitDisplayString =
862 		"public class X {\n" +
863 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
864 		"  public X() {\n" +
865 		"  }\n" +
866 		"  void bar() {\n" +
867 		"  }\n" +
868 		"}\n";
869 
870 	checkDietParse(
871 			str.toCharArray(),
872 			cursorLocation,
873 			expectedCompletionNodeToString,
874 			expectedParentNodeToString,
875 			expectedUnitDisplayString,
876 			completionIdentifier,
877 			expectedReplacedSource,
878 	"diet ast");
879 }
test0027()880 public void test0027(){
881 	String str =
882 		"public class X {\n" +
883 		"  @Annot(foo)\n" +
884 		"  int var;\n" +
885 		"}";
886 
887 
888 	String completeBehind = "foo";
889 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
890 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
891 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
892 	String completionIdentifier = "foo";
893 	String expectedReplacedSource = "foo";
894 	String expectedUnitDisplayString =
895 		"public class X {\n" +
896 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
897 		"  int var;\n" +
898 		"  public X() {\n" +
899 		"  }\n" +
900 		"}\n";
901 
902 	checkDietParse(
903 			str.toCharArray(),
904 			cursorLocation,
905 			expectedCompletionNodeToString,
906 			expectedParentNodeToString,
907 			expectedUnitDisplayString,
908 			completionIdentifier,
909 			expectedReplacedSource,
910 	"diet ast");
911 }
test0028_Diet()912 public void test0028_Diet(){
913 	String str =
914 		"public class X {\n" +
915 		"  void bar() {\n" +
916 		"    @Annot(foo)\n" +
917 		"    int var;\n" +
918 		"  }\n" +
919 		"}";
920 
921 
922 	String completeBehind = "foo";
923 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
924 	String expectedCompletionNodeToString = "<NONE>";
925 	String expectedParentNodeToString = "<NONE>";
926 	String completionIdentifier = "<NONE>";
927 	String expectedReplacedSource = "<NONE>";
928 	String expectedUnitDisplayString =
929 		"public class X {\n" +
930 		"  public X() {\n" +
931 		"  }\n" +
932 		"  void bar() {\n" +
933 		"  }\n" +
934 		"}\n";
935 
936 	checkDietParse(
937 			str.toCharArray(),
938 			cursorLocation,
939 			expectedCompletionNodeToString,
940 			expectedParentNodeToString,
941 			expectedUnitDisplayString,
942 			completionIdentifier,
943 			expectedReplacedSource,
944 	"diet ast");
945 }
test0028_Method()946 public void test0028_Method(){
947 	String str =
948 		"public class X {\n" +
949 		"  void bar() {\n" +
950 		"    @Annot(foo)\n" +
951 		"    int var;\n" +
952 		"  }\n" +
953 		"}";
954 
955 
956 	String completeBehind = "foo";
957 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
958 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
959 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
960 	String completionIdentifier = "foo";
961 	String expectedReplacedSource = "foo";
962 	String expectedUnitDisplayString =
963 			"public class X {\n" +
964 			"  public X() {\n" +
965 			"  }\n" +
966 			"  void bar() {\n" +
967 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
968 			"  }\n" +
969 			"}\n";
970 
971 	checkMethodParse(
972 			str.toCharArray(),
973 			cursorLocation,
974 			expectedCompletionNodeToString,
975 			expectedParentNodeToString,
976 			expectedUnitDisplayString,
977 			completionIdentifier,
978 			expectedReplacedSource,
979 			"full ast");
980 }
test0029_Diet()981 public void test0029_Diet(){
982 	String str =
983 		"public class X {\n" +
984 		"  void bar(int var1, @Annot(foo) int var2) {\n" +
985 		"  }\n" +
986 		"}";
987 
988 
989 	String completeBehind = "foo";
990 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
991 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
992 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
993 	String completionIdentifier = "foo";
994 	String expectedReplacedSource = "foo";
995 	String expectedUnitDisplayString =
996 		"public class X {\n" +
997 		"  public X() {\n" +
998 		"  }\n" +
999 		"  void bar(int var1) {\n" +
1000 		"  }\n" +
1001 		"}\n";
1002 
1003 	checkDietParse(
1004 			str.toCharArray(),
1005 			cursorLocation,
1006 			expectedCompletionNodeToString,
1007 			expectedParentNodeToString,
1008 			expectedUnitDisplayString,
1009 			completionIdentifier,
1010 			expectedReplacedSource,
1011 	"diet ast");
1012 }
test0029_Method()1013 public void test0029_Method(){
1014 	String str =
1015 		"public class X {\n" +
1016 		"  void bar(int var1, @Annot(foo) int var2) {\n" +
1017 		"  }\n" +
1018 		"}";
1019 
1020 
1021 	String completeBehind = "foo";
1022 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1023 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1024 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1025 	String completionIdentifier = "foo";
1026 	String expectedReplacedSource = "foo";
1027 	String expectedUnitDisplayString =
1028 			"public class X {\n" +
1029 			"  public X() {\n" +
1030 			"  }\n" +
1031 			"  void bar(int var1) {\n" +
1032 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1033 			"  }\n" +
1034 			"}\n";
1035 
1036 	checkMethodParse(
1037 			str.toCharArray(),
1038 			cursorLocation,
1039 			expectedCompletionNodeToString,
1040 			expectedParentNodeToString,
1041 			expectedUnitDisplayString,
1042 			completionIdentifier,
1043 			expectedReplacedSource,
1044 			"full ast");
1045 }
test0030()1046 public void test0030(){
1047 	String str =
1048 		"public class X {\n" +
1049 		"  @Annot(foo)\n" +
1050 		"  X() {\n" +
1051 		"  }\n" +
1052 		"}";
1053 
1054 
1055 	String completeBehind = "foo";
1056 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1057 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1058 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1059 	String completionIdentifier = "foo";
1060 	String expectedReplacedSource = "foo";
1061 	String expectedUnitDisplayString =
1062 		"public class X {\n" +
1063 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1064 		"  X() {\n" +
1065 		"  }\n" +
1066 		"}\n";
1067 
1068 	checkDietParse(
1069 			str.toCharArray(),
1070 			cursorLocation,
1071 			expectedCompletionNodeToString,
1072 			expectedParentNodeToString,
1073 			expectedUnitDisplayString,
1074 			completionIdentifier,
1075 			expectedReplacedSource,
1076 	"diet ast");
1077 }
test0031()1078 public void test0031(){
1079 	String str =
1080 		"@Annot(foo\n" +
1081 		"public class X {\n" +
1082 		"}";
1083 
1084 
1085 	String completeBehind = "foo";
1086 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1087 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1088 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1089 	String completionIdentifier = "foo";
1090 	String expectedReplacedSource = "foo";
1091 	String expectedUnitDisplayString =
1092 		"@Annot(<CompleteOnAttributeName:foo>)\n" +
1093 		"public class X {\n" +
1094 		"  public X() {\n" +
1095 		"  }\n" +
1096 		"}\n";
1097 
1098 	checkDietParse(
1099 			str.toCharArray(),
1100 			cursorLocation,
1101 			expectedCompletionNodeToString,
1102 			expectedParentNodeToString,
1103 			expectedUnitDisplayString,
1104 			completionIdentifier,
1105 			expectedReplacedSource,
1106 	"diet ast");
1107 }
test0032()1108 public void test0032(){
1109 	String str =
1110 		"public class X {\n" +
1111 		"  @Annot(foo\n" +
1112 		"  void bar() {\n" +
1113 		"  }\n" +
1114 		"}";
1115 
1116 
1117 	String completeBehind = "foo";
1118 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1119 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1120 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1121 	String completionIdentifier = "foo";
1122 	String expectedReplacedSource = "foo";
1123 	String expectedUnitDisplayString =
1124 		"public class X {\n" +
1125 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1126 		"  public X() {\n" +
1127 		"  }\n" +
1128 		"  void bar() {\n" +
1129 		"  }\n" +
1130 		"}\n";
1131 
1132 	checkDietParse(
1133 			str.toCharArray(),
1134 			cursorLocation,
1135 			expectedCompletionNodeToString,
1136 			expectedParentNodeToString,
1137 			expectedUnitDisplayString,
1138 			completionIdentifier,
1139 			expectedReplacedSource,
1140 	"diet ast");
1141 }
test0033()1142 public void test0033(){
1143 	String str =
1144 		"public class X {\n" +
1145 		"  @Annot(foo\n" +
1146 		"  int var;\n" +
1147 		"}";
1148 
1149 
1150 	String completeBehind = "foo";
1151 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1152 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1153 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1154 	String completionIdentifier = "foo";
1155 	String expectedReplacedSource = "foo";
1156 	String expectedUnitDisplayString =
1157 		"public class X {\n" +
1158 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1159 		"  int var;\n" +
1160 		"  public X() {\n" +
1161 		"  }\n" +
1162 		"}\n";
1163 
1164 	checkDietParse(
1165 			str.toCharArray(),
1166 			cursorLocation,
1167 			expectedCompletionNodeToString,
1168 			expectedParentNodeToString,
1169 			expectedUnitDisplayString,
1170 			completionIdentifier,
1171 			expectedReplacedSource,
1172 	"diet ast");
1173 }
test0034_Diet()1174 public void test0034_Diet(){
1175 	String str =
1176 		"public class X {\n" +
1177 		"  void bar() {\n" +
1178 		"    @Annot(foo\n" +
1179 		"    int var;\n" +
1180 		"  }\n" +
1181 		"}";
1182 
1183 
1184 	String completeBehind = "foo";
1185 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1186 	String expectedCompletionNodeToString = "<NONE>";
1187 	String expectedParentNodeToString = "<NONE>";
1188 	String completionIdentifier = "<NONE>";
1189 	String expectedReplacedSource = "<NONE>";
1190 	String expectedUnitDisplayString =
1191 		"public class X {\n" +
1192 		"  public X() {\n" +
1193 		"  }\n" +
1194 		"  void bar() {\n" +
1195 		"  }\n" +
1196 		"}\n";
1197 
1198 	checkDietParse(
1199 			str.toCharArray(),
1200 			cursorLocation,
1201 			expectedCompletionNodeToString,
1202 			expectedParentNodeToString,
1203 			expectedUnitDisplayString,
1204 			completionIdentifier,
1205 			expectedReplacedSource,
1206 	"diet ast");
1207 }
test0034_Method()1208 public void test0034_Method(){
1209 	String str =
1210 		"public class X {\n" +
1211 		"  void bar() {\n" +
1212 		"    @Annot(foo\n" +
1213 		"    int var;\n" +
1214 		"  }\n" +
1215 		"}";
1216 
1217 
1218 	String completeBehind = "foo";
1219 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1220 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1221 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1222 	String completionIdentifier = "foo";
1223 	String expectedReplacedSource = "foo";
1224 	String expectedUnitDisplayString =
1225 			"public class X {\n" +
1226 			"  public X() {\n" +
1227 			"  }\n" +
1228 			"  void bar() {\n" +
1229 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1230 			"  }\n" +
1231 			"}\n";
1232 
1233 	checkMethodParse(
1234 			str.toCharArray(),
1235 			cursorLocation,
1236 			expectedCompletionNodeToString,
1237 			expectedParentNodeToString,
1238 			expectedUnitDisplayString,
1239 			completionIdentifier,
1240 			expectedReplacedSource,
1241 			"full ast");
1242 }
test0035_Diet()1243 public void test0035_Diet(){
1244 	String str =
1245 		"public class X {\n" +
1246 		"  void bar(int var1, @Annot(foo int var2) {\n" +
1247 		"  }\n" +
1248 		"}";
1249 
1250 
1251 	String completeBehind = "foo";
1252 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1253 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1254 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1255 	String completionIdentifier = "foo";
1256 	String expectedReplacedSource = "foo";
1257 	String expectedUnitDisplayString =
1258 		"public class X {\n" +
1259 		"  public X() {\n" +
1260 		"  }\n" +
1261 		"  void bar(int var1) {\n" +
1262 		"  }\n" +
1263 		"}\n";
1264 
1265 	checkDietParse(
1266 			str.toCharArray(),
1267 			cursorLocation,
1268 			expectedCompletionNodeToString,
1269 			expectedParentNodeToString,
1270 			expectedUnitDisplayString,
1271 			completionIdentifier,
1272 			expectedReplacedSource,
1273 	"diet ast");
1274 }
test0035_Method()1275 public void test0035_Method(){
1276 	String str =
1277 		"public class X {\n" +
1278 		"  void bar(int var1, @Annot(foo int var2) {\n" +
1279 		"  }\n" +
1280 		"}";
1281 
1282 
1283 	String completeBehind = "foo";
1284 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1285 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1286 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1287 	String completionIdentifier = "foo";
1288 	String expectedReplacedSource = "foo";
1289 	String expectedUnitDisplayString =
1290 			"public class X {\n" +
1291 			"  public X() {\n" +
1292 			"  }\n" +
1293 			"  void bar(int var1) {\n" +
1294 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1295 			"  }\n" +
1296 			"}\n";
1297 
1298 	checkMethodParse(
1299 			str.toCharArray(),
1300 			cursorLocation,
1301 			expectedCompletionNodeToString,
1302 			expectedParentNodeToString,
1303 			expectedUnitDisplayString,
1304 			completionIdentifier,
1305 			expectedReplacedSource,
1306 			"full ast");
1307 }
test0036()1308 public void test0036(){
1309 	String str =
1310 		"public class X {\n" +
1311 		"  @Annot(foo\n" +
1312 		"  X() {\n" +
1313 		"  }\n" +
1314 		"}";
1315 
1316 
1317 	String completeBehind = "foo";
1318 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1319 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1320 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1321 	String completionIdentifier = "foo";
1322 	String expectedReplacedSource = "foo";
1323 	String expectedUnitDisplayString =
1324 		"public class X {\n" +
1325 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1326 		"  X() {\n" +
1327 		"  }\n" +
1328 		"}\n";
1329 
1330 	checkDietParse(
1331 			str.toCharArray(),
1332 			cursorLocation,
1333 			expectedCompletionNodeToString,
1334 			expectedParentNodeToString,
1335 			expectedUnitDisplayString,
1336 			completionIdentifier,
1337 			expectedReplacedSource,
1338 	"diet ast");
1339 }
test0037()1340 public void test0037(){
1341 	String str =
1342 		"@Annot(foo=zzz)\n" +
1343 		"public class X {\n" +
1344 		"}";
1345 
1346 
1347 	String completeBehind = "foo";
1348 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1349 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1350 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1351 	String completionIdentifier = "foo";
1352 	String expectedReplacedSource = "foo";
1353 	String expectedUnitDisplayString =
1354 		"@Annot(<CompleteOnAttributeName:foo>)\n" +
1355 		"public class X {\n" +
1356 		"  public X() {\n" +
1357 		"  }\n" +
1358 		"}\n";
1359 
1360 	checkDietParse(
1361 			str.toCharArray(),
1362 			cursorLocation,
1363 			expectedCompletionNodeToString,
1364 			expectedParentNodeToString,
1365 			expectedUnitDisplayString,
1366 			completionIdentifier,
1367 			expectedReplacedSource,
1368 	"diet ast");
1369 }
test0038()1370 public void test0038(){
1371 	String str =
1372 		"public class X {\n" +
1373 		"  @Annot(foo=zzz)\n" +
1374 		"  void bar() {\n" +
1375 		"  }\n" +
1376 		"}";
1377 
1378 
1379 	String completeBehind = "foo";
1380 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1381 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1382 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1383 	String completionIdentifier = "foo";
1384 	String expectedReplacedSource = "foo";
1385 	String expectedUnitDisplayString =
1386 		"public class X {\n" +
1387 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1388 		"  public X() {\n" +
1389 		"  }\n" +
1390 		"  void bar() {\n" +
1391 		"  }\n" +
1392 		"}\n";
1393 
1394 	checkDietParse(
1395 			str.toCharArray(),
1396 			cursorLocation,
1397 			expectedCompletionNodeToString,
1398 			expectedParentNodeToString,
1399 			expectedUnitDisplayString,
1400 			completionIdentifier,
1401 			expectedReplacedSource,
1402 	"diet ast");
1403 }
test0039()1404 public void test0039(){
1405 	String str =
1406 		"public class X {\n" +
1407 		"  @Annot(foo=zzz)\n" +
1408 		"  int var;\n" +
1409 		"}";
1410 
1411 
1412 	String completeBehind = "foo";
1413 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1414 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1415 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1416 	String completionIdentifier = "foo";
1417 	String expectedReplacedSource = "foo";
1418 	String expectedUnitDisplayString =
1419 		"public class X {\n" +
1420 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1421 		"  int var;\n" +
1422 		"  public X() {\n" +
1423 		"  }\n" +
1424 		"}\n";
1425 
1426 	checkDietParse(
1427 			str.toCharArray(),
1428 			cursorLocation,
1429 			expectedCompletionNodeToString,
1430 			expectedParentNodeToString,
1431 			expectedUnitDisplayString,
1432 			completionIdentifier,
1433 			expectedReplacedSource,
1434 	"diet ast");
1435 }
test0040_Diet()1436 public void test0040_Diet(){
1437 	String str =
1438 		"public class X {\n" +
1439 		"  void bar() {\n" +
1440 		"    @Annot(foo=zzz)\n" +
1441 		"    int var;\n" +
1442 		"  }\n" +
1443 		"}";
1444 
1445 
1446 	String completeBehind = "foo";
1447 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1448 	String expectedCompletionNodeToString = "<NONE>";
1449 	String expectedParentNodeToString = "<NONE>";
1450 	String completionIdentifier = "<NONE>";
1451 	String expectedReplacedSource = "<NONE>";
1452 	String expectedUnitDisplayString =
1453 		"public class X {\n" +
1454 		"  public X() {\n" +
1455 		"  }\n" +
1456 		"  void bar() {\n" +
1457 		"  }\n" +
1458 		"}\n";
1459 
1460 	checkDietParse(
1461 			str.toCharArray(),
1462 			cursorLocation,
1463 			expectedCompletionNodeToString,
1464 			expectedParentNodeToString,
1465 			expectedUnitDisplayString,
1466 			completionIdentifier,
1467 			expectedReplacedSource,
1468 	"diet ast");
1469 }
test0040_Method()1470 public void test0040_Method(){
1471 	String str =
1472 		"public class X {\n" +
1473 		"  void bar() {\n" +
1474 		"    @Annot(foo=zzz)\n" +
1475 		"    int var;\n" +
1476 		"  }\n" +
1477 		"}";
1478 
1479 
1480 	String completeBehind = "foo";
1481 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1482 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1483 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1484 	String completionIdentifier = "foo";
1485 	String expectedReplacedSource = "foo";
1486 	String expectedUnitDisplayString =
1487 			"public class X {\n" +
1488 			"  public X() {\n" +
1489 			"  }\n" +
1490 			"  void bar() {\n" +
1491 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1492 			"  }\n" +
1493 			"}\n";
1494 
1495 	checkMethodParse(
1496 			str.toCharArray(),
1497 			cursorLocation,
1498 			expectedCompletionNodeToString,
1499 			expectedParentNodeToString,
1500 			expectedUnitDisplayString,
1501 			completionIdentifier,
1502 			expectedReplacedSource,
1503 			"full ast");
1504 }
test0041_Diet()1505 public void test0041_Diet(){
1506 	String str =
1507 		"public class X {\n" +
1508 		"  void bar(int var1, @Annot(foo=zzz) int var2) {\n" +
1509 		"  }\n" +
1510 		"}";
1511 
1512 
1513 	String completeBehind = "foo";
1514 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1515 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1516 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1517 	String completionIdentifier = "foo";
1518 	String expectedReplacedSource = "foo";
1519 	String expectedUnitDisplayString =
1520 		"public class X {\n" +
1521 		"  public X() {\n" +
1522 		"  }\n" +
1523 		"  void bar(int var1) {\n" +
1524 		"  }\n" +
1525 		"}\n";
1526 
1527 	checkDietParse(
1528 			str.toCharArray(),
1529 			cursorLocation,
1530 			expectedCompletionNodeToString,
1531 			expectedParentNodeToString,
1532 			expectedUnitDisplayString,
1533 			completionIdentifier,
1534 			expectedReplacedSource,
1535 	"diet ast");
1536 }
test0041_Method()1537 public void test0041_Method(){
1538 	String str =
1539 		"public class X {\n" +
1540 		"  void bar(int var1, @Annot(foo=zzz) int var2) {\n" +
1541 		"  }\n" +
1542 		"}";
1543 
1544 
1545 	String completeBehind = "foo";
1546 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1547 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1548 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1549 	String completionIdentifier = "foo";
1550 	String expectedReplacedSource = "foo";
1551 	String expectedUnitDisplayString =
1552 			"public class X {\n" +
1553 			"  public X() {\n" +
1554 			"  }\n" +
1555 			"  void bar(int var1) {\n" +
1556 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1557 			"  }\n" +
1558 			"}\n";
1559 
1560 	checkMethodParse(
1561 			str.toCharArray(),
1562 			cursorLocation,
1563 			expectedCompletionNodeToString,
1564 			expectedParentNodeToString,
1565 			expectedUnitDisplayString,
1566 			completionIdentifier,
1567 			expectedReplacedSource,
1568 			"full ast");
1569 }
test0042()1570 public void test0042(){
1571 	String str =
1572 		"public class X {\n" +
1573 		"  @Annot(foo=zzz)\n" +
1574 		"  X() {\n" +
1575 		"  }\n" +
1576 		"}";
1577 
1578 
1579 	String completeBehind = "foo";
1580 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1581 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1582 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1583 	String completionIdentifier = "foo";
1584 	String expectedReplacedSource = "foo";
1585 	String expectedUnitDisplayString =
1586 		"public class X {\n" +
1587 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1588 		"  X() {\n" +
1589 		"  }\n" +
1590 		"}\n";
1591 
1592 	checkDietParse(
1593 			str.toCharArray(),
1594 			cursorLocation,
1595 			expectedCompletionNodeToString,
1596 			expectedParentNodeToString,
1597 			expectedUnitDisplayString,
1598 			completionIdentifier,
1599 			expectedReplacedSource,
1600 	"diet ast");
1601 }
test0043()1602 public void test0043(){
1603 	String str =
1604 		"@Annot(foo=zzz\n" +
1605 		"public class X {\n" +
1606 		"}";
1607 
1608 
1609 	String completeBehind = "foo";
1610 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1611 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1612 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1613 	String completionIdentifier = "foo";
1614 	String expectedReplacedSource = "foo";
1615 	String expectedUnitDisplayString =
1616 		"@Annot(<CompleteOnAttributeName:foo>)\n" +
1617 		"public class X {\n" +
1618 		"  public X() {\n" +
1619 		"  }\n" +
1620 		"}\n";
1621 
1622 	checkDietParse(
1623 			str.toCharArray(),
1624 			cursorLocation,
1625 			expectedCompletionNodeToString,
1626 			expectedParentNodeToString,
1627 			expectedUnitDisplayString,
1628 			completionIdentifier,
1629 			expectedReplacedSource,
1630 	"diet ast");
1631 }
test0044()1632 public void test0044(){
1633 	String str =
1634 		"public class X {\n" +
1635 		"  @Annot(foo=zzz\n" +
1636 		"  void bar() {\n" +
1637 		"  }\n" +
1638 		"}";
1639 
1640 
1641 	String completeBehind = "foo";
1642 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1643 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1644 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1645 	String completionIdentifier = "foo";
1646 	String expectedReplacedSource = "foo";
1647 	String expectedUnitDisplayString =
1648 		"public class X {\n" +
1649 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1650 		"  public X() {\n" +
1651 		"  }\n" +
1652 		"  void bar() {\n" +
1653 		"  }\n" +
1654 		"}\n";
1655 
1656 	checkDietParse(
1657 			str.toCharArray(),
1658 			cursorLocation,
1659 			expectedCompletionNodeToString,
1660 			expectedParentNodeToString,
1661 			expectedUnitDisplayString,
1662 			completionIdentifier,
1663 			expectedReplacedSource,
1664 	"diet ast");
1665 }
test0045()1666 public void test0045(){
1667 	String str =
1668 		"public class X {\n" +
1669 		"  @Annot(foo=zzz\n" +
1670 		"  int var;\n" +
1671 		"}";
1672 
1673 
1674 	String completeBehind = "foo";
1675 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1676 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1677 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1678 	String completionIdentifier = "foo";
1679 	String expectedReplacedSource = "foo";
1680 	String expectedUnitDisplayString =
1681 		"public class X {\n" +
1682 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1683 		"  int var;\n" +
1684 		"  public X() {\n" +
1685 		"  }\n" +
1686 		"}\n";
1687 
1688 	checkDietParse(
1689 			str.toCharArray(),
1690 			cursorLocation,
1691 			expectedCompletionNodeToString,
1692 			expectedParentNodeToString,
1693 			expectedUnitDisplayString,
1694 			completionIdentifier,
1695 			expectedReplacedSource,
1696 	"diet ast");
1697 }
test0046_Diet()1698 public void test0046_Diet(){
1699 	String str =
1700 		"public class X {\n" +
1701 		"  void bar() {\n" +
1702 		"    @Annot(foo=zzz\n" +
1703 		"    int var;\n" +
1704 		"  }\n" +
1705 		"}";
1706 
1707 
1708 	String completeBehind = "foo";
1709 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1710 	String expectedCompletionNodeToString = "<NONE>";
1711 	String expectedParentNodeToString = "<NONE>";
1712 	String completionIdentifier = "<NONE>";
1713 	String expectedReplacedSource = "<NONE>";
1714 	String expectedUnitDisplayString =
1715 		"public class X {\n" +
1716 		"  public X() {\n" +
1717 		"  }\n" +
1718 		"  void bar() {\n" +
1719 		"  }\n" +
1720 		"}\n";
1721 
1722 	checkDietParse(
1723 			str.toCharArray(),
1724 			cursorLocation,
1725 			expectedCompletionNodeToString,
1726 			expectedParentNodeToString,
1727 			expectedUnitDisplayString,
1728 			completionIdentifier,
1729 			expectedReplacedSource,
1730 	"diet ast");
1731 }
test0046_Method()1732 public void test0046_Method(){
1733 	String str =
1734 		"public class X {\n" +
1735 		"  void bar() {\n" +
1736 		"    @Annot(foo=zzz\n" +
1737 		"    int var;\n" +
1738 		"  }\n" +
1739 		"}";
1740 
1741 
1742 	String completeBehind = "foo";
1743 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1744 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1745 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1746 	String completionIdentifier = "foo";
1747 	String expectedReplacedSource = "foo";
1748 	String expectedUnitDisplayString =
1749 			"public class X {\n" +
1750 			"  public X() {\n" +
1751 			"  }\n" +
1752 			"  void bar() {\n" +
1753 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1754 			"  }\n" +
1755 			"}\n";
1756 
1757 	checkMethodParse(
1758 			str.toCharArray(),
1759 			cursorLocation,
1760 			expectedCompletionNodeToString,
1761 			expectedParentNodeToString,
1762 			expectedUnitDisplayString,
1763 			completionIdentifier,
1764 			expectedReplacedSource,
1765 			"full ast");
1766 }
test0047_Diet()1767 public void test0047_Diet(){
1768 	String str =
1769 		"public class X {\n" +
1770 		"  void bar(int var1, @Annot(foo=zzz int var2) {\n" +
1771 		"  }\n" +
1772 		"}";
1773 
1774 
1775 	String completeBehind = "foo";
1776 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1777 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1778 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1779 	String completionIdentifier = "foo";
1780 	String expectedReplacedSource = "foo";
1781 	String expectedUnitDisplayString =
1782 		"public class X {\n" +
1783 		"  public X() {\n" +
1784 		"  }\n" +
1785 		"  void bar(int var1) {\n" +
1786 		"  }\n" +
1787 		"}\n";
1788 
1789 	checkDietParse(
1790 			str.toCharArray(),
1791 			cursorLocation,
1792 			expectedCompletionNodeToString,
1793 			expectedParentNodeToString,
1794 			expectedUnitDisplayString,
1795 			completionIdentifier,
1796 			expectedReplacedSource,
1797 	"diet ast");
1798 }
test0047_Method()1799 public void test0047_Method(){
1800 	String str =
1801 		"public class X {\n" +
1802 		"  void bar(int var1, @Annot(foo=zzz int var2) {\n" +
1803 		"  }\n" +
1804 		"}";
1805 
1806 
1807 	String completeBehind = "foo";
1808 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1809 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1810 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1811 	String completionIdentifier = "foo";
1812 	String expectedReplacedSource = "foo";
1813 	String expectedUnitDisplayString =
1814 			"public class X {\n" +
1815 			"  public X() {\n" +
1816 			"  }\n" +
1817 			"  void bar(int var1) {\n" +
1818 			"    @Annot(<CompleteOnAttributeName:foo>)\n" +
1819 			"  }\n" +
1820 			"}\n";
1821 
1822 	checkMethodParse(
1823 			str.toCharArray(),
1824 			cursorLocation,
1825 			expectedCompletionNodeToString,
1826 			expectedParentNodeToString,
1827 			expectedUnitDisplayString,
1828 			completionIdentifier,
1829 			expectedReplacedSource,
1830 			"full ast");
1831 }
test0048()1832 public void test0048(){
1833 	String str =
1834 		"public class X {\n" +
1835 		"  @Annot(foo=zzz\n" +
1836 		"  X() {\n" +
1837 		"  }\n" +
1838 		"}";
1839 
1840 
1841 	String completeBehind = "foo";
1842 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1843 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1844 	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1845 	String completionIdentifier = "foo";
1846 	String expectedReplacedSource = "foo";
1847 	String expectedUnitDisplayString =
1848 		"public class X {\n" +
1849 		"  @Annot(<CompleteOnAttributeName:foo>)\n" +
1850 		"  public X() {\n" +
1851 		"  }\n" +
1852 		"  zzz X() {\n" +
1853 		"  }\n" +
1854 		"}\n";
1855 
1856 	checkDietParse(
1857 			str.toCharArray(),
1858 			cursorLocation,
1859 			expectedCompletionNodeToString,
1860 			expectedParentNodeToString,
1861 			expectedUnitDisplayString,
1862 			completionIdentifier,
1863 			expectedReplacedSource,
1864 	"diet ast");
1865 }
test0049()1866 public void test0049(){
1867 	String str =
1868 		"@Annot(yyy=zzz,foo)\n" +
1869 		"public class X {\n" +
1870 		"}";
1871 
1872 
1873 	String completeBehind = "foo";
1874 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1875 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1876 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
1877 	String completionIdentifier = "foo";
1878 	String expectedReplacedSource = "foo";
1879 	String expectedUnitDisplayString =
1880 		"@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
1881 		"public class X {\n" +
1882 		"  public X() {\n" +
1883 		"  }\n" +
1884 		"}\n";
1885 
1886 	checkDietParse(
1887 			str.toCharArray(),
1888 			cursorLocation,
1889 			expectedCompletionNodeToString,
1890 			expectedParentNodeToString,
1891 			expectedUnitDisplayString,
1892 			completionIdentifier,
1893 			expectedReplacedSource,
1894 	"diet ast");
1895 }
test0050()1896 public void test0050(){
1897 	String str =
1898 		"public class X {\n" +
1899 		"  @Annot(yyy=zzz,foo)\n" +
1900 		"  void bar() {\n" +
1901 		"  }\n" +
1902 		"}";
1903 
1904 
1905 	String completeBehind = "foo";
1906 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1907 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1908 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
1909 	String completionIdentifier = "foo";
1910 	String expectedReplacedSource = "foo";
1911 	String expectedUnitDisplayString =
1912 		"public class X {\n" +
1913 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
1914 		"  public X() {\n" +
1915 		"  }\n" +
1916 		"  void bar() {\n" +
1917 		"  }\n" +
1918 		"}\n";
1919 
1920 	checkDietParse(
1921 			str.toCharArray(),
1922 			cursorLocation,
1923 			expectedCompletionNodeToString,
1924 			expectedParentNodeToString,
1925 			expectedUnitDisplayString,
1926 			completionIdentifier,
1927 			expectedReplacedSource,
1928 	"diet ast");
1929 }
test0051()1930 public void test0051(){
1931 	String str =
1932 		"public class X {\n" +
1933 		"  @Annot(yyy=zzz,foo)\n" +
1934 		"  int var;\n" +
1935 		"}";
1936 
1937 
1938 	String completeBehind = "foo";
1939 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1940 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1941 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
1942 	String completionIdentifier = "foo";
1943 	String expectedReplacedSource = "foo";
1944 	String expectedUnitDisplayString =
1945 		"public class X {\n" +
1946 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
1947 		"  int var;\n" +
1948 		"  public X() {\n" +
1949 		"  }\n" +
1950 		"}\n";
1951 
1952 	checkDietParse(
1953 			str.toCharArray(),
1954 			cursorLocation,
1955 			expectedCompletionNodeToString,
1956 			expectedParentNodeToString,
1957 			expectedUnitDisplayString,
1958 			completionIdentifier,
1959 			expectedReplacedSource,
1960 	"diet ast");
1961 }
test0052_Diet()1962 public void test0052_Diet(){
1963 	String str =
1964 		"public class X {\n" +
1965 		"  void bar() {\n" +
1966 		"    @Annot(yyy=zzz,foo)\n" +
1967 		"    int var;\n" +
1968 		"  }\n" +
1969 		"}";
1970 
1971 
1972 	String completeBehind = "foo";
1973 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1974 	String expectedCompletionNodeToString = "<NONE>";
1975 	String expectedParentNodeToString = "<NONE>";
1976 	String completionIdentifier = "<NONE>";
1977 	String expectedReplacedSource = "<NONE>";
1978 	String expectedUnitDisplayString =
1979 		"public class X {\n" +
1980 		"  public X() {\n" +
1981 		"  }\n" +
1982 		"  void bar() {\n" +
1983 		"  }\n" +
1984 		"}\n";
1985 
1986 	checkDietParse(
1987 			str.toCharArray(),
1988 			cursorLocation,
1989 			expectedCompletionNodeToString,
1990 			expectedParentNodeToString,
1991 			expectedUnitDisplayString,
1992 			completionIdentifier,
1993 			expectedReplacedSource,
1994 	"diet ast");
1995 }
test0052_Method()1996 public void test0052_Method(){
1997 	String str =
1998 		"public class X {\n" +
1999 		"  void bar() {\n" +
2000 		"    @Annot(yyy=zzz,foo)\n" +
2001 		"    int var;\n" +
2002 		"  }\n" +
2003 		"}";
2004 
2005 
2006 	String completeBehind = "foo";
2007 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2008 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2009 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2010 	String completionIdentifier = "foo";
2011 	String expectedReplacedSource = "foo";
2012 	String expectedUnitDisplayString =
2013 			"public class X {\n" +
2014 			"  public X() {\n" +
2015 			"  }\n" +
2016 			"  void bar() {\n" +
2017 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2018 			"  }\n" +
2019 			"}\n";
2020 
2021 	checkMethodParse(
2022 			str.toCharArray(),
2023 			cursorLocation,
2024 			expectedCompletionNodeToString,
2025 			expectedParentNodeToString,
2026 			expectedUnitDisplayString,
2027 			completionIdentifier,
2028 			expectedReplacedSource,
2029 			"full ast");
2030 }
test0053_Diet()2031 public void test0053_Diet(){
2032 	String str =
2033 		"public class X {\n" +
2034 		"  void bar(int var1, @Annot(yyy=zzz,foo) int var2) {\n" +
2035 		"  }\n" +
2036 		"}";
2037 
2038 
2039 	String completeBehind = "foo";
2040 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2041 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2042 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2043 	String completionIdentifier = "foo";
2044 	String expectedReplacedSource = "foo";
2045 	String expectedUnitDisplayString =
2046 		"public class X {\n" +
2047 		"  public X() {\n" +
2048 		"  }\n" +
2049 		"  void bar(int var1) {\n" +
2050 		"  }\n" +
2051 		"}\n";
2052 
2053 	checkDietParse(
2054 			str.toCharArray(),
2055 			cursorLocation,
2056 			expectedCompletionNodeToString,
2057 			expectedParentNodeToString,
2058 			expectedUnitDisplayString,
2059 			completionIdentifier,
2060 			expectedReplacedSource,
2061 	"diet ast");
2062 }
test0053_Method()2063 public void test0053_Method(){
2064 	String str =
2065 		"public class X {\n" +
2066 		"  void bar(int var1, @Annot(yyy=zzz,foo) int var2) {\n" +
2067 		"  }\n" +
2068 		"}";
2069 
2070 
2071 	String completeBehind = "foo";
2072 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2073 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2074 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2075 	String completionIdentifier = "foo";
2076 	String expectedReplacedSource = "foo";
2077 	String expectedUnitDisplayString =
2078 			"public class X {\n" +
2079 			"  public X() {\n" +
2080 			"  }\n" +
2081 			"  void bar(int var1) {\n" +
2082 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2083 			"  }\n" +
2084 			"}\n";
2085 
2086 	checkMethodParse(
2087 			str.toCharArray(),
2088 			cursorLocation,
2089 			expectedCompletionNodeToString,
2090 			expectedParentNodeToString,
2091 			expectedUnitDisplayString,
2092 			completionIdentifier,
2093 			expectedReplacedSource,
2094 			"full ast");
2095 }
test0054()2096 public void test0054(){
2097 	String str =
2098 		"public class X {\n" +
2099 		"  @Annot(yyy=zzz,foo)\n" +
2100 		"  X() {\n" +
2101 		"  }\n" +
2102 		"}";
2103 
2104 
2105 	String completeBehind = "foo";
2106 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2107 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2108 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2109 	String completionIdentifier = "foo";
2110 	String expectedReplacedSource = "foo";
2111 	String expectedUnitDisplayString =
2112 		"public class X {\n" +
2113 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2114 		"  X() {\n" +
2115 		"  }\n" +
2116 		"}\n";
2117 
2118 	checkDietParse(
2119 			str.toCharArray(),
2120 			cursorLocation,
2121 			expectedCompletionNodeToString,
2122 			expectedParentNodeToString,
2123 			expectedUnitDisplayString,
2124 			completionIdentifier,
2125 			expectedReplacedSource,
2126 	"diet ast");
2127 }
test0055()2128 public void test0055(){
2129 	String str =
2130 		"@Annot(yyy=zzz,foo\n" +
2131 		"public class X {\n" +
2132 		"}";
2133 
2134 
2135 	String completeBehind = "foo";
2136 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2137 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2138 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2139 	String completionIdentifier = "foo";
2140 	String expectedReplacedSource = "foo";
2141 	String expectedUnitDisplayString =
2142 		"@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2143 		"public class X {\n" +
2144 		"  public X() {\n" +
2145 		"  }\n" +
2146 		"}\n";
2147 
2148 	checkDietParse(
2149 			str.toCharArray(),
2150 			cursorLocation,
2151 			expectedCompletionNodeToString,
2152 			expectedParentNodeToString,
2153 			expectedUnitDisplayString,
2154 			completionIdentifier,
2155 			expectedReplacedSource,
2156 	"diet ast");
2157 }
test0056()2158 public void test0056(){
2159 	String str =
2160 		"public class X {\n" +
2161 		"  @Annot(yyy=zzz,foo\n" +
2162 		"  void bar() {\n" +
2163 		"  }\n" +
2164 		"}";
2165 
2166 
2167 	String completeBehind = "foo";
2168 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2169 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2170 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2171 	String completionIdentifier = "foo";
2172 	String expectedReplacedSource = "foo";
2173 	String expectedUnitDisplayString =
2174 		"public class X {\n" +
2175 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2176 		"  public X() {\n" +
2177 		"  }\n" +
2178 		"  void bar() {\n" +
2179 		"  }\n" +
2180 		"}\n";
2181 
2182 	checkDietParse(
2183 			str.toCharArray(),
2184 			cursorLocation,
2185 			expectedCompletionNodeToString,
2186 			expectedParentNodeToString,
2187 			expectedUnitDisplayString,
2188 			completionIdentifier,
2189 			expectedReplacedSource,
2190 	"diet ast");
2191 }
test0057()2192 public void test0057(){
2193 	String str =
2194 		"public class X {\n" +
2195 		"  @Annot(yyy=zzz,foo\n" +
2196 		"  int var;\n" +
2197 		"}";
2198 
2199 
2200 	String completeBehind = "foo";
2201 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2202 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2203 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2204 	String completionIdentifier = "foo";
2205 	String expectedReplacedSource = "foo";
2206 	String expectedUnitDisplayString =
2207 		"public class X {\n" +
2208 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2209 		"  int var;\n" +
2210 		"  public X() {\n" +
2211 		"  }\n" +
2212 		"}\n";
2213 
2214 	checkDietParse(
2215 			str.toCharArray(),
2216 			cursorLocation,
2217 			expectedCompletionNodeToString,
2218 			expectedParentNodeToString,
2219 			expectedUnitDisplayString,
2220 			completionIdentifier,
2221 			expectedReplacedSource,
2222 	"diet ast");
2223 }
test0058_Diet()2224 public void test0058_Diet(){
2225 	String str =
2226 		"public class X {\n" +
2227 		"  void bar() {\n" +
2228 		"    @Annot(yyy=zzz,foo\n" +
2229 		"    int var;\n" +
2230 		"  }\n" +
2231 		"}";
2232 
2233 
2234 	String completeBehind = "foo";
2235 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2236 	String expectedCompletionNodeToString = "<NONE>";
2237 	String expectedParentNodeToString = "<NONE>";
2238 	String completionIdentifier = "<NONE>";
2239 	String expectedReplacedSource = "<NONE>";
2240 	String expectedUnitDisplayString =
2241 		"public class X {\n" +
2242 		"  public X() {\n" +
2243 		"  }\n" +
2244 		"  void bar() {\n" +
2245 		"  }\n" +
2246 		"}\n";
2247 
2248 	checkDietParse(
2249 			str.toCharArray(),
2250 			cursorLocation,
2251 			expectedCompletionNodeToString,
2252 			expectedParentNodeToString,
2253 			expectedUnitDisplayString,
2254 			completionIdentifier,
2255 			expectedReplacedSource,
2256 	"diet ast");
2257 }
test0058_Method()2258 public void test0058_Method(){
2259 	String str =
2260 		"public class X {\n" +
2261 		"  void bar() {\n" +
2262 		"    @Annot(yyy=zzz,foo\n" +
2263 		"    int var;\n" +
2264 		"  }\n" +
2265 		"}";
2266 
2267 
2268 	String completeBehind = "foo";
2269 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2270 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2271 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2272 	String completionIdentifier = "foo";
2273 	String expectedReplacedSource = "foo";
2274 	String expectedUnitDisplayString =
2275 			"public class X {\n" +
2276 			"  public X() {\n" +
2277 			"  }\n" +
2278 			"  void bar() {\n" +
2279 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2280 			"  }\n" +
2281 			"}\n";
2282 
2283 	checkMethodParse(
2284 			str.toCharArray(),
2285 			cursorLocation,
2286 			expectedCompletionNodeToString,
2287 			expectedParentNodeToString,
2288 			expectedUnitDisplayString,
2289 			completionIdentifier,
2290 			expectedReplacedSource,
2291 			"full ast");
2292 }
test0059_Diet()2293 public void test0059_Diet(){
2294 	String str =
2295 		"public class X {\n" +
2296 		"  void bar(int var1, @Annot(yyy=zzz,foo int var2) {\n" +
2297 		"  }\n" +
2298 		"}";
2299 
2300 
2301 	String completeBehind = "foo";
2302 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2303 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2304 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2305 	String completionIdentifier = "foo";
2306 	String expectedReplacedSource = "foo";
2307 	String expectedUnitDisplayString =
2308 		"public class X {\n" +
2309 		"  public X() {\n" +
2310 		"  }\n" +
2311 		"  void bar(int var1) {\n" +
2312 		"  }\n" +
2313 		"}\n";
2314 
2315 	checkDietParse(
2316 			str.toCharArray(),
2317 			cursorLocation,
2318 			expectedCompletionNodeToString,
2319 			expectedParentNodeToString,
2320 			expectedUnitDisplayString,
2321 			completionIdentifier,
2322 			expectedReplacedSource,
2323 	"diet ast");
2324 }
test0059_Method()2325 public void test0059_Method(){
2326 	String str =
2327 		"public class X {\n" +
2328 		"  void bar(int var1, @Annot(yyy=zzz,foo int var2) {\n" +
2329 		"  }\n" +
2330 		"}";
2331 
2332 
2333 	String completeBehind = "foo";
2334 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2335 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2336 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2337 	String completionIdentifier = "foo";
2338 	String expectedReplacedSource = "foo";
2339 	String expectedUnitDisplayString =
2340 			"public class X {\n" +
2341 			"  public X() {\n" +
2342 			"  }\n" +
2343 			"  void bar(int var1) {\n" +
2344 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2345 			"  }\n" +
2346 			"}\n";
2347 
2348 	checkMethodParse(
2349 			str.toCharArray(),
2350 			cursorLocation,
2351 			expectedCompletionNodeToString,
2352 			expectedParentNodeToString,
2353 			expectedUnitDisplayString,
2354 			completionIdentifier,
2355 			expectedReplacedSource,
2356 			"full ast");
2357 }
test0060()2358 public void test0060(){
2359 	String str =
2360 		"public class X {\n" +
2361 		"  @Annot(yyy=zzz,foo\n" +
2362 		"  X() {\n" +
2363 		"  }\n" +
2364 		"}";
2365 
2366 
2367 	String completeBehind = "foo";
2368 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2369 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2370 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2371 	String completionIdentifier = "foo";
2372 	String expectedReplacedSource = "foo";
2373 	String expectedUnitDisplayString =
2374 		"public class X {\n" +
2375 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2376 		"  X() {\n" +
2377 		"  }\n" +
2378 		"}\n";
2379 
2380 	checkDietParse(
2381 			str.toCharArray(),
2382 			cursorLocation,
2383 			expectedCompletionNodeToString,
2384 			expectedParentNodeToString,
2385 			expectedUnitDisplayString,
2386 			completionIdentifier,
2387 			expectedReplacedSource,
2388 	"diet ast");
2389 }
test0061()2390 public void test0061(){
2391 	String str =
2392 		"@Annot(yyy=zzz,foo=zzz)\n" +
2393 		"public class X {\n" +
2394 		"}";
2395 
2396 
2397 	String completeBehind = "foo";
2398 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2399 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2400 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2401 	String completionIdentifier = "foo";
2402 	String expectedReplacedSource = "foo";
2403 	String expectedUnitDisplayString =
2404 		"@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2405 		"public class X {\n" +
2406 		"  public X() {\n" +
2407 		"  }\n" +
2408 		"}\n";
2409 
2410 	checkDietParse(
2411 			str.toCharArray(),
2412 			cursorLocation,
2413 			expectedCompletionNodeToString,
2414 			expectedParentNodeToString,
2415 			expectedUnitDisplayString,
2416 			completionIdentifier,
2417 			expectedReplacedSource,
2418 	"diet ast");
2419 }
test0062()2420 public void test0062(){
2421 	String str =
2422 		"public class X {\n" +
2423 		"  @Annot(yyy=zzz,foo=zzz)\n" +
2424 		"  void bar() {\n" +
2425 		"  }\n" +
2426 		"}";
2427 
2428 
2429 	String completeBehind = "foo";
2430 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2431 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2432 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2433 	String completionIdentifier = "foo";
2434 	String expectedReplacedSource = "foo";
2435 	String expectedUnitDisplayString =
2436 		"public class X {\n" +
2437 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2438 		"  public X() {\n" +
2439 		"  }\n" +
2440 		"  void bar() {\n" +
2441 		"  }\n" +
2442 		"}\n";
2443 
2444 	checkDietParse(
2445 			str.toCharArray(),
2446 			cursorLocation,
2447 			expectedCompletionNodeToString,
2448 			expectedParentNodeToString,
2449 			expectedUnitDisplayString,
2450 			completionIdentifier,
2451 			expectedReplacedSource,
2452 	"diet ast");
2453 }
test0063()2454 public void test0063(){
2455 	String str =
2456 		"public class X {\n" +
2457 		"  @Annot(yyy=zzz,foo=zzz)\n" +
2458 		"  int var;\n" +
2459 		"}";
2460 
2461 
2462 	String completeBehind = "foo";
2463 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2464 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2465 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2466 	String completionIdentifier = "foo";
2467 	String expectedReplacedSource = "foo";
2468 	String expectedUnitDisplayString =
2469 		"public class X {\n" +
2470 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2471 		"  int var;\n" +
2472 		"  public X() {\n" +
2473 		"  }\n" +
2474 		"}\n";
2475 
2476 	checkDietParse(
2477 			str.toCharArray(),
2478 			cursorLocation,
2479 			expectedCompletionNodeToString,
2480 			expectedParentNodeToString,
2481 			expectedUnitDisplayString,
2482 			completionIdentifier,
2483 			expectedReplacedSource,
2484 	"diet ast");
2485 }
test0064_Diet()2486 public void test0064_Diet(){
2487 	String str =
2488 		"public class X {\n" +
2489 		"  void bar() {\n" +
2490 		"    @Annot(yyy=zzz,foo=zzz)\n" +
2491 		"    int var;\n" +
2492 		"  }\n" +
2493 		"}";
2494 
2495 
2496 	String completeBehind = "foo";
2497 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2498 	String expectedCompletionNodeToString = "<NONE>";
2499 	String expectedParentNodeToString = "<NONE>";
2500 	String completionIdentifier = "<NONE>";
2501 	String expectedReplacedSource = "<NONE>";
2502 	String expectedUnitDisplayString =
2503 		"public class X {\n" +
2504 		"  public X() {\n" +
2505 		"  }\n" +
2506 		"  void bar() {\n" +
2507 		"  }\n" +
2508 		"}\n";
2509 
2510 	checkDietParse(
2511 			str.toCharArray(),
2512 			cursorLocation,
2513 			expectedCompletionNodeToString,
2514 			expectedParentNodeToString,
2515 			expectedUnitDisplayString,
2516 			completionIdentifier,
2517 			expectedReplacedSource,
2518 	"diet ast");
2519 }
test0064_Method()2520 public void test0064_Method(){
2521 	String str =
2522 		"public class X {\n" +
2523 		"  void bar() {\n" +
2524 		"    @Annot(yyy=zzz,foo=zzz)\n" +
2525 		"    int var;\n" +
2526 		"  }\n" +
2527 		"}";
2528 
2529 
2530 	String completeBehind = "foo";
2531 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2532 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2533 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2534 	String completionIdentifier = "foo";
2535 	String expectedReplacedSource = "foo";
2536 	String expectedUnitDisplayString =
2537 			"public class X {\n" +
2538 			"  public X() {\n" +
2539 			"  }\n" +
2540 			"  void bar() {\n" +
2541 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2542 			"  }\n" +
2543 			"}\n";
2544 
2545 	checkMethodParse(
2546 			str.toCharArray(),
2547 			cursorLocation,
2548 			expectedCompletionNodeToString,
2549 			expectedParentNodeToString,
2550 			expectedUnitDisplayString,
2551 			completionIdentifier,
2552 			expectedReplacedSource,
2553 			"full ast");
2554 }
test0065_Diet()2555 public void test0065_Diet(){
2556 	String str =
2557 		"public class X {\n" +
2558 		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz) int var2) {\n" +
2559 		"  }\n" +
2560 		"}";
2561 
2562 
2563 	String completeBehind = "foo";
2564 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2565 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2566 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2567 	String completionIdentifier = "foo";
2568 	String expectedReplacedSource = "foo";
2569 	String expectedUnitDisplayString =
2570 		"public class X {\n" +
2571 		"  public X() {\n" +
2572 		"  }\n" +
2573 		"  void bar(int var1) {\n" +
2574 		"  }\n" +
2575 		"}\n";
2576 
2577 	checkDietParse(
2578 			str.toCharArray(),
2579 			cursorLocation,
2580 			expectedCompletionNodeToString,
2581 			expectedParentNodeToString,
2582 			expectedUnitDisplayString,
2583 			completionIdentifier,
2584 			expectedReplacedSource,
2585 	"diet ast");
2586 }
test0065_Method()2587 public void test0065_Method(){
2588 	String str =
2589 		"public class X {\n" +
2590 		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz) int var2) {\n" +
2591 		"  }\n" +
2592 		"}";
2593 
2594 
2595 	String completeBehind = "foo";
2596 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2597 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2598 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2599 	String completionIdentifier = "foo";
2600 	String expectedReplacedSource = "foo";
2601 	String expectedUnitDisplayString =
2602 			"public class X {\n" +
2603 			"  public X() {\n" +
2604 			"  }\n" +
2605 			"  void bar(int var1) {\n" +
2606 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2607 			"  }\n" +
2608 			"}\n";
2609 
2610 	checkMethodParse(
2611 			str.toCharArray(),
2612 			cursorLocation,
2613 			expectedCompletionNodeToString,
2614 			expectedParentNodeToString,
2615 			expectedUnitDisplayString,
2616 			completionIdentifier,
2617 			expectedReplacedSource,
2618 			"full ast");
2619 }
test0066()2620 public void test0066(){
2621 	String str =
2622 		"public class X {\n" +
2623 		"  @Annot(yyy=zzz,foo=zzz)\n" +
2624 		"  X() {\n" +
2625 		"  }\n" +
2626 		"}";
2627 
2628 
2629 	String completeBehind = "foo";
2630 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2631 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2632 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2633 	String completionIdentifier = "foo";
2634 	String expectedReplacedSource = "foo";
2635 	String expectedUnitDisplayString =
2636 		"public class X {\n" +
2637 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2638 		"  X() {\n" +
2639 		"  }\n" +
2640 		"}\n";
2641 
2642 	checkDietParse(
2643 			str.toCharArray(),
2644 			cursorLocation,
2645 			expectedCompletionNodeToString,
2646 			expectedParentNodeToString,
2647 			expectedUnitDisplayString,
2648 			completionIdentifier,
2649 			expectedReplacedSource,
2650 	"diet ast");
2651 }
test0067()2652 public void test0067(){
2653 	String str =
2654 		"@Annot(yyy=zzz,foo=zzz\n" +
2655 		"public class X {\n" +
2656 		"}";
2657 
2658 
2659 	String completeBehind = "foo";
2660 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2661 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2662 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2663 	String completionIdentifier = "foo";
2664 	String expectedReplacedSource = "foo";
2665 	String expectedUnitDisplayString =
2666 		"@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2667 		"public class X {\n" +
2668 		"  public X() {\n" +
2669 		"  }\n" +
2670 		"}\n";
2671 
2672 	checkDietParse(
2673 			str.toCharArray(),
2674 			cursorLocation,
2675 			expectedCompletionNodeToString,
2676 			expectedParentNodeToString,
2677 			expectedUnitDisplayString,
2678 			completionIdentifier,
2679 			expectedReplacedSource,
2680 	"diet ast");
2681 }
test0068()2682 public void test0068(){
2683 	String str =
2684 		"public class X {\n" +
2685 		"  @Annot(yyy=zzz,foo=zzz\n" +
2686 		"  void bar() {\n" +
2687 		"  }\n" +
2688 		"}";
2689 
2690 
2691 	String completeBehind = "foo";
2692 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2693 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2694 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2695 	String completionIdentifier = "foo";
2696 	String expectedReplacedSource = "foo";
2697 	String expectedUnitDisplayString =
2698 		"public class X {\n" +
2699 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2700 		"  public X() {\n" +
2701 		"  }\n" +
2702 		"  void bar() {\n" +
2703 		"  }\n" +
2704 		"}\n";
2705 
2706 	checkDietParse(
2707 			str.toCharArray(),
2708 			cursorLocation,
2709 			expectedCompletionNodeToString,
2710 			expectedParentNodeToString,
2711 			expectedUnitDisplayString,
2712 			completionIdentifier,
2713 			expectedReplacedSource,
2714 	"diet ast");
2715 }
test0069()2716 public void test0069(){
2717 	String str =
2718 		"public class X {\n" +
2719 		"  @Annot(yyy=zzz,foo=zzz\n" +
2720 		"  int var;\n" +
2721 		"}";
2722 
2723 
2724 	String completeBehind = "foo";
2725 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2726 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2727 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2728 	String completionIdentifier = "foo";
2729 	String expectedReplacedSource = "foo";
2730 	String expectedUnitDisplayString =
2731 		"public class X {\n" +
2732 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2733 		"  int var;\n" +
2734 		"  public X() {\n" +
2735 		"  }\n" +
2736 		"}\n";
2737 
2738 	checkDietParse(
2739 			str.toCharArray(),
2740 			cursorLocation,
2741 			expectedCompletionNodeToString,
2742 			expectedParentNodeToString,
2743 			expectedUnitDisplayString,
2744 			completionIdentifier,
2745 			expectedReplacedSource,
2746 	"diet ast");
2747 }
test0070_Diet()2748 public void test0070_Diet(){
2749 	String str =
2750 		"public class X {\n" +
2751 		"  void bar() {\n" +
2752 		"    @Annot(yyy=zzz,foo=zzz\n" +
2753 		"    int var;\n" +
2754 		"  }\n" +
2755 		"}";
2756 
2757 
2758 	String completeBehind = "foo";
2759 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2760 	String expectedCompletionNodeToString = "<NONE>";
2761 	String expectedParentNodeToString = "<NONE>";
2762 	String completionIdentifier = "<NONE>";
2763 	String expectedReplacedSource = "<NONE>";
2764 	String expectedUnitDisplayString =
2765 		"public class X {\n" +
2766 		"  public X() {\n" +
2767 		"  }\n" +
2768 		"  void bar() {\n" +
2769 		"  }\n" +
2770 		"}\n";
2771 
2772 	checkDietParse(
2773 			str.toCharArray(),
2774 			cursorLocation,
2775 			expectedCompletionNodeToString,
2776 			expectedParentNodeToString,
2777 			expectedUnitDisplayString,
2778 			completionIdentifier,
2779 			expectedReplacedSource,
2780 	"diet ast");
2781 }
test0070_Method()2782 public void test0070_Method(){
2783 	String str =
2784 		"public class X {\n" +
2785 		"  void bar() {\n" +
2786 		"    @Annot(yyy=zzz,foo=zzz\n" +
2787 		"    int var;\n" +
2788 		"  }\n" +
2789 		"}";
2790 
2791 
2792 	String completeBehind = "foo";
2793 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2794 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2795 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2796 	String completionIdentifier = "foo";
2797 	String expectedReplacedSource = "foo";
2798 	String expectedUnitDisplayString =
2799 			"public class X {\n" +
2800 			"  public X() {\n" +
2801 			"  }\n" +
2802 			"  void bar() {\n" +
2803 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2804 			"  }\n" +
2805 			"}\n";
2806 
2807 	checkMethodParse(
2808 			str.toCharArray(),
2809 			cursorLocation,
2810 			expectedCompletionNodeToString,
2811 			expectedParentNodeToString,
2812 			expectedUnitDisplayString,
2813 			completionIdentifier,
2814 			expectedReplacedSource,
2815 			"full ast");
2816 }
test0071_Diet()2817 public void test0071_Diet(){
2818 	String str =
2819 		"public class X {\n" +
2820 		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz int var2) {\n" +
2821 		"  }\n" +
2822 		"}";
2823 
2824 
2825 	String completeBehind = "foo";
2826 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2827 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2828 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2829 	String completionIdentifier = "foo";
2830 	String expectedReplacedSource = "foo";
2831 	String expectedUnitDisplayString =
2832 		"public class X {\n" +
2833 		"  public X() {\n" +
2834 		"  }\n" +
2835 		"  void bar(int var1) {\n" +
2836 		"  }\n" +
2837 		"}\n";
2838 
2839 	checkDietParse(
2840 			str.toCharArray(),
2841 			cursorLocation,
2842 			expectedCompletionNodeToString,
2843 			expectedParentNodeToString,
2844 			expectedUnitDisplayString,
2845 			completionIdentifier,
2846 			expectedReplacedSource,
2847 	"diet ast");
2848 }
test0071_Method()2849 public void test0071_Method(){
2850 	String str =
2851 		"public class X {\n" +
2852 		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz int var2) {\n" +
2853 		"  }\n" +
2854 		"}";
2855 
2856 
2857 	String completeBehind = "foo";
2858 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2859 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2860 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2861 	String completionIdentifier = "foo";
2862 	String expectedReplacedSource = "foo";
2863 	String expectedUnitDisplayString =
2864 			"public class X {\n" +
2865 			"  public X() {\n" +
2866 			"  }\n" +
2867 			"  void bar(int var1) {\n" +
2868 			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2869 			"  }\n" +
2870 			"}\n";
2871 
2872 	checkMethodParse(
2873 			str.toCharArray(),
2874 			cursorLocation,
2875 			expectedCompletionNodeToString,
2876 			expectedParentNodeToString,
2877 			expectedUnitDisplayString,
2878 			completionIdentifier,
2879 			expectedReplacedSource,
2880 			"full ast");
2881 }
test0072()2882 public void test0072(){
2883 	String str =
2884 		"public class X {\n" +
2885 		"  @Annot(yyy=zzz,foo=zzz\n" +
2886 		"  X() {\n" +
2887 		"  }\n" +
2888 		"}";
2889 
2890 
2891 	String completeBehind = "foo";
2892 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2893 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2894 	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2895 	String completionIdentifier = "foo";
2896 	String expectedReplacedSource = "foo";
2897 	String expectedUnitDisplayString =
2898 		"public class X {\n" +
2899 		"  @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" +
2900 		"  public X() {\n" +
2901 		"  }\n" +
2902 		"  zzz X() {\n" +
2903 		"  }\n" +
2904 		"}\n";
2905 
2906 	checkDietParse(
2907 			str.toCharArray(),
2908 			cursorLocation,
2909 			expectedCompletionNodeToString,
2910 			expectedParentNodeToString,
2911 			expectedUnitDisplayString,
2912 			completionIdentifier,
2913 			expectedReplacedSource,
2914 	"diet ast");
2915 }
test0073()2916 public void test0073(){
2917 	String str =
2918 		"@Annot(zzz=yyy,f)\n" +
2919 		"public class X {\n" +
2920 		"}";
2921 
2922 
2923 	String completeBehind = "f";
2924 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2925 	String expectedCompletionNodeToString = "<CompleteOnAttributeName:f>";
2926 	String expectedParentNodeToString = "@Annot(zzz = yyy,<CompleteOnAttributeName:f>)";
2927 	String completionIdentifier = "f";
2928 	String expectedReplacedSource = "f";
2929 	String expectedUnitDisplayString =
2930 		"@Annot(zzz = yyy,<CompleteOnAttributeName:f>)\n" +
2931 		"public class X {\n" +
2932 		"  public X() {\n" +
2933 		"  }\n" +
2934 		"}\n";
2935 
2936 	checkDietParse(
2937 			str.toCharArray(),
2938 			cursorLocation,
2939 			expectedCompletionNodeToString,
2940 			expectedParentNodeToString,
2941 			expectedUnitDisplayString,
2942 			completionIdentifier,
2943 			expectedReplacedSource,
2944 	"diet ast");
2945 }
test0074()2946 public void test0074(){
2947 	String str =
2948 		"@Annot(zzz=foo)\n" +
2949 		"public class X {\n" +
2950 		"}";
2951 
2952 
2953 	String completeBehind = "foo";
2954 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2955 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
2956 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
2957 	String completionIdentifier = "foo";
2958 	String expectedReplacedSource = "foo";
2959 	String expectedUnitDisplayString =
2960 		"public @Annot(zzz = <CompleteOnName:foo>) class X {\n" +
2961 		"  public X() {\n" +
2962 		"  }\n" +
2963 		"}\n";
2964 
2965 	checkDietParse(
2966 			str.toCharArray(),
2967 			cursorLocation,
2968 			expectedCompletionNodeToString,
2969 			expectedParentNodeToString,
2970 			expectedUnitDisplayString,
2971 			completionIdentifier,
2972 			expectedReplacedSource,
2973 	"diet ast");
2974 }
test0075()2975 public void test0075(){
2976 	String str =
2977 		"@Annot(zzz= a && foo)\n" +
2978 		"public class X {\n" +
2979 		"}";
2980 
2981 
2982 	String completeBehind = "foo";
2983 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2984 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
2985 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
2986 	String completionIdentifier = "foo";
2987 	String expectedReplacedSource = "foo";
2988 	String expectedUnitDisplayString =
2989 		"public @Annot(zzz = (a && <CompleteOnName:foo>)) class X {\n" +
2990 		"  public X() {\n" +
2991 		"  }\n" +
2992 		"}\n";
2993 
2994 	checkDietParse(
2995 			str.toCharArray(),
2996 			cursorLocation,
2997 			expectedCompletionNodeToString,
2998 			expectedParentNodeToString,
2999 			expectedUnitDisplayString,
3000 			completionIdentifier,
3001 			expectedReplacedSource,
3002 	"diet ast");
3003 }
test0076()3004 public void test0076(){
3005 	String str =
3006 		"@Annot(zzz= {foo})\n" +
3007 		"public class X {\n" +
3008 		"}";
3009 
3010 
3011 	String completeBehind = "foo";
3012 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3013 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3014 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3015 	String completionIdentifier = "foo";
3016 	String expectedReplacedSource = "foo";
3017 	String expectedUnitDisplayString =
3018 		"@Annot(zzz = {<CompleteOnName:foo>})\n" +
3019 		"public class X {\n" +
3020 		"  public X() {\n" +
3021 		"  }\n" +
3022 		"}\n";
3023 
3024 	checkDietParse(
3025 			str.toCharArray(),
3026 			cursorLocation,
3027 			expectedCompletionNodeToString,
3028 			expectedParentNodeToString,
3029 			expectedUnitDisplayString,
3030 			completionIdentifier,
3031 			expectedReplacedSource,
3032 	"diet ast");
3033 }
test0078()3034 public void test0078(){
3035 	String str =
3036 		"@Annot(zzz= {yyy, foo})\n" +
3037 		"public class X {\n" +
3038 		"}";
3039 
3040 
3041 	String completeBehind = "foo";
3042 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3043 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3044 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3045 	String completionIdentifier = "foo";
3046 	String expectedReplacedSource = "foo";
3047 	String expectedUnitDisplayString =
3048 		"@Annot(zzz = {<CompleteOnName:foo>})\n" +
3049 		"public class X {\n" +
3050 		"  public X() {\n" +
3051 		"  }\n" +
3052 		"}\n";
3053 
3054 	checkDietParse(
3055 			str.toCharArray(),
3056 			cursorLocation,
3057 			expectedCompletionNodeToString,
3058 			expectedParentNodeToString,
3059 			expectedUnitDisplayString,
3060 			completionIdentifier,
3061 			expectedReplacedSource,
3062 	"diet ast");
3063 }
test0079()3064 public void test0079(){
3065 	String str =
3066 		"@Annot(zzz=foo\n" +
3067 		"public class X {\n" +
3068 		"}";
3069 
3070 
3071 	String completeBehind = "foo";
3072 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3073 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3074 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3075 	String completionIdentifier = "foo";
3076 	String expectedReplacedSource = "foo";
3077 	String expectedUnitDisplayString =
3078 		"@Annot(zzz = <CompleteOnName:foo>)\n" +
3079 		"public class X {\n" +
3080 		"  public X() {\n" +
3081 		"  }\n" +
3082 		"}\n";
3083 
3084 	checkDietParse(
3085 			str.toCharArray(),
3086 			cursorLocation,
3087 			expectedCompletionNodeToString,
3088 			expectedParentNodeToString,
3089 			expectedUnitDisplayString,
3090 			completionIdentifier,
3091 			expectedReplacedSource,
3092 	"diet ast");
3093 }
test0080()3094 public void test0080(){
3095 	String str =
3096 		"@Annot(zzz= a && foo\n" +
3097 		"public class X {\n" +
3098 		"}";
3099 
3100 
3101 	String completeBehind = "foo";
3102 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3103 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3104 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3105 	String completionIdentifier = "foo";
3106 	String expectedReplacedSource = "foo";
3107 	String expectedUnitDisplayString =
3108 		"@Annot(zzz = (a && <CompleteOnName:foo>))\n" +
3109 		"public class X {\n" +
3110 		"  public X() {\n" +
3111 		"  }\n" +
3112 		"}\n";
3113 
3114 	checkDietParse(
3115 			str.toCharArray(),
3116 			cursorLocation,
3117 			expectedCompletionNodeToString,
3118 			expectedParentNodeToString,
3119 			expectedUnitDisplayString,
3120 			completionIdentifier,
3121 			expectedReplacedSource,
3122 	"diet ast");
3123 }
test0081()3124 public void test0081(){
3125 	String str =
3126 		"@Annot(zzz= {yyy, foo}\n" +
3127 		"public class X {\n" +
3128 		"}";
3129 
3130 
3131 	String completeBehind = "foo";
3132 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3133 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3134 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3135 	String completionIdentifier = "foo";
3136 	String expectedReplacedSource = "foo";
3137 	String expectedUnitDisplayString =
3138 		"@Annot(zzz = {<CompleteOnName:foo>})\n" +
3139 		"public class X {\n" +
3140 		"  public X() {\n" +
3141 		"  }\n" +
3142 		"}\n";
3143 
3144 	checkDietParse(
3145 			str.toCharArray(),
3146 			cursorLocation,
3147 			expectedCompletionNodeToString,
3148 			expectedParentNodeToString,
3149 			expectedUnitDisplayString,
3150 			completionIdentifier,
3151 			expectedReplacedSource,
3152 	"diet ast");
3153 }
test0082()3154 public void test0082(){
3155 	String str =
3156 		"@Annot(zzz= {yyy, foo\n" +
3157 		"public class X {\n" +
3158 		"}";
3159 
3160 
3161 	String completeBehind = "foo";
3162 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3163 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3164 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3165 	String completionIdentifier = "foo";
3166 	String expectedReplacedSource = "foo";
3167 	String expectedUnitDisplayString =
3168 		"@Annot(zzz = {<CompleteOnName:foo>})\n" +
3169 		"public class X {\n" +
3170 		"  public X() {\n" +
3171 		"  }\n" +
3172 		"}\n";
3173 
3174 	checkDietParse(
3175 			str.toCharArray(),
3176 			cursorLocation,
3177 			expectedCompletionNodeToString,
3178 			expectedParentNodeToString,
3179 			expectedUnitDisplayString,
3180 			completionIdentifier,
3181 			expectedReplacedSource,
3182 	"diet ast");
3183 }
test0083()3184 public void test0083(){
3185 	String str =
3186 		"@Annot(zzz= a && (b || (foo && c)))\n" +
3187 		"public class X {\n" +
3188 		"}";
3189 
3190 
3191 	String completeBehind = "foo";
3192 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3193 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3194 	String expectedParentNodeToString = "<NONE>";
3195 	String completionIdentifier = "foo";
3196 	String expectedReplacedSource = "foo";
3197 	String expectedUnitDisplayString =
3198 		"public @Annot(zzz = (a && (b || (<CompleteOnName:foo> && c)))) class X {\n" +
3199 		"  public X() {\n" +
3200 		"  }\n" +
3201 		"}\n";
3202 
3203 	checkDietParse(
3204 			str.toCharArray(),
3205 			cursorLocation,
3206 			expectedCompletionNodeToString,
3207 			expectedParentNodeToString,
3208 			expectedUnitDisplayString,
3209 			completionIdentifier,
3210 			expectedReplacedSource,
3211 	"diet ast");
3212 }
test0084()3213 public void test0084(){
3214 	String str =
3215 		"@Annot(zzz= a && (b || (foo\n" +
3216 		"public class X {\n" +
3217 		"}";
3218 
3219 
3220 	String completeBehind = "foo";
3221 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3222 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3223 	String expectedParentNodeToString = "@Annot(zzz = <CompleteOnName:foo>)";
3224 	String completionIdentifier = "foo";
3225 	String expectedReplacedSource = "foo";
3226 	String expectedUnitDisplayString =
3227 		"@Annot(zzz = <CompleteOnName:foo>)\n" +
3228 		"public class X {\n" +
3229 		"  public X() {\n" +
3230 		"  }\n" +
3231 		"}\n";
3232 
3233 	checkDietParse(
3234 			str.toCharArray(),
3235 			cursorLocation,
3236 			expectedCompletionNodeToString,
3237 			expectedParentNodeToString,
3238 			expectedUnitDisplayString,
3239 			completionIdentifier,
3240 			expectedReplacedSource,
3241 	"diet ast");
3242 }
test0085()3243 public void test0085(){
3244 	String str =
3245 		"public class X {\n" +
3246 		"  @Annot(zzz=foo)\n" +
3247 		"  void bar() {\n" +
3248 		"  }\n" +
3249 		"}";
3250 
3251 
3252 	String completeBehind = "foo";
3253 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3254 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3255 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3256 	String completionIdentifier = "foo";
3257 	String expectedReplacedSource = "foo";
3258 	String expectedUnitDisplayString =
3259 		"public class X {\n" +
3260 		"  public X() {\n" +
3261 		"  }\n" +
3262 		"  @Annot(zzz = <CompleteOnName:foo>) void bar() {\n" +
3263 		"  }\n" +
3264 		"}\n";
3265 
3266 	checkDietParse(
3267 			str.toCharArray(),
3268 			cursorLocation,
3269 			expectedCompletionNodeToString,
3270 			expectedParentNodeToString,
3271 			expectedUnitDisplayString,
3272 			completionIdentifier,
3273 			expectedReplacedSource,
3274 	"diet ast");
3275 }
test0086()3276 public void test0086(){
3277 	String str =
3278 		"public class X {\n" +
3279 		"  @Annot(zzz= a && foo)\n" +
3280 		"  void bar() {\n" +
3281 		"  }\n" +
3282 		"}";
3283 
3284 
3285 	String completeBehind = "foo";
3286 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3287 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3288 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3289 	String completionIdentifier = "foo";
3290 	String expectedReplacedSource = "foo";
3291 	String expectedUnitDisplayString =
3292 		"public class X {\n" +
3293 		"  public X() {\n" +
3294 		"  }\n" +
3295 		"  @Annot(zzz = (a && <CompleteOnName:foo>)) void bar() {\n" +
3296 		"  }\n" +
3297 		"}\n";
3298 
3299 	checkDietParse(
3300 			str.toCharArray(),
3301 			cursorLocation,
3302 			expectedCompletionNodeToString,
3303 			expectedParentNodeToString,
3304 			expectedUnitDisplayString,
3305 			completionIdentifier,
3306 			expectedReplacedSource,
3307 	"diet ast");
3308 }
test0087()3309 public void test0087(){
3310 	String str =
3311 		"public class X {\n" +
3312 		"  @Annot(zzz= {foo})\n" +
3313 		"  void bar() {\n" +
3314 		"  }\n" +
3315 		"}";
3316 
3317 
3318 	String completeBehind = "foo";
3319 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3320 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3321 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3322 	String completionIdentifier = "foo";
3323 	String expectedReplacedSource = "foo";
3324 	String expectedUnitDisplayString =
3325 		"public class X {\n" +
3326 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3327 		"  public X() {\n" +
3328 		"  }\n" +
3329 		"  void bar() {\n" +
3330 		"  }\n" +
3331 		"}\n";
3332 
3333 	checkDietParse(
3334 			str.toCharArray(),
3335 			cursorLocation,
3336 			expectedCompletionNodeToString,
3337 			expectedParentNodeToString,
3338 			expectedUnitDisplayString,
3339 			completionIdentifier,
3340 			expectedReplacedSource,
3341 	"diet ast");
3342 }
test0088()3343 public void test0088(){
3344 	String str =
3345 		"public class X {\n" +
3346 		"  @Annot(zzz= {yyy, foo})\n" +
3347 		"  void bar() {\n" +
3348 		"  }\n" +
3349 		"}";
3350 
3351 
3352 	String completeBehind = "foo";
3353 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3354 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3355 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3356 	String completionIdentifier = "foo";
3357 	String expectedReplacedSource = "foo";
3358 	String expectedUnitDisplayString =
3359 		"public class X {\n" +
3360 		"  @Annot(zzz = {<CompleteOnName:foo>})\n"+
3361 		"  public X() {\n" +
3362 		"  }\n" +
3363 		"  void bar() {\n" +
3364 		"  }\n" +
3365 		"}\n";
3366 
3367 	checkDietParse(
3368 			str.toCharArray(),
3369 			cursorLocation,
3370 			expectedCompletionNodeToString,
3371 			expectedParentNodeToString,
3372 			expectedUnitDisplayString,
3373 			completionIdentifier,
3374 			expectedReplacedSource,
3375 	"diet ast");
3376 }
test0089()3377 public void test0089(){
3378 	String str =
3379 		"public class X {\n" +
3380 		"  @Annot(zzz=foo\n" +
3381 		"  void bar() {\n" +
3382 		"  }\n" +
3383 		"}";
3384 
3385 
3386 	String completeBehind = "foo";
3387 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3388 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3389 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3390 	String completionIdentifier = "foo";
3391 	String expectedReplacedSource = "foo";
3392 	String expectedUnitDisplayString =
3393 		"public class X {\n" +
3394 		"  @Annot(zzz = <CompleteOnName:foo>)\n" +
3395 		"  public X() {\n" +
3396 		"  }\n" +
3397 		"  void bar() {\n" +
3398 		"  }\n" +
3399 		"}\n";
3400 
3401 	checkDietParse(
3402 			str.toCharArray(),
3403 			cursorLocation,
3404 			expectedCompletionNodeToString,
3405 			expectedParentNodeToString,
3406 			expectedUnitDisplayString,
3407 			completionIdentifier,
3408 			expectedReplacedSource,
3409 	"diet ast");
3410 }
test0090()3411 public void test0090(){
3412 	String str =
3413 		"public class X {\n" +
3414 		"  @Annot(zzz= a && foo\n" +
3415 		"  void bar() {\n" +
3416 		"  }\n" +
3417 		"}";
3418 
3419 
3420 	String completeBehind = "foo";
3421 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3422 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3423 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3424 	String completionIdentifier = "foo";
3425 	String expectedReplacedSource = "foo";
3426 	String expectedUnitDisplayString =
3427 		"public class X {\n" +
3428 		"  @Annot(zzz = (a && <CompleteOnName:foo>))\n" +
3429 		"  public X() {\n" +
3430 		"  }\n" +
3431 		"  void bar() {\n" +
3432 		"  }\n" +
3433 		"}\n";
3434 
3435 	checkDietParse(
3436 			str.toCharArray(),
3437 			cursorLocation,
3438 			expectedCompletionNodeToString,
3439 			expectedParentNodeToString,
3440 			expectedUnitDisplayString,
3441 			completionIdentifier,
3442 			expectedReplacedSource,
3443 	"diet ast");
3444 }
test0091()3445 public void test0091(){
3446 	String str =
3447 		"public class X {\n" +
3448 		"  @Annot(zzz= {yyy, foo}\n" +
3449 		"  void bar() {\n" +
3450 		"  }\n" +
3451 		"}";
3452 
3453 
3454 	String completeBehind = "foo";
3455 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3456 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3457 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3458 	String completionIdentifier = "foo";
3459 	String expectedReplacedSource = "foo";
3460 	String expectedUnitDisplayString =
3461 		"public class X {\n" +
3462 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3463 		"  public X() {\n" +
3464 		"  }\n" +
3465 		"  void bar() {\n" +
3466 		"  }\n" +
3467 		"}\n";
3468 
3469 	checkDietParse(
3470 			str.toCharArray(),
3471 			cursorLocation,
3472 			expectedCompletionNodeToString,
3473 			expectedParentNodeToString,
3474 			expectedUnitDisplayString,
3475 			completionIdentifier,
3476 			expectedReplacedSource,
3477 	"diet ast");
3478 }
test0092()3479 public void test0092(){
3480 	String str =
3481 		"public class X {\n" +
3482 		"  @Annot(zzz= {yyy, foo\n" +
3483 		"  void bar() {\n" +
3484 		"  }\n" +
3485 		"}";
3486 
3487 
3488 	String completeBehind = "foo";
3489 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3490 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3491 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3492 	String completionIdentifier = "foo";
3493 	String expectedReplacedSource = "foo";
3494 	String expectedUnitDisplayString =
3495 		"public class X {\n" +
3496 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3497 		"  public X() {\n" +
3498 		"  }\n" +
3499 		"  void bar() {\n" +
3500 		"  }\n" +
3501 		"}\n";
3502 
3503 	checkDietParse(
3504 			str.toCharArray(),
3505 			cursorLocation,
3506 			expectedCompletionNodeToString,
3507 			expectedParentNodeToString,
3508 			expectedUnitDisplayString,
3509 			completionIdentifier,
3510 			expectedReplacedSource,
3511 	"diet ast");
3512 }
test0093()3513 public void test0093(){
3514 	String str =
3515 		"public class X {\n" +
3516 		"  @Annot(zzz= a && (b || (foo && c)))\n" +
3517 		"  void bar() {\n" +
3518 		"  }\n" +
3519 		"}";
3520 
3521 
3522 	String completeBehind = "foo";
3523 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3524 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3525 	String expectedParentNodeToString = "<NONE>";
3526 	String completionIdentifier = "foo";
3527 	String expectedReplacedSource = "foo";
3528 	String expectedUnitDisplayString =
3529 		"public class X {\n" +
3530 		"  public X() {\n" +
3531 		"  }\n" +
3532 		"  @Annot(zzz = (a && (b || (<CompleteOnName:foo> && c)))) void bar() {\n" +
3533 		"  }\n" +
3534 		"}\n";
3535 
3536 	checkDietParse(
3537 			str.toCharArray(),
3538 			cursorLocation,
3539 			expectedCompletionNodeToString,
3540 			expectedParentNodeToString,
3541 			expectedUnitDisplayString,
3542 			completionIdentifier,
3543 			expectedReplacedSource,
3544 	"diet ast");
3545 }
test0094()3546 public void test0094(){
3547 	String str =
3548 		"public class X {\n" +
3549 		"  @Annot(zzz= a && (b || (foo\n" +
3550 		"  void bar() {\n" +
3551 		"  }\n" +
3552 		"}";
3553 
3554 
3555 	String completeBehind = "foo";
3556 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3557 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3558 	String expectedParentNodeToString = "@Annot(zzz = <CompleteOnName:foo>)";
3559 	String completionIdentifier = "foo";
3560 	String expectedReplacedSource = "foo";
3561 	String expectedUnitDisplayString =
3562 		"public class X {\n" +
3563 		"  @Annot(zzz = <CompleteOnName:foo>)\n" +
3564 		"  public X() {\n" +
3565 		"  }\n" +
3566 		"  void bar() {\n" +
3567 		"  }\n" +
3568 		"}\n";
3569 
3570 	checkDietParse(
3571 			str.toCharArray(),
3572 			cursorLocation,
3573 			expectedCompletionNodeToString,
3574 			expectedParentNodeToString,
3575 			expectedUnitDisplayString,
3576 			completionIdentifier,
3577 			expectedReplacedSource,
3578 	"diet ast");
3579 }
test0095()3580 public void test0095(){
3581 	String str =
3582 		"public class X {\n" +
3583 		"  @Annot(zzz=foo)\n" +
3584 		"  int bar;\n" +
3585 		"}";
3586 
3587 
3588 	String completeBehind = "foo";
3589 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3590 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3591 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3592 	String completionIdentifier = "foo";
3593 	String expectedReplacedSource = "foo";
3594 	String expectedUnitDisplayString =
3595 		"public class X {\n" +
3596 		"  @Annot(zzz = <CompleteOnName:foo>) int bar;\n" +
3597 		"  public X() {\n" +
3598 		"  }\n" +
3599 		"}\n";
3600 
3601 	checkDietParse(
3602 			str.toCharArray(),
3603 			cursorLocation,
3604 			expectedCompletionNodeToString,
3605 			expectedParentNodeToString,
3606 			expectedUnitDisplayString,
3607 			completionIdentifier,
3608 			expectedReplacedSource,
3609 	"diet ast");
3610 }
test0096()3611 public void test0096(){
3612 	String str =
3613 		"public class X {\n" +
3614 		"  @Annot(zzz= a && foo)\n" +
3615 		"  int bar;\n" +
3616 		"}";
3617 
3618 
3619 	String completeBehind = "foo";
3620 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3621 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3622 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3623 	String completionIdentifier = "foo";
3624 	String expectedReplacedSource = "foo";
3625 	String expectedUnitDisplayString =
3626 		"public class X {\n" +
3627 		"  @Annot(zzz = (a && <CompleteOnName:foo>)) int bar;\n" +
3628 		"  public X() {\n" +
3629 		"  }\n" +
3630 		"}\n";
3631 
3632 	checkDietParse(
3633 			str.toCharArray(),
3634 			cursorLocation,
3635 			expectedCompletionNodeToString,
3636 			expectedParentNodeToString,
3637 			expectedUnitDisplayString,
3638 			completionIdentifier,
3639 			expectedReplacedSource,
3640 	"diet ast");
3641 }
test0097()3642 public void test0097(){
3643 	String str =
3644 		"public class X {\n" +
3645 		"  @Annot(zzz= {foo})\n" +
3646 		"  int bar;\n" +
3647 		"}";
3648 
3649 
3650 	String completeBehind = "foo";
3651 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3652 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3653 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3654 	String completionIdentifier = "foo";
3655 	String expectedReplacedSource = "foo";
3656 	String expectedUnitDisplayString =
3657 		"public class X {\n" +
3658 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3659 		"  int bar;\n" +
3660 		"  public X() {\n" +
3661 		"  }\n" +
3662 		"}\n";
3663 
3664 	checkDietParse(
3665 			str.toCharArray(),
3666 			cursorLocation,
3667 			expectedCompletionNodeToString,
3668 			expectedParentNodeToString,
3669 			expectedUnitDisplayString,
3670 			completionIdentifier,
3671 			expectedReplacedSource,
3672 	"diet ast");
3673 }
test0098()3674 public void test0098(){
3675 	String str =
3676 		"public class X {\n" +
3677 		"  @Annot(zzz= {yyy, foo})\n" +
3678 		"  int bar;\n" +
3679 		"}";
3680 
3681 
3682 	String completeBehind = "foo";
3683 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3684 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3685 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3686 	String completionIdentifier = "foo";
3687 	String expectedReplacedSource = "foo";
3688 	String expectedUnitDisplayString =
3689 		"public class X {\n" +
3690 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3691 		"  int bar;\n" +
3692 		"  public X() {\n" +
3693 		"  }\n" +
3694 		"}\n";
3695 
3696 	checkDietParse(
3697 			str.toCharArray(),
3698 			cursorLocation,
3699 			expectedCompletionNodeToString,
3700 			expectedParentNodeToString,
3701 			expectedUnitDisplayString,
3702 			completionIdentifier,
3703 			expectedReplacedSource,
3704 	"diet ast");
3705 }
test0099()3706 public void test0099(){
3707 	String str =
3708 		"public class X {\n" +
3709 		"  @Annot(zzz=foo\n" +
3710 		"  int bar;\n" +
3711 		"}";
3712 
3713 
3714 	String completeBehind = "foo";
3715 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3716 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3717 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3718 	String completionIdentifier = "foo";
3719 	String expectedReplacedSource = "foo";
3720 	String expectedUnitDisplayString =
3721 		"public class X {\n" +
3722 		"  @Annot(zzz = <CompleteOnName:foo>)\n" +
3723 		"  int bar;\n" +
3724 		"  public X() {\n" +
3725 		"  }\n" +
3726 		"}\n";
3727 
3728 	checkDietParse(
3729 			str.toCharArray(),
3730 			cursorLocation,
3731 			expectedCompletionNodeToString,
3732 			expectedParentNodeToString,
3733 			expectedUnitDisplayString,
3734 			completionIdentifier,
3735 			expectedReplacedSource,
3736 	"diet ast");
3737 }
test0100()3738 public void test0100(){
3739 	String str =
3740 		"public class X {\n" +
3741 		"  @Annot(zzz= a && foo\n" +
3742 		"  int bar;\n" +
3743 		"}";
3744 
3745 
3746 	String completeBehind = "foo";
3747 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3748 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3749 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3750 	String completionIdentifier = "foo";
3751 	String expectedReplacedSource = "foo";
3752 	String expectedUnitDisplayString =
3753 		"public class X {\n" +
3754 		"  @Annot(zzz = (a && <CompleteOnName:foo>))\n" +
3755 		"  int bar;\n" +
3756 		"  public X() {\n" +
3757 		"  }\n" +
3758 		"}\n";
3759 
3760 	checkDietParse(
3761 			str.toCharArray(),
3762 			cursorLocation,
3763 			expectedCompletionNodeToString,
3764 			expectedParentNodeToString,
3765 			expectedUnitDisplayString,
3766 			completionIdentifier,
3767 			expectedReplacedSource,
3768 	"diet ast");
3769 }
test0101()3770 public void test0101(){
3771 	String str =
3772 		"public class X {\n" +
3773 		"  @Annot(zzz= {yyy, foo}\n" +
3774 		"  int bar;\n" +
3775 		"}";
3776 
3777 
3778 	String completeBehind = "foo";
3779 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3780 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3781 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3782 	String completionIdentifier = "foo";
3783 	String expectedReplacedSource = "foo";
3784 	String expectedUnitDisplayString =
3785 		"public class X {\n" +
3786 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3787 		"  int bar;\n" +
3788 		"  public X() {\n" +
3789 		"  }\n" +
3790 		"}\n";
3791 
3792 	checkDietParse(
3793 			str.toCharArray(),
3794 			cursorLocation,
3795 			expectedCompletionNodeToString,
3796 			expectedParentNodeToString,
3797 			expectedUnitDisplayString,
3798 			completionIdentifier,
3799 			expectedReplacedSource,
3800 	"diet ast");
3801 }
test0102()3802 public void test0102(){
3803 	String str =
3804 		"public class X {\n" +
3805 		"  @Annot(zzz= {yyy, foo\n" +
3806 		"  int bar;\n" +
3807 		"}";
3808 
3809 
3810 	String completeBehind = "foo";
3811 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3812 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3813 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
3814 	String completionIdentifier = "foo";
3815 	String expectedReplacedSource = "foo";
3816 	String expectedUnitDisplayString =
3817 		"public class X {\n" +
3818 		"  @Annot(zzz = {<CompleteOnName:foo>})\n" +
3819 		"  int bar;\n" +
3820 		"  public X() {\n" +
3821 		"  }\n" +
3822 		"}\n";
3823 
3824 	checkDietParse(
3825 			str.toCharArray(),
3826 			cursorLocation,
3827 			expectedCompletionNodeToString,
3828 			expectedParentNodeToString,
3829 			expectedUnitDisplayString,
3830 			completionIdentifier,
3831 			expectedReplacedSource,
3832 	"diet ast");
3833 }
test0103()3834 public void test0103(){
3835 	String str =
3836 		"public class X {\n" +
3837 		"  @Annot(zzz= a && (b || (foo && c)))\n" +
3838 		"  int bar;\n" +
3839 		"}";
3840 
3841 
3842 	String completeBehind = "foo";
3843 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3844 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3845 	String expectedParentNodeToString = "<NONE>";
3846 	String completionIdentifier = "foo";
3847 	String expectedReplacedSource = "foo";
3848 	String expectedUnitDisplayString =
3849 		"public class X {\n" +
3850 		"  @Annot(zzz = (a && (b || (<CompleteOnName:foo> && c)))) int bar;\n" +
3851 		"  public X() {\n" +
3852 		"  }\n" +
3853 		"}\n";
3854 
3855 	checkDietParse(
3856 			str.toCharArray(),
3857 			cursorLocation,
3858 			expectedCompletionNodeToString,
3859 			expectedParentNodeToString,
3860 			expectedUnitDisplayString,
3861 			completionIdentifier,
3862 			expectedReplacedSource,
3863 	"diet ast");
3864 }
test0104()3865 public void test0104(){
3866 	String str =
3867 		"public class X {\n" +
3868 		"  @Annot(zzz= a && (b || (foo\n" +
3869 		"  int bar;\n" +
3870 		"}";
3871 
3872 
3873 	String completeBehind = "foo";
3874 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3875 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3876 	String expectedParentNodeToString = "@Annot(zzz = <CompleteOnName:foo>)";
3877 	String completionIdentifier = "foo";
3878 	String expectedReplacedSource = "foo";
3879 	String expectedUnitDisplayString =
3880 		"public class X {\n" +
3881 		"  @Annot(zzz = <CompleteOnName:foo>)\n" +
3882 		"  int bar;\n" +
3883 		"  public X() {\n" +
3884 		"  }\n" +
3885 		"}\n";
3886 
3887 	checkDietParse(
3888 			str.toCharArray(),
3889 			cursorLocation,
3890 			expectedCompletionNodeToString,
3891 			expectedParentNodeToString,
3892 			expectedUnitDisplayString,
3893 			completionIdentifier,
3894 			expectedReplacedSource,
3895 	"diet ast");
3896 }
test0105_Diet()3897 public void test0105_Diet(){
3898 	String str =
3899 		"public class X {\n" +
3900 		"  void bar() {\n" +
3901 		"    @Annot(zzz=foo)\n" +
3902 		"    int var;\n" +
3903 		"  }\n" +
3904 		"}";
3905 
3906 
3907 	String completeBehind = "foo";
3908 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3909 	String expectedCompletionNodeToString = "<NONE>";
3910 	String expectedParentNodeToString = "<NONE>";
3911 	String completionIdentifier = "<NONE>";
3912 	String expectedReplacedSource = "<NONE>";
3913 	String expectedUnitDisplayString =
3914 		"public class X {\n" +
3915 		"  public X() {\n" +
3916 		"  }\n" +
3917 		"  void bar() {\n" +
3918 		"  }\n" +
3919 		"}\n";
3920 
3921 	checkDietParse(
3922 			str.toCharArray(),
3923 			cursorLocation,
3924 			expectedCompletionNodeToString,
3925 			expectedParentNodeToString,
3926 			expectedUnitDisplayString,
3927 			completionIdentifier,
3928 			expectedReplacedSource,
3929 	"diet ast");
3930 }
test0105_Method()3931 public void test0105_Method(){
3932 	String str =
3933 		"public class X {\n" +
3934 		"  void bar() {\n" +
3935 		"    @Annot(zzz=foo)\n" +
3936 		"    int var;\n" +
3937 		"  }\n" +
3938 		"}";
3939 
3940 
3941 	String completeBehind = "foo";
3942 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3943 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3944 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3945 	String completionIdentifier = "foo";
3946 	String expectedReplacedSource = "foo";
3947 	String expectedUnitDisplayString =
3948 			"public class X {\n" +
3949 			"  public X() {\n" +
3950 			"  }\n" +
3951 			"  void bar() {\n" +
3952 			"    @Annot(zzz = <CompleteOnName:foo>)\n" +
3953 			"  }\n" +
3954 			"}\n";
3955 
3956 	checkMethodParse(
3957 			str.toCharArray(),
3958 			cursorLocation,
3959 			expectedCompletionNodeToString,
3960 			expectedParentNodeToString,
3961 			expectedUnitDisplayString,
3962 			completionIdentifier,
3963 			expectedReplacedSource,
3964 			"full ast");
3965 }
test0106_Diet()3966 public void test0106_Diet(){
3967 	String str =
3968 		"public class X {\n" +
3969 		"  void bar() {\n" +
3970 		"    @Annot(zzz= a && foo)\n" +
3971 		"    int var;\n" +
3972 		"  }\n" +
3973 		"}";
3974 
3975 
3976 	String completeBehind = "foo";
3977 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3978 	String expectedCompletionNodeToString = "<NONE>";
3979 	String expectedParentNodeToString = "<NONE>";
3980 	String completionIdentifier = "<NONE>";
3981 	String expectedReplacedSource = "<NONE>";
3982 	String expectedUnitDisplayString =
3983 		"public class X {\n" +
3984 		"  public X() {\n" +
3985 		"  }\n" +
3986 		"  void bar() {\n" +
3987 		"  }\n" +
3988 		"}\n";
3989 
3990 	checkDietParse(
3991 			str.toCharArray(),
3992 			cursorLocation,
3993 			expectedCompletionNodeToString,
3994 			expectedParentNodeToString,
3995 			expectedUnitDisplayString,
3996 			completionIdentifier,
3997 			expectedReplacedSource,
3998 	"diet ast");
3999 }
test0106_Method()4000 public void test0106_Method(){
4001 	String str =
4002 		"public class X {\n" +
4003 		"  void bar() {\n" +
4004 		"    @Annot(zzz= a && foo)\n" +
4005 		"    int var;\n" +
4006 		"  }\n" +
4007 		"}";
4008 
4009 
4010 	String completeBehind = "foo";
4011 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4012 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4013 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4014 	String completionIdentifier = "foo";
4015 	String expectedReplacedSource = "foo";
4016 	String expectedUnitDisplayString =
4017 			"public class X {\n" +
4018 			"  public X() {\n" +
4019 			"  }\n" +
4020 			"  void bar() {\n" +
4021 			"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" +
4022 			"  }\n" +
4023 			"}\n";
4024 
4025 	checkMethodParse(
4026 			str.toCharArray(),
4027 			cursorLocation,
4028 			expectedCompletionNodeToString,
4029 			expectedParentNodeToString,
4030 			expectedUnitDisplayString,
4031 			completionIdentifier,
4032 			expectedReplacedSource,
4033 			"full ast");
4034 }
test0107_Diet()4035 public void test0107_Diet(){
4036 	String str =
4037 		"public class X {\n" +
4038 		"  void bar() {\n" +
4039 		"    @Annot(zzz= {foo})\n" +
4040 		"    int var;\n" +
4041 		"  }\n" +
4042 		"}";
4043 
4044 
4045 	String completeBehind = "foo";
4046 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4047 	String expectedCompletionNodeToString = "<NONE>";
4048 	String expectedParentNodeToString = "<NONE>";
4049 	String completionIdentifier = "<NONE>";
4050 	String expectedReplacedSource = "<NONE>";
4051 	String expectedUnitDisplayString =
4052 		"public class X {\n" +
4053 		"  public X() {\n" +
4054 		"  }\n" +
4055 		"  void bar() {\n" +
4056 		"  }\n" +
4057 		"}\n";
4058 
4059 	checkDietParse(
4060 			str.toCharArray(),
4061 			cursorLocation,
4062 			expectedCompletionNodeToString,
4063 			expectedParentNodeToString,
4064 			expectedUnitDisplayString,
4065 			completionIdentifier,
4066 			expectedReplacedSource,
4067 	"diet ast");
4068 }
test0107_Method()4069 public void test0107_Method(){
4070 	String str =
4071 		"public class X {\n" +
4072 		"  void bar() {\n" +
4073 		"    @Annot(zzz= {foo})\n" +
4074 		"    int var;\n" +
4075 		"  }\n" +
4076 		"}";
4077 
4078 
4079 	String completeBehind = "foo";
4080 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4081 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4082 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4083 	String completionIdentifier = "foo";
4084 	String expectedReplacedSource = "foo";
4085 	String expectedUnitDisplayString =
4086 			"public class X {\n" +
4087 			"  public X() {\n" +
4088 			"  }\n" +
4089 			"  void bar() {\n" +
4090 			"    @Annot(zzz = {<CompleteOnName:foo>})\n" +
4091 			"  }\n" +
4092 			"}\n";
4093 
4094 	checkMethodParse(
4095 			str.toCharArray(),
4096 			cursorLocation,
4097 			expectedCompletionNodeToString,
4098 			expectedParentNodeToString,
4099 			expectedUnitDisplayString,
4100 			completionIdentifier,
4101 			expectedReplacedSource,
4102 			"full ast");
4103 }
test0108_Diet()4104 public void test0108_Diet(){
4105 	String str =
4106 		"public class X {\n" +
4107 		"  void bar() {\n" +
4108 		"    @Annot(zzz= {yyy, foo})\n" +
4109 		"    int var;\n" +
4110 		"  }\n" +
4111 		"}";
4112 
4113 
4114 	String completeBehind = "foo";
4115 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4116 	String expectedCompletionNodeToString = "<NONE>";
4117 	String expectedParentNodeToString = "<NONE>";
4118 	String completionIdentifier = "<NONE>";
4119 	String expectedReplacedSource = "<NONE>";
4120 	String expectedUnitDisplayString =
4121 		"public class X {\n" +
4122 		"  public X() {\n" +
4123 		"  }\n" +
4124 		"  void bar() {\n" +
4125 		"  }\n" +
4126 		"}\n";
4127 
4128 	checkDietParse(
4129 			str.toCharArray(),
4130 			cursorLocation,
4131 			expectedCompletionNodeToString,
4132 			expectedParentNodeToString,
4133 			expectedUnitDisplayString,
4134 			completionIdentifier,
4135 			expectedReplacedSource,
4136 	"diet ast");
4137 }
test0108_Method()4138 public void test0108_Method(){
4139 	String str =
4140 		"public class X {\n" +
4141 		"  void bar() {\n" +
4142 		"    @Annot(zzz= {yyy, foo})\n" +
4143 		"    int var;\n" +
4144 		"  }\n" +
4145 		"}";
4146 
4147 
4148 	String completeBehind = "foo";
4149 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4150 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4151 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4152 	String completionIdentifier = "foo";
4153 	String expectedReplacedSource = "foo";
4154 	String expectedUnitDisplayString =
4155 			"public class X {\n" +
4156 			"  public X() {\n" +
4157 			"  }\n" +
4158 			"  void bar() {\n" +
4159 			"    @Annot(zzz = {<CompleteOnName:foo>})\n" +
4160 			"  }\n" +
4161 			"}\n";
4162 
4163 	checkMethodParse(
4164 			str.toCharArray(),
4165 			cursorLocation,
4166 			expectedCompletionNodeToString,
4167 			expectedParentNodeToString,
4168 			expectedUnitDisplayString,
4169 			completionIdentifier,
4170 			expectedReplacedSource,
4171 			"full ast");
4172 }
test0109_Diet()4173 public void test0109_Diet(){
4174 	String str =
4175 		"public class X {\n" +
4176 		"  void bar() {\n" +
4177 		"    @Annot(zzz=foo\n" +
4178 		"    int var;\n" +
4179 		"  }\n" +
4180 		"}";
4181 
4182 
4183 	String completeBehind = "foo";
4184 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4185 	String expectedCompletionNodeToString = "<NONE>";
4186 	String expectedParentNodeToString = "<NONE>";
4187 	String completionIdentifier = "<NONE>";
4188 	String expectedReplacedSource = "<NONE>";
4189 	String expectedUnitDisplayString =
4190 		"public class X {\n" +
4191 		"  public X() {\n" +
4192 		"  }\n" +
4193 		"  void bar() {\n" +
4194 		"  }\n" +
4195 		"}\n";
4196 
4197 	checkDietParse(
4198 			str.toCharArray(),
4199 			cursorLocation,
4200 			expectedCompletionNodeToString,
4201 			expectedParentNodeToString,
4202 			expectedUnitDisplayString,
4203 			completionIdentifier,
4204 			expectedReplacedSource,
4205 	"diet ast");
4206 }
test0109_Method()4207 public void test0109_Method(){
4208 	String str =
4209 		"public class X {\n" +
4210 		"  void bar() {\n" +
4211 		"    @Annot(zzz=foo\n" +
4212 		"    int var;\n" +
4213 		"  }\n" +
4214 		"}";
4215 
4216 
4217 	String completeBehind = "foo";
4218 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4219 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4220 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4221 	String completionIdentifier = "foo";
4222 	String expectedReplacedSource = "foo";
4223 	String expectedUnitDisplayString =
4224 			"public class X {\n" +
4225 			"  public X() {\n" +
4226 			"  }\n" +
4227 			"  void bar() {\n" +
4228 			"    @Annot(zzz = <CompleteOnName:foo>)\n" +
4229 			"  }\n" +
4230 			"}\n";
4231 
4232 	checkMethodParse(
4233 			str.toCharArray(),
4234 			cursorLocation,
4235 			expectedCompletionNodeToString,
4236 			expectedParentNodeToString,
4237 			expectedUnitDisplayString,
4238 			completionIdentifier,
4239 			expectedReplacedSource,
4240 			"full ast");
4241 }
test0110_Diet()4242 public void test0110_Diet(){
4243 	String str =
4244 		"public class X {\n" +
4245 		"  void bar() {\n" +
4246 		"    int var;\n" +
4247 		"    @Annot(zzz= a && foo\n" +
4248 		"  }\n" +
4249 		"}";
4250 
4251 
4252 	String completeBehind = "foo";
4253 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4254 	String expectedCompletionNodeToString = "<NONE>";
4255 	String expectedParentNodeToString = "<NONE>";
4256 	String completionIdentifier = "<NONE>";
4257 	String expectedReplacedSource = "<NONE>";
4258 	String expectedUnitDisplayString =
4259 		"public class X {\n" +
4260 		"  public X() {\n" +
4261 		"  }\n" +
4262 		"  void bar() {\n" +
4263 		"  }\n" +
4264 		"}\n";
4265 
4266 	checkDietParse(
4267 			str.toCharArray(),
4268 			cursorLocation,
4269 			expectedCompletionNodeToString,
4270 			expectedParentNodeToString,
4271 			expectedUnitDisplayString,
4272 			completionIdentifier,
4273 			expectedReplacedSource,
4274 	"diet ast");
4275 }
test0110_Method()4276 public void test0110_Method(){
4277 	String str =
4278 		"public class X {\n" +
4279 		"  void bar() {\n" +
4280 		"    int var;\n" +
4281 		"    @Annot(zzz= a && foo\n" +
4282 		"  }\n" +
4283 		"}";
4284 
4285 
4286 	String completeBehind = "foo";
4287 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4288 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4289 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4290 	String completionIdentifier = "foo";
4291 	String expectedReplacedSource = "foo";
4292 	String expectedUnitDisplayString =
4293 			"public class X {\n" +
4294 			"  public X() {\n" +
4295 			"  }\n" +
4296 			"  void bar() {\n" +
4297 			"    int var;\n" +
4298 			"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" +
4299 			"  }\n" +
4300 			"}\n";
4301 
4302 	checkMethodParse(
4303 			str.toCharArray(),
4304 			cursorLocation,
4305 			expectedCompletionNodeToString,
4306 			expectedParentNodeToString,
4307 			expectedUnitDisplayString,
4308 			completionIdentifier,
4309 			expectedReplacedSource,
4310 			"full ast");
4311 }
test0111_Diet()4312 public void test0111_Diet(){
4313 	String str =
4314 		"public class X {\n" +
4315 		"  void bar() {\n" +
4316 		"    @Annot(zzz= {yyy, foo}\n" +
4317 		"    int var;\n" +
4318 		"  }\n" +
4319 		"}";
4320 
4321 
4322 	String completeBehind = "foo";
4323 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4324 	String expectedCompletionNodeToString = "<NONE>";
4325 	String expectedParentNodeToString = "<NONE>";
4326 	String completionIdentifier = "<NONE>";
4327 	String expectedReplacedSource = "<NONE>";
4328 	String expectedUnitDisplayString =
4329 		"public class X {\n" +
4330 		"  public X() {\n" +
4331 		"  }\n" +
4332 		"  void bar() {\n" +
4333 		"  }\n" +
4334 		"}\n";
4335 
4336 	checkDietParse(
4337 			str.toCharArray(),
4338 			cursorLocation,
4339 			expectedCompletionNodeToString,
4340 			expectedParentNodeToString,
4341 			expectedUnitDisplayString,
4342 			completionIdentifier,
4343 			expectedReplacedSource,
4344 	"diet ast");
4345 }
test0111_Method()4346 public void test0111_Method(){
4347 	String str =
4348 		"public class X {\n" +
4349 		"  void bar() {\n" +
4350 		"    @Annot(zzz= {yyy, foo}\n" +
4351 		"    int var;\n" +
4352 		"  }\n" +
4353 		"}";
4354 
4355 
4356 	String completeBehind = "foo";
4357 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4358 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4359 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4360 	String completionIdentifier = "foo";
4361 	String expectedReplacedSource = "foo";
4362 	String expectedUnitDisplayString =
4363 			"public class X {\n" +
4364 			"  public X() {\n" +
4365 			"  }\n" +
4366 			"  void bar() {\n" +
4367 			"    @Annot(zzz = {<CompleteOnName:foo>})\n" +
4368 			"  }\n" +
4369 			"}\n";
4370 
4371 	checkMethodParse(
4372 			str.toCharArray(),
4373 			cursorLocation,
4374 			expectedCompletionNodeToString,
4375 			expectedParentNodeToString,
4376 			expectedUnitDisplayString,
4377 			completionIdentifier,
4378 			expectedReplacedSource,
4379 			"full ast");
4380 }
test0112_Diet()4381 public void test0112_Diet(){
4382 	String str =
4383 		"public class X {\n" +
4384 		"  void bar() {\n" +
4385 		"    @Annot(zzz= {yyy, foo\n" +
4386 		"    int var;\n" +
4387 		"  }\n" +
4388 		"}";
4389 
4390 
4391 	String completeBehind = "foo";
4392 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4393 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4394 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4395 	String completionIdentifier = "foo";
4396 	String expectedReplacedSource = "foo";
4397 	String expectedUnitDisplayString =
4398 		"public class X {\n" +
4399 		"  public X() {\n" +
4400 		"  }\n" +
4401 		"  void bar() {\n" +
4402 		"  }\n" +
4403 		"}\n";
4404 
4405 	checkDietParse(
4406 			str.toCharArray(),
4407 			cursorLocation,
4408 			expectedCompletionNodeToString,
4409 			expectedParentNodeToString,
4410 			expectedUnitDisplayString,
4411 			completionIdentifier,
4412 			expectedReplacedSource,
4413 	"diet ast");
4414 }
test0112_Method()4415 public void test0112_Method(){
4416 	String str =
4417 		"public class X {\n" +
4418 		"  void bar() {\n" +
4419 		"    @Annot(zzz= {yyy, foo\n" +
4420 		"    int var;\n" +
4421 		"  }\n" +
4422 		"}";
4423 
4424 
4425 	String completeBehind = "foo";
4426 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4427 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4428 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4429 	String completionIdentifier = "foo";
4430 	String expectedReplacedSource = "foo";
4431 	String expectedUnitDisplayString =
4432 			"public class X {\n" +
4433 			"  public X() {\n" +
4434 			"  }\n" +
4435 			"  void bar() {\n" +
4436 			"    @Annot(zzz = {<CompleteOnName:foo>})\n" +
4437 			"  }\n" +
4438 			"}\n";
4439 
4440 	checkMethodParse(
4441 			str.toCharArray(),
4442 			cursorLocation,
4443 			expectedCompletionNodeToString,
4444 			expectedParentNodeToString,
4445 			expectedUnitDisplayString,
4446 			completionIdentifier,
4447 			expectedReplacedSource,
4448 			"full ast");
4449 }
test0113_Diet()4450 public void test0113_Diet(){
4451 	String str =
4452 		"public class X {\n" +
4453 		"  void bar() {\n" +
4454 		"    @Annot(zzz= a && (b || (foo && c)))\n" +
4455 		"    int var;\n" +
4456 		"  }\n" +
4457 		"}";
4458 
4459 
4460 	String completeBehind = "foo";
4461 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4462 	String expectedCompletionNodeToString = "<NONE>";
4463 	String expectedParentNodeToString = "<NONE>";
4464 	String completionIdentifier = "<NONE>";
4465 	String expectedReplacedSource = "<NONE>";
4466 	String expectedUnitDisplayString =
4467 		"public class X {\n" +
4468 		"  public X() {\n" +
4469 		"  }\n" +
4470 		"  void bar() {\n" +
4471 		"  }\n" +
4472 		"}\n";
4473 
4474 	checkDietParse(
4475 			str.toCharArray(),
4476 			cursorLocation,
4477 			expectedCompletionNodeToString,
4478 			expectedParentNodeToString,
4479 			expectedUnitDisplayString,
4480 			completionIdentifier,
4481 			expectedReplacedSource,
4482 	"diet ast");
4483 }
test0113_Method()4484 public void test0113_Method(){
4485 	String str =
4486 		"public class X {\n" +
4487 		"  void bar() {\n" +
4488 		"    @Annot(zzz= a && (b || (foo && c)))\n" +
4489 		"    int var;\n" +
4490 		"  }\n" +
4491 		"}";
4492 
4493 
4494 	String completeBehind = "foo";
4495 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4496 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4497 	String expectedParentNodeToString = "@Annot(zzz = <CompleteOnName:foo>)";
4498 	String completionIdentifier = "foo";
4499 	String expectedReplacedSource = "foo";
4500 	String expectedUnitDisplayString =
4501 			"public class X {\n" +
4502 			"  public X() {\n" +
4503 			"  }\n" +
4504 			"  void bar() {\n" +
4505 			"    @Annot(zzz = <CompleteOnName:foo>)\n" +
4506 			"  }\n" +
4507 			"}\n";
4508 
4509 	checkMethodParse(
4510 			str.toCharArray(),
4511 			cursorLocation,
4512 			expectedCompletionNodeToString,
4513 			expectedParentNodeToString,
4514 			expectedUnitDisplayString,
4515 			completionIdentifier,
4516 			expectedReplacedSource,
4517 			"full ast");
4518 }
test0114_Diet()4519 public void test0114_Diet(){
4520 	String str =
4521 		"public class X {\n" +
4522 		"  void bar() {\n" +
4523 		"    @Annot(zzz= a && (b || (foo\n" +
4524 		"    int var;\n" +
4525 		"  }\n" +
4526 		"}";
4527 
4528 
4529 	String completeBehind = "foo";
4530 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4531 	String expectedCompletionNodeToString = "<NONE>";
4532 	String expectedParentNodeToString = "<NONE>";
4533 	String completionIdentifier = "<NONE>";
4534 	String expectedReplacedSource = "<NONE>";
4535 	String expectedUnitDisplayString =
4536 		"public class X {\n" +
4537 		"  public X() {\n" +
4538 		"  }\n" +
4539 		"  void bar() {\n" +
4540 		"  }\n" +
4541 		"}\n";
4542 
4543 	checkDietParse(
4544 			str.toCharArray(),
4545 			cursorLocation,
4546 			expectedCompletionNodeToString,
4547 			expectedParentNodeToString,
4548 			expectedUnitDisplayString,
4549 			completionIdentifier,
4550 			expectedReplacedSource,
4551 	"diet ast");
4552 }
test0114_Method()4553 public void test0114_Method(){
4554 	String str =
4555 		"public class X {\n" +
4556 		"  void bar() {\n" +
4557 		"    @Annot(zzz= a && (b || (foo\n" +
4558 		"    int var;\n" +
4559 		"  }\n" +
4560 		"}";
4561 
4562 
4563 	String completeBehind = "foo";
4564 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4565 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4566 	String expectedParentNodeToString = "@Annot(zzz = <CompleteOnName:foo>)";
4567 	String completionIdentifier = "foo";
4568 	String expectedReplacedSource = "foo";
4569 	String expectedUnitDisplayString =
4570 			"public class X {\n" +
4571 			"  public X() {\n" +
4572 			"  }\n" +
4573 			"  void bar() {\n" +
4574 			"    @Annot(zzz = <CompleteOnName:foo>)\n" +
4575 			"  }\n" +
4576 			"}\n";
4577 
4578 	checkMethodParse(
4579 			str.toCharArray(),
4580 			cursorLocation,
4581 			expectedCompletionNodeToString,
4582 			expectedParentNodeToString,
4583 			expectedUnitDisplayString,
4584 			completionIdentifier,
4585 			expectedReplacedSource,
4586 			"full ast");
4587 }
test0115()4588 public void test0115(){
4589 	String str =
4590 		"public class X {\n" +
4591 		"  void bar(@Annot(zzz=foo) int var) {\n" +
4592 		"  }\n" +
4593 		"}";
4594 
4595 
4596 	String completeBehind = "foo";
4597 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4598 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4599 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4600 	String completionIdentifier = "foo";
4601 	String expectedReplacedSource = "foo";
4602 	String expectedUnitDisplayString =
4603 		"public class X {\n" +
4604 		"  public X() {\n" +
4605 		"  }\n" +
4606 		"  void bar(@Annot(zzz = <CompleteOnName:foo>) int var) {\n" +
4607 		"  }\n" +
4608 		"}\n";
4609 
4610 	checkDietParse(
4611 			str.toCharArray(),
4612 			cursorLocation,
4613 			expectedCompletionNodeToString,
4614 			expectedParentNodeToString,
4615 			expectedUnitDisplayString,
4616 			completionIdentifier,
4617 			expectedReplacedSource,
4618 	"diet ast");
4619 }
test0116()4620 public void test0116(){
4621 	String str =
4622 		"public class X {\n" +
4623 		"  void bar(@Annot(zzz= a && foo) int var) {\n" +
4624 		"  }\n" +
4625 		"}";
4626 
4627 
4628 	String completeBehind = "foo";
4629 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4630 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4631 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4632 	String completionIdentifier = "foo";
4633 	String expectedReplacedSource = "foo";
4634 	String expectedUnitDisplayString =
4635 		"public class X {\n" +
4636 		"  public X() {\n" +
4637 		"  }\n" +
4638 		"  void bar(@Annot(zzz = (a && <CompleteOnName:foo>)) int var) {\n" +
4639 		"  }\n" +
4640 		"}\n";
4641 
4642 	checkDietParse(
4643 			str.toCharArray(),
4644 			cursorLocation,
4645 			expectedCompletionNodeToString,
4646 			expectedParentNodeToString,
4647 			expectedUnitDisplayString,
4648 			completionIdentifier,
4649 			expectedReplacedSource,
4650 	"diet ast");
4651 }
test0117()4652 public void test0117(){
4653 	String str =
4654 		"public class X {\n" +
4655 		"  void bar(@Annot(zzz= {foo}) int var) {\n" +
4656 		"  }\n" +
4657 		"}";
4658 
4659 
4660 	String completeBehind = "foo";
4661 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4662 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4663 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4664 	String completionIdentifier = "foo";
4665 	String expectedReplacedSource = "foo";
4666 	String expectedUnitDisplayString =
4667 		"public class X {\n" +
4668 		"  public X() {\n" +
4669 		"  }\n" +
4670 		"  void bar() {\n" +
4671 		"  }\n" +
4672 		"}\n";
4673 
4674 	checkDietParse(
4675 			str.toCharArray(),
4676 			cursorLocation,
4677 			expectedCompletionNodeToString,
4678 			expectedParentNodeToString,
4679 			expectedUnitDisplayString,
4680 			completionIdentifier,
4681 			expectedReplacedSource,
4682 	"diet ast");
4683 }
test0118()4684 public void test0118(){
4685 	String str =
4686 		"public class X {\n" +
4687 		"  void bar(@Annot(zzz= {yyy, foo}) int var) {\n" +
4688 		"  }\n" +
4689 		"}";
4690 
4691 
4692 	String completeBehind = "foo";
4693 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4694 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4695 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4696 	String completionIdentifier = "foo";
4697 	String expectedReplacedSource = "foo";
4698 	String expectedUnitDisplayString =
4699 		"public class X {\n" +
4700 		"  public X() {\n" +
4701 		"  }\n" +
4702 		"  void bar() {\n" +
4703 		"  }\n" +
4704 		"}\n";
4705 
4706 	checkDietParse(
4707 			str.toCharArray(),
4708 			cursorLocation,
4709 			expectedCompletionNodeToString,
4710 			expectedParentNodeToString,
4711 			expectedUnitDisplayString,
4712 			completionIdentifier,
4713 			expectedReplacedSource,
4714 	"diet ast");
4715 }
test0119_Diet()4716 public void test0119_Diet(){
4717 	String str =
4718 		"public class X {\n" +
4719 		"  void bar(@Annot(zzz=foo int var) {\n" +
4720 		"  }\n" +
4721 		"}";
4722 
4723 
4724 	String completeBehind = "foo";
4725 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4726 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4727 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4728 	String completionIdentifier = "foo";
4729 	String expectedReplacedSource = "foo";
4730 	String expectedUnitDisplayString =
4731 		"public class X {\n" +
4732 		"  public X() {\n" +
4733 		"  }\n" +
4734 		"  void bar() {\n" +
4735 		"  }\n" +
4736 		"}\n";
4737 
4738 	checkDietParse(
4739 			str.toCharArray(),
4740 			cursorLocation,
4741 			expectedCompletionNodeToString,
4742 			expectedParentNodeToString,
4743 			expectedUnitDisplayString,
4744 			completionIdentifier,
4745 			expectedReplacedSource,
4746 	"diet ast");
4747 }
test0119_Method()4748 public void test0119_Method(){
4749 	String str =
4750 		"public class X {\n" +
4751 		"  void bar(@Annot(zzz=foo int var) {\n" +
4752 		"  }\n" +
4753 		"}";
4754 
4755 
4756 	String completeBehind = "foo";
4757 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4758 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4759 	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4760 	String completionIdentifier = "foo";
4761 	String expectedReplacedSource = "foo";
4762 	String expectedUnitDisplayString =
4763 			"public class X {\n" +
4764 			"  public X() {\n" +
4765 			"  }\n" +
4766 			"  void bar() {\n" +
4767 			"    @Annot(zzz = <CompleteOnName:foo>)\n" +
4768 			"  }\n" +
4769 			"}\n";
4770 
4771 	checkMethodParse(
4772 			str.toCharArray(),
4773 			cursorLocation,
4774 			expectedCompletionNodeToString,
4775 			expectedParentNodeToString,
4776 			expectedUnitDisplayString,
4777 			completionIdentifier,
4778 			expectedReplacedSource,
4779 			"full ast");
4780 }
test0120_Diet()4781 public void test0120_Diet(){
4782 	String str =
4783 		"public class X {\n" +
4784 		"  void bar(@Annot(zzz= a && foo int var) {\n" +
4785 		"  }\n" +
4786 		"}";
4787 
4788 
4789 	String completeBehind = "foo";
4790 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4791 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4792 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4793 	String completionIdentifier = "foo";
4794 	String expectedReplacedSource = "foo";
4795 	String expectedUnitDisplayString =
4796 		"public class X {\n" +
4797 		"  public X() {\n" +
4798 		"  }\n" +
4799 		"  void bar() {\n" +
4800 		"  }\n" +
4801 		"}\n";
4802 
4803 	checkDietParse(
4804 			str.toCharArray(),
4805 			cursorLocation,
4806 			expectedCompletionNodeToString,
4807 			expectedParentNodeToString,
4808 			expectedUnitDisplayString,
4809 			completionIdentifier,
4810 			expectedReplacedSource,
4811 	"diet ast");
4812 }
test0120_Method()4813 public void test0120_Method(){
4814 	String str =
4815 		"public class X {\n" +
4816 		"  void bar(@Annot(zzz= a && foo int var) {\n" +
4817 		"  }\n" +
4818 		"}";
4819 
4820 
4821 	String completeBehind = "foo";
4822 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4823 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4824 	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4825 	String completionIdentifier = "foo";
4826 	String expectedReplacedSource = "foo";
4827 	String expectedUnitDisplayString =
4828 			"public class X {\n" +
4829 			"  public X() {\n" +
4830 			"  }\n" +
4831 			"  void bar() {\n" +
4832 			"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" +
4833 			"  }\n" +
4834 			"}\n";
4835 
4836 	checkMethodParse(
4837 			str.toCharArray(),
4838 			cursorLocation,
4839 			expectedCompletionNodeToString,
4840 			expectedParentNodeToString,
4841 			expectedUnitDisplayString,
4842 			completionIdentifier,
4843 			expectedReplacedSource,
4844 			"full ast");
4845 }
test0121()4846 public void test0121(){
4847 	String str =
4848 		"public class X {\n" +
4849 		"  void bar(@Annot(zzz= {yyy, foo} int var) {\n" +
4850 		"  }\n" +
4851 		"}";
4852 
4853 
4854 	String completeBehind = "foo";
4855 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4856 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4857 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4858 	String completionIdentifier = "foo";
4859 	String expectedReplacedSource = "foo";
4860 	String expectedUnitDisplayString =
4861 		"public class X {\n" +
4862 		"  public X() {\n" +
4863 		"  }\n" +
4864 		"  void bar() {\n" +
4865 		"  }\n" +
4866 		"}\n";
4867 
4868 	checkDietParse(
4869 			str.toCharArray(),
4870 			cursorLocation,
4871 			expectedCompletionNodeToString,
4872 			expectedParentNodeToString,
4873 			expectedUnitDisplayString,
4874 			completionIdentifier,
4875 			expectedReplacedSource,
4876 	"diet ast");
4877 }
test0122()4878 public void test0122(){
4879 	String str =
4880 		"public class X {\n" +
4881 		"  void bar(@Annot(zzz= {yyy, foo int var) {\n" +
4882 		"  }\n" +
4883 		"}";
4884 
4885 
4886 	String completeBehind = "foo";
4887 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4888 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4889 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@Annot(zzz)>";
4890 	String completionIdentifier = "foo";
4891 	String expectedReplacedSource = "foo";
4892 	String expectedUnitDisplayString =
4893 		"public class X {\n" +
4894 		"  public X() {\n" +
4895 		"  }\n" +
4896 		"  void bar() {\n" +
4897 		"  }\n" +
4898 		"}\n";
4899 
4900 	checkDietParse(
4901 			str.toCharArray(),
4902 			cursorLocation,
4903 			expectedCompletionNodeToString,
4904 			expectedParentNodeToString,
4905 			expectedUnitDisplayString,
4906 			completionIdentifier,
4907 			expectedReplacedSource,
4908 	"diet ast");
4909 }
test0123()4910 public void test0123(){
4911 	String str =
4912 		"public class X {\n" +
4913 		"  void bar(@Annot(zzz= a && (b || (foo && c))) int var) {\n" +
4914 		"  }\n" +
4915 		"}";
4916 
4917 
4918 	String completeBehind = "foo";
4919 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4920 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4921 	String expectedParentNodeToString = "<NONE>";
4922 	String completionIdentifier = "foo";
4923 	String expectedReplacedSource = "foo";
4924 	String expectedUnitDisplayString =
4925 		"public class X {\n" +
4926 		"  public X() {\n" +
4927 		"  }\n" +
4928 		"  void bar(@Annot(zzz = (a && (b || (<CompleteOnName:foo> && c)))) int var) {\n" +
4929 		"  }\n" +
4930 		"}\n";
4931 
4932 	checkDietParse(
4933 			str.toCharArray(),
4934 			cursorLocation,
4935 			expectedCompletionNodeToString,
4936 			expectedParentNodeToString,
4937 			expectedUnitDisplayString,
4938 			completionIdentifier,
4939 			expectedReplacedSource,
4940 	"diet ast");
4941 }
test0124()4942 public void test0124(){
4943 	String str =
4944 		"public class X {\n" +
4945 		"  void bar(@Annot(zzz= a && (b || (foo int var) {\n" +
4946 		"  }\n" +
4947 		"}";
4948 
4949 
4950 	String completeBehind = "foo";
4951 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4952 	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4953 	String expectedParentNodeToString = "@Annot(zzz = <CompleteOnName:foo>)";
4954 	String completionIdentifier = "foo";
4955 	String expectedReplacedSource = "foo";
4956 	String expectedUnitDisplayString =
4957 		"public class X {\n" +
4958 		"  public X() {\n" +
4959 		"  }\n" +
4960 		"  void bar() {\n" +
4961 		"  }\n" +
4962 		"}\n";
4963 
4964 	checkDietParse(
4965 			str.toCharArray(),
4966 			cursorLocation,
4967 			expectedCompletionNodeToString,
4968 			expectedParentNodeToString,
4969 			expectedUnitDisplayString,
4970 			completionIdentifier,
4971 			expectedReplacedSource,
4972 	"diet ast");
4973 }
4974 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=148742
test0125()4975 public void test0125(){
4976 	String str =
4977 		"public interface X {\n" +
4978 		"  public void test(@TestAnnotation int testParam);\n" +
4979 		"}";
4980 
4981 
4982 	String completeBehind = "@TestAnnotation";
4983 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4984 	String expectedCompletionNodeToString = "@<CompleteOnType:TestAnnotation>";
4985 	String expectedParentNodeToString = "<NONE>";
4986 	String completionIdentifier = "TestAnnotation";
4987 	String expectedReplacedSource = "TestAnnotation";
4988 	String expectedUnitDisplayString =
4989 		"public interface X {\n" +
4990 		"  @<CompleteOnType:TestAnnotation>\n" +
4991 		"  public void test() {\n" +
4992 		"  }\n" +
4993 		"}\n";
4994 
4995 	checkDietParse(
4996 			str.toCharArray(),
4997 			cursorLocation,
4998 			expectedCompletionNodeToString,
4999 			expectedParentNodeToString,
5000 			expectedUnitDisplayString,
5001 			completionIdentifier,
5002 			expectedReplacedSource,
5003 	"diet ast");
5004 }
5005 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148742
test0126()5006 public void test0126(){
5007 	String str =
5008 		"public abstract class X {\n" +
5009 		"  public abstract void test(@TestAnnotation int testParam);\n" +
5010 		"}";
5011 
5012 
5013 	String completeBehind = "@TestAnnotation";
5014 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
5015 	String expectedCompletionNodeToString = "@<CompleteOnType:TestAnnotation>";
5016 	String expectedParentNodeToString = "<NONE>";
5017 	String completionIdentifier = "TestAnnotation";
5018 	String expectedReplacedSource = "TestAnnotation";
5019 	String expectedUnitDisplayString =
5020 		"public abstract class X {\n" +
5021 		"  @<CompleteOnType:TestAnnotation>\n" +
5022 		"  public X() {\n" +
5023 		"  }\n" +
5024 		"  public abstract void test();\n" +
5025 		"}\n";
5026 
5027 	checkDietParse(
5028 			str.toCharArray(),
5029 			cursorLocation,
5030 			expectedCompletionNodeToString,
5031 			expectedParentNodeToString,
5032 			expectedUnitDisplayString,
5033 			completionIdentifier,
5034 			expectedReplacedSource,
5035 	"diet ast");
5036 }
test0127()5037 public void test0127(){
5038 	String str =
5039 		"public class Test {\n" +
5040 		"  public static final int zzint = 0;\n" +
5041 		"  @ZZAnnotation({ZZ})\n" +
5042 		"  void bar() {\n" +
5043 		"  }\n" +
5044 		"}";
5045 
5046 
5047 	String completeBehind = "{ZZ";
5048 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
5049 	String expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
5050 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@ZZAnnotation(value)>";
5051 	String completionIdentifier = "ZZ";
5052 	String expectedReplacedSource = "ZZ";
5053 	String expectedUnitDisplayString =
5054 		"public class Test {\n" +
5055 		"  @ZZAnnotation(value = {<CompleteOnName:ZZ>})\n" +
5056 		"  public static final int zzint;\n" +
5057 		"  public Test() {\n" +
5058 		"  }\n" +
5059 		"  <clinit>() {\n" +
5060 		"  }\n" +
5061 		"  void bar() {\n" +
5062 		"  }\n" +
5063 		"}\n";
5064 
5065 	checkDietParse(
5066 			str.toCharArray(),
5067 			cursorLocation,
5068 			expectedCompletionNodeToString,
5069 			expectedParentNodeToString,
5070 			expectedUnitDisplayString,
5071 			completionIdentifier,
5072 			expectedReplacedSource,
5073 	"diet ast");
5074 }
test0128()5075 public void test0128(){
5076 	String str =
5077 		"public class Test {\n" +
5078 		"  public static final int zzint = 0;\n" +
5079 		"  @ZZAnnotation(value={ZZ})\n" +
5080 		"  void bar() {\n" +
5081 		"  }\n" +
5082 		"}";
5083 
5084 
5085 	String completeBehind = "{ZZ";
5086 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
5087 	String expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
5088 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@ZZAnnotation(value)>";
5089 	String completionIdentifier = "ZZ";
5090 	String expectedReplacedSource = "ZZ";
5091 	String expectedUnitDisplayString =
5092 		"public class Test {\n" +
5093 		"  @ZZAnnotation(value = {<CompleteOnName:ZZ>})\n" +
5094 		"  public static final int zzint;\n" +
5095 		"  public Test() {\n" +
5096 		"  }\n" +
5097 		"  <clinit>() {\n" +
5098 		"  }\n" +
5099 		"  void bar() {\n" +
5100 		"  }\n" +
5101 		"}\n";
5102 
5103 	checkDietParse(
5104 			str.toCharArray(),
5105 			cursorLocation,
5106 			expectedCompletionNodeToString,
5107 			expectedParentNodeToString,
5108 			expectedUnitDisplayString,
5109 			completionIdentifier,
5110 			expectedReplacedSource,
5111 	"diet ast");
5112 }
test0129()5113 public void test0129(){
5114 	String str =
5115 		"public class Test {\n" +
5116 		"  public static final int zzint = 0;\n" +
5117 		"  @ZZAnnotation({ZZ\n" +
5118 		"}";
5119 
5120 
5121 	String completeBehind = "{ZZ";
5122 	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
5123 	String expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
5124 	String expectedParentNodeToString = "<AssistNodeParentAnnotationArrayInitializer:@ZZAnnotation(value)>";
5125 	String completionIdentifier = "ZZ";
5126 	String expectedReplacedSource = "ZZ";
5127 	String expectedUnitDisplayString =
5128 		"public class Test {\n" +
5129 		"  @ZZAnnotation(value = {<CompleteOnName:ZZ>})\n" +
5130 		"  public static final int zzint;\n" +
5131 		"  public Test() {\n" +
5132 		"  }\n" +
5133 		"  <clinit>() {\n" +
5134 		"  }\n" +
5135 		"}\n";
5136 
5137 	checkDietParse(
5138 			str.toCharArray(),
5139 			cursorLocation,
5140 			expectedCompletionNodeToString,
5141 			expectedParentNodeToString,
5142 			expectedUnitDisplayString,
5143 			completionIdentifier,
5144 			expectedReplacedSource,
5145 	"diet ast");
5146 }
5147 }
5148