View | Details | Raw Unified | Return to bug 179672
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTestKeyword.java (-1249 / +2957 lines)
Lines 665-671 Link Here
665
/*
665
/*
666
 * Test for 'abstract' keyword.
666
 * Test for 'abstract' keyword.
667
 */
667
 */
668
public void test0021(){
668
public void test0021_Diet(){
669
	String str =
669
	String str =
670
		"package p;\n" +
670
		"package p;\n" +
671
		"public class X {\n" +
671
		"public class X {\n" +
Lines 699-718 Link Here
699
		completionIdentifier,
699
		completionIdentifier,
700
		expectedReplacedSource,
700
		expectedReplacedSource,
701
		"diet ast");
701
		"diet ast");
702
	
702
}
703
	expectedCompletionNodeToString = "<CompleteOnName:abst>";
703
/*
704
	expectedParentNodeToString = "<NONE>";
704
 * Test for 'abstract' keyword.
705
	completionIdentifier = "abst";
705
 */
706
	expectedReplacedSource = "abst";
706
public void test0021_Method(){
707
	expectedUnitDisplayString =
707
	String str =
708
		"package p;\n" +
708
		"package p;\n" +
709
		"public class X {\n" +
709
		"public class X {\n" +
710
		"  public X() {\n" +
710
		"  void foo(){\n" +
711
		"  }\n" +
711
		"    abst\n" +
712
		"  void foo() {\n" +
713
		"    <CompleteOnName:abst>;\n" +
714
		"  }\n" +
712
		"  }\n" +
715
		"}\n";
713
		"}\n";
714
715
	String completeBehind = "abst";
716
	int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
717
718
	String expectedCompletionNodeToString = "<CompleteOnName:abst>";
719
	String expectedParentNodeToString = "<NONE>";
720
	String completionIdentifier = "abst";
721
	String expectedReplacedSource = "abst";
722
	String expectedUnitDisplayString =
723
			"package p;\n" +
724
			"public class X {\n" +
725
			"  public X() {\n" +
726
			"  }\n" +
727
			"  void foo() {\n" +
728
			"    <CompleteOnName:abst>;\n" +
729
			"  }\n" +
730
			"}\n";
716
	
731
	
717
	checkMethodParse(
732
	checkMethodParse(
718
		str.toCharArray(), 
733
		str.toCharArray(), 
Lines 727-733 Link Here
727
/*
742
/*
728
 * Test for 'abstract' keyword.
743
 * Test for 'abstract' keyword.
729
 */
744
 */
730
public void test0022(){
745
public void test0022_Diet(){
731
	String str =
746
	String str =
732
		"package p;\n" +
747
		"package p;\n" +
733
		"public class X {\n" +
748
		"public class X {\n" +
Lines 761-780 Link Here
761
		completionIdentifier,
776
		completionIdentifier,
762
		expectedReplacedSource,
777
		expectedReplacedSource,
763
		"diet ast");
778
		"diet ast");
764
	
779
}
765
	expectedCompletionNodeToString = "<CompleteOnName:abst>";
780
/*
766
	expectedParentNodeToString = "<NONE>";
781
 * Test for 'abstract' keyword.
767
	completionIdentifier = "abst";
782
 */
768
	expectedReplacedSource = "abst";
783
public void test0022_Method(){
769
	expectedUnitDisplayString =
784
	String str =
770
		"package p;\n" +
785
		"package p;\n" +
771
		"public class X {\n" +
786
		"public class X {\n" +
772
		"  public X() {\n" +
787
		"  void foo(){\n" +
773
		"  }\n" +
788
		"    abst zzz\n" +
774
		"  void foo() {\n" +
775
		"    <CompleteOnName:abst>;\n" +
776
		"  }\n" +
789
		"  }\n" +
777
		"}\n";
790
		"}\n";
791
792
	String completeBehind = "abst";
793
	int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
794
795
	String expectedCompletionNodeToString = "<CompleteOnName:abst>";
796
	String expectedParentNodeToString = "<NONE>";
797
	String completionIdentifier = "abst";
798
	String expectedReplacedSource = "abst";
799
	String expectedUnitDisplayString =
800
			"package p;\n" +
801
			"public class X {\n" +
802
			"  public X() {\n" +
803
			"  }\n" +
804
			"  void foo() {\n" +
805
			"    <CompleteOnName:abst>;\n" +
806
			"  }\n" +
807
			"}\n";
778
	
808
	
779
	checkMethodParse(
809
	checkMethodParse(
780
		str.toCharArray(), 
810
		str.toCharArray(), 
Lines 789-795 Link Here
789
/*
819
/*
790
 * Test for 'break' keyword.
820
 * Test for 'break' keyword.
791
 */
821
 */
792
public void test0023(){
822
public void test0023_Diet(){
793
	String str =
823
	String str =
794
		"package p;\n" +
824
		"package p;\n" +
795
		"public class X {\n" +
825
		"public class X {\n" +
Lines 823-842 Link Here
823
		completionIdentifier,
853
		completionIdentifier,
824
		expectedReplacedSource,
854
		expectedReplacedSource,
825
		"diet ast");
855
		"diet ast");
826
	
856
}
827
	expectedCompletionNodeToString = "<CompleteOnName:bre>";
857
/*
828
	expectedParentNodeToString = "<NONE>";
858
 * Test for 'break' keyword.
829
	completionIdentifier = "bre";
859
 */
830
	expectedReplacedSource = "bre";
860
public void test0023_Method(){
831
	expectedUnitDisplayString =
861
	String str =
832
		"package p;\n" +
862
		"package p;\n" +
833
		"public class X {\n" +
863
		"public class X {\n" +
834
		"  public X() {\n" +
864
		"  void foo(){\n" +
835
		"  }\n" +
865
		"    bre\n" +
836
		"  void foo() {\n" +
837
		"    <CompleteOnName:bre>;\n" +
838
		"  }\n" +
866
		"  }\n" +
839
		"}\n";
867
		"}\n";
868
869
	String completeBehind = "bre";
870
	int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
871
872
	String expectedCompletionNodeToString = "<CompleteOnName:bre>";
873
	String expectedParentNodeToString = "<NONE>";
874
	String completionIdentifier = "bre";
875
	String expectedReplacedSource = "bre";
876
	String expectedUnitDisplayString =
877
			"package p;\n" +
878
			"public class X {\n" +
879
			"  public X() {\n" +
880
			"  }\n" +
881
			"  void foo() {\n" +
882
			"    <CompleteOnName:bre>;\n" +
883
			"  }\n" +
884
			"}\n";
840
	
885
	
841
	checkMethodParse(
886
	checkMethodParse(
842
		str.toCharArray(), 
887
		str.toCharArray(), 
Lines 851-857 Link Here
851
/*
896
/*
852
 * Test for 'break' keyword.
897
 * Test for 'break' keyword.
853
 */
898
 */
854
public void test0024(){
899
public void test0024_Diet(){
855
	String str =
900
	String str =
856
		"package p;\n" +
901
		"package p;\n" +
857
		"public class X {\n" +
902
		"public class X {\n" +
Lines 887-909 Link Here
887
		completionIdentifier,
932
		completionIdentifier,
888
		expectedReplacedSource,
933
		expectedReplacedSource,
889
		"diet ast");
934
		"diet ast");
890
	
935
}
891
	expectedCompletionNodeToString = "<CompleteOnName:bre>";
936
/*
892
	expectedParentNodeToString = "<NONE>";
937
 * Test for 'break' keyword.
893
	completionIdentifier = "bre";
938
 */
894
	expectedReplacedSource = "bre";
939
public void test0024_Method(){
895
	expectedUnitDisplayString =
940
	String str =
896
		"package p;\n" +
941
		"package p;\n" +
897
		"public class X {\n" +
942
		"public class X {\n" +
898
		"  public X() {\n" +
943
		"  void foo(){\n" +
899
		"  }\n" +
944
		"    for(int i; i < 10; i++) {\n" +
900
		"  void foo() {\n" +
945
		"      bre\n" +
901
		"    int i;\n" +
902
		"    {\n" +
903
		"      <CompleteOnName:bre>;\n" +
904
		"    }\n" +
946
		"    }\n" +
905
		"  }\n" +
947
		"  }\n" +
906
		"}\n";
948
		"}\n";
949
950
	String completeBehind = "bre";
951
	int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
952
953
	String expectedCompletionNodeToString = "<CompleteOnName:bre>";
954
	String expectedParentNodeToString = "<NONE>";
955
	String completionIdentifier = "bre";
956
	String expectedReplacedSource = "bre";
957
	String expectedUnitDisplayString =
958
			"package p;\n" +
959
			"public class X {\n" +
960
			"  public X() {\n" +
961
			"  }\n" +
962
			"  void foo() {\n" +
963
			"    int i;\n" +
964
			"    {\n" +
965
			"      <CompleteOnName:bre>;\n" +
966
			"    }\n" +
967
			"  }\n" +
968
			"}\n";
907
	
969
	
908
	checkMethodParse(
970
	checkMethodParse(
909
		str.toCharArray(), 
971
		str.toCharArray(), 
Lines 918-924 Link Here
918
/*
980
/*
919
 * Test for 'case' keyword.
981
 * Test for 'case' keyword.
920
 */
982
 */
921
public void test0025(){
983
public void test0025_Diet(){
922
	String str =
984
	String str =
923
		"package p;\n" +
985
		"package p;\n" +
924
		"public class X {\n" +
986
		"public class X {\n" +
Lines 952-971 Link Here
952
		completionIdentifier,
1014
		completionIdentifier,
953
		expectedReplacedSource,
1015
		expectedReplacedSource,
954
		"diet ast");
1016
		"diet ast");
955
	
1017
}
956
	expectedCompletionNodeToString = "<CompleteOnName:cas>";
1018
/*
957
	expectedParentNodeToString = "<NONE>";
1019
 * Test for 'case' keyword.
958
	completionIdentifier = "cas";
1020
 */
959
	expectedReplacedSource = "cas";
1021
public void test0025_Method(){
960
	expectedUnitDisplayString =
1022
	String str =
961
		"package p;\n" +
1023
		"package p;\n" +
962
		"public class X {\n" +
1024
		"public class X {\n" +
963
		"  public X() {\n" +
1025
		"  void foo(){\n" +
964
		"  }\n" +
1026
		"    cas\n" +
965
		"  void foo() {\n" +
966
		"    <CompleteOnName:cas>;\n" +
967
		"  }\n" +
1027
		"  }\n" +
968
		"}\n";
1028
		"}\n";
1029
1030
	String completeBehind = "cas";
1031
	int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
1032
1033
	String expectedCompletionNodeToString = "<CompleteOnName:cas>";
1034
	String expectedParentNodeToString = "<NONE>";
1035
	String completionIdentifier = "cas";
1036
	String expectedReplacedSource = "cas";
1037
	String expectedUnitDisplayString =
1038
			"package p;\n" +
1039
			"public class X {\n" +
1040
			"  public X() {\n" +
1041
			"  }\n" +
1042
			"  void foo() {\n" +
1043
			"    <CompleteOnName:cas>;\n" +
1044
			"  }\n" +
1045
			"}\n";
969
	
1046
	
970
	checkMethodParse(
1047
	checkMethodParse(
971
		str.toCharArray(), 
1048
		str.toCharArray(), 
Lines 980-986 Link Here
980
/*
1057
/*
981
 * Test for 'case' keyword.
1058
 * Test for 'case' keyword.
982
 */
1059
 */
983
public void test0026(){
1060
public void test0026_Diet(){
984
	String str =
1061
	String str =
985
		"package p;\n" +
1062
		"package p;\n" +
986
		"public class X {\n" +
1063
		"public class X {\n" +
Lines 1016-1035 Link Here
1016
		completionIdentifier,
1093
		completionIdentifier,
1017
		expectedReplacedSource,
1094
		expectedReplacedSource,
1018
		"diet ast");
1095
		"diet ast");
1019
	
1096
}
1020
	expectedCompletionNodeToString = "<CompleteOnKeyword:cas>";
1097
/*
1021
	expectedParentNodeToString = "<NONE>";
1098
 * Test for 'case' keyword.
1022
	completionIdentifier = "cas";
1099
 */
1023
	expectedReplacedSource = "cas";
1100
public void test0026_Method(){
1024
	expectedUnitDisplayString =
1101
	String str =
1025
		"package p;\n" +
1102
		"package p;\n" +
1026
		"public class X {\n" +
1103
		"public class X {\n" +
1027
		"  public X() {\n" +
1104
		"  void foo(){\n" +
1028
		"  }\n" +
1105
		"    switch(0) {\n" +
1029
		"  void foo() {\n" +
1106
		"      cas\n" +
1030
		"    <CompleteOnKeyword:cas>;\n" +
1107
		"    }\n" +
1031
		"  }\n" +
1108
		"  }\n" +
1032
		"}\n";
1109
		"}\n";
1110
1111
	String completeBehind = "cas";
1112
	int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
1113
1114
	String expectedCompletionNodeToString = "<CompleteOnKeyword:cas>";
1115
	String expectedParentNodeToString = "<NONE>";
1116
	String completionIdentifier = "cas";
1117
	String expectedReplacedSource = "cas";
1118
	String expectedUnitDisplayString =
1119
			"package p;\n" +
1120
			"public class X {\n" +
1121
			"  public X() {\n" +
1122
			"  }\n" +
1123
			"  void foo() {\n" +
1124
			"    <CompleteOnKeyword:cas>;\n" +
1125
			"  }\n" +
1126
			"}\n";
1033
	
1127
	
1034
	checkMethodParse(
1128
	checkMethodParse(
1035
		str.toCharArray(), 
1129
		str.toCharArray(), 
Lines 1044-1050 Link Here
1044
/*
1138
/*
1045
 * Test for 'catch' keyword.
1139
 * Test for 'catch' keyword.
1046
 */
1140
 */
1047
public void test0027(){
1141
public void test0027_Diet(){
1048
	String str =
1142
	String str =
1049
		"package p;\n" +
1143
		"package p;\n" +
1050
		"public class X {\n" +
1144
		"public class X {\n" +
Lines 1078-1097 Link Here
1078
		completionIdentifier,
1172
		completionIdentifier,
1079
		expectedReplacedSource,
1173
		expectedReplacedSource,
1080
		"diet ast");
1174
		"diet ast");
1081
	
1175
}
1082
	expectedCompletionNodeToString = "<CompleteOnName:cat>";
1176
/*
1083
	expectedParentNodeToString = "<NONE>";
1177
 * Test for 'catch' keyword.
1084
	completionIdentifier = "cat";
1178
 */
1085
	expectedReplacedSource = "cat";
1179
public void test0027_Method(){
1086
	expectedUnitDisplayString =
1180
	String str =
1087
		"package p;\n" +
1181
		"package p;\n" +
1088
		"public class X {\n" +
1182
		"public class X {\n" +
1089
		"  public X() {\n" +
1183
		"  void foo(){\n" +
1090
		"  }\n" +
1184
		"     cat\n" +
1091
		"  void foo() {\n" +
1092
		"    <CompleteOnName:cat>;\n" +
1093
		"  }\n" +
1185
		"  }\n" +
1094
		"}\n";
1186
		"}\n";
1187
1188
	String completeBehind = "cat";
1189
	int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
1190
1191
	String expectedCompletionNodeToString = "<CompleteOnName:cat>";
1192
	String expectedParentNodeToString = "<NONE>";
1193
	String completionIdentifier = "cat";
1194
	String expectedReplacedSource = "cat";
1195
	String expectedUnitDisplayString =
1196
			"package p;\n" +
1197
			"public class X {\n" +
1198
			"  public X() {\n" +
1199
			"  }\n" +
1200
			"  void foo() {\n" +
1201
			"    <CompleteOnName:cat>;\n" +
1202
			"  }\n" +
1203
			"}\n";
1095
	
1204
	
1096
	checkMethodParse(
1205
	checkMethodParse(
1097
		str.toCharArray(), 
1206
		str.toCharArray(), 
Lines 1106-1112 Link Here
1106
/*
1215
/*
1107
 * Test for 'catch' keyword.
1216
 * Test for 'catch' keyword.
1108
 */
1217
 */
1109
public void test0028(){
1218
public void test0028_Diet(){
1110
	String str =
1219
	String str =
1111
		"package p;\n" +
1220
		"package p;\n" +
1112
		"public class X {\n" +
1221
		"public class X {\n" +
Lines 1141-1160 Link Here
1141
		completionIdentifier,
1250
		completionIdentifier,
1142
		expectedReplacedSource,
1251
		expectedReplacedSource,
1143
		"diet ast");
1252
		"diet ast");
1144
	
1253
}
1145
	expectedCompletionNodeToString = "<CompleteOnKeyword:cat>";
1254
/*
1146
	expectedParentNodeToString = "<NONE>";
1255
 * Test for 'catch' keyword.
1147
	completionIdentifier = "cat";
1256
 */
1148
	expectedReplacedSource = "cat";
1257
public void test0028_Method(){
1149
	expectedUnitDisplayString =
1258
	String str =
1150
		"package p;\n" +
1259
		"package p;\n" +
1151
		"public class X {\n" +
1260
		"public class X {\n" +
1152
		"  public X() {\n" +
1261
		"  void foo(){\n" +
1153
		"  }\n" +
1262
		"    try {\n" +
1154
		"  void foo() {\n" +
1263
		"    } cat\n" +
1155
		"    <CompleteOnKeyword:cat>;\n" +
1156
		"  }\n" +
1264
		"  }\n" +
1157
		"}\n";
1265
		"}\n";
1266
1267
	String completeBehind = "cat";
1268
	int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
1269
1270
	String expectedCompletionNodeToString = "<CompleteOnKeyword:cat>";
1271
	String expectedParentNodeToString = "<NONE>";
1272
	String completionIdentifier = "cat";
1273
	String expectedReplacedSource = "cat";
1274
	String expectedUnitDisplayString =
1275
			"package p;\n" +
1276
			"public class X {\n" +
1277
			"  public X() {\n" +
1278
			"  }\n" +
1279
			"  void foo() {\n" +
1280
			"    <CompleteOnKeyword:cat>;\n" +
1281
			"  }\n" +
1282
			"}\n";
1158
	
1283
	
1159
	checkMethodParse(
1284
	checkMethodParse(
1160
		str.toCharArray(), 
1285
		str.toCharArray(), 
Lines 1409-1415 Link Here
1409
/*
1534
/*
1410
 * Test for 'class' keyword.
1535
 * Test for 'class' keyword.
1411
 */
1536
 */
1412
public void test0037(){
1537
public void test0037_Diet(){
1413
	String str =
1538
	String str =
1414
		"public class X {\n" +
1539
		"public class X {\n" +
1415
		"  void foo() {\n" +
1540
		"  void foo() {\n" +
Lines 1441-1459 Link Here
1441
		completionIdentifier,
1566
		completionIdentifier,
1442
		expectedReplacedSource,
1567
		expectedReplacedSource,
1443
		"diet ast");
1568
		"diet ast");
1444
	
1569
}
1445
	expectedCompletionNodeToString = "<CompleteOnName:cla>";
1570
/*
1446
	expectedParentNodeToString = "<NONE>";
1571
 * Test for 'class' keyword.
1447
	completionIdentifier = "cla";
1572
 */
1448
	expectedReplacedSource = "cla";
1573
public void test0037_Method(){
1449
	expectedUnitDisplayString =
1574
	String str =
1450
		"public class X {\n" +
1575
		"public class X {\n" +
1451
		"  public X() {\n" +
1452
		"  }\n" +
1453
		"  void foo() {\n" +
1576
		"  void foo() {\n" +
1454
		"    <CompleteOnName:cla>;\n" +
1577
		"    cla\n" +
1455
		"  }\n" +
1578
		"  }\n" +
1456
		"}\n";
1579
		"}";
1580
1581
	String completeBehind = "cla";
1582
	int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
1583
1584
	String expectedCompletionNodeToString = "<CompleteOnName:cla>";
1585
	String expectedParentNodeToString = "<NONE>";
1586
	String completionIdentifier = "cla";
1587
	String expectedReplacedSource = "cla";
1588
	String expectedUnitDisplayString =
1589
			"public class X {\n" +
1590
			"  public X() {\n" +
1591
			"  }\n" +
1592
			"  void foo() {\n" +
1593
			"    <CompleteOnName:cla>;\n" +
1594
			"  }\n" +
1595
			"}\n";
1457
	
1596
	
1458
	checkMethodParse(
1597
	checkMethodParse(
1459
		str.toCharArray(), 
1598
		str.toCharArray(), 
Lines 1468-1474 Link Here
1468
/*
1607
/*
1469
 * Test for 'class' keyword.
1608
 * Test for 'class' keyword.
1470
 */
1609
 */
1471
public void test0038(){
1610
public void test0038_Diet(){
1472
	String str =
1611
	String str =
1473
		"public class X {\n" +
1612
		"public class X {\n" +
1474
		"  void foo() {\n" +
1613
		"  void foo() {\n" +
Lines 1500-1518 Link Here
1500
		completionIdentifier,
1639
		completionIdentifier,
1501
		expectedReplacedSource,
1640
		expectedReplacedSource,
1502
		"diet ast");
1641
		"diet ast");
1503
	
1642
}
1504
	expectedCompletionNodeToString = "<CompleteOnName:cla>";
1643
/*
1505
	expectedParentNodeToString = "<NONE>";
1644
 * Test for 'class' keyword.
1506
	completionIdentifier = "cla";
1645
 */
1507
	expectedReplacedSource = "cla";
1646
public void test0038_Method(){
1508
	expectedUnitDisplayString =
1647
	String str =
1509
		"public class X {\n" +
1648
		"public class X {\n" +
1510
		"  public X() {\n" +
1511
		"  }\n" +
1512
		"  void foo() {\n" +
1649
		"  void foo() {\n" +
1513
		"    <CompleteOnName:cla>;\n" +
1650
		"    final cla\n" +
1514
		"  }\n" +
1651
		"  }\n" +
1515
		"}\n";
1652
		"}";
1653
1654
	String completeBehind = "cla";
1655
	int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
1656
1657
	String expectedCompletionNodeToString = "<CompleteOnName:cla>";
1658
	String expectedParentNodeToString = "<NONE>";
1659
	String completionIdentifier = "cla";
1660
	String expectedReplacedSource = "cla";
1661
	String expectedUnitDisplayString =
1662
			"public class X {\n" +
1663
			"  public X() {\n" +
1664
			"  }\n" +
1665
			"  void foo() {\n" +
1666
			"    <CompleteOnName:cla>;\n" +
1667
			"  }\n" +
1668
			"}\n";
1516
	
1669
	
1517
	checkMethodParse(
1670
	checkMethodParse(
1518
		str.toCharArray(), 
1671
		str.toCharArray(), 
Lines 1527-1533 Link Here
1527
/*
1680
/*
1528
 * Test for 'class' keyword.
1681
 * Test for 'class' keyword.
1529
 */
1682
 */
1530
public void test0039(){
1683
public void test0039_Diet(){
1531
	String str =
1684
	String str =
1532
		"public class X {\n" +
1685
		"public class X {\n" +
1533
		"  void foo() {\n" +
1686
		"  void foo() {\n" +
Lines 1559-1577 Link Here
1559
		completionIdentifier,
1712
		completionIdentifier,
1560
		expectedReplacedSource,
1713
		expectedReplacedSource,
1561
		"diet ast");
1714
		"diet ast");
1562
	
1715
}
1563
	expectedCompletionNodeToString = "<CompleteOnName:cla>";
1716
/*
1564
	expectedParentNodeToString = "<NONE>";
1717
 * Test for 'class' keyword.
1565
	completionIdentifier = "cla";
1718
 */
1566
	expectedReplacedSource = "cla";
1719
public void test0039_Method(){
1567
	expectedUnitDisplayString =
1720
	String str =
1568
		"public class X {\n" +
1721
		"public class X {\n" +
1569
		"  public X() {\n" +
1570
		"  }\n" +
1571
		"  void foo() {\n" +
1722
		"  void foo() {\n" +
1572
		"    <CompleteOnName:cla>;\n" +
1723
		"    final cla Y\n" +
1573
		"  }\n" +
1724
		"  }\n" +
1574
		"}\n";
1725
		"}";
1726
1727
	String completeBehind = "cla";
1728
	int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
1729
1730
	String expectedCompletionNodeToString = "<CompleteOnName:cla>";
1731
	String expectedParentNodeToString = "<NONE>";
1732
	String completionIdentifier = "cla";
1733
	String expectedReplacedSource = "cla";
1734
	String expectedUnitDisplayString =
1735
			"public class X {\n" +
1736
			"  public X() {\n" +
1737
			"  }\n" +
1738
			"  void foo() {\n" +
1739
			"    <CompleteOnName:cla>;\n" +
1740
			"  }\n" +
1741
			"}\n";
1575
	
1742
	
1576
	checkMethodParse(
1743
	checkMethodParse(
1577
		str.toCharArray(), 
1744
		str.toCharArray(), 
Lines 1586-1592 Link Here
1586
/*
1753
/*
1587
 * Test for 'continue' keyword.
1754
 * Test for 'continue' keyword.
1588
 */
1755
 */
1589
public void test0040(){
1756
public void test0040_Diet(){
1590
	String str =
1757
	String str =
1591
		"package p;\n" +
1758
		"package p;\n" +
1592
		"public class X {\n" +
1759
		"public class X {\n" +
Lines 1620-1639 Link Here
1620
		completionIdentifier,
1787
		completionIdentifier,
1621
		expectedReplacedSource,
1788
		expectedReplacedSource,
1622
		"diet ast");
1789
		"diet ast");
1623
	
1790
}
1624
	expectedCompletionNodeToString = "<CompleteOnName:con>";
1791
/*
1625
	expectedParentNodeToString = "<NONE>";
1792
 * Test for 'continue' keyword.
1626
	completionIdentifier = "con";
1793
 */
1627
	expectedReplacedSource = "con";
1794
public void test0040_Method(){
1628
	expectedUnitDisplayString =
1795
	String str =
1629
		"package p;\n" +
1796
		"package p;\n" +
1630
		"public class X {\n" +
1797
		"public class X {\n" +
1631
		"  public X() {\n" +
1798
		"  void foo(){\n" +
1632
		"  }\n" +
1799
		"     con\n" +
1633
		"  void foo() {\n" +
1634
		"    <CompleteOnName:con>;\n" +
1635
		"  }\n" +
1800
		"  }\n" +
1636
		"}\n";
1801
		"}\n";
1802
1803
	String completeBehind = "con";
1804
	int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
1805
1806
	String expectedCompletionNodeToString = "<CompleteOnName:con>";
1807
	String expectedParentNodeToString = "<NONE>";
1808
	String completionIdentifier = "con";
1809
	String expectedReplacedSource = "con";
1810
	String expectedUnitDisplayString =
1811
			"package p;\n" +
1812
			"public class X {\n" +
1813
			"  public X() {\n" +
1814
			"  }\n" +
1815
			"  void foo() {\n" +
1816
			"    <CompleteOnName:con>;\n" +
1817
			"  }\n" +
1818
			"}\n";
1637
	
1819
	
1638
	checkMethodParse(
1820
	checkMethodParse(
1639
		str.toCharArray(), 
1821
		str.toCharArray(), 
Lines 1648-1654 Link Here
1648
/*
1830
/*
1649
 * Test for 'continue' keyword.
1831
 * Test for 'continue' keyword.
1650
 */
1832
 */
1651
public void test0041(){
1833
public void test0041_Diet(){
1652
	String str =
1834
	String str =
1653
		"package p;\n" +
1835
		"package p;\n" +
1654
		"public class X {\n" +
1836
		"public class X {\n" +
Lines 1684-1706 Link Here
1684
		completionIdentifier,
1866
		completionIdentifier,
1685
		expectedReplacedSource,
1867
		expectedReplacedSource,
1686
		"diet ast");
1868
		"diet ast");
1687
	
1869
}
1688
	expectedCompletionNodeToString = "<CompleteOnName:con>";
1870
/*
1689
	expectedParentNodeToString = "<NONE>";
1871
 * Test for 'continue' keyword.
1690
	completionIdentifier = "con";
1872
 */
1691
	expectedReplacedSource = "con";
1873
public void test0041_Method(){
1692
	expectedUnitDisplayString =
1874
	String str =
1693
		"package p;\n" +
1875
		"package p;\n" +
1694
		"public class X {\n" +
1876
		"public class X {\n" +
1695
		"  public X() {\n" +
1877
		"  void foo(){\n" +
1696
		"  }\n" +
1878
		"     for(int i; i < 5; i++) {\n" +
1697
		"  void foo() {\n" +
1879
		"       con\n" +
1698
		"    int i;\n" +
1880
		"     }\n" +
1699
		"    {\n" +
1700
		"      <CompleteOnName:con>;\n" +
1701
		"    }\n" +
1702
		"  }\n" +
1881
		"  }\n" +
1703
		"}\n";
1882
		"}\n";
1883
1884
	String completeBehind = "con";
1885
	int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
1886
1887
	String expectedCompletionNodeToString = "<CompleteOnName:con>";
1888
	String expectedParentNodeToString = "<NONE>";
1889
	String completionIdentifier = "con";
1890
	String expectedReplacedSource = "con";
1891
	String expectedUnitDisplayString =
1892
			"package p;\n" +
1893
			"public class X {\n" +
1894
			"  public X() {\n" +
1895
			"  }\n" +
1896
			"  void foo() {\n" +
1897
			"    int i;\n" +
1898
			"    {\n" +
1899
			"      <CompleteOnName:con>;\n" +
1900
			"    }\n" +
1901
			"  }\n" +
1902
			"}\n";
1704
	
1903
	
1705
	checkMethodParse(
1904
	checkMethodParse(
1706
		str.toCharArray(), 
1905
		str.toCharArray(), 
Lines 1715-1721 Link Here
1715
/*
1914
/*
1716
 * Test for 'default' keyword.
1915
 * Test for 'default' keyword.
1717
 */
1916
 */
1718
public void test0042(){
1917
public void test0042_Diet(){
1719
	String str =
1918
	String str =
1720
		"package p;\n" +
1919
		"package p;\n" +
1721
		"public class X {\n" +
1920
		"public class X {\n" +
Lines 1749-1768 Link Here
1749
		completionIdentifier,
1948
		completionIdentifier,
1750
		expectedReplacedSource,
1949
		expectedReplacedSource,
1751
		"diet ast");
1950
		"diet ast");
1752
	
1951
}
1753
	expectedCompletionNodeToString = "<CompleteOnName:def>";
1952
/*
1754
	expectedParentNodeToString = "<NONE>";
1953
 * Test for 'default' keyword.
1755
	completionIdentifier = "def";
1954
 */
1756
	expectedReplacedSource = "def";
1955
public void test0042_Method(){
1757
	expectedUnitDisplayString =
1956
	String str =
1758
		"package p;\n" +
1957
		"package p;\n" +
1759
		"public class X {\n" +
1958
		"public class X {\n" +
1760
		"  public X() {\n" +
1959
		"  void foo(){\n" +
1761
		"  }\n" +
1960
		"     def\n" +
1762
		"  void foo() {\n" +
1763
		"    <CompleteOnName:def>;\n" +
1764
		"  }\n" +
1961
		"  }\n" +
1765
		"}\n";
1962
		"}\n";
1963
1964
	String completeBehind = "def";
1965
	int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
1966
1967
	String expectedCompletionNodeToString = "<CompleteOnName:def>";
1968
	String expectedParentNodeToString = "<NONE>";
1969
	String completionIdentifier = "def";
1970
	String expectedReplacedSource = "def";
1971
	String expectedUnitDisplayString =
1972
			"package p;\n" +
1973
			"public class X {\n" +
1974
			"  public X() {\n" +
1975
			"  }\n" +
1976
			"  void foo() {\n" +
1977
			"    <CompleteOnName:def>;\n" +
1978
			"  }\n" +
1979
			"}\n";
1766
	
1980
	
1767
	checkMethodParse(
1981
	checkMethodParse(
1768
		str.toCharArray(), 
1982
		str.toCharArray(), 
Lines 1777-1783 Link Here
1777
/*
1991
/*
1778
 * Test for 'default' keyword.
1992
 * Test for 'default' keyword.
1779
 */
1993
 */
1780
public void test0043(){
1994
public void test0043_Diet(){
1781
	String str =
1995
	String str =
1782
		"package p;\n" +
1996
		"package p;\n" +
1783
		"public class X {\n" +
1997
		"public class X {\n" +
Lines 1814-1835 Link Here
1814
		completionIdentifier,
2028
		completionIdentifier,
1815
		expectedReplacedSource,
2029
		expectedReplacedSource,
1816
		"diet ast");
2030
		"diet ast");
1817
	
2031
}
1818
	expectedCompletionNodeToString = "<CompleteOnName:def>";
2032
/*
1819
	expectedParentNodeToString = "<NONE>";
2033
 * Test for 'default' keyword.
1820
	completionIdentifier = "def";
2034
 */
1821
	expectedReplacedSource = "def";
2035
public void test0043_Method(){
1822
	expectedUnitDisplayString =
2036
	String str =
1823
		"package p;\n" +
2037
		"package p;\n" +
1824
		"public class X {\n" +
2038
		"public class X {\n" +
1825
		"  public X() {\n" +
2039
		"  void foo(){\n" +
1826
		"  }\n" +
2040
		"     switch(0) {\n" +
1827
		"  void foo() {\n" +
2041
		"       case 1 : break;\n" +
1828
		"    {\n" +
2042
		"       def\n" +
1829
		"      <CompleteOnName:def>;\n" +
2043
		"     }\n" +
1830
		"    }\n" +
1831
		"  }\n" +
2044
		"  }\n" +
1832
		"}\n";
2045
		"}\n";
2046
2047
	String completeBehind = "def";
2048
	int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
2049
2050
	String expectedCompletionNodeToString = "<CompleteOnName:def>";
2051
	String expectedParentNodeToString = "<NONE>";
2052
	String completionIdentifier = "def";
2053
	String expectedReplacedSource = "def";
2054
	String expectedUnitDisplayString =
2055
			"package p;\n" +
2056
			"public class X {\n" +
2057
			"  public X() {\n" +
2058
			"  }\n" +
2059
			"  void foo() {\n" +
2060
			"    {\n" +
2061
			"      <CompleteOnName:def>;\n" +
2062
			"    }\n" +
2063
			"  }\n" +
2064
			"}\n";
1833
	
2065
	
1834
	checkMethodParse(
2066
	checkMethodParse(
1835
		str.toCharArray(), 
2067
		str.toCharArray(), 
Lines 1844-1850 Link Here
1844
/*
2076
/*
1845
 * Test for 'do' keyword.
2077
 * Test for 'do' keyword.
1846
 */
2078
 */
1847
public void test0044(){
2079
public void test0044_Diet(){
1848
	String str =
2080
	String str =
1849
		"package p;\n" +
2081
		"package p;\n" +
1850
		"public class X {\n" +
2082
		"public class X {\n" +
Lines 1878-1897 Link Here
1878
		completionIdentifier,
2110
		completionIdentifier,
1879
		expectedReplacedSource,
2111
		expectedReplacedSource,
1880
		"diet ast");
2112
		"diet ast");
1881
	
2113
}
1882
	expectedCompletionNodeToString = "<CompleteOnName:do>";
2114
/*
1883
	expectedParentNodeToString = "<NONE>";
2115
 * Test for 'do' keyword.
1884
	completionIdentifier = "do";
2116
 */
1885
	expectedReplacedSource = "do";
2117
public void test0044_Method(){
1886
	expectedUnitDisplayString =
2118
	String str =
1887
		"package p;\n" +
2119
		"package p;\n" +
1888
		"public class X {\n" +
2120
		"public class X {\n" +
1889
		"  public X() {\n" +
2121
		"  void foo(){\n" +
1890
		"  }\n" +
2122
		"     do\n" +
1891
		"  void foo() {\n" +
1892
		"    <CompleteOnName:do>;\n" +
1893
		"  }\n" +
2123
		"  }\n" +
1894
		"}\n";
2124
		"}\n";
2125
2126
	String completeBehind = "do";
2127
	int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
2128
2129
	String expectedCompletionNodeToString = "<CompleteOnName:do>";
2130
	String expectedParentNodeToString = "<NONE>";
2131
	String completionIdentifier = "do";
2132
	String expectedReplacedSource = "do";
2133
	String expectedUnitDisplayString =
2134
			"package p;\n" +
2135
			"public class X {\n" +
2136
			"  public X() {\n" +
2137
			"  }\n" +
2138
			"  void foo() {\n" +
2139
			"    <CompleteOnName:do>;\n" +
2140
			"  }\n" +
2141
			"}\n";
1895
	
2142
	
1896
	checkMethodParse(
2143
	checkMethodParse(
1897
		str.toCharArray(), 
2144
		str.toCharArray(), 
Lines 1906-1912 Link Here
1906
/*
2153
/*
1907
 * Test for 'else' keyword.
2154
 * Test for 'else' keyword.
1908
 */
2155
 */
1909
public void test0045(){
2156
public void test0045_Diet(){
1910
	String str =
2157
	String str =
1911
		"package p;\n" +
2158
		"package p;\n" +
1912
		"public class X {\n" +
2159
		"public class X {\n" +
Lines 1940-1959 Link Here
1940
		completionIdentifier,
2187
		completionIdentifier,
1941
		expectedReplacedSource,
2188
		expectedReplacedSource,
1942
		"diet ast");
2189
		"diet ast");
1943
	
2190
}
1944
	expectedCompletionNodeToString = "<CompleteOnName:els>";
2191
/*
1945
	expectedParentNodeToString = "<NONE>";
2192
 * Test for 'else' keyword.
1946
	completionIdentifier = "els";
2193
 */
1947
	expectedReplacedSource = "els";
2194
public void test0045_Method(){
1948
	expectedUnitDisplayString =
2195
	String str =
1949
		"package p;\n" +
2196
		"package p;\n" +
1950
		"public class X {\n" +
2197
		"public class X {\n" +
1951
		"  public X() {\n" +
2198
		"  void foo(){\n" +
1952
		"  }\n" +
2199
		"     els\n" +
1953
		"  void foo() {\n" +
1954
		"    <CompleteOnName:els>;\n" +
1955
		"  }\n" +
2200
		"  }\n" +
1956
		"}\n";
2201
		"}\n";
2202
2203
	String completeBehind = "els";
2204
	int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
2205
2206
	String expectedCompletionNodeToString = "<CompleteOnName:els>";
2207
	String expectedParentNodeToString = "<NONE>";
2208
	String completionIdentifier = "els";
2209
	String expectedReplacedSource = "els";
2210
	String expectedUnitDisplayString =
2211
			"package p;\n" +
2212
			"public class X {\n" +
2213
			"  public X() {\n" +
2214
			"  }\n" +
2215
			"  void foo() {\n" +
2216
			"    <CompleteOnName:els>;\n" +
2217
			"  }\n" +
2218
			"}\n";
1957
	
2219
	
1958
	checkMethodParse(
2220
	checkMethodParse(
1959
		str.toCharArray(), 
2221
		str.toCharArray(), 
Lines 1968-1974 Link Here
1968
/*
2230
/*
1969
 * Test for 'else' keyword.
2231
 * Test for 'else' keyword.
1970
 */
2232
 */
1971
public void test0046(){
2233
public void test0046_Diet(){
1972
	String str =
2234
	String str =
1973
		"package p;\n" +
2235
		"package p;\n" +
1974
		"public class X {\n" +
2236
		"public class X {\n" +
Lines 2003-2022 Link Here
2003
		completionIdentifier,
2265
		completionIdentifier,
2004
		expectedReplacedSource,
2266
		expectedReplacedSource,
2005
		"diet ast");
2267
		"diet ast");
2006
	
2268
}
2007
	expectedCompletionNodeToString = "<CompleteOnName:els>";
2269
/*
2008
	expectedParentNodeToString = "<NONE>";
2270
 * Test for 'else' keyword.
2009
	completionIdentifier = "els";
2271
 */
2010
	expectedReplacedSource = "els";
2272
public void test0046_Method(){
2011
	expectedUnitDisplayString =
2273
	String str =
2012
		"package p;\n" +
2274
		"package p;\n" +
2013
		"public class X {\n" +
2275
		"public class X {\n" +
2014
		"  public X() {\n" +
2276
		"  void foo(){\n" +
2015
		"  }\n" +
2277
		"     if(true) {\n" +
2016
		"  void foo() {\n" +
2278
		"     } els\n" +
2017
		"    <CompleteOnName:els>;\n" +
2018
		"  }\n" +
2279
		"  }\n" +
2019
		"}\n";
2280
		"}\n";
2281
2282
	String completeBehind = "els";
2283
	int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
2284
2285
	String expectedCompletionNodeToString = "<CompleteOnName:els>";
2286
	String expectedParentNodeToString = "<NONE>";
2287
	String completionIdentifier = "els";
2288
	String expectedReplacedSource = "els";
2289
	String expectedUnitDisplayString =
2290
			"package p;\n" +
2291
			"public class X {\n" +
2292
			"  public X() {\n" +
2293
			"  }\n" +
2294
			"  void foo() {\n" +
2295
			"    <CompleteOnName:els>;\n" +
2296
			"  }\n" +
2297
			"}\n";
2020
	
2298
	
2021
	checkMethodParse(
2299
	checkMethodParse(
2022
		str.toCharArray(), 
2300
		str.toCharArray(), 
Lines 2264-2270 Link Here
2264
/*
2542
/*
2265
 * Test for 'finally' keyword.
2543
 * Test for 'finally' keyword.
2266
 */
2544
 */
2267
public void test0055(){
2545
public void test0055_Diet(){
2268
	String str =
2546
	String str =
2269
		"package p;\n" +
2547
		"package p;\n" +
2270
		"public class X {\n" +
2548
		"public class X {\n" +
Lines 2298-2317 Link Here
2298
		completionIdentifier,
2576
		completionIdentifier,
2299
		expectedReplacedSource,
2577
		expectedReplacedSource,
2300
		"diet ast");
2578
		"diet ast");
2301
	
2579
}
2302
	expectedCompletionNodeToString = "<CompleteOnName:fin>";
2580
/*
2303
	expectedParentNodeToString = "<NONE>";
2581
 * Test for 'finally' keyword.
2304
	completionIdentifier = "fin";
2582
 */
2305
	expectedReplacedSource = "fin";
2583
public void test0055_Method(){
2306
	expectedUnitDisplayString =
2584
	String str =
2307
		"package p;\n" +
2585
		"package p;\n" +
2308
		"public class X {\n" +
2586
		"public class X {\n" +
2309
		"  public X() {\n" +
2587
		"  void foo(){\n" +
2310
		"  }\n" +
2588
		"     fin" +
2311
		"  void foo() {\n" +
2312
		"    <CompleteOnName:fin>;\n" +
2313
		"  }\n" +
2589
		"  }\n" +
2314
		"}\n";
2590
		"}\n";
2591
2592
	String completeBehind = "fin";
2593
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
2594
2595
	String expectedCompletionNodeToString = "<CompleteOnName:fin>";
2596
	String expectedParentNodeToString = "<NONE>";
2597
	String completionIdentifier = "fin";
2598
	String expectedReplacedSource = "fin";
2599
	String expectedUnitDisplayString =
2600
			"package p;\n" +
2601
			"public class X {\n" +
2602
			"  public X() {\n" +
2603
			"  }\n" +
2604
			"  void foo() {\n" +
2605
			"    <CompleteOnName:fin>;\n" +
2606
			"  }\n" +
2607
			"}\n";
2315
	
2608
	
2316
	checkMethodParse(
2609
	checkMethodParse(
2317
		str.toCharArray(), 
2610
		str.toCharArray(), 
Lines 2326-2332 Link Here
2326
/*
2619
/*
2327
 * Test for 'finally' keyword.
2620
 * Test for 'finally' keyword.
2328
 */
2621
 */
2329
public void test0056(){
2622
public void test0056_Diet(){
2330
	String str =
2623
	String str =
2331
		"package p;\n" +
2624
		"package p;\n" +
2332
		"public class X {\n" +
2625
		"public class X {\n" +
Lines 2361-2380 Link Here
2361
		completionIdentifier,
2654
		completionIdentifier,
2362
		expectedReplacedSource,
2655
		expectedReplacedSource,
2363
		"diet ast");
2656
		"diet ast");
2364
	
2657
}
2365
	expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
2658
/*
2366
	expectedParentNodeToString = "<NONE>";
2659
 * Test for 'finally' keyword.
2367
	completionIdentifier = "fin";
2660
 */
2368
	expectedReplacedSource = "fin";
2661
public void test0056_Method(){
2369
	expectedUnitDisplayString =
2662
	String str =
2370
		"package p;\n" +
2663
		"package p;\n" +
2371
		"public class X {\n" +
2664
		"public class X {\n" +
2372
		"  public X() {\n" +
2665
		"  void foo(){\n" +
2373
		"  }\n" +
2666
		"     try {" +
2374
		"  void foo() {\n" +
2667
		"     } fin" +
2375
		"    <CompleteOnKeyword:fin>;\n" +
2376
		"  }\n" +
2668
		"  }\n" +
2377
		"}\n";
2669
		"}\n";
2670
2671
	String completeBehind = "fin";
2672
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
2673
2674
	String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
2675
	String expectedParentNodeToString = "<NONE>";
2676
	String completionIdentifier = "fin";
2677
	String expectedReplacedSource = "fin";
2678
	String expectedUnitDisplayString =
2679
			"package p;\n" +
2680
			"public class X {\n" +
2681
			"  public X() {\n" +
2682
			"  }\n" +
2683
			"  void foo() {\n" +
2684
			"    <CompleteOnKeyword:fin>;\n" +
2685
			"  }\n" +
2686
			"}\n";
2378
	
2687
	
2379
	checkMethodParse(
2688
	checkMethodParse(
2380
		str.toCharArray(), 
2689
		str.toCharArray(), 
Lines 2389-2395 Link Here
2389
/*
2698
/*
2390
 * Test for 'for' keyword.
2699
 * Test for 'for' keyword.
2391
 */
2700
 */
2392
public void test0057(){
2701
public void test0057_Diet(){
2393
	String str =
2702
	String str =
2394
		"package p;\n" +
2703
		"package p;\n" +
2395
		"public class X {\n" +
2704
		"public class X {\n" +
Lines 2423-2442 Link Here
2423
		completionIdentifier,
2732
		completionIdentifier,
2424
		expectedReplacedSource,
2733
		expectedReplacedSource,
2425
		"diet ast");
2734
		"diet ast");
2426
	
2735
}
2427
	expectedCompletionNodeToString = "<CompleteOnName:for>";
2736
/*
2428
	expectedParentNodeToString = "<NONE>";
2737
 * Test for 'for' keyword.
2429
	completionIdentifier = "for";
2738
 */
2430
	expectedReplacedSource = "for";
2739
public void test0057_Method(){
2431
	expectedUnitDisplayString =
2740
	String str =
2432
		"package p;\n" +
2741
		"package p;\n" +
2433
		"public class X {\n" +
2742
		"public class X {\n" +
2434
		"  public X() {\n" +
2743
		"  void foo(){\n" +
2435
		"  }\n" +
2744
		"     for" +
2436
		"  void foo() {\n" +
2437
		"    <CompleteOnName:for>;\n" +
2438
		"  }\n" +
2745
		"  }\n" +
2439
		"}\n";
2746
		"}\n";
2747
2748
	String completeBehind = "for";
2749
	int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
2750
2751
	String expectedCompletionNodeToString = "<CompleteOnName:for>";
2752
	String expectedParentNodeToString = "<NONE>";
2753
	String completionIdentifier = "for";
2754
	String expectedReplacedSource = "for";
2755
	String expectedUnitDisplayString =
2756
			"package p;\n" +
2757
			"public class X {\n" +
2758
			"  public X() {\n" +
2759
			"  }\n" +
2760
			"  void foo() {\n" +
2761
			"    <CompleteOnName:for>;\n" +
2762
			"  }\n" +
2763
			"}\n";
2440
	
2764
	
2441
	checkMethodParse(
2765
	checkMethodParse(
2442
		str.toCharArray(), 
2766
		str.toCharArray(), 
Lines 2451-2457 Link Here
2451
/*
2775
/*
2452
 * Test for 'if' keyword.
2776
 * Test for 'if' keyword.
2453
 */
2777
 */
2454
public void test0058(){
2778
public void test0058_Diet(){
2455
	String str =
2779
	String str =
2456
		"package p;\n" +
2780
		"package p;\n" +
2457
		"public class X {\n" +
2781
		"public class X {\n" +
Lines 2485-2504 Link Here
2485
		completionIdentifier,
2809
		completionIdentifier,
2486
		expectedReplacedSource,
2810
		expectedReplacedSource,
2487
		"diet ast");
2811
		"diet ast");
2488
	
2812
}
2489
	expectedCompletionNodeToString = "<CompleteOnName:if>";
2813
/*
2490
	expectedParentNodeToString = "<NONE>";
2814
 * Test for 'if' keyword.
2491
	completionIdentifier = "if";
2815
 */
2492
	expectedReplacedSource = "if";
2816
public void test0058_Method(){
2493
	expectedUnitDisplayString =
2817
	String str =
2494
		"package p;\n" +
2818
		"package p;\n" +
2495
		"public class X {\n" +
2819
		"public class X {\n" +
2496
		"  public X() {\n" +
2820
		"  void foo(){\n" +
2497
		"  }\n" +
2821
		"     if" +
2498
		"  void foo() {\n" +
2499
		"    <CompleteOnName:if>;\n" +
2500
		"  }\n" +
2822
		"  }\n" +
2501
		"}\n";
2823
		"}\n";
2824
2825
	String completeBehind = "if";
2826
	int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
2827
2828
	String expectedCompletionNodeToString = "<CompleteOnName:if>";
2829
	String expectedParentNodeToString = "<NONE>";
2830
	String completionIdentifier = "if";
2831
	String expectedReplacedSource = "if";
2832
	String expectedUnitDisplayString =
2833
			"package p;\n" +
2834
			"public class X {\n" +
2835
			"  public X() {\n" +
2836
			"  }\n" +
2837
			"  void foo() {\n" +
2838
			"    <CompleteOnName:if>;\n" +
2839
			"  }\n" +
2840
			"}\n";
2502
	
2841
	
2503
	checkMethodParse(
2842
	checkMethodParse(
2504
		str.toCharArray(), 
2843
		str.toCharArray(), 
Lines 2513-2519 Link Here
2513
/*
2852
/*
2514
 * Test for 'switch' keyword.
2853
 * Test for 'switch' keyword.
2515
 */
2854
 */
2516
public void test0059(){
2855
public void test0059_Diet(){
2517
	String str =
2856
	String str =
2518
		"package p;\n" +
2857
		"package p;\n" +
2519
		"public class X {\n" +
2858
		"public class X {\n" +
Lines 2547-2566 Link Here
2547
		completionIdentifier,
2886
		completionIdentifier,
2548
		expectedReplacedSource,
2887
		expectedReplacedSource,
2549
		"diet ast");
2888
		"diet ast");
2550
	
2889
}
2551
	expectedCompletionNodeToString = "<CompleteOnName:swi>";
2890
/*
2552
	expectedParentNodeToString = "<NONE>";
2891
 * Test for 'switch' keyword.
2553
	completionIdentifier = "swi";
2892
 */
2554
	expectedReplacedSource = "swi";
2893
public void test0059_Method(){
2555
	expectedUnitDisplayString =
2894
	String str =
2556
		"package p;\n" +
2895
		"package p;\n" +
2557
		"public class X {\n" +
2896
		"public class X {\n" +
2558
		"  public X() {\n" +
2897
		"  void foo(){\n" +
2559
		"  }\n" +
2898
		"     swi" +
2560
		"  void foo() {\n" +
2561
		"    <CompleteOnName:swi>;\n" +
2562
		"  }\n" +
2899
		"  }\n" +
2563
		"}\n";
2900
		"}\n";
2901
2902
	String completeBehind = "swi";
2903
	int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
2904
2905
	String expectedCompletionNodeToString = "<CompleteOnName:swi>";
2906
	String expectedParentNodeToString = "<NONE>";
2907
	String completionIdentifier = "swi";
2908
	String expectedReplacedSource = "swi";
2909
	String expectedUnitDisplayString =
2910
			"package p;\n" +
2911
			"public class X {\n" +
2912
			"  public X() {\n" +
2913
			"  }\n" +
2914
			"  void foo() {\n" +
2915
			"    <CompleteOnName:swi>;\n" +
2916
			"  }\n" +
2917
			"}\n";
2564
	
2918
	
2565
	checkMethodParse(
2919
	checkMethodParse(
2566
		str.toCharArray(), 
2920
		str.toCharArray(), 
Lines 3162-3168 Link Here
3162
/*
3516
/*
3163
 * Test for 'interface' keyword.
3517
 * Test for 'interface' keyword.
3164
 */
3518
 */
3165
public void test0080(){
3519
public void test0080_Diet(){
3166
	String str =
3520
	String str =
3167
		"public class X {\n" +
3521
		"public class X {\n" +
3168
		"  void foo() {\n" +
3522
		"  void foo() {\n" +
Lines 3194-3212 Link Here
3194
		completionIdentifier,
3548
		completionIdentifier,
3195
		expectedReplacedSource,
3549
		expectedReplacedSource,
3196
		"diet ast");
3550
		"diet ast");
3197
	
3551
}
3198
	expectedCompletionNodeToString = "<CompleteOnName:int>";
3552
/*
3199
	expectedParentNodeToString = "<NONE>";
3553
 * Test for 'interface' keyword.
3200
	completionIdentifier = "int";
3554
 */
3201
	expectedReplacedSource = "int";
3555
public void test0080_Method(){
3202
	expectedUnitDisplayString =
3556
	String str =
3203
		"public class X {\n" +
3557
		"public class X {\n" +
3204
		"  public X() {\n" +
3205
		"  }\n" +
3206
		"  void foo() {\n" +
3558
		"  void foo() {\n" +
3207
		"    <CompleteOnName:int>;\n" +
3559
		"    int\n" +
3208
		"  }\n" +
3560
		"  }\n" +
3209
		"}\n";
3561
		"}";
3562
3563
	String completeBehind = "int";
3564
	int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
3565
3566
	String expectedCompletionNodeToString = "<CompleteOnName:int>";
3567
	String expectedParentNodeToString = "<NONE>";
3568
	String completionIdentifier = "int";
3569
	String expectedReplacedSource = "int";
3570
	String expectedUnitDisplayString =
3571
			"public class X {\n" +
3572
			"  public X() {\n" +
3573
			"  }\n" +
3574
			"  void foo() {\n" +
3575
			"    <CompleteOnName:int>;\n" +
3576
			"  }\n" +
3577
			"}\n";
3210
	
3578
	
3211
	checkMethodParse(
3579
	checkMethodParse(
3212
		str.toCharArray(), 
3580
		str.toCharArray(), 
Lines 3221-3227 Link Here
3221
/*
3589
/*
3222
 * Test for 'interface' keyword.
3590
 * Test for 'interface' keyword.
3223
 */
3591
 */
3224
public void test0081(){
3592
public void test0081_Diet(){
3225
	String str =
3593
	String str =
3226
		"public class X {\n" +
3594
		"public class X {\n" +
3227
		"  void foo() {\n" +
3595
		"  void foo() {\n" +
Lines 3253-3271 Link Here
3253
		completionIdentifier,
3621
		completionIdentifier,
3254
		expectedReplacedSource,
3622
		expectedReplacedSource,
3255
		"diet ast");
3623
		"diet ast");
3256
	
3624
}
3257
	expectedCompletionNodeToString = "<CompleteOnName:int>";
3625
/*
3258
	expectedParentNodeToString = "<NONE>";
3626
 * Test for 'interface' keyword.
3259
	completionIdentifier = "int";
3627
 */
3260
	expectedReplacedSource = "int";
3628
public void test0081_Method(){
3261
	expectedUnitDisplayString =
3629
	String str =
3262
		"public class X {\n" +
3630
		"public class X {\n" +
3263
		"  public X() {\n" +
3264
		"  }\n" +
3265
		"  void foo() {\n" +
3631
		"  void foo() {\n" +
3266
		"    <CompleteOnName:int>;\n" +
3632
		"    abstract int\n" +
3267
		"  }\n" +
3633
		"  }\n" +
3268
		"}\n";
3634
		"}";
3635
3636
	String completeBehind = "int";
3637
	int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
3638
3639
	String expectedCompletionNodeToString = "<CompleteOnName:int>";
3640
	String expectedParentNodeToString = "<NONE>";
3641
	String completionIdentifier = "int";
3642
	String expectedReplacedSource = "int";
3643
	String expectedUnitDisplayString =
3644
			"public class X {\n" +
3645
			"  public X() {\n" +
3646
			"  }\n" +
3647
			"  void foo() {\n" +
3648
			"    <CompleteOnName:int>;\n" +
3649
			"  }\n" +
3650
			"}\n";
3269
	
3651
	
3270
	checkMethodParse(
3652
	checkMethodParse(
3271
		str.toCharArray(), 
3653
		str.toCharArray(), 
Lines 3280-3286 Link Here
3280
/*
3662
/*
3281
 * Test for 'interface' keyword.
3663
 * Test for 'interface' keyword.
3282
 */
3664
 */
3283
public void test0082(){
3665
public void test0082_Diet(){
3284
	String str =
3666
	String str =
3285
		"public class X {\n" +
3667
		"public class X {\n" +
3286
		"  void foo() {\n" +
3668
		"  void foo() {\n" +
Lines 3312-3330 Link Here
3312
		completionIdentifier,
3694
		completionIdentifier,
3313
		expectedReplacedSource,
3695
		expectedReplacedSource,
3314
		"diet ast");
3696
		"diet ast");
3315
	
3697
}
3316
	expectedCompletionNodeToString = "<CompleteOnName:int>";
3698
/*
3317
	expectedParentNodeToString = "<NONE>";
3699
 * Test for 'interface' keyword.
3318
	completionIdentifier = "int";
3700
 */
3319
	expectedReplacedSource = "int";
3701
public void test0082_Method(){
3320
	expectedUnitDisplayString =
3702
	String str =
3321
		"public class X {\n" +
3703
		"public class X {\n" +
3322
		"  public X() {\n" +
3323
		"  }\n" +
3324
		"  void foo() {\n" +
3704
		"  void foo() {\n" +
3325
		"    <CompleteOnName:int>;\n" +
3705
		"    abstract int Y\n" +
3326
		"  }\n" +
3706
		"  }\n" +
3327
		"}\n";
3707
		"}";
3708
3709
	String completeBehind = "int";
3710
	int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
3711
3712
	String expectedCompletionNodeToString = "<CompleteOnName:int>";
3713
	String expectedParentNodeToString = "<NONE>";
3714
	String completionIdentifier = "int";
3715
	String expectedReplacedSource = "int";
3716
	String expectedUnitDisplayString =
3717
			"public class X {\n" +
3718
			"  public X() {\n" +
3719
			"  }\n" +
3720
			"  void foo() {\n" +
3721
			"    <CompleteOnName:int>;\n" +
3722
			"  }\n" +
3723
			"}\n";
3328
	
3724
	
3329
	checkMethodParse(
3725
	checkMethodParse(
3330
		str.toCharArray(), 
3726
		str.toCharArray(), 
Lines 3537-3543 Link Here
3537
/*
3933
/*
3538
 * Test for 'return' keyword.
3934
 * Test for 'return' keyword.
3539
 */
3935
 */
3540
public void test0090(){
3936
public void test0090_Diet(){
3541
	String str =
3937
	String str =
3542
		"public class X {\n" +
3938
		"public class X {\n" +
3543
		"  int foo() {\n" +
3939
		"  int foo() {\n" +
Lines 3569-3587 Link Here
3569
		completionIdentifier,
3965
		completionIdentifier,
3570
		expectedReplacedSource,
3966
		expectedReplacedSource,
3571
		"diet ast");
3967
		"diet ast");
3572
	
3968
}
3573
	expectedCompletionNodeToString = "<CompleteOnName:ret>";
3969
/*
3574
	expectedParentNodeToString = "<NONE>";
3970
 * Test for 'return' keyword.
3575
	completionIdentifier = "ret";
3971
 */
3576
	expectedReplacedSource = "ret";
3972
public void test0090_Method(){
3577
	expectedUnitDisplayString =
3973
	String str =
3578
		"public class X {\n" +
3974
		"public class X {\n" +
3579
		"  public X() {\n" +
3580
		"  }\n" +
3581
		"  int foo() {\n" +
3975
		"  int foo() {\n" +
3582
		"    <CompleteOnName:ret>;\n" +
3976
		"    ret\n" +
3583
		"  }\n" +
3977
		"  }\n" +
3584
		"}\n";
3978
		"}";
3979
3980
	String completeBehind = "ret";
3981
	int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1;
3982
3983
	String expectedCompletionNodeToString = "<CompleteOnName:ret>";
3984
	String expectedParentNodeToString = "<NONE>";
3985
	String completionIdentifier = "ret";
3986
	String expectedReplacedSource = "ret";
3987
	String expectedUnitDisplayString =
3988
			"public class X {\n" +
3989
			"  public X() {\n" +
3990
			"  }\n" +
3991
			"  int foo() {\n" +
3992
			"    <CompleteOnName:ret>;\n" +
3993
			"  }\n" +
3994
			"}\n";
3585
	
3995
	
3586
	checkMethodParse(
3996
	checkMethodParse(
3587
		str.toCharArray(), 
3997
		str.toCharArray(), 
Lines 3596-3602 Link Here
3596
/*
4006
/*
3597
 * Test for 'throw' keyword.
4007
 * Test for 'throw' keyword.
3598
 */
4008
 */
3599
public void test0091(){
4009
public void test0091_Diet(){
3600
	String str =
4010
	String str =
3601
		"public class X {\n" +
4011
		"public class X {\n" +
3602
		"  void foo() {\n" +
4012
		"  void foo() {\n" +
Lines 3628-3646 Link Here
3628
		completionIdentifier,
4038
		completionIdentifier,
3629
		expectedReplacedSource,
4039
		expectedReplacedSource,
3630
		"diet ast");
4040
		"diet ast");
3631
	
4041
}
3632
	expectedCompletionNodeToString = "<CompleteOnName:thr>";
4042
/*
3633
	expectedParentNodeToString = "<NONE>";
4043
 * Test for 'throw' keyword.
3634
	completionIdentifier = "thr";
4044
 */
3635
	expectedReplacedSource = "thr";
4045
public void test0091_Method(){
3636
	expectedUnitDisplayString =
4046
	String str =
3637
		"public class X {\n" +
4047
		"public class X {\n" +
3638
		"  public X() {\n" +
3639
		"  }\n" +
3640
		"  void foo() {\n" +
4048
		"  void foo() {\n" +
3641
		"    <CompleteOnName:thr>;\n" +
4049
		"    thr\n" +
3642
		"  }\n" +
4050
		"  }\n" +
3643
		"}\n";
4051
		"}";
4052
4053
	String completeBehind = "thr";
4054
	int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
4055
4056
	String expectedCompletionNodeToString = "<CompleteOnName:thr>";
4057
	String expectedParentNodeToString = "<NONE>";
4058
	String completionIdentifier = "thr";
4059
	String expectedReplacedSource = "thr";
4060
	String expectedUnitDisplayString =
4061
			"public class X {\n" +
4062
			"  public X() {\n" +
4063
			"  }\n" +
4064
			"  void foo() {\n" +
4065
			"    <CompleteOnName:thr>;\n" +
4066
			"  }\n" +
4067
			"}\n";
3644
	
4068
	
3645
	checkMethodParse(
4069
	checkMethodParse(
3646
		str.toCharArray(), 
4070
		str.toCharArray(), 
Lines 3655-3661 Link Here
3655
/*
4079
/*
3656
 * Test for 'try' keyword.
4080
 * Test for 'try' keyword.
3657
 */
4081
 */
3658
public void test0092(){
4082
public void test0092_Diet(){
3659
	String str =
4083
	String str =
3660
		"public class X {\n" +
4084
		"public class X {\n" +
3661
		"  void foo() {\n" +
4085
		"  void foo() {\n" +
Lines 3687-3705 Link Here
3687
		completionIdentifier,
4111
		completionIdentifier,
3688
		expectedReplacedSource,
4112
		expectedReplacedSource,
3689
		"diet ast");
4113
		"diet ast");
3690
	
4114
}
3691
	expectedCompletionNodeToString = "<CompleteOnName:try>";
4115
/*
3692
	expectedParentNodeToString = "<NONE>";
4116
 * Test for 'try' keyword.
3693
	completionIdentifier = "try";
4117
 */
3694
	expectedReplacedSource = "try";
4118
public void test0092_Method(){
3695
	expectedUnitDisplayString =
4119
	String str =
3696
		"public class X {\n" +
4120
		"public class X {\n" +
3697
		"  public X() {\n" +
3698
		"  }\n" +
3699
		"  void foo() {\n" +
4121
		"  void foo() {\n" +
3700
		"    <CompleteOnName:try>;\n" +
4122
		"    try\n" +
3701
		"  }\n" +
4123
		"  }\n" +
3702
		"}\n";
4124
		"}";
4125
4126
	String completeBehind = "try";
4127
	int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
4128
4129
	String expectedCompletionNodeToString = "<CompleteOnName:try>";
4130
	String expectedParentNodeToString = "<NONE>";
4131
	String completionIdentifier = "try";
4132
	String expectedReplacedSource = "try";
4133
	String expectedUnitDisplayString =
4134
			"public class X {\n" +
4135
			"  public X() {\n" +
4136
			"  }\n" +
4137
			"  void foo() {\n" +
4138
			"    <CompleteOnName:try>;\n" +
4139
			"  }\n" +
4140
			"}\n";
3703
	
4141
	
3704
	checkMethodParse(
4142
	checkMethodParse(
3705
		str.toCharArray(), 
4143
		str.toCharArray(), 
Lines 3714-3720 Link Here
3714
/*
4152
/*
3715
 * Test for 'try' keyword.
4153
 * Test for 'try' keyword.
3716
 */
4154
 */
3717
public void test0093(){
4155
public void test0093_Diet(){
3718
	String str =
4156
	String str =
3719
		"public class X {\n" +
4157
		"public class X {\n" +
3720
		"  void foo() {\n" +
4158
		"  void foo() {\n" +
Lines 3746-3764 Link Here
3746
		completionIdentifier,
4184
		completionIdentifier,
3747
		expectedReplacedSource,
4185
		expectedReplacedSource,
3748
		"diet ast");
4186
		"diet ast");
3749
	
4187
}
3750
	expectedCompletionNodeToString = "<CompleteOnName:try>";
4188
/*
3751
	expectedParentNodeToString = "<NONE>";
4189
 * Test for 'try' keyword.
3752
	completionIdentifier = "try";
4190
 */
3753
	expectedReplacedSource = "try";
4191
public void test0093_Method(){
3754
	expectedUnitDisplayString =
4192
	String str =
3755
		"public class X {\n" +
4193
		"public class X {\n" +
3756
		"  public X() {\n" +
3757
		"  }\n" +
3758
		"  void foo() {\n" +
4194
		"  void foo() {\n" +
3759
		"    <CompleteOnName:try>;\n" +
4195
		"    if(try\n" +
3760
		"  }\n" +
4196
		"  }\n" +
3761
		"}\n";
4197
		"}";
4198
4199
	String completeBehind = "try";
4200
	int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
4201
4202
	String expectedCompletionNodeToString = "<CompleteOnName:try>";
4203
	String expectedParentNodeToString = "<NONE>";
4204
	String completionIdentifier = "try";
4205
	String expectedReplacedSource = "try";
4206
	String expectedUnitDisplayString =
4207
			"public class X {\n" +
4208
			"  public X() {\n" +
4209
			"  }\n" +
4210
			"  void foo() {\n" +
4211
			"    <CompleteOnName:try>;\n" +
4212
			"  }\n" +
4213
			"}\n";
3762
	
4214
	
3763
	checkMethodParse(
4215
	checkMethodParse(
3764
		str.toCharArray(), 
4216
		str.toCharArray(), 
Lines 3773-3779 Link Here
3773
/*
4225
/*
3774
 * Test for 'do' keyword.
4226
 * Test for 'do' keyword.
3775
 */
4227
 */
3776
public void test0094(){
4228
public void test0094_Diet(){
3777
	String str =
4229
	String str =
3778
		"public class X {\n" +
4230
		"public class X {\n" +
3779
		"  void foo() {\n" +
4231
		"  void foo() {\n" +
Lines 3805-3823 Link Here
3805
		completionIdentifier,
4257
		completionIdentifier,
3806
		expectedReplacedSource,
4258
		expectedReplacedSource,
3807
		"diet ast");
4259
		"diet ast");
3808
	
4260
}
3809
	expectedCompletionNodeToString = "<CompleteOnName:do>";
4261
/*
3810
	expectedParentNodeToString = "<NONE>";
4262
 * Test for 'do' keyword.
3811
	completionIdentifier = "do";
4263
 */
3812
	expectedReplacedSource = "do";
4264
public void test0094_Method(){
3813
	expectedUnitDisplayString =
4265
	String str =
3814
		"public class X {\n" +
4266
		"public class X {\n" +
3815
		"  public X() {\n" +
3816
		"  }\n" +
3817
		"  void foo() {\n" +
4267
		"  void foo() {\n" +
3818
		"    <CompleteOnName:do>;\n" +
4268
		"    if(do\n" +
3819
		"  }\n" +
4269
		"  }\n" +
3820
		"}\n";
4270
		"}";
4271
4272
	String completeBehind = "do";
4273
	int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
4274
4275
	String expectedCompletionNodeToString = "<CompleteOnName:do>";
4276
	String expectedParentNodeToString = "<NONE>";
4277
	String completionIdentifier = "do";
4278
	String expectedReplacedSource = "do";
4279
	String expectedUnitDisplayString =
4280
			"public class X {\n" +
4281
			"  public X() {\n" +
4282
			"  }\n" +
4283
			"  void foo() {\n" +
4284
			"    <CompleteOnName:do>;\n" +
4285
			"  }\n" +
4286
			"}\n";
3821
	
4287
	
3822
	checkMethodParse(
4288
	checkMethodParse(
3823
		str.toCharArray(), 
4289
		str.toCharArray(), 
Lines 3832-3838 Link Here
3832
/*
4298
/*
3833
 * Test for 'for' keyword.
4299
 * Test for 'for' keyword.
3834
 */
4300
 */
3835
public void test0095(){
4301
public void test0095_Diet(){
3836
	String str =
4302
	String str =
3837
		"public class X {\n" +
4303
		"public class X {\n" +
3838
		"  void foo() {\n" +
4304
		"  void foo() {\n" +
Lines 3864-3882 Link Here
3864
		completionIdentifier,
4330
		completionIdentifier,
3865
		expectedReplacedSource,
4331
		expectedReplacedSource,
3866
		"diet ast");
4332
		"diet ast");
3867
	
4333
}
3868
	expectedCompletionNodeToString = "<CompleteOnName:for>";
4334
/*
3869
	expectedParentNodeToString = "<NONE>";
4335
 * Test for 'for' keyword.
3870
	completionIdentifier = "for";
4336
 */
3871
	expectedReplacedSource = "for";
4337
public void test0095_Method(){
3872
	expectedUnitDisplayString =
4338
	String str =
3873
		"public class X {\n" +
4339
		"public class X {\n" +
3874
		"  public X() {\n" +
3875
		"  }\n" +
3876
		"  void foo() {\n" +
4340
		"  void foo() {\n" +
3877
		"    <CompleteOnName:for>;\n" +
4341
		"    if(for\n" +
3878
		"  }\n" +
4342
		"  }\n" +
3879
		"}\n";
4343
		"}";
4344
4345
	String completeBehind = "for";
4346
	int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
4347
4348
	String expectedCompletionNodeToString = "<CompleteOnName:for>";
4349
	String expectedParentNodeToString = "<NONE>";
4350
	String completionIdentifier = "for";
4351
	String expectedReplacedSource = "for";
4352
	String expectedUnitDisplayString =
4353
			"public class X {\n" +
4354
			"  public X() {\n" +
4355
			"  }\n" +
4356
			"  void foo() {\n" +
4357
			"    <CompleteOnName:for>;\n" +
4358
			"  }\n" +
4359
			"}\n";
3880
	
4360
	
3881
	checkMethodParse(
4361
	checkMethodParse(
3882
		str.toCharArray(), 
4362
		str.toCharArray(), 
Lines 3891-3897 Link Here
3891
/*
4371
/*
3892
 * Test for 'if' keyword.
4372
 * Test for 'if' keyword.
3893
 */
4373
 */
3894
public void test0096(){
4374
public void test0096_Diet(){
3895
	String str =
4375
	String str =
3896
		"public class X {\n" +
4376
		"public class X {\n" +
3897
		"  void foo() {\n" +
4377
		"  void foo() {\n" +
Lines 3923-3941 Link Here
3923
		completionIdentifier,
4403
		completionIdentifier,
3924
		expectedReplacedSource,
4404
		expectedReplacedSource,
3925
		"diet ast");
4405
		"diet ast");
3926
	
4406
}
3927
	expectedCompletionNodeToString = "<CompleteOnName:if>";
4407
/*
3928
	expectedParentNodeToString = "<NONE>";
4408
 * Test for 'if' keyword.
3929
	completionIdentifier = "if";
4409
 */
3930
	expectedReplacedSource = "if";
4410
public void test0096_Method(){
3931
	expectedUnitDisplayString =
4411
	String str =
3932
		"public class X {\n" +
4412
		"public class X {\n" +
3933
		"  public X() {\n" +
3934
		"  }\n" +
3935
		"  void foo() {\n" +
4413
		"  void foo() {\n" +
3936
		"    <CompleteOnName:if>;\n" +
4414
		"    if(if\n" +
3937
		"  }\n" +
4415
		"  }\n" +
3938
		"}\n";
4416
		"}";
4417
4418
	String completeBehind = "if";
4419
	int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
4420
4421
	String expectedCompletionNodeToString = "<CompleteOnName:if>";
4422
	String expectedParentNodeToString = "<NONE>";
4423
	String completionIdentifier = "if";
4424
	String expectedReplacedSource = "if";
4425
	String expectedUnitDisplayString =
4426
			"public class X {\n" +
4427
			"  public X() {\n" +
4428
			"  }\n" +
4429
			"  void foo() {\n" +
4430
			"    <CompleteOnName:if>;\n" +
4431
			"  }\n" +
4432
			"}\n";
3939
	
4433
	
3940
	checkMethodParse(
4434
	checkMethodParse(
3941
		str.toCharArray(), 
4435
		str.toCharArray(), 
Lines 3950-3956 Link Here
3950
/*
4444
/*
3951
 * Test for 'switch' keyword.
4445
 * Test for 'switch' keyword.
3952
 */
4446
 */
3953
public void test0097(){
4447
public void test0097_Diet(){
3954
	String str =
4448
	String str =
3955
		"public class X {\n" +
4449
		"public class X {\n" +
3956
		"  void foo() {\n" +
4450
		"  void foo() {\n" +
Lines 3982-4000 Link Here
3982
		completionIdentifier,
4476
		completionIdentifier,
3983
		expectedReplacedSource,
4477
		expectedReplacedSource,
3984
		"diet ast");
4478
		"diet ast");
3985
	
4479
}
3986
	expectedCompletionNodeToString = "<CompleteOnName:swi>";
4480
/*
3987
	expectedParentNodeToString = "<NONE>";
4481
 * Test for 'switch' keyword.
3988
	completionIdentifier = "swi";
4482
 */
3989
	expectedReplacedSource = "swi";
4483
public void test0097_Method(){
3990
	expectedUnitDisplayString =
4484
	String str =
3991
		"public class X {\n" +
4485
		"public class X {\n" +
3992
		"  public X() {\n" +
3993
		"  }\n" +
3994
		"  void foo() {\n" +
4486
		"  void foo() {\n" +
3995
		"    <CompleteOnName:swi>;\n" +
4487
		"    if(swi\n" +
3996
		"  }\n" +
4488
		"  }\n" +
3997
		"}\n";
4489
		"}";
4490
4491
	String completeBehind = "swi";
4492
	int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
4493
4494
	String expectedCompletionNodeToString = "<CompleteOnName:swi>";
4495
	String expectedParentNodeToString = "<NONE>";
4496
	String completionIdentifier = "swi";
4497
	String expectedReplacedSource = "swi";
4498
	String expectedUnitDisplayString =
4499
			"public class X {\n" +
4500
			"  public X() {\n" +
4501
			"  }\n" +
4502
			"  void foo() {\n" +
4503
			"    <CompleteOnName:swi>;\n" +
4504
			"  }\n" +
4505
			"}\n";
3998
	
4506
	
3999
	checkMethodParse(
4507
	checkMethodParse(
4000
		str.toCharArray(), 
4508
		str.toCharArray(), 
Lines 4009-4015 Link Here
4009
/*
4517
/*
4010
 * Test for 'new' keyword.
4518
 * Test for 'new' keyword.
4011
 */
4519
 */
4012
public void test0098(){
4520
public void test0098_Diet(){
4013
	String str =
4521
	String str =
4014
		"public class X {\n" +
4522
		"public class X {\n" +
4015
		"  void foo() {\n" +
4523
		"  void foo() {\n" +
Lines 4041-4059 Link Here
4041
		completionIdentifier,
4549
		completionIdentifier,
4042
		expectedReplacedSource,
4550
		expectedReplacedSource,
4043
		"diet ast");
4551
		"diet ast");
4044
	
4552
}
4045
	expectedCompletionNodeToString = "<CompleteOnName:new>";
4553
/*
4046
	expectedParentNodeToString = "<NONE>";
4554
 * Test for 'new' keyword.
4047
	completionIdentifier = "new";
4555
 */
4048
	expectedReplacedSource = "new";
4556
public void test0098_Method(){
4049
	expectedUnitDisplayString =
4557
	String str =
4050
		"public class X {\n" +
4558
		"public class X {\n" +
4051
		"  public X() {\n" +
4052
		"  }\n" +
4053
		"  void foo() {\n" +
4559
		"  void foo() {\n" +
4054
		"    <CompleteOnName:new>;\n" +
4560
		"    new\n" +
4055
		"  }\n" +
4561
		"  }\n" +
4056
		"}\n";
4562
		"}";
4563
4564
	String completeBehind = "new";
4565
	int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
4566
4567
	String expectedCompletionNodeToString = "<CompleteOnName:new>";
4568
	String expectedParentNodeToString = "<NONE>";
4569
	String completionIdentifier = "new";
4570
	String expectedReplacedSource = "new";
4571
	String expectedUnitDisplayString =
4572
			"public class X {\n" +
4573
			"  public X() {\n" +
4574
			"  }\n" +
4575
			"  void foo() {\n" +
4576
			"    <CompleteOnName:new>;\n" +
4577
			"  }\n" +
4578
			"}\n";
4057
	
4579
	
4058
	checkMethodParse(
4580
	checkMethodParse(
4059
		str.toCharArray(), 
4581
		str.toCharArray(), 
Lines 4068-4074 Link Here
4068
/*
4590
/*
4069
 * Test for 'new' keyword.
4591
 * Test for 'new' keyword.
4070
 */
4592
 */
4071
public void test0099(){
4593
public void test0099_Diet(){
4072
	String str =
4594
	String str =
4073
		"public class X {\n" +
4595
		"public class X {\n" +
4074
		"  void foo() {\n" +
4596
		"  void foo() {\n" +
Lines 4100-4118 Link Here
4100
		completionIdentifier,
4622
		completionIdentifier,
4101
		expectedReplacedSource,
4623
		expectedReplacedSource,
4102
		"diet ast");
4624
		"diet ast");
4103
	
4625
}
4104
	expectedCompletionNodeToString = "<CompleteOnName:new>";
4626
/*
4105
	expectedParentNodeToString = "<NONE>";
4627
 * Test for 'new' keyword.
4106
	completionIdentifier = "new";
4628
 */
4107
	expectedReplacedSource = "new";
4629
public void test0099_Method(){
4108
	expectedUnitDisplayString =
4630
	String str =
4109
		"public class X {\n" +
4631
		"public class X {\n" +
4110
		"  public X() {\n" +
4111
		"  }\n" +
4112
		"  void foo() {\n" +
4632
		"  void foo() {\n" +
4113
		"    <CompleteOnName:new>;\n" +
4633
		"    new X\n" +
4114
		"  }\n" +
4634
		"  }\n" +
4115
		"}\n";
4635
		"}";
4636
4637
	String completeBehind = "new";
4638
	int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
4639
4640
	String expectedCompletionNodeToString = "<CompleteOnName:new>";
4641
	String expectedParentNodeToString = "<NONE>";
4642
	String completionIdentifier = "new";
4643
	String expectedReplacedSource = "new";
4644
	String expectedUnitDisplayString =
4645
			"public class X {\n" +
4646
			"  public X() {\n" +
4647
			"  }\n" +
4648
			"  void foo() {\n" +
4649
			"    <CompleteOnName:new>;\n" +
4650
			"  }\n" +
4651
			"}\n";
4116
	
4652
	
4117
	checkMethodParse(
4653
	checkMethodParse(
4118
		str.toCharArray(), 
4654
		str.toCharArray(), 
Lines 4127-4133 Link Here
4127
/*
4663
/*
4128
 * Test for 'new' keyword.
4664
 * Test for 'new' keyword.
4129
 */
4665
 */
4130
public void test0100(){
4666
public void test0100_Diet(){
4131
	String str =
4667
	String str =
4132
		"public class X {\n" +
4668
		"public class X {\n" +
4133
		"  void foo() {\n" +
4669
		"  void foo() {\n" +
Lines 4159-4177 Link Here
4159
		completionIdentifier,
4695
		completionIdentifier,
4160
		expectedReplacedSource,
4696
		expectedReplacedSource,
4161
		"diet ast");
4697
		"diet ast");
4162
	
4698
}
4163
	expectedCompletionNodeToString = "<CompleteOnName:new>";
4699
/*
4164
	expectedParentNodeToString = "<NONE>";
4700
 * Test for 'new' keyword.
4165
	completionIdentifier = "new";
4701
 */
4166
	expectedReplacedSource = "new";
4702
public void test0100_Method(){
4167
	expectedUnitDisplayString =
4703
	String str =
4168
		"public class X {\n" +
4704
		"public class X {\n" +
4169
		"  public X() {\n" +
4170
		"  }\n" +
4171
		"  void foo() {\n" +
4705
		"  void foo() {\n" +
4172
		"    <CompleteOnName:new>;\n" +
4706
		"    new X()\n" +
4173
		"  }\n" +
4707
		"  }\n" +
4174
		"}\n";
4708
		"}";
4709
4710
	String completeBehind = "new";
4711
	int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
4712
4713
	String expectedCompletionNodeToString = "<CompleteOnName:new>";
4714
	String expectedParentNodeToString = "<NONE>";
4715
	String completionIdentifier = "new";
4716
	String expectedReplacedSource = "new";
4717
	String expectedUnitDisplayString =
4718
			"public class X {\n" +
4719
			"  public X() {\n" +
4720
			"  }\n" +
4721
			"  void foo() {\n" +
4722
			"    <CompleteOnName:new>;\n" +
4723
			"  }\n" +
4724
			"}\n";
4175
	
4725
	
4176
	checkMethodParse(
4726
	checkMethodParse(
4177
		str.toCharArray(), 
4727
		str.toCharArray(), 
Lines 4394-4400 Link Here
4394
/*
4944
/*
4395
 * Test for 'while' keyword.
4945
 * Test for 'while' keyword.
4396
 */
4946
 */
4397
public void test0107(){
4947
public void test0107_Diet(){
4398
	String str =
4948
	String str =
4399
		"public class X {\n" +
4949
		"public class X {\n" +
4400
		"  void foo() {\n" +
4950
		"  void foo() {\n" +
Lines 4426-4444 Link Here
4426
		completionIdentifier,
4976
		completionIdentifier,
4427
		expectedReplacedSource,
4977
		expectedReplacedSource,
4428
		"diet ast");
4978
		"diet ast");
4429
	
4979
}
4430
	expectedCompletionNodeToString = "<CompleteOnName:whi>";
4980
/*
4431
	expectedParentNodeToString = "<NONE>";
4981
 * Test for 'while' keyword.
4432
	completionIdentifier = "whi";
4982
 */
4433
	expectedReplacedSource = "whi";
4983
public void test0107_Method(){
4434
	expectedUnitDisplayString =
4984
	String str =
4435
		"public class X {\n" +
4985
		"public class X {\n" +
4436
		"  public X() {\n" +
4437
		"  }\n" +
4438
		"  void foo() {\n" +
4986
		"  void foo() {\n" +
4439
		"    <CompleteOnName:whi>;\n" +
4987
		"    whi\n" +
4440
		"  }\n" +
4988
		"  }\n" +
4441
		"}\n";
4989
		"}";
4990
4991
	String completeBehind = "whi";
4992
	int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
4993
4994
	String expectedCompletionNodeToString = "<CompleteOnName:whi>";
4995
	String expectedParentNodeToString = "<NONE>";
4996
	String completionIdentifier = "whi";
4997
	String expectedReplacedSource = "whi";
4998
	String expectedUnitDisplayString =
4999
			"public class X {\n" +
5000
			"  public X() {\n" +
5001
			"  }\n" +
5002
			"  void foo() {\n" +
5003
			"    <CompleteOnName:whi>;\n" +
5004
			"  }\n" +
5005
			"}\n";
4442
	
5006
	
4443
	checkMethodParse(
5007
	checkMethodParse(
4444
		str.toCharArray(), 
5008
		str.toCharArray(), 
Lines 4453-4459 Link Here
4453
/*
5017
/*
4454
 * Test for 'while' keyword.
5018
 * Test for 'while' keyword.
4455
 */
5019
 */
4456
public void test0108(){
5020
public void test0108_Diet(){
4457
	String str =
5021
	String str =
4458
		"public class X {\n" +
5022
		"public class X {\n" +
4459
		"  void foo() {\n" +
5023
		"  void foo() {\n" +
Lines 4485-4503 Link Here
4485
		completionIdentifier,
5049
		completionIdentifier,
4486
		expectedReplacedSource,
5050
		expectedReplacedSource,
4487
		"diet ast");
5051
		"diet ast");
4488
	
5052
}
4489
	expectedCompletionNodeToString = "<CompleteOnName:whi>";
5053
/*
4490
	expectedParentNodeToString = "<NONE>";
5054
 * Test for 'while' keyword.
4491
	completionIdentifier = "whi";
5055
 */
4492
	expectedReplacedSource = "whi";
5056
public void test0108_Method(){
4493
	expectedUnitDisplayString =
5057
	String str =
4494
		"public class X {\n" +
5058
		"public class X {\n" +
4495
		"  public X() {\n" +
4496
		"  }\n" +
4497
		"  void foo() {\n" +
5059
		"  void foo() {\n" +
4498
		"    <CompleteOnName:whi>;\n" +
5060
		"    if(whi\n" +
4499
		"  }\n" +
5061
		"  }\n" +
4500
		"}\n";
5062
		"}";
5063
5064
	String completeBehind = "whi";
5065
	int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
5066
5067
	String expectedCompletionNodeToString = "<CompleteOnName:whi>";
5068
	String expectedParentNodeToString = "<NONE>";
5069
	String completionIdentifier = "whi";
5070
	String expectedReplacedSource = "whi";
5071
	String expectedUnitDisplayString =
5072
			"public class X {\n" +
5073
			"  public X() {\n" +
5074
			"  }\n" +
5075
			"  void foo() {\n" +
5076
			"    <CompleteOnName:whi>;\n" +
5077
			"  }\n" +
5078
			"}\n";
4501
	
5079
	
4502
	checkMethodParse(
5080
	checkMethodParse(
4503
		str.toCharArray(), 
5081
		str.toCharArray(), 
Lines 4512-4518 Link Here
4512
/*
5090
/*
4513
 * Test for 'assert' keyword.
5091
 * Test for 'assert' keyword.
4514
 */
5092
 */
4515
public void test0109(){
5093
public void test0109_Diet(){
4516
	String str =
5094
	String str =
4517
		"public class X {\n" +
5095
		"public class X {\n" +
4518
		"  void foo() {\n" +
5096
		"  void foo() {\n" +
Lines 4544-4562 Link Here
4544
		completionIdentifier,
5122
		completionIdentifier,
4545
		expectedReplacedSource,
5123
		expectedReplacedSource,
4546
		"diet ast");
5124
		"diet ast");
4547
	
5125
}
4548
	expectedCompletionNodeToString = "<CompleteOnName:ass>";
5126
/*
4549
	expectedParentNodeToString = "<NONE>";
5127
 * Test for 'assert' keyword.
4550
	completionIdentifier = "ass";
5128
 */
4551
	expectedReplacedSource = "ass";
5129
public void test0109_Method(){
4552
	expectedUnitDisplayString =
5130
	String str =
4553
		"public class X {\n" +
5131
		"public class X {\n" +
4554
		"  public X() {\n" +
4555
		"  }\n" +
4556
		"  void foo() {\n" +
5132
		"  void foo() {\n" +
4557
		"    <CompleteOnName:ass>;\n" +
5133
		"    ass\n" +
4558
		"  }\n" +
5134
		"  }\n" +
4559
		"}\n";
5135
		"}";
5136
5137
	String completeBehind = "ass";
5138
	int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
5139
5140
	String expectedCompletionNodeToString = "<CompleteOnName:ass>";
5141
	String expectedParentNodeToString = "<NONE>";
5142
	String completionIdentifier = "ass";
5143
	String expectedReplacedSource = "ass";
5144
	String expectedUnitDisplayString =
5145
			"public class X {\n" +
5146
			"  public X() {\n" +
5147
			"  }\n" +
5148
			"  void foo() {\n" +
5149
			"    <CompleteOnName:ass>;\n" +
5150
			"  }\n" +
5151
			"}\n";
4560
	
5152
	
4561
	checkMethodParse(
5153
	checkMethodParse(
4562
		str.toCharArray(), 
5154
		str.toCharArray(), 
Lines 4571-4577 Link Here
4571
/*
5163
/*
4572
 * Test for 'assert' keyword.
5164
 * Test for 'assert' keyword.
4573
 */
5165
 */
4574
public void test0110(){
5166
public void test0110_Diet(){
4575
	String str =
5167
	String str =
4576
		"public class X {\n" +
5168
		"public class X {\n" +
4577
		"  void foo() {\n" +
5169
		"  void foo() {\n" +
Lines 4603-4621 Link Here
4603
		completionIdentifier,
5195
		completionIdentifier,
4604
		expectedReplacedSource,
5196
		expectedReplacedSource,
4605
		"diet ast");
5197
		"diet ast");
4606
	
5198
}
4607
	expectedCompletionNodeToString = "<CompleteOnName:ass>";
5199
/*
4608
	expectedParentNodeToString = "<NONE>";
5200
 * Test for 'assert' keyword.
4609
	completionIdentifier = "ass";
5201
 */
4610
	expectedReplacedSource = "ass";
5202
public void test0110_Method(){
4611
	expectedUnitDisplayString =
5203
	String str =
4612
		"public class X {\n" +
5204
		"public class X {\n" +
4613
		"  public X() {\n" +
4614
		"  }\n" +
4615
		"  void foo() {\n" +
5205
		"  void foo() {\n" +
4616
		"    <CompleteOnName:ass>;\n" +
5206
		"    if(ass\n" +
4617
		"  }\n" +
5207
		"  }\n" +
4618
		"}\n";
5208
		"}";
5209
5210
	String completeBehind = "ass";
5211
	int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
5212
5213
	String expectedCompletionNodeToString = "<CompleteOnName:ass>";
5214
	String expectedParentNodeToString = "<NONE>";
5215
	String completionIdentifier = "ass";
5216
	String expectedReplacedSource = "ass";
5217
	String expectedUnitDisplayString =
5218
			"public class X {\n" +
5219
			"  public X() {\n" +
5220
			"  }\n" +
5221
			"  void foo() {\n" +
5222
			"    <CompleteOnName:ass>;\n" +
5223
			"  }\n" +
5224
			"}\n";
4619
	
5225
	
4620
	checkMethodParse(
5226
	checkMethodParse(
4621
		str.toCharArray(), 
5227
		str.toCharArray(), 
Lines 5786-5792 Link Here
5786
/*
6392
/*
5787
 * Test for 'synchronized' keyword.
6393
 * Test for 'synchronized' keyword.
5788
 */
6394
 */
5789
public void test0147(){
6395
public void test0147_Diet(){
5790
	String str =
6396
	String str =
5791
		"public class X {\n" +
6397
		"public class X {\n" +
5792
		"  void foo() {\n" +
6398
		"  void foo() {\n" +
Lines 5818-5836 Link Here
5818
		completionIdentifier,
6424
		completionIdentifier,
5819
		expectedReplacedSource,
6425
		expectedReplacedSource,
5820
		"diet ast");
6426
		"diet ast");
5821
	
6427
}
5822
	expectedCompletionNodeToString = "<CompleteOnName:syn>";
6428
/*
5823
	expectedParentNodeToString = "<NONE>";
6429
 * Test for 'synchronized' keyword.
5824
	completionIdentifier = "syn";
6430
 */
5825
	expectedReplacedSource = "syn";
6431
public void test0147_Method(){
5826
	expectedUnitDisplayString =
6432
	String str =
5827
		"public class X {\n" +
6433
		"public class X {\n" +
5828
		"  public X() {\n" +
5829
		"  }\n" +
5830
		"  void foo() {\n" +
6434
		"  void foo() {\n" +
5831
		"    <CompleteOnName:syn>;\n" +
6435
		"    syn\n" +
5832
		"  }\n" +
6436
		"  }\n" +
5833
		"}\n";
6437
		"}";
6438
6439
	String completeBehind = "syn";
6440
	int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
6441
6442
	String expectedCompletionNodeToString = "<CompleteOnName:syn>";
6443
	String expectedParentNodeToString = "<NONE>";
6444
	String completionIdentifier = "syn";
6445
	String expectedReplacedSource = "syn";
6446
	String expectedUnitDisplayString =
6447
			"public class X {\n" +
6448
			"  public X() {\n" +
6449
			"  }\n" +
6450
			"  void foo() {\n" +
6451
			"    <CompleteOnName:syn>;\n" +
6452
			"  }\n" +
6453
			"}\n";
5834
	
6454
	
5835
	checkMethodParse(
6455
	checkMethodParse(
5836
		str.toCharArray(), 
6456
		str.toCharArray(), 
Lines 5845-5851 Link Here
5845
/*
6465
/*
5846
 * Test for 'synchronized' keyword.
6466
 * Test for 'synchronized' keyword.
5847
 */
6467
 */
5848
public void test0148(){
6468
public void test0148_Diet(){
5849
	String str =
6469
	String str =
5850
		"public class X {\n" +
6470
		"public class X {\n" +
5851
		"  void foo() {\n" +
6471
		"  void foo() {\n" +
Lines 5877-5895 Link Here
5877
		completionIdentifier,
6497
		completionIdentifier,
5878
		expectedReplacedSource,
6498
		expectedReplacedSource,
5879
		"diet ast");
6499
		"diet ast");
5880
	
6500
}
5881
	expectedCompletionNodeToString = "<CompleteOnName:syn>";
6501
/*
5882
	expectedParentNodeToString = "<NONE>";
6502
 * Test for 'synchronized' keyword.
5883
	completionIdentifier = "syn";
6503
 */
5884
	expectedReplacedSource = "syn";
6504
public void test0148_Method(){
5885
	expectedUnitDisplayString =
6505
	String str =
5886
		"public class X {\n" +
6506
		"public class X {\n" +
5887
		"  public X() {\n" +
5888
		"  }\n" +
5889
		"  void foo() {\n" +
6507
		"  void foo() {\n" +
5890
		"    <CompleteOnName:syn>;\n" +
6508
		"    if(syn\n" +
5891
		"  }\n" +
6509
		"  }\n" +
5892
		"}\n";
6510
		"}";
6511
6512
	String completeBehind = "syn";
6513
	int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
6514
6515
	String expectedCompletionNodeToString = "<CompleteOnName:syn>";
6516
	String expectedParentNodeToString = "<NONE>";
6517
	String completionIdentifier = "syn";
6518
	String expectedReplacedSource = "syn";
6519
	String expectedUnitDisplayString =
6520
			"public class X {\n" +
6521
			"  public X() {\n" +
6522
			"  }\n" +
6523
			"  void foo() {\n" +
6524
			"    <CompleteOnName:syn>;\n" +
6525
			"  }\n" +
6526
			"}\n";
5893
	
6527
	
5894
	checkMethodParse(
6528
	checkMethodParse(
5895
		str.toCharArray(), 
6529
		str.toCharArray(), 
Lines 6885-6891 Link Here
6885
/*
7519
/*
6886
 * Test for 'super' keyword.
7520
 * Test for 'super' keyword.
6887
 */
7521
 */
6888
public void test0181(){
7522
public void test0181_Diet(){
6889
	String str =
7523
	String str =
6890
		"public class X {\n" +
7524
		"public class X {\n" +
6891
		"  void foo(){\n" +
7525
		"  void foo(){\n" +
Lines 6917-6935 Link Here
6917
		completionIdentifier,
7551
		completionIdentifier,
6918
		expectedReplacedSource,
7552
		expectedReplacedSource,
6919
		"diet ast");
7553
		"diet ast");
6920
	
7554
}
6921
	expectedCompletionNodeToString = "<CompleteOnName:sup>";
7555
/*
6922
	expectedParentNodeToString = "<NONE>";
7556
 * Test for 'super' keyword.
6923
	completionIdentifier = "sup";
7557
 */
6924
	expectedReplacedSource = "sup";
7558
public void test0181_Method(){
6925
	expectedUnitDisplayString =
7559
	String str =
6926
		"public class X {\n" +
7560
		"public class X {\n" +
6927
		"  public X() {\n" +
7561
		"  void foo(){\n" +
6928
		"  }\n" +
7562
		"     sup\n" +
6929
		"  void foo() {\n" +
6930
		"    <CompleteOnName:sup>;\n" +
6931
		"  }\n" +
7563
		"  }\n" +
6932
		"}\n";
7564
		"}\n";
7565
7566
	String completeBehind = "sup";
7567
	int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1;
7568
7569
	String expectedCompletionNodeToString = "<CompleteOnName:sup>";
7570
	String expectedParentNodeToString = "<NONE>";
7571
	String completionIdentifier = "sup";
7572
	String expectedReplacedSource = "sup";
7573
	String expectedUnitDisplayString =
7574
			"public class X {\n" +
7575
			"  public X() {\n" +
7576
			"  }\n" +
7577
			"  void foo() {\n" +
7578
			"    <CompleteOnName:sup>;\n" +
7579
			"  }\n" +
7580
			"}\n";
6933
	
7581
	
6934
	checkMethodParse(
7582
	checkMethodParse(
6935
		str.toCharArray(), 
7583
		str.toCharArray(), 
Lines 6944-6950 Link Here
6944
/*
7592
/*
6945
 * Test for 'this' keyword.
7593
 * Test for 'this' keyword.
6946
 */
7594
 */
6947
public void test0182(){
7595
public void test0182_Diet(){
6948
	String str =
7596
	String str =
6949
		"public class X {\n" +
7597
		"public class X {\n" +
6950
		"  void foo(){\n" +
7598
		"  void foo(){\n" +
Lines 6976-6994 Link Here
6976
		completionIdentifier,
7624
		completionIdentifier,
6977
		expectedReplacedSource,
7625
		expectedReplacedSource,
6978
		"diet ast");
7626
		"diet ast");
6979
	
7627
}
6980
	expectedCompletionNodeToString = "<CompleteOnName:thi>";
7628
/*
6981
	expectedParentNodeToString = "<NONE>";
7629
 * Test for 'this' keyword.
6982
	completionIdentifier = "thi";
7630
 */
6983
	expectedReplacedSource = "thi";
7631
public void test0182_Method(){
6984
	expectedUnitDisplayString =
7632
	String str =
6985
		"public class X {\n" +
7633
		"public class X {\n" +
6986
		"  public X() {\n" +
7634
		"  void foo(){\n" +
6987
		"  }\n" +
7635
		"     thi\n" +
6988
		"  void foo() {\n" +
6989
		"    <CompleteOnName:thi>;\n" +
6990
		"  }\n" +
7636
		"  }\n" +
6991
		"}\n";
7637
		"}\n";
7638
7639
	String completeBehind = "thi";
7640
	int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
7641
7642
	String expectedCompletionNodeToString = "<CompleteOnName:thi>";
7643
	String expectedParentNodeToString = "<NONE>";
7644
	String completionIdentifier = "thi";
7645
	String expectedReplacedSource = "thi";
7646
	String expectedUnitDisplayString =
7647
			"public class X {\n" +
7648
			"  public X() {\n" +
7649
			"  }\n" +
7650
			"  void foo() {\n" +
7651
			"    <CompleteOnName:thi>;\n" +
7652
			"  }\n" +
7653
			"}\n";
6992
	
7654
	
6993
	checkMethodParse(
7655
	checkMethodParse(
6994
		str.toCharArray(), 
7656
		str.toCharArray(), 
Lines 7003-7009 Link Here
7003
/*
7665
/*
7004
 * Test for 'true' keyword.
7666
 * Test for 'true' keyword.
7005
 */
7667
 */
7006
public void test0183(){
7668
public void test0183_Diet(){
7007
	String str =
7669
	String str =
7008
		"public class X {\n" +
7670
		"public class X {\n" +
7009
		"  void foo(){\n" +
7671
		"  void foo(){\n" +
Lines 7035-7053 Link Here
7035
		completionIdentifier,
7697
		completionIdentifier,
7036
		expectedReplacedSource,
7698
		expectedReplacedSource,
7037
		"diet ast");
7699
		"diet ast");
7038
	
7700
}
7039
	expectedCompletionNodeToString = "<CompleteOnName:tru>";
7701
/*
7040
	expectedParentNodeToString = "<NONE>";
7702
 * Test for 'true' keyword.
7041
	completionIdentifier = "tru";
7703
 */
7042
	expectedReplacedSource = "tru";
7704
public void test0183_Method(){
7043
	expectedUnitDisplayString =
7705
	String str =
7044
		"public class X {\n" +
7706
		"public class X {\n" +
7045
		"  public X() {\n" +
7707
		"  void foo(){\n" +
7046
		"  }\n" +
7708
		"     tru\n" +
7047
		"  void foo() {\n" +
7048
		"    <CompleteOnName:tru>;\n" +
7049
		"  }\n" +
7709
		"  }\n" +
7050
		"}\n";
7710
		"}\n";
7711
7712
	String completeBehind = "tru";
7713
	int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1;
7714
7715
	String expectedCompletionNodeToString = "<CompleteOnName:tru>";
7716
	String expectedParentNodeToString = "<NONE>";
7717
	String completionIdentifier = "tru";
7718
	String expectedReplacedSource = "tru";
7719
	String expectedUnitDisplayString =
7720
			"public class X {\n" +
7721
			"  public X() {\n" +
7722
			"  }\n" +
7723
			"  void foo() {\n" +
7724
			"    <CompleteOnName:tru>;\n" +
7725
			"  }\n" +
7726
			"}\n";
7051
	
7727
	
7052
	checkMethodParse(
7728
	checkMethodParse(
7053
		str.toCharArray(), 
7729
		str.toCharArray(), 
Lines 7062-7068 Link Here
7062
/*
7738
/*
7063
 * Test for 'false' keyword.
7739
 * Test for 'false' keyword.
7064
 */
7740
 */
7065
public void test0184(){
7741
public void test0184_Diet(){
7066
	String str =
7742
	String str =
7067
		"public class X {\n" +
7743
		"public class X {\n" +
7068
		"  void foo(){\n" +
7744
		"  void foo(){\n" +
Lines 7094-7112 Link Here
7094
		completionIdentifier,
7770
		completionIdentifier,
7095
		expectedReplacedSource,
7771
		expectedReplacedSource,
7096
		"diet ast");
7772
		"diet ast");
7097
	
7773
}
7098
	expectedCompletionNodeToString = "<CompleteOnName:fal>";
7774
/*
7099
	expectedParentNodeToString = "<NONE>";
7775
 * Test for 'false' keyword.
7100
	completionIdentifier = "fal";
7776
 */
7101
	expectedReplacedSource = "fal";
7777
public void test0184_Method(){
7102
	expectedUnitDisplayString =
7778
	String str =
7103
		"public class X {\n" +
7779
		"public class X {\n" +
7104
		"  public X() {\n" +
7780
		"  void foo(){\n" +
7105
		"  }\n" +
7781
		"     fal\n" +
7106
		"  void foo() {\n" +
7107
		"    <CompleteOnName:fal>;\n" +
7108
		"  }\n" +
7782
		"  }\n" +
7109
		"}\n";
7783
		"}\n";
7784
7785
	String completeBehind = "fal";
7786
	int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1;
7787
7788
	String expectedCompletionNodeToString = "<CompleteOnName:fal>";
7789
	String expectedParentNodeToString = "<NONE>";
7790
	String completionIdentifier = "fal";
7791
	String expectedReplacedSource = "fal";
7792
	String expectedUnitDisplayString =
7793
			"public class X {\n" +
7794
			"  public X() {\n" +
7795
			"  }\n" +
7796
			"  void foo() {\n" +
7797
			"    <CompleteOnName:fal>;\n" +
7798
			"  }\n" +
7799
			"}\n";
7110
	
7800
	
7111
	checkMethodParse(
7801
	checkMethodParse(
7112
		str.toCharArray(), 
7802
		str.toCharArray(), 
Lines 7121-7127 Link Here
7121
/*
7811
/*
7122
 * Test for 'null' keyword.
7812
 * Test for 'null' keyword.
7123
 */
7813
 */
7124
public void test0185(){
7814
public void test0185_Diet(){
7125
	String str =
7815
	String str =
7126
		"public class X {\n" +
7816
		"public class X {\n" +
7127
		"  void foo(){\n" +
7817
		"  void foo(){\n" +
Lines 7153-7171 Link Here
7153
		completionIdentifier,
7843
		completionIdentifier,
7154
		expectedReplacedSource,
7844
		expectedReplacedSource,
7155
		"diet ast");
7845
		"diet ast");
7156
	
7846
}
7157
	expectedCompletionNodeToString = "<CompleteOnName:nul>";
7847
/*
7158
	expectedParentNodeToString = "<NONE>";
7848
 * Test for 'null' keyword.
7159
	completionIdentifier = "nul";
7849
 */
7160
	expectedReplacedSource = "nul";
7850
public void test0185_Method(){
7161
	expectedUnitDisplayString =
7851
	String str =
7162
		"public class X {\n" +
7852
		"public class X {\n" +
7163
		"  public X() {\n" +
7853
		"  void foo(){\n" +
7164
		"  }\n" +
7854
		"     nul\n" +
7165
		"  void foo() {\n" +
7166
		"    <CompleteOnName:nul>;\n" +
7167
		"  }\n" +
7855
		"  }\n" +
7168
		"}\n";
7856
		"}\n";
7857
7858
	String completeBehind = "nul";
7859
	int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1;
7860
7861
	String expectedCompletionNodeToString = "<CompleteOnName:nul>";
7862
	String expectedParentNodeToString = "<NONE>";
7863
	String completionIdentifier = "nul";
7864
	String expectedReplacedSource = "nul";
7865
	String expectedUnitDisplayString =
7866
			"public class X {\n" +
7867
			"  public X() {\n" +
7868
			"  }\n" +
7869
			"  void foo() {\n" +
7870
			"    <CompleteOnName:nul>;\n" +
7871
			"  }\n" +
7872
			"}\n";
7169
	
7873
	
7170
	checkMethodParse(
7874
	checkMethodParse(
7171
		str.toCharArray(), 
7875
		str.toCharArray(), 
Lines 7180-7186 Link Here
7180
/*
7884
/*
7181
 * Test for 'instanceof' keyword.
7885
 * Test for 'instanceof' keyword.
7182
 */
7886
 */
7183
public void test0186(){
7887
public void test0186_Diet(){
7184
	String str =
7888
	String str =
7185
		"public class X {\n" +
7889
		"public class X {\n" +
7186
		"  void foo(){\n" +
7890
		"  void foo(){\n" +
Lines 7212-7230 Link Here
7212
		completionIdentifier,
7916
		completionIdentifier,
7213
		expectedReplacedSource,
7917
		expectedReplacedSource,
7214
		"diet ast");
7918
		"diet ast");
7215
	
7919
}
7216
	expectedCompletionNodeToString = "<CompleteOnKeyword:ins>";
7920
/*
7217
	expectedParentNodeToString = "<NONE>";
7921
 * Test for 'instanceof' keyword.
7218
	completionIdentifier = "ins";
7922
 */
7219
	expectedReplacedSource = "ins";
7923
public void test0186_Method(){
7220
	expectedUnitDisplayString =
7924
	String str =
7221
		"public class X {\n" +
7925
		"public class X {\n" +
7222
		"  public X() {\n" +
7926
		"  void foo(){\n" +
7223
		"  }\n" +
7927
		"     if(zzz ins\n" +
7224
		"  void foo() {\n" +
7225
		"    <CompleteOnKeyword:ins>;\n" +
7226
		"  }\n" +
7928
		"  }\n" +
7227
		"}\n";
7929
		"}\n";
7930
7931
	String completeBehind = "ins";
7932
	int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
7933
7934
	String expectedCompletionNodeToString = "<CompleteOnKeyword:ins>";
7935
	String expectedParentNodeToString = "<NONE>";
7936
	String completionIdentifier = "ins";
7937
	String expectedReplacedSource = "ins";
7938
	String expectedUnitDisplayString =
7939
			"public class X {\n" +
7940
			"  public X() {\n" +
7941
			"  }\n" +
7942
			"  void foo() {\n" +
7943
			"    <CompleteOnKeyword:ins>;\n" +
7944
			"  }\n" +
7945
			"}\n";
7228
	
7946
	
7229
	checkMethodParse(
7947
	checkMethodParse(
7230
		str.toCharArray(), 
7948
		str.toCharArray(), 
Lines 7239-7245 Link Here
7239
/*
7957
/*
7240
 * Test for 'instanceof' keyword.
7958
 * Test for 'instanceof' keyword.
7241
 */
7959
 */
7242
public void test0187(){
7960
public void test0187_Diet(){
7243
	String str =
7961
	String str =
7244
		"public class X {\n" +
7962
		"public class X {\n" +
7245
		"  void foo(){\n" +
7963
		"  void foo(){\n" +
Lines 7271-7289 Link Here
7271
		completionIdentifier,
7989
		completionIdentifier,
7272
		expectedReplacedSource,
7990
		expectedReplacedSource,
7273
		"diet ast");
7991
		"diet ast");
7274
	
7992
}
7275
	expectedCompletionNodeToString = "<CompleteOnName:ins>";
7993
/*
7276
	expectedParentNodeToString = "<NONE>";
7994
 * Test for 'instanceof' keyword.
7277
	completionIdentifier = "ins";
7995
 */
7278
	expectedReplacedSource = "ins";
7996
public void test0187_Method(){
7279
	expectedUnitDisplayString =
7997
	String str =
7280
		"public class X {\n" +
7998
		"public class X {\n" +
7281
		"  public X() {\n" +
7999
		"  void foo(){\n" +
7282
		"  }\n" +
8000
		"     ins\n" +
7283
		"  void foo() {\n" +
7284
		"    <CompleteOnName:ins>;\n" +
7285
		"  }\n" +
8001
		"  }\n" +
7286
		"}\n";
8002
		"}\n";
8003
8004
	String completeBehind = "ins";
8005
	int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
8006
8007
	String expectedCompletionNodeToString = "<CompleteOnName:ins>";
8008
	String expectedParentNodeToString = "<NONE>";
8009
	String completionIdentifier = "ins";
8010
	String expectedReplacedSource = "ins";
8011
	String expectedUnitDisplayString =
8012
			"public class X {\n" +
8013
			"  public X() {\n" +
8014
			"  }\n" +
8015
			"  void foo() {\n" +
8016
			"    <CompleteOnName:ins>;\n" +
8017
			"  }\n" +
8018
			"}\n";
7287
	
8019
	
7288
	checkMethodParse(
8020
	checkMethodParse(
7289
		str.toCharArray(), 
8021
		str.toCharArray(), 
Lines 7298-7304 Link Here
7298
/*
8030
/*
7299
 * Test for 'instanceof' keyword.
8031
 * Test for 'instanceof' keyword.
7300
 */
8032
 */
7301
public void test0188(){
8033
public void test0188_Diet(){
7302
	String str =
8034
	String str =
7303
		"public class X {\n" +
8035
		"public class X {\n" +
7304
		"  void foo(){\n" +
8036
		"  void foo(){\n" +
Lines 7330-7349 Link Here
7330
		completionIdentifier,
8062
		completionIdentifier,
7331
		expectedReplacedSource,
8063
		expectedReplacedSource,
7332
		"diet ast");
8064
		"diet ast");
7333
	
8065
}
7334
	expectedCompletionNodeToString = "<CompleteOnName:ins>";
8066
/*
7335
	expectedParentNodeToString = "<NONE>";
8067
 * Test for 'instanceof' keyword.
7336
	completionIdentifier = "ins";
8068
 */
7337
	expectedReplacedSource = "ins";
8069
public void test0188_Method(){
7338
	expectedUnitDisplayString =
8070
	String str =
7339
		"public class X {\n" +
8071
		"public class X {\n" +
7340
		"  public X() {\n" +
8072
		"  void foo(){\n" +
7341
		"  }\n" +
8073
		"     if(zzz zzz ins\n" +
7342
		"  void foo() {\n" +
7343
		"    zzz zzz;\n" +
7344
		"    <CompleteOnName:ins>;\n" +
7345
		"  }\n" +
8074
		"  }\n" +
7346
		"}\n";
8075
		"}\n";
8076
8077
	String completeBehind = "ins";
8078
	int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
8079
8080
	String expectedCompletionNodeToString = "<CompleteOnName:ins>";
8081
	String expectedParentNodeToString = "<NONE>";
8082
	String completionIdentifier = "ins";
8083
	String expectedReplacedSource = "ins";
8084
	String expectedUnitDisplayString =
8085
			"public class X {\n" +
8086
			"  public X() {\n" +
8087
			"  }\n" +
8088
			"  void foo() {\n" +
8089
			"    zzz zzz;\n" +
8090
			"    <CompleteOnName:ins>;\n" +
8091
			"  }\n" +
8092
			"}\n";
7347
	
8093
	
7348
	checkMethodParse(
8094
	checkMethodParse(
7349
		str.toCharArray(), 
8095
		str.toCharArray(), 
Lines 7358-7364 Link Here
7358
/*
8104
/*
7359
 * Test for 'while' keyword.
8105
 * Test for 'while' keyword.
7360
 */
8106
 */
7361
public void test0189(){
8107
public void test0189_Diet(){
7362
	String str =
8108
	String str =
7363
		"public class X {\n" +
8109
		"public class X {\n" +
7364
		"  void foo() {\n" +
8110
		"  void foo() {\n" +
Lines 7391-7409 Link Here
7391
		completionIdentifier,
8137
		completionIdentifier,
7392
		expectedReplacedSource,
8138
		expectedReplacedSource,
7393
		"diet ast");
8139
		"diet ast");
7394
	
8140
}
7395
	expectedCompletionNodeToString = "<CompleteOnKeyword:whi>";
8141
/*
7396
	expectedParentNodeToString = "<NONE>";
8142
 * Test for 'while' keyword.
7397
	completionIdentifier = "whi";
8143
 */
7398
	expectedReplacedSource = "whi";
8144
public void test0189_Method(){
7399
	expectedUnitDisplayString =
8145
	String str =
7400
		"public class X {\n" +
8146
		"public class X {\n" +
7401
		"  public X() {\n" +
7402
		"  }\n" +
7403
		"  void foo() {\n" +
8147
		"  void foo() {\n" +
7404
		"    <CompleteOnKeyword:whi>;\n" +
8148
		"    do{\n" +
8149
		"    } whi\n" +
7405
		"  }\n" +
8150
		"  }\n" +
7406
		"}\n";
8151
		"}";
8152
8153
	String completeBehind = "whi";
8154
	int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
8155
8156
	String expectedCompletionNodeToString = "<CompleteOnKeyword:whi>";
8157
	String expectedParentNodeToString = "<NONE>";
8158
	String completionIdentifier = "whi";
8159
	String expectedReplacedSource = "whi";
8160
	String expectedUnitDisplayString =
8161
			"public class X {\n" +
8162
			"  public X() {\n" +
8163
			"  }\n" +
8164
			"  void foo() {\n" +
8165
			"    <CompleteOnKeyword:whi>;\n" +
8166
			"  }\n" +
8167
			"}\n";
7407
	
8168
	
7408
	checkMethodParse(
8169
	checkMethodParse(
7409
		str.toCharArray(), 
8170
		str.toCharArray(), 
Lines 7418-7424 Link Here
7418
/*
8179
/*
7419
 * Test for 'catch' keyword.
8180
 * Test for 'catch' keyword.
7420
 */
8181
 */
7421
public void test0190(){
8182
public void test0190_Diet(){
7422
	String str =
8183
	String str =
7423
		"package p;\n" +
8184
		"package p;\n" +
7424
		"public class X {\n" +
8185
		"public class X {\n" +
Lines 7454-7473 Link Here
7454
		completionIdentifier,
8215
		completionIdentifier,
7455
		expectedReplacedSource,
8216
		expectedReplacedSource,
7456
		"diet ast");
8217
		"diet ast");
7457
	
8218
}
7458
	expectedCompletionNodeToString = "<CompleteOnName:cat>";
8219
/*
7459
	expectedParentNodeToString = "<NONE>";
8220
 * Test for 'catch' keyword.
7460
	completionIdentifier = "cat";
8221
 */
7461
	expectedReplacedSource = "cat";
8222
public void test0190_Method(){
7462
	expectedUnitDisplayString =
8223
	String str =
7463
		"package p;\n" +
8224
		"package p;\n" +
7464
		"public class X {\n" +
8225
		"public class X {\n" +
7465
		"  public X() {\n" +
8226
		"  void foo(){\n" +
7466
		"  }\n" +
8227
		"    try {\n" +
7467
		"  void foo() {\n" +
8228
		"    } catch(E e) {\n" +
7468
		"    <CompleteOnName:cat>;\n" +
8229
		"    } cat\n" +
7469
		"  }\n" +
8230
		"  }\n" +
7470
		"}\n";
8231
		"}\n";
8232
8233
	String completeBehind = "cat";
8234
	int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
8235
8236
	String expectedCompletionNodeToString = "<CompleteOnName:cat>";
8237
	String expectedParentNodeToString = "<NONE>";
8238
	String completionIdentifier = "cat";
8239
	String expectedReplacedSource = "cat";
8240
	String expectedUnitDisplayString =
8241
			"package p;\n" +
8242
			"public class X {\n" +
8243
			"  public X() {\n" +
8244
			"  }\n" +
8245
			"  void foo() {\n" +
8246
			"    <CompleteOnName:cat>;\n" +
8247
			"  }\n" +
8248
			"}\n";
7471
	
8249
	
7472
	checkMethodParse(
8250
	checkMethodParse(
7473
		str.toCharArray(), 
8251
		str.toCharArray(), 
Lines 7482-7488 Link Here
7482
/*
8260
/*
7483
 * Test for 'finally' keyword.
8261
 * Test for 'finally' keyword.
7484
 */
8262
 */
7485
public void test0191(){
8263
public void test0191_Diet(){
7486
	String str =
8264
	String str =
7487
		"package p;\n" +
8265
		"package p;\n" +
7488
		"public class X {\n" +
8266
		"public class X {\n" +
Lines 7518-7537 Link Here
7518
		completionIdentifier,
8296
		completionIdentifier,
7519
		expectedReplacedSource,
8297
		expectedReplacedSource,
7520
		"diet ast");
8298
		"diet ast");
7521
	
8299
}
7522
	expectedCompletionNodeToString = "<CompleteOnName:fin>";
8300
/*
7523
	expectedParentNodeToString = "<NONE>";
8301
 * Test for 'finally' keyword.
7524
	completionIdentifier = "fin";
8302
 */
7525
	expectedReplacedSource = "fin";
8303
public void test0191_Method(){
7526
	expectedUnitDisplayString =
8304
	String str =
7527
		"package p;\n" +
8305
		"package p;\n" +
7528
		"public class X {\n" +
8306
		"public class X {\n" +
7529
		"  public X() {\n" +
8307
		"  void foo(){\n" +
7530
		"  }\n" +
8308
		"     try {" +
7531
		"  void foo() {\n" +
8309
		"     } catch(E e) {" +
7532
		"    <CompleteOnName:fin>;\n" +
8310
		"     } fin" +
7533
		"  }\n" +
8311
		"  }\n" +
7534
		"}\n";
8312
		"}\n";
8313
8314
	String completeBehind = "fin";
8315
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
8316
8317
	String expectedCompletionNodeToString = "<CompleteOnName:fin>";
8318
	String expectedParentNodeToString = "<NONE>";
8319
	String completionIdentifier = "fin";
8320
	String expectedReplacedSource = "fin";
8321
	String expectedUnitDisplayString =
8322
			"package p;\n" +
8323
			"public class X {\n" +
8324
			"  public X() {\n" +
8325
			"  }\n" +
8326
			"  void foo() {\n" +
8327
			"    <CompleteOnName:fin>;\n" +
8328
			"  }\n" +
8329
			"}\n";
7535
	
8330
	
7536
	checkMethodParse(
8331
	checkMethodParse(
7537
		str.toCharArray(), 
8332
		str.toCharArray(), 
Lines 7546-7552 Link Here
7546
/*
8341
/*
7547
 * Test for 'finally' keyword.
8342
 * Test for 'finally' keyword.
7548
 */
8343
 */
7549
public void test0192(){
8344
public void test0192_Diet(){
7550
	String str =
8345
	String str =
7551
		"package p;\n" +
8346
		"package p;\n" +
7552
		"public class X {\n" +
8347
		"public class X {\n" +
Lines 7582-7601 Link Here
7582
		completionIdentifier,
8377
		completionIdentifier,
7583
		expectedReplacedSource,
8378
		expectedReplacedSource,
7584
		"diet ast");
8379
		"diet ast");
7585
	
8380
}
7586
	expectedCompletionNodeToString = "<CompleteOnName:fin>";
8381
/*
7587
	expectedParentNodeToString = "<NONE>";
8382
 * Test for 'finally' keyword.
7588
	completionIdentifier = "fin";
8383
 */
7589
	expectedReplacedSource = "fin";
8384
public void test0192_Method(){
7590
	expectedUnitDisplayString =
8385
	String str =
7591
		"package p;\n" +
8386
		"package p;\n" +
7592
		"public class X {\n" +
8387
		"public class X {\n" +
7593
		"  public X() {\n" +
8388
		"  void foo(){\n" +
7594
		"  }\n" +
8389
		"     try {" +
7595
		"  void foo() {\n" +
8390
		"     } finally {" +
7596
		"    <CompleteOnName:fin>;\n" +
8391
		"     } fin" +
7597
		"  }\n" +
8392
		"  }\n" +
7598
		"}\n";
8393
		"}\n";
8394
8395
	String completeBehind = "fin";
8396
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
8397
8398
	String expectedCompletionNodeToString = "<CompleteOnName:fin>";
8399
	String expectedParentNodeToString = "<NONE>";
8400
	String completionIdentifier = "fin";
8401
	String expectedReplacedSource = "fin";
8402
	String expectedUnitDisplayString =
8403
			"package p;\n" +
8404
			"public class X {\n" +
8405
			"  public X() {\n" +
8406
			"  }\n" +
8407
			"  void foo() {\n" +
8408
			"    <CompleteOnName:fin>;\n" +
8409
			"  }\n" +
8410
			"}\n";
7599
	
8411
	
7600
	checkMethodParse(
8412
	checkMethodParse(
7601
		str.toCharArray(), 
8413
		str.toCharArray(), 
Lines 7610-7616 Link Here
7610
/*
8422
/*
7611
 * Test for 'this' keyword.
8423
 * Test for 'this' keyword.
7612
 */
8424
 */
7613
public void test0193(){
8425
public void test0193_Diet(){
7614
	String str =
8426
	String str =
7615
		"public class X {\n" +
8427
		"public class X {\n" +
7616
		"  void foo(){\n" +
8428
		"  void foo(){\n" +
Lines 7642-7660 Link Here
7642
		completionIdentifier,
8454
		completionIdentifier,
7643
		expectedReplacedSource,
8455
		expectedReplacedSource,
7644
		"diet ast");
8456
		"diet ast");
7645
	
8457
}
7646
	expectedCompletionNodeToString = "<CompleteOnName:X.thi>";
8458
/*
7647
	expectedParentNodeToString = "<NONE>";
8459
 * Test for 'this' keyword.
7648
	completionIdentifier = "thi";
8460
 */
7649
	expectedReplacedSource = "X.thi";
8461
public void test0193_Method(){
7650
	expectedUnitDisplayString =
8462
	String str =
7651
		"public class X {\n" +
8463
		"public class X {\n" +
7652
		"  public X() {\n" +
8464
		"  void foo(){\n" +
7653
		"  }\n" +
8465
		"     X.thi\n" +
7654
		"  void foo() {\n" +
7655
		"    <CompleteOnName:X.thi>;\n" +
7656
		"  }\n" +
8466
		"  }\n" +
7657
		"}\n";
8467
		"}\n";
8468
8469
	String completeBehind = "thi";
8470
	int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
8471
8472
	String expectedCompletionNodeToString = "<CompleteOnName:X.thi>";
8473
	String expectedParentNodeToString = "<NONE>";
8474
	String completionIdentifier = "thi";
8475
	String expectedReplacedSource = "X.thi";
8476
	String expectedUnitDisplayString =
8477
			"public class X {\n" +
8478
			"  public X() {\n" +
8479
			"  }\n" +
8480
			"  void foo() {\n" +
8481
			"    <CompleteOnName:X.thi>;\n" +
8482
			"  }\n" +
8483
			"}\n";
7658
	
8484
	
7659
	checkMethodParse(
8485
	checkMethodParse(
7660
		str.toCharArray(), 
8486
		str.toCharArray(), 
Lines 8359-8365 Link Here
8359
/*
9185
/*
8360
 * Test for 'abstract' keyword.
9186
 * Test for 'abstract' keyword.
8361
 */
9187
 */
8362
public void test0214(){
9188
public void test0214_Diet(){
8363
	String str =
9189
	String str =
8364
		"package p;\n" +
9190
		"package p;\n" +
8365
		"public class X {\n" +
9191
		"public class X {\n" +
Lines 8394-8413 Link Here
8394
		completionIdentifier,
9220
		completionIdentifier,
8395
		expectedReplacedSource,
9221
		expectedReplacedSource,
8396
		"diet ast");
9222
		"diet ast");
8397
	
9223
}
8398
	expectedCompletionNodeToString = "<CompleteOnName:abst>";
9224
/*
8399
	expectedParentNodeToString = "<NONE>";
9225
 * Test for 'abstract' keyword.
8400
	completionIdentifier = "abst";
9226
 */
8401
	expectedReplacedSource = "abst";
9227
public void test0214_Method(){
8402
	expectedUnitDisplayString =
9228
	String str =
8403
		"package p;\n" +
9229
		"package p;\n" +
8404
		"public class X {\n" +
9230
		"public class X {\n" +
8405
		"  public X() {\n" +
9231
		"  void foo(){\n" +
8406
		"  }\n" +
9232
		"    #\n" +
8407
		"  void foo() {\n" +
9233
		"    abst\n" +
8408
		"    <CompleteOnName:abst>;\n" +
8409
		"  }\n" +
9234
		"  }\n" +
8410
		"}\n";
9235
		"}\n";
9236
9237
	String completeBehind = "abst";
9238
	int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
9239
9240
	String expectedCompletionNodeToString = "<CompleteOnName:abst>";
9241
	String expectedParentNodeToString = "<NONE>";
9242
	String completionIdentifier = "abst";
9243
	String expectedReplacedSource = "abst";
9244
	String expectedUnitDisplayString =
9245
			"package p;\n" +
9246
			"public class X {\n" +
9247
			"  public X() {\n" +
9248
			"  }\n" +
9249
			"  void foo() {\n" +
9250
			"    <CompleteOnName:abst>;\n" +
9251
			"  }\n" +
9252
			"}\n";
8411
	
9253
	
8412
	checkMethodParse(
9254
	checkMethodParse(
8413
		str.toCharArray(), 
9255
		str.toCharArray(), 
Lines 8422-8428 Link Here
8422
/*
9264
/*
8423
 * Test for 'abstract' keyword.
9265
 * Test for 'abstract' keyword.
8424
 */
9266
 */
8425
public void test0216(){
9267
public void test0216_Diet(){
8426
	String str =
9268
	String str =
8427
		"package p;\n" +
9269
		"package p;\n" +
8428
		"public class X {\n" +
9270
		"public class X {\n" +
Lines 8457-8476 Link Here
8457
		completionIdentifier,
9299
		completionIdentifier,
8458
		expectedReplacedSource,
9300
		expectedReplacedSource,
8459
		"diet ast");
9301
		"diet ast");
8460
	
9302
}
8461
	expectedCompletionNodeToString = "<CompleteOnName:abst>";
9303
/*
8462
	expectedParentNodeToString = "<NONE>";
9304
 * Test for 'abstract' keyword.
8463
	completionIdentifier = "abst";
9305
 */
8464
	expectedReplacedSource = "abst";
9306
public void test0216_Method(){
8465
	expectedUnitDisplayString =
9307
	String str =
8466
		"package p;\n" +
9308
		"package p;\n" +
8467
		"public class X {\n" +
9309
		"public class X {\n" +
8468
		"  public X() {\n" +
9310
		"  void foo(){\n" +
8469
		"  }\n" +
9311
		"    #\n" +
8470
		"  void foo() {\n" +
9312
		"    abst zzz\n" +
8471
		"    <CompleteOnName:abst>;\n" +
8472
		"  }\n" +
9313
		"  }\n" +
8473
		"}\n";
9314
		"}\n";
9315
9316
	String completeBehind = "abst";
9317
	int cursorLocation = str.lastIndexOf("abst") + completeBehind.length() - 1;
9318
9319
	String expectedCompletionNodeToString = "<CompleteOnName:abst>";
9320
	String expectedParentNodeToString = "<NONE>";
9321
	String completionIdentifier = "abst";
9322
	String expectedReplacedSource = "abst";
9323
	String expectedUnitDisplayString =
9324
			"package p;\n" +
9325
			"public class X {\n" +
9326
			"  public X() {\n" +
9327
			"  }\n" +
9328
			"  void foo() {\n" +
9329
			"    <CompleteOnName:abst>;\n" +
9330
			"  }\n" +
9331
			"}\n";
8474
	
9332
	
8475
	checkMethodParse(
9333
	checkMethodParse(
8476
		str.toCharArray(), 
9334
		str.toCharArray(), 
Lines 8485-8491 Link Here
8485
/*
9343
/*
8486
 * Test for 'break' keyword.
9344
 * Test for 'break' keyword.
8487
 */
9345
 */
8488
public void test0217(){
9346
public void test0217_Diet(){
8489
	String str =
9347
	String str =
8490
		"package p;\n" +
9348
		"package p;\n" +
8491
		"public class X {\n" +
9349
		"public class X {\n" +
Lines 8520-8539 Link Here
8520
		completionIdentifier,
9378
		completionIdentifier,
8521
		expectedReplacedSource,
9379
		expectedReplacedSource,
8522
		"diet ast");
9380
		"diet ast");
8523
	
9381
}
8524
	expectedCompletionNodeToString = "<CompleteOnName:bre>";
9382
/*
8525
	expectedParentNodeToString = "<NONE>";
9383
 * Test for 'break' keyword.
8526
	completionIdentifier = "bre";
9384
 */
8527
	expectedReplacedSource = "bre";
9385
public void test0217_Method(){
8528
	expectedUnitDisplayString =
9386
	String str =
8529
		"package p;\n" +
9387
		"package p;\n" +
8530
		"public class X {\n" +
9388
		"public class X {\n" +
8531
		"  public X() {\n" +
9389
		"  void foo(){\n" +
8532
		"  }\n" +
9390
		"    #\n" +
8533
		"  void foo() {\n" +
9391
		"    bre\n" +
8534
		"    <CompleteOnName:bre>;\n" +
8535
		"  }\n" +
9392
		"  }\n" +
8536
		"}\n";
9393
		"}\n";
9394
9395
	String completeBehind = "bre";
9396
	int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
9397
9398
	String expectedCompletionNodeToString = "<CompleteOnName:bre>";
9399
	String expectedParentNodeToString = "<NONE>";
9400
	String completionIdentifier = "bre";
9401
	String expectedReplacedSource = "bre";
9402
	String expectedUnitDisplayString =
9403
			"package p;\n" +
9404
			"public class X {\n" +
9405
			"  public X() {\n" +
9406
			"  }\n" +
9407
			"  void foo() {\n" +
9408
			"    <CompleteOnName:bre>;\n" +
9409
			"  }\n" +
9410
			"}\n";
8537
	
9411
	
8538
	checkMethodParse(
9412
	checkMethodParse(
8539
		str.toCharArray(), 
9413
		str.toCharArray(), 
Lines 8548-8554 Link Here
8548
/*
9422
/*
8549
 * Test for 'break' keyword.
9423
 * Test for 'break' keyword.
8550
 */
9424
 */
8551
public void test0218(){
9425
public void test0218_Diet(){
8552
	String str =
9426
	String str =
8553
		"package p;\n" +
9427
		"package p;\n" +
8554
		"public class X {\n" +
9428
		"public class X {\n" +
Lines 8585-8607 Link Here
8585
		completionIdentifier,
9459
		completionIdentifier,
8586
		expectedReplacedSource,
9460
		expectedReplacedSource,
8587
		"diet ast");
9461
		"diet ast");
8588
	
9462
}
8589
	expectedCompletionNodeToString = "<CompleteOnName:bre>";
9463
/*
8590
	expectedParentNodeToString = "<NONE>";
9464
 * Test for 'break' keyword.
8591
	completionIdentifier = "bre";
9465
 */
8592
	expectedReplacedSource = "bre";
9466
public void test0218_Method(){
8593
	expectedUnitDisplayString =
9467
	String str =
8594
		"package p;\n" +
9468
		"package p;\n" +
8595
		"public class X {\n" +
9469
		"public class X {\n" +
8596
		"  public X() {\n" +
9470
		"  void foo(){\n" +
8597
		"  }\n" +
9471
		"    #\n" +
8598
		"  void foo() {\n" +
9472
		"    for(int i; i < 10; i++) {\n" +
8599
		"    int i;\n" +
9473
		"      bre\n" +
8600
		"    {\n" +
8601
		"      <CompleteOnName:bre>;\n" +
8602
		"    }\n" +
9474
		"    }\n" +
8603
		"  }\n" +
9475
		"  }\n" +
8604
		"}\n";
9476
		"}\n";
9477
9478
	String completeBehind = "bre";
9479
	int cursorLocation = str.lastIndexOf("bre") + completeBehind.length() - 1;
9480
9481
	String expectedCompletionNodeToString = "<CompleteOnName:bre>";
9482
	String expectedParentNodeToString = "<NONE>";
9483
	String completionIdentifier = "bre";
9484
	String expectedReplacedSource = "bre";
9485
	String expectedUnitDisplayString =
9486
			"package p;\n" +
9487
			"public class X {\n" +
9488
			"  public X() {\n" +
9489
			"  }\n" +
9490
			"  void foo() {\n" +
9491
			"    int i;\n" +
9492
			"    {\n" +
9493
			"      <CompleteOnName:bre>;\n" +
9494
			"    }\n" +
9495
			"  }\n" +
9496
			"}\n";
8605
	
9497
	
8606
	checkMethodParse(
9498
	checkMethodParse(
8607
		str.toCharArray(), 
9499
		str.toCharArray(), 
Lines 8616-8622 Link Here
8616
/*
9508
/*
8617
 * Test for 'case' keyword.
9509
 * Test for 'case' keyword.
8618
 */
9510
 */
8619
public void test0219(){
9511
public void test0219_Diet(){
8620
	String str =
9512
	String str =
8621
		"package p;\n" +
9513
		"package p;\n" +
8622
		"public class X {\n" +
9514
		"public class X {\n" +
Lines 8651-8670 Link Here
8651
		completionIdentifier,
9543
		completionIdentifier,
8652
		expectedReplacedSource,
9544
		expectedReplacedSource,
8653
		"diet ast");
9545
		"diet ast");
8654
	
9546
}
8655
	expectedCompletionNodeToString = "<CompleteOnName:cas>";
9547
/*
8656
	expectedParentNodeToString = "<NONE>";
9548
 * Test for 'case' keyword.
8657
	completionIdentifier = "cas";
9549
 */
8658
	expectedReplacedSource = "cas";
9550
public void test0219_Method(){
8659
	expectedUnitDisplayString =
9551
	String str =
8660
		"package p;\n" +
9552
		"package p;\n" +
8661
		"public class X {\n" +
9553
		"public class X {\n" +
8662
		"  public X() {\n" +
9554
		"  void foo(){\n" +
8663
		"  }\n" +
9555
		"    #\n" +
8664
		"  void foo() {\n" +
9556
		"    cas\n" +
8665
		"    <CompleteOnName:cas>;\n" +
8666
		"  }\n" +
9557
		"  }\n" +
8667
		"}\n";
9558
		"}\n";
9559
9560
	String completeBehind = "cas";
9561
	int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
9562
9563
	String expectedCompletionNodeToString = "<CompleteOnName:cas>";
9564
	String expectedParentNodeToString = "<NONE>";
9565
	String completionIdentifier = "cas";
9566
	String expectedReplacedSource = "cas";
9567
	String expectedUnitDisplayString =
9568
			"package p;\n" +
9569
			"public class X {\n" +
9570
			"  public X() {\n" +
9571
			"  }\n" +
9572
			"  void foo() {\n" +
9573
			"    <CompleteOnName:cas>;\n" +
9574
			"  }\n" +
9575
			"}\n";
8668
	
9576
	
8669
	checkMethodParse(
9577
	checkMethodParse(
8670
		str.toCharArray(), 
9578
		str.toCharArray(), 
Lines 8679-8685 Link Here
8679
/*
9587
/*
8680
 * Test for 'case' keyword.
9588
 * Test for 'case' keyword.
8681
 */
9589
 */
8682
public void test0220(){
9590
public void test0220_Diet(){
8683
	String str =
9591
	String str =
8684
		"package p;\n" +
9592
		"package p;\n" +
8685
		"public class X {\n" +
9593
		"public class X {\n" +
Lines 8716-8737 Link Here
8716
		completionIdentifier,
9624
		completionIdentifier,
8717
		expectedReplacedSource,
9625
		expectedReplacedSource,
8718
		"diet ast");
9626
		"diet ast");
8719
	
9627
}
8720
	expectedCompletionNodeToString = "<CompleteOnKeyword:cas>";
9628
/*
8721
	expectedParentNodeToString = "<NONE>";
9629
 * Test for 'case' keyword.
8722
	completionIdentifier = "cas";
9630
 */
8723
	expectedReplacedSource = "cas";
9631
public void test0220_Method(){
8724
	expectedUnitDisplayString =
9632
	String str =
8725
		"package p;\n" +
9633
		"package p;\n" +
8726
		"public class X {\n" +
9634
		"public class X {\n" +
8727
		"  public X() {\n" +
9635
		"  void foo(){\n" +
8728
		"  }\n" +
9636
		"    #\n" +
8729
		"  void foo() {\n" +
9637
		"    switch(0) {\n" +
8730
		"    {\n" +
9638
		"      cas\n" +
8731
		"      <CompleteOnKeyword:cas>;\n" +
9639
		"    }\n" +
8732
		"    }\n"+
8733
		"  }\n" +
9640
		"  }\n" +
8734
		"}\n";
9641
		"}\n";
9642
9643
	String completeBehind = "cas";
9644
	int cursorLocation = str.lastIndexOf("cas") + completeBehind.length() - 1;
9645
9646
	String expectedCompletionNodeToString = "<CompleteOnKeyword:cas>";
9647
	String expectedParentNodeToString = "<NONE>";
9648
	String completionIdentifier = "cas";
9649
	String expectedReplacedSource = "cas";
9650
	String expectedUnitDisplayString =
9651
			"package p;\n" +
9652
			"public class X {\n" +
9653
			"  public X() {\n" +
9654
			"  }\n" +
9655
			"  void foo() {\n" +
9656
			"    {\n" +
9657
			"      <CompleteOnKeyword:cas>;\n" +
9658
			"    }\n"+
9659
			"  }\n" +
9660
			"}\n";
8735
	
9661
	
8736
	checkMethodParse(
9662
	checkMethodParse(
8737
		str.toCharArray(), 
9663
		str.toCharArray(), 
Lines 8746-8752 Link Here
8746
/*
9672
/*
8747
 * Test for 'catch' keyword.
9673
 * Test for 'catch' keyword.
8748
 */
9674
 */
8749
public void test0221(){
9675
public void test0221_Diet(){
8750
	String str =
9676
	String str =
8751
		"package p;\n" +
9677
		"package p;\n" +
8752
		"public class X {\n" +
9678
		"public class X {\n" +
Lines 8781-8800 Link Here
8781
		completionIdentifier,
9707
		completionIdentifier,
8782
		expectedReplacedSource,
9708
		expectedReplacedSource,
8783
		"diet ast");
9709
		"diet ast");
8784
	
9710
}
8785
	expectedCompletionNodeToString = "<CompleteOnName:cat>";
9711
/*
8786
	expectedParentNodeToString = "<NONE>";
9712
 * Test for 'catch' keyword.
8787
	completionIdentifier = "cat";
9713
 */
8788
	expectedReplacedSource = "cat";
9714
public void test0221_Method(){
8789
	expectedUnitDisplayString =
9715
	String str =
8790
		"package p;\n" +
9716
		"package p;\n" +
8791
		"public class X {\n" +
9717
		"public class X {\n" +
8792
		"  public X() {\n" +
9718
		"  void foo(){\n" +
8793
		"  }\n" +
9719
		"    #\n" +
8794
		"  void foo() {\n" +
9720
		"    cat\n" +
8795
		"    <CompleteOnName:cat>;\n" +
8796
		"  }\n" +
9721
		"  }\n" +
8797
		"}\n";
9722
		"}\n";
9723
9724
	String completeBehind = "cat";
9725
	int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
9726
9727
	String expectedCompletionNodeToString = "<CompleteOnName:cat>";
9728
	String expectedParentNodeToString = "<NONE>";
9729
	String completionIdentifier = "cat";
9730
	String expectedReplacedSource = "cat";
9731
	String expectedUnitDisplayString =
9732
			"package p;\n" +
9733
			"public class X {\n" +
9734
			"  public X() {\n" +
9735
			"  }\n" +
9736
			"  void foo() {\n" +
9737
			"    <CompleteOnName:cat>;\n" +
9738
			"  }\n" +
9739
			"}\n";
8798
	
9740
	
8799
	checkMethodParse(
9741
	checkMethodParse(
8800
		str.toCharArray(), 
9742
		str.toCharArray(), 
Lines 8809-8815 Link Here
8809
/*
9751
/*
8810
 * Test for 'catch' keyword.
9752
 * Test for 'catch' keyword.
8811
 */
9753
 */
8812
public void test0222(){
9754
public void test0222_Diet(){
8813
	String str =
9755
	String str =
8814
		"package p;\n" +
9756
		"package p;\n" +
8815
		"public class X {\n" +
9757
		"public class X {\n" +
Lines 8845-8864 Link Here
8845
		completionIdentifier,
9787
		completionIdentifier,
8846
		expectedReplacedSource,
9788
		expectedReplacedSource,
8847
		"diet ast");
9789
		"diet ast");
8848
	
9790
}
8849
	expectedCompletionNodeToString = "<CompleteOnKeyword:cat>";
9791
/*
8850
	expectedParentNodeToString = "<NONE>";
9792
 * Test for 'catch' keyword.
8851
	completionIdentifier = "cat";
9793
 */
8852
	expectedReplacedSource = "cat";
9794
public void test0222_Method(){
8853
	expectedUnitDisplayString =
9795
	String str =
8854
		"package p;\n" +
9796
		"package p;\n" +
8855
		"public class X {\n" +
9797
		"public class X {\n" +
8856
		"  public X() {\n" +
9798
		"  void foo(){\n" +
8857
		"  }\n" +
9799
		"    #\n" +
8858
		"  void foo() {\n" +
9800
		"    try {\n" +
8859
		"    <CompleteOnKeyword:cat>;\n" +
9801
		"    } cat\n" +
8860
		"  }\n" +
9802
		"  }\n" +
8861
		"}\n";
9803
		"}\n";
9804
9805
	String completeBehind = "cat";
9806
	int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
9807
9808
	String expectedCompletionNodeToString = "<CompleteOnKeyword:cat>";
9809
	String expectedParentNodeToString = "<NONE>";
9810
	String completionIdentifier = "cat";
9811
	String expectedReplacedSource = "cat";
9812
	String expectedUnitDisplayString =
9813
			"package p;\n" +
9814
			"public class X {\n" +
9815
			"  public X() {\n" +
9816
			"  }\n" +
9817
			"  void foo() {\n" +
9818
			"    <CompleteOnKeyword:cat>;\n" +
9819
			"  }\n" +
9820
			"}\n";
8862
	
9821
	
8863
	checkMethodParse(
9822
	checkMethodParse(
8864
		str.toCharArray(), 
9823
		str.toCharArray(), 
Lines 9121-9127 Link Here
9121
/*
10080
/*
9122
 * Test for 'class' keyword.
10081
 * Test for 'class' keyword.
9123
 */
10082
 */
9124
public void test0231(){
10083
public void test0231_Diet(){
9125
	String str =
10084
	String str =
9126
		"public class X {\n" +
10085
		"public class X {\n" +
9127
		"  void foo() {\n" +
10086
		"  void foo() {\n" +
Lines 9154-9172 Link Here
9154
		completionIdentifier,
10113
		completionIdentifier,
9155
		expectedReplacedSource,
10114
		expectedReplacedSource,
9156
		"diet ast");
10115
		"diet ast");
9157
	
10116
}
9158
	expectedCompletionNodeToString = "<CompleteOnName:cla>";
10117
/*
9159
	expectedParentNodeToString = "<NONE>";
10118
 * Test for 'class' keyword.
9160
	completionIdentifier = "cla";
10119
 */
9161
	expectedReplacedSource = "cla";
10120
public void test0231_Method(){
9162
	expectedUnitDisplayString =
10121
	String str =
9163
		"public class X {\n" +
10122
		"public class X {\n" +
9164
		"  public X() {\n" +
9165
		"  }\n" +
9166
		"  void foo() {\n" +
10123
		"  void foo() {\n" +
9167
		"    <CompleteOnName:cla>;\n" +
10124
		"    #\n" +
10125
		"    cla\n" +
9168
		"  }\n" +
10126
		"  }\n" +
9169
		"}\n";
10127
		"}";
10128
10129
	String completeBehind = "cla";
10130
	int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
10131
10132
	String expectedCompletionNodeToString = "<CompleteOnName:cla>";
10133
	String expectedParentNodeToString = "<NONE>";
10134
	String completionIdentifier = "cla";
10135
	String expectedReplacedSource = "cla";
10136
	String expectedUnitDisplayString =
10137
			"public class X {\n" +
10138
			"  public X() {\n" +
10139
			"  }\n" +
10140
			"  void foo() {\n" +
10141
			"    <CompleteOnName:cla>;\n" +
10142
			"  }\n" +
10143
			"}\n";
9170
	
10144
	
9171
	checkMethodParse(
10145
	checkMethodParse(
9172
		str.toCharArray(), 
10146
		str.toCharArray(), 
Lines 9181-9187 Link Here
9181
/*
10155
/*
9182
 * Test for 'class' keyword.
10156
 * Test for 'class' keyword.
9183
 */
10157
 */
9184
public void test0232(){
10158
public void test0232_Diet(){
9185
	String str =
10159
	String str =
9186
		"public class X {\n" +
10160
		"public class X {\n" +
9187
		"  void foo() {\n" +
10161
		"  void foo() {\n" +
Lines 9214-9232 Link Here
9214
		completionIdentifier,
10188
		completionIdentifier,
9215
		expectedReplacedSource,
10189
		expectedReplacedSource,
9216
		"diet ast");
10190
		"diet ast");
9217
	
10191
}
9218
	expectedCompletionNodeToString = "<CompleteOnName:cla>";
10192
/*
9219
	expectedParentNodeToString = "<NONE>";
10193
 * Test for 'class' keyword.
9220
	completionIdentifier = "cla";
10194
 */
9221
	expectedReplacedSource = "cla";
10195
public void test0232_Method(){
9222
	expectedUnitDisplayString =
10196
	String str =
9223
		"public class X {\n" +
10197
		"public class X {\n" +
9224
		"  public X() {\n" +
9225
		"  }\n" +
9226
		"  void foo() {\n" +
10198
		"  void foo() {\n" +
9227
		"    <CompleteOnName:cla>;\n" +
10199
		"    #\n" +
10200
		"    final cla\n" +
9228
		"  }\n" +
10201
		"  }\n" +
9229
		"}\n";
10202
		"}";
10203
10204
	String completeBehind = "cla";
10205
	int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
10206
10207
	String expectedCompletionNodeToString = "<CompleteOnName:cla>";
10208
	String expectedParentNodeToString = "<NONE>";
10209
	String completionIdentifier = "cla";
10210
	String expectedReplacedSource = "cla";
10211
	String expectedUnitDisplayString =
10212
			"public class X {\n" +
10213
			"  public X() {\n" +
10214
			"  }\n" +
10215
			"  void foo() {\n" +
10216
			"    <CompleteOnName:cla>;\n" +
10217
			"  }\n" +
10218
			"}\n";
9230
	
10219
	
9231
	checkMethodParse(
10220
	checkMethodParse(
9232
		str.toCharArray(), 
10221
		str.toCharArray(), 
Lines 9241-9247 Link Here
9241
/*
10230
/*
9242
 * Test for 'class' keyword.
10231
 * Test for 'class' keyword.
9243
 */
10232
 */
9244
public void test0233(){
10233
public void test0233_Diet(){
9245
	String str =
10234
	String str =
9246
		"public class X {\n" +
10235
		"public class X {\n" +
9247
		"  void foo() {\n" +
10236
		"  void foo() {\n" +
Lines 9274-9292 Link Here
9274
		completionIdentifier,
10263
		completionIdentifier,
9275
		expectedReplacedSource,
10264
		expectedReplacedSource,
9276
		"diet ast");
10265
		"diet ast");
9277
	
10266
}
9278
	expectedCompletionNodeToString = "<CompleteOnName:cla>";
10267
/*
9279
	expectedParentNodeToString = "<NONE>";
10268
 * Test for 'class' keyword.
9280
	completionIdentifier = "cla";
10269
 */
9281
	expectedReplacedSource = "cla";
10270
public void test0233_Method(){
9282
	expectedUnitDisplayString =
10271
	String str =
9283
		"public class X {\n" +
10272
		"public class X {\n" +
9284
		"  public X() {\n" +
9285
		"  }\n" +
9286
		"  void foo() {\n" +
10273
		"  void foo() {\n" +
9287
		"    <CompleteOnName:cla>;\n" +
10274
		"    #\n" +
10275
		"    final cla Y\n" +
9288
		"  }\n" +
10276
		"  }\n" +
9289
		"}\n";
10277
		"}";
10278
10279
	String completeBehind = "cla";
10280
	int cursorLocation = str.lastIndexOf("cla") + completeBehind.length() - 1;
10281
10282
	String expectedCompletionNodeToString = "<CompleteOnName:cla>";
10283
	String expectedParentNodeToString = "<NONE>";
10284
	String completionIdentifier = "cla";
10285
	String expectedReplacedSource = "cla";
10286
	String expectedUnitDisplayString =
10287
			"public class X {\n" +
10288
			"  public X() {\n" +
10289
			"  }\n" +
10290
			"  void foo() {\n" +
10291
			"    <CompleteOnName:cla>;\n" +
10292
			"  }\n" +
10293
			"}\n";
9290
	
10294
	
9291
	checkMethodParse(
10295
	checkMethodParse(
9292
		str.toCharArray(), 
10296
		str.toCharArray(), 
Lines 9301-9307 Link Here
9301
/*
10305
/*
9302
 * Test for 'continue' keyword.
10306
 * Test for 'continue' keyword.
9303
 */
10307
 */
9304
public void test0234(){
10308
public void test0234_Diet(){
9305
	String str =
10309
	String str =
9306
		"package p;\n" +
10310
		"package p;\n" +
9307
		"public class X {\n" +
10311
		"public class X {\n" +
Lines 9336-9355 Link Here
9336
		completionIdentifier,
10340
		completionIdentifier,
9337
		expectedReplacedSource,
10341
		expectedReplacedSource,
9338
		"diet ast");
10342
		"diet ast");
9339
	
10343
}
9340
	expectedCompletionNodeToString = "<CompleteOnName:con>";
10344
/*
9341
	expectedParentNodeToString = "<NONE>";
10345
 * Test for 'continue' keyword.
9342
	completionIdentifier = "con";
10346
 */
9343
	expectedReplacedSource = "con";
10347
public void test0234_Method(){
9344
	expectedUnitDisplayString =
10348
	String str =
9345
		"package p;\n" +
10349
		"package p;\n" +
9346
		"public class X {\n" +
10350
		"public class X {\n" +
9347
		"  public X() {\n" +
10351
		"  void foo(){\n" +
9348
		"  }\n" +
10352
		"    #\n" +
9349
		"  void foo() {\n" +
10353
		"    con\n" +
9350
		"    <CompleteOnName:con>;\n" +
9351
		"  }\n" +
10354
		"  }\n" +
9352
		"}\n";
10355
		"}\n";
10356
10357
	String completeBehind = "con";
10358
	int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
10359
10360
	String expectedCompletionNodeToString = "<CompleteOnName:con>";
10361
	String expectedParentNodeToString = "<NONE>";
10362
	String completionIdentifier = "con";
10363
	String expectedReplacedSource = "con";
10364
	String expectedUnitDisplayString =
10365
			"package p;\n" +
10366
			"public class X {\n" +
10367
			"  public X() {\n" +
10368
			"  }\n" +
10369
			"  void foo() {\n" +
10370
			"    <CompleteOnName:con>;\n" +
10371
			"  }\n" +
10372
			"}\n";
9353
	
10373
	
9354
	checkMethodParse(
10374
	checkMethodParse(
9355
		str.toCharArray(), 
10375
		str.toCharArray(), 
Lines 9364-9370 Link Here
9364
/*
10384
/*
9365
 * Test for 'continue' keyword.
10385
 * Test for 'continue' keyword.
9366
 */
10386
 */
9367
public void test0235(){
10387
public void test0235_Diet(){
9368
	String str =
10388
	String str =
9369
		"package p;\n" +
10389
		"package p;\n" +
9370
		"public class X {\n" +
10390
		"public class X {\n" +
Lines 9401-9423 Link Here
9401
		completionIdentifier,
10421
		completionIdentifier,
9402
		expectedReplacedSource,
10422
		expectedReplacedSource,
9403
		"diet ast");
10423
		"diet ast");
9404
	
10424
}
9405
	expectedCompletionNodeToString = "<CompleteOnName:con>";
10425
/*
9406
	expectedParentNodeToString = "<NONE>";
10426
 * Test for 'continue' keyword.
9407
	completionIdentifier = "con";
10427
 */
9408
	expectedReplacedSource = "con";
10428
public void test0235_Method(){
9409
	expectedUnitDisplayString =
10429
	String str =
9410
		"package p;\n" +
10430
		"package p;\n" +
9411
		"public class X {\n" +
10431
		"public class X {\n" +
9412
		"  public X() {\n" +
10432
		"  void foo(){\n" +
9413
		"  }\n" +
10433
		"    #\n" +
9414
		"  void foo() {\n" +
10434
		"    for(int i; i < 5; i++) {\n" +
9415
		"    int i;\n" +
10435
		"      con\n" +
9416
		"    {\n" +
9417
		"      <CompleteOnName:con>;\n" +
9418
		"    }\n" +
10436
		"    }\n" +
9419
		"  }\n" +
10437
		"  }\n" +
9420
		"}\n";
10438
		"}\n";
10439
10440
	String completeBehind = "con";
10441
	int cursorLocation = str.lastIndexOf("con") + completeBehind.length() - 1;
10442
10443
	String expectedCompletionNodeToString = "<CompleteOnName:con>";
10444
	String expectedParentNodeToString = "<NONE>";
10445
	String completionIdentifier = "con";
10446
	String expectedReplacedSource = "con";
10447
	String expectedUnitDisplayString =
10448
			"package p;\n" +
10449
			"public class X {\n" +
10450
			"  public X() {\n" +
10451
			"  }\n" +
10452
			"  void foo() {\n" +
10453
			"    int i;\n" +
10454
			"    {\n" +
10455
			"      <CompleteOnName:con>;\n" +
10456
			"    }\n" +
10457
			"  }\n" +
10458
			"}\n";
9421
	
10459
	
9422
	checkMethodParse(
10460
	checkMethodParse(
9423
		str.toCharArray(), 
10461
		str.toCharArray(), 
Lines 9432-9438 Link Here
9432
/*
10470
/*
9433
 * Test for 'default' keyword.
10471
 * Test for 'default' keyword.
9434
 */
10472
 */
9435
public void test0236(){
10473
public void test0236_Diet(){
9436
	String str =
10474
	String str =
9437
		"package p;\n" +
10475
		"package p;\n" +
9438
		"public class X {\n" +
10476
		"public class X {\n" +
Lines 9467-9486 Link Here
9467
		completionIdentifier,
10505
		completionIdentifier,
9468
		expectedReplacedSource,
10506
		expectedReplacedSource,
9469
		"diet ast");
10507
		"diet ast");
9470
	
10508
}
9471
	expectedCompletionNodeToString = "<CompleteOnName:def>";
10509
/*
9472
	expectedParentNodeToString = "<NONE>";
10510
 * Test for 'default' keyword.
9473
	completionIdentifier = "def";
10511
 */
9474
	expectedReplacedSource = "def";
10512
public void test0236_Method(){
9475
	expectedUnitDisplayString =
10513
	String str =
9476
		"package p;\n" +
10514
		"package p;\n" +
9477
		"public class X {\n" +
10515
		"public class X {\n" +
9478
		"  public X() {\n" +
10516
		"  void foo(){\n" +
9479
		"  }\n" +
10517
		"    #\n" +
9480
		"  void foo() {\n" +
10518
		"    def\n" +
9481
		"    <CompleteOnName:def>;\n" +
9482
		"  }\n" +
10519
		"  }\n" +
9483
		"}\n";
10520
		"}\n";
10521
10522
	String completeBehind = "def";
10523
	int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
10524
10525
	String expectedCompletionNodeToString = "<CompleteOnName:def>";
10526
	String expectedParentNodeToString = "<NONE>";
10527
	String completionIdentifier = "def";
10528
	String expectedReplacedSource = "def";
10529
	String expectedUnitDisplayString =
10530
			"package p;\n" +
10531
			"public class X {\n" +
10532
			"  public X() {\n" +
10533
			"  }\n" +
10534
			"  void foo() {\n" +
10535
			"    <CompleteOnName:def>;\n" +
10536
			"  }\n" +
10537
			"}\n";
9484
	
10538
	
9485
	checkMethodParse(
10539
	checkMethodParse(
9486
		str.toCharArray(), 
10540
		str.toCharArray(), 
Lines 9495-9501 Link Here
9495
/*
10549
/*
9496
 * Test for 'default' keyword.
10550
 * Test for 'default' keyword.
9497
 */
10551
 */
9498
public void test0237(){
10552
public void test0237_Diet(){
9499
	String str =
10553
	String str =
9500
		"package p;\n" +
10554
		"package p;\n" +
9501
		"public class X {\n" +
10555
		"public class X {\n" +
Lines 9533-9554 Link Here
9533
		completionIdentifier,
10587
		completionIdentifier,
9534
		expectedReplacedSource,
10588
		expectedReplacedSource,
9535
		"diet ast");
10589
		"diet ast");
9536
	
10590
}
9537
	expectedCompletionNodeToString = "<CompleteOnName:def>";
10591
/*
9538
	expectedParentNodeToString = "<NONE>";
10592
 * Test for 'default' keyword.
9539
	completionIdentifier = "def";
10593
 */
9540
	expectedReplacedSource = "def";
10594
public void test0237_Method(){
9541
	expectedUnitDisplayString =
10595
	String str =
9542
		"package p;\n" +
10596
		"package p;\n" +
9543
		"public class X {\n" +
10597
		"public class X {\n" +
9544
		"  public X() {\n" +
10598
		"  void foo(){\n" +
9545
		"  }\n" +
10599
		"    #\n" +
9546
		"  void foo() {\n" +
10600
		"    switch(0) {\n" +
9547
		"    {\n" +
10601
		"      case 1 : break;\n" +
9548
		"      <CompleteOnName:def>;\n" +
10602
		"      def\n" +
9549
		"    }\n" +
10603
		"    }\n" +
9550
		"  }\n" +
10604
		"  }\n" +
9551
		"}\n";
10605
		"}\n";
10606
10607
	String completeBehind = "def";
10608
	int cursorLocation = str.lastIndexOf("def") + completeBehind.length() - 1;
10609
10610
	String expectedCompletionNodeToString = "<CompleteOnName:def>";
10611
	String expectedParentNodeToString = "<NONE>";
10612
	String completionIdentifier = "def";
10613
	String expectedReplacedSource = "def";
10614
	String expectedUnitDisplayString =
10615
			"package p;\n" +
10616
			"public class X {\n" +
10617
			"  public X() {\n" +
10618
			"  }\n" +
10619
			"  void foo() {\n" +
10620
			"    {\n" +
10621
			"      <CompleteOnName:def>;\n" +
10622
			"    }\n" +
10623
			"  }\n" +
10624
			"}\n";
9552
	
10625
	
9553
	checkMethodParse(
10626
	checkMethodParse(
9554
		str.toCharArray(), 
10627
		str.toCharArray(), 
Lines 9563-9569 Link Here
9563
/*
10636
/*
9564
 * Test for 'do' keyword.
10637
 * Test for 'do' keyword.
9565
 */
10638
 */
9566
public void test0238(){
10639
public void test0238_Diet(){
9567
	String str =
10640
	String str =
9568
		"package p;\n" +
10641
		"package p;\n" +
9569
		"public class X {\n" +
10642
		"public class X {\n" +
Lines 9598-9617 Link Here
9598
		completionIdentifier,
10671
		completionIdentifier,
9599
		expectedReplacedSource,
10672
		expectedReplacedSource,
9600
		"diet ast");
10673
		"diet ast");
9601
	
10674
}
9602
	expectedCompletionNodeToString = "<CompleteOnName:do>";
10675
/*
9603
	expectedParentNodeToString = "<NONE>";
10676
 * Test for 'do' keyword.
9604
	completionIdentifier = "do";
10677
 */
9605
	expectedReplacedSource = "do";
10678
public void test0238_Method(){
9606
	expectedUnitDisplayString =
10679
	String str =
9607
		"package p;\n" +
10680
		"package p;\n" +
9608
		"public class X {\n" +
10681
		"public class X {\n" +
9609
		"  public X() {\n" +
10682
		"  void foo(){\n" +
9610
		"  }\n" +
10683
		"    #\n" +
9611
		"  void foo() {\n" +
10684
		"    do\n" +
9612
		"    <CompleteOnName:do>;\n" +
9613
		"  }\n" +
10685
		"  }\n" +
9614
		"}\n";
10686
		"}\n";
10687
10688
	String completeBehind = "do";
10689
	int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
10690
10691
	String expectedCompletionNodeToString = "<CompleteOnName:do>";
10692
	String expectedParentNodeToString = "<NONE>";
10693
	String completionIdentifier = "do";
10694
	String expectedReplacedSource = "do";
10695
	String expectedUnitDisplayString =
10696
			"package p;\n" +
10697
			"public class X {\n" +
10698
			"  public X() {\n" +
10699
			"  }\n" +
10700
			"  void foo() {\n" +
10701
			"    <CompleteOnName:do>;\n" +
10702
			"  }\n" +
10703
			"}\n";
9615
	
10704
	
9616
	checkMethodParse(
10705
	checkMethodParse(
9617
		str.toCharArray(), 
10706
		str.toCharArray(), 
Lines 9626-9632 Link Here
9626
/*
10715
/*
9627
 * Test for 'else' keyword.
10716
 * Test for 'else' keyword.
9628
 */
10717
 */
9629
public void test0239(){
10718
public void test0239_Diet(){
9630
	String str =
10719
	String str =
9631
		"package p;\n" +
10720
		"package p;\n" +
9632
		"public class X {\n" +
10721
		"public class X {\n" +
Lines 9661-9680 Link Here
9661
		completionIdentifier,
10750
		completionIdentifier,
9662
		expectedReplacedSource,
10751
		expectedReplacedSource,
9663
		"diet ast");
10752
		"diet ast");
9664
	
10753
}
9665
	expectedCompletionNodeToString = "<CompleteOnName:els>";
10754
/*
9666
	expectedParentNodeToString = "<NONE>";
10755
 * Test for 'else' keyword.
9667
	completionIdentifier = "els";
10756
 */
9668
	expectedReplacedSource = "els";
10757
public void test0239_Method(){
9669
	expectedUnitDisplayString =
10758
	String str =
9670
		"package p;\n" +
10759
		"package p;\n" +
9671
		"public class X {\n" +
10760
		"public class X {\n" +
9672
		"  public X() {\n" +
10761
		"  void foo(){\n" +
9673
		"  }\n" +
10762
		"    #\n" +
9674
		"  void foo() {\n" +
10763
		"    els\n" +
9675
		"    <CompleteOnName:els>;\n" +
9676
		"  }\n" +
10764
		"  }\n" +
9677
		"}\n";
10765
		"}\n";
10766
10767
	String completeBehind = "els";
10768
	int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
10769
10770
	String expectedCompletionNodeToString = "<CompleteOnName:els>";
10771
	String expectedParentNodeToString = "<NONE>";
10772
	String completionIdentifier = "els";
10773
	String expectedReplacedSource = "els";
10774
	String expectedUnitDisplayString =
10775
			"package p;\n" +
10776
			"public class X {\n" +
10777
			"  public X() {\n" +
10778
			"  }\n" +
10779
			"  void foo() {\n" +
10780
			"    <CompleteOnName:els>;\n" +
10781
			"  }\n" +
10782
			"}\n";
9678
	
10783
	
9679
	checkMethodParse(
10784
	checkMethodParse(
9680
		str.toCharArray(), 
10785
		str.toCharArray(), 
Lines 9689-9695 Link Here
9689
/*
10794
/*
9690
 * Test for 'else' keyword.
10795
 * Test for 'else' keyword.
9691
 */
10796
 */
9692
public void test0240(){
10797
public void test0240_Diet(){
9693
	String str =
10798
	String str =
9694
		"package p;\n" +
10799
		"package p;\n" +
9695
		"public class X {\n" +
10800
		"public class X {\n" +
Lines 9725-9744 Link Here
9725
		completionIdentifier,
10830
		completionIdentifier,
9726
		expectedReplacedSource,
10831
		expectedReplacedSource,
9727
		"diet ast");
10832
		"diet ast");
9728
	
10833
}
9729
	expectedCompletionNodeToString = "<CompleteOnName:els>";
10834
/*
9730
	expectedParentNodeToString = "<NONE>";
10835
 * Test for 'else' keyword.
9731
	completionIdentifier = "els";
10836
 */
9732
	expectedReplacedSource = "els";
10837
public void test0240_Method(){
9733
	expectedUnitDisplayString =
10838
	String str =
9734
		"package p;\n" +
10839
		"package p;\n" +
9735
		"public class X {\n" +
10840
		"public class X {\n" +
9736
		"  public X() {\n" +
10841
		"  void foo(){\n" +
9737
		"  }\n" +
10842
		"    #\n" +
9738
		"  void foo() {\n" +
10843
		"    if(true) {\n" +
9739
		"    <CompleteOnName:els>;\n" +
10844
		"    } els\n" +
9740
		"  }\n" +
10845
		"  }\n" +
9741
		"}\n";
10846
		"}\n";
10847
10848
	String completeBehind = "els";
10849
	int cursorLocation = str.lastIndexOf("els") + completeBehind.length() - 1;
10850
10851
	String expectedCompletionNodeToString = "<CompleteOnName:els>";
10852
	String expectedParentNodeToString = "<NONE>";
10853
	String completionIdentifier = "els";
10854
	String expectedReplacedSource = "els";
10855
	String expectedUnitDisplayString =
10856
			"package p;\n" +
10857
			"public class X {\n" +
10858
			"  public X() {\n" +
10859
			"  }\n" +
10860
			"  void foo() {\n" +
10861
			"    <CompleteOnName:els>;\n" +
10862
			"  }\n" +
10863
			"}\n";
9742
	
10864
	
9743
	checkMethodParse(
10865
	checkMethodParse(
9744
		str.toCharArray(), 
10866
		str.toCharArray(), 
Lines 9994-10000 Link Here
9994
/*
11116
/*
9995
 * Test for 'finally' keyword.
11117
 * Test for 'finally' keyword.
9996
 */
11118
 */
9997
public void test0249(){
11119
public void test0249_Diet(){
9998
	String str =
11120
	String str =
9999
		"package p;\n" +
11121
		"package p;\n" +
10000
		"public class X {\n" +
11122
		"public class X {\n" +
Lines 10029-10048 Link Here
10029
		completionIdentifier,
11151
		completionIdentifier,
10030
		expectedReplacedSource,
11152
		expectedReplacedSource,
10031
		"diet ast");
11153
		"diet ast");
10032
	
11154
}
10033
	expectedCompletionNodeToString = "<CompleteOnName:fin>";
11155
/*
10034
	expectedParentNodeToString = "<NONE>";
11156
 * Test for 'finally' keyword.
10035
	completionIdentifier = "fin";
11157
 */
10036
	expectedReplacedSource = "fin";
11158
public void test0249_Method(){
10037
	expectedUnitDisplayString =
11159
	String str =
10038
		"package p;\n" +
11160
		"package p;\n" +
10039
		"public class X {\n" +
11161
		"public class X {\n" +
10040
		"  public X() {\n" +
11162
		"  void foo(){\n" +
10041
		"  }\n" +
11163
		"    #\n" +
10042
		"  void foo() {\n" +
11164
		"    fin" +
10043
		"    <CompleteOnName:fin>;\n" +
10044
		"  }\n" +
11165
		"  }\n" +
10045
		"}\n";
11166
		"}\n";
11167
11168
	String completeBehind = "fin";
11169
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
11170
11171
	String expectedCompletionNodeToString = "<CompleteOnName:fin>";
11172
	String expectedParentNodeToString = "<NONE>";
11173
	String completionIdentifier = "fin";
11174
	String expectedReplacedSource = "fin";
11175
	String expectedUnitDisplayString =
11176
			"package p;\n" +
11177
			"public class X {\n" +
11178
			"  public X() {\n" +
11179
			"  }\n" +
11180
			"  void foo() {\n" +
11181
			"    <CompleteOnName:fin>;\n" +
11182
			"  }\n" +
11183
			"}\n";
10046
	
11184
	
10047
	checkMethodParse(
11185
	checkMethodParse(
10048
		str.toCharArray(), 
11186
		str.toCharArray(), 
Lines 10057-10063 Link Here
10057
/*
11195
/*
10058
 * Test for 'finally' keyword.
11196
 * Test for 'finally' keyword.
10059
 */
11197
 */
10060
public void test0250(){
11198
public void test0250_Diet(){
10061
	String str =
11199
	String str =
10062
		"package p;\n" +
11200
		"package p;\n" +
10063
		"public class X {\n" +
11201
		"public class X {\n" +
Lines 10093-10112 Link Here
10093
		completionIdentifier,
11231
		completionIdentifier,
10094
		expectedReplacedSource,
11232
		expectedReplacedSource,
10095
		"diet ast");
11233
		"diet ast");
10096
	
11234
}
10097
	expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
11235
/*
10098
	expectedParentNodeToString = "<NONE>";
11236
 * Test for 'finally' keyword.
10099
	completionIdentifier = "fin";
11237
 */
10100
	expectedReplacedSource = "fin";
11238
public void test0250_Method(){
10101
	expectedUnitDisplayString =
11239
	String str =
10102
		"package p;\n" +
11240
		"package p;\n" +
10103
		"public class X {\n" +
11241
		"public class X {\n" +
10104
		"  public X() {\n" +
11242
		"  void foo(){\n" +
10105
		"  }\n" +
11243
		"    #\n" +
10106
		"  void foo() {\n" +
11244
		"    try {" +
10107
		"    <CompleteOnKeyword:fin>;\n" +
11245
		"    } fin" +
10108
		"  }\n" +
11246
		"  }\n" +
10109
		"}\n";
11247
		"}\n";
11248
11249
	String completeBehind = "fin";
11250
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
11251
11252
	String expectedCompletionNodeToString = "<CompleteOnKeyword:fin>";
11253
	String expectedParentNodeToString = "<NONE>";
11254
	String completionIdentifier = "fin";
11255
	String expectedReplacedSource = "fin";
11256
	String expectedUnitDisplayString =
11257
			"package p;\n" +
11258
			"public class X {\n" +
11259
			"  public X() {\n" +
11260
			"  }\n" +
11261
			"  void foo() {\n" +
11262
			"    <CompleteOnKeyword:fin>;\n" +
11263
			"  }\n" +
11264
			"}\n";
10110
	
11265
	
10111
	checkMethodParse(
11266
	checkMethodParse(
10112
		str.toCharArray(), 
11267
		str.toCharArray(), 
Lines 10121-10127 Link Here
10121
/*
11276
/*
10122
 * Test for 'for' keyword.
11277
 * Test for 'for' keyword.
10123
 */
11278
 */
10124
public void test0251(){
11279
public void test0251_Diet(){
10125
	String str =
11280
	String str =
10126
		"package p;\n" +
11281
		"package p;\n" +
10127
		"public class X {\n" +
11282
		"public class X {\n" +
Lines 10156-10175 Link Here
10156
		completionIdentifier,
11311
		completionIdentifier,
10157
		expectedReplacedSource,
11312
		expectedReplacedSource,
10158
		"diet ast");
11313
		"diet ast");
10159
	
11314
}
10160
	expectedCompletionNodeToString = "<CompleteOnName:for>";
11315
/*
10161
	expectedParentNodeToString = "<NONE>";
11316
 * Test for 'for' keyword.
10162
	completionIdentifier = "for";
11317
 */
10163
	expectedReplacedSource = "for";
11318
public void test0251_Method(){
10164
	expectedUnitDisplayString =
11319
	String str =
10165
		"package p;\n" +
11320
		"package p;\n" +
10166
		"public class X {\n" +
11321
		"public class X {\n" +
10167
		"  public X() {\n" +
11322
		"  void foo(){\n" +
10168
		"  }\n" +
11323
		"    #\n" +
10169
		"  void foo() {\n" +
11324
		"    for" +
10170
		"    <CompleteOnName:for>;\n" +
10171
		"  }\n" +
11325
		"  }\n" +
10172
		"}\n";
11326
		"}\n";
11327
11328
	String completeBehind = "for";
11329
	int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
11330
11331
	String expectedCompletionNodeToString = "<CompleteOnName:for>";
11332
	String expectedParentNodeToString = "<NONE>";
11333
	String completionIdentifier = "for";
11334
	String expectedReplacedSource = "for";
11335
	String expectedUnitDisplayString =
11336
			"package p;\n" +
11337
			"public class X {\n" +
11338
			"  public X() {\n" +
11339
			"  }\n" +
11340
			"  void foo() {\n" +
11341
			"    <CompleteOnName:for>;\n" +
11342
			"  }\n" +
11343
			"}\n";
10173
	
11344
	
10174
	checkMethodParse(
11345
	checkMethodParse(
10175
		str.toCharArray(), 
11346
		str.toCharArray(), 
Lines 10184-10190 Link Here
10184
/*
11355
/*
10185
 * Test for 'if' keyword.
11356
 * Test for 'if' keyword.
10186
 */
11357
 */
10187
public void test0252(){
11358
public void test0252_Diet(){
10188
	String str =
11359
	String str =
10189
		"package p;\n" +
11360
		"package p;\n" +
10190
		"public class X {\n" +
11361
		"public class X {\n" +
Lines 10219-10238 Link Here
10219
		completionIdentifier,
11390
		completionIdentifier,
10220
		expectedReplacedSource,
11391
		expectedReplacedSource,
10221
		"diet ast");
11392
		"diet ast");
10222
	
11393
}
10223
	expectedCompletionNodeToString = "<CompleteOnName:if>";
11394
/*
10224
	expectedParentNodeToString = "<NONE>";
11395
 * Test for 'if' keyword.
10225
	completionIdentifier = "if";
11396
 */
10226
	expectedReplacedSource = "if";
11397
public void test0252_Method(){
10227
	expectedUnitDisplayString =
11398
	String str =
10228
		"package p;\n" +
11399
		"package p;\n" +
10229
		"public class X {\n" +
11400
		"public class X {\n" +
10230
		"  public X() {\n" +
11401
		"  void foo(){\n" +
10231
		"  }\n" +
11402
		"    #\n" +
10232
		"  void foo() {\n" +
11403
		"    if" +
10233
		"    <CompleteOnName:if>;\n" +
10234
		"  }\n" +
11404
		"  }\n" +
10235
		"}\n";
11405
		"}\n";
11406
11407
	String completeBehind = "if";
11408
	int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
11409
11410
	String expectedCompletionNodeToString = "<CompleteOnName:if>";
11411
	String expectedParentNodeToString = "<NONE>";
11412
	String completionIdentifier = "if";
11413
	String expectedReplacedSource = "if";
11414
	String expectedUnitDisplayString =
11415
			"package p;\n" +
11416
			"public class X {\n" +
11417
			"  public X() {\n" +
11418
			"  }\n" +
11419
			"  void foo() {\n" +
11420
			"    <CompleteOnName:if>;\n" +
11421
			"  }\n" +
11422
			"}\n";
10236
	
11423
	
10237
	checkMethodParse(
11424
	checkMethodParse(
10238
		str.toCharArray(), 
11425
		str.toCharArray(), 
Lines 10247-10253 Link Here
10247
/*
11434
/*
10248
 * Test for 'switch' keyword.
11435
 * Test for 'switch' keyword.
10249
 */
11436
 */
10250
public void test0253(){
11437
public void test0253_Diet(){
10251
	String str =
11438
	String str =
10252
		"package p;\n" +
11439
		"package p;\n" +
10253
		"public class X {\n" +
11440
		"public class X {\n" +
Lines 10282-10301 Link Here
10282
		completionIdentifier,
11469
		completionIdentifier,
10283
		expectedReplacedSource,
11470
		expectedReplacedSource,
10284
		"diet ast");
11471
		"diet ast");
10285
	
11472
}
10286
	expectedCompletionNodeToString = "<CompleteOnName:swi>";
11473
/*
10287
	expectedParentNodeToString = "<NONE>";
11474
 * Test for 'switch' keyword.
10288
	completionIdentifier = "swi";
11475
 */
10289
	expectedReplacedSource = "swi";
11476
public void test0253_Method(){
10290
	expectedUnitDisplayString =
11477
	String str =
10291
		"package p;\n" +
11478
		"package p;\n" +
10292
		"public class X {\n" +
11479
		"public class X {\n" +
10293
		"  public X() {\n" +
11480
		"  void foo(){\n" +
10294
		"  }\n" +
11481
		"    #\n" +
10295
		"  void foo() {\n" +
11482
		"    swi" +
10296
		"    <CompleteOnName:swi>;\n" +
10297
		"  }\n" +
11483
		"  }\n" +
10298
		"}\n";
11484
		"}\n";
11485
11486
	String completeBehind = "swi";
11487
	int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
11488
11489
	String expectedCompletionNodeToString = "<CompleteOnName:swi>";
11490
	String expectedParentNodeToString = "<NONE>";
11491
	String completionIdentifier = "swi";
11492
	String expectedReplacedSource = "swi";
11493
	String expectedUnitDisplayString =
11494
			"package p;\n" +
11495
			"public class X {\n" +
11496
			"  public X() {\n" +
11497
			"  }\n" +
11498
			"  void foo() {\n" +
11499
			"    <CompleteOnName:swi>;\n" +
11500
			"  }\n" +
11501
			"}\n";
10299
	
11502
	
10300
	checkMethodParse(
11503
	checkMethodParse(
10301
		str.toCharArray(), 
11504
		str.toCharArray(), 
Lines 10917-10923 Link Here
10917
/*
12120
/*
10918
 * Test for 'interface' keyword.
12121
 * Test for 'interface' keyword.
10919
 */
12122
 */
10920
public void test0274(){
12123
public void test0274_Diet(){
10921
	String str =
12124
	String str =
10922
		"public class X {\n" +
12125
		"public class X {\n" +
10923
		"  void foo() {\n" +
12126
		"  void foo() {\n" +
Lines 10950-10968 Link Here
10950
		completionIdentifier,
12153
		completionIdentifier,
10951
		expectedReplacedSource,
12154
		expectedReplacedSource,
10952
		"diet ast");
12155
		"diet ast");
10953
	
12156
}
10954
	expectedCompletionNodeToString = "<CompleteOnName:int>";
12157
/*
10955
	expectedParentNodeToString = "<NONE>";
12158
 * Test for 'interface' keyword.
10956
	completionIdentifier = "int";
12159
 */
10957
	expectedReplacedSource = "int";
12160
public void test0274_Method(){
10958
	expectedUnitDisplayString =
12161
	String str =
10959
		"public class X {\n" +
12162
		"public class X {\n" +
10960
		"  public X() {\n" +
10961
		"  }\n" +
10962
		"  void foo() {\n" +
12163
		"  void foo() {\n" +
10963
		"    <CompleteOnName:int>;\n" +
12164
		"    #\n" +
12165
		"    int\n" +
10964
		"  }\n" +
12166
		"  }\n" +
10965
		"}\n";
12167
		"}";
12168
12169
	String completeBehind = "int";
12170
	int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
12171
12172
	String expectedCompletionNodeToString = "<CompleteOnName:int>";
12173
	String expectedParentNodeToString = "<NONE>";
12174
	String completionIdentifier = "int";
12175
	String expectedReplacedSource = "int";
12176
	String expectedUnitDisplayString =
12177
			"public class X {\n" +
12178
			"  public X() {\n" +
12179
			"  }\n" +
12180
			"  void foo() {\n" +
12181
			"    <CompleteOnName:int>;\n" +
12182
			"  }\n" +
12183
			"}\n";
10966
	
12184
	
10967
	checkMethodParse(
12185
	checkMethodParse(
10968
		str.toCharArray(), 
12186
		str.toCharArray(), 
Lines 10977-10983 Link Here
10977
/*
12195
/*
10978
 * Test for 'interface' keyword.
12196
 * Test for 'interface' keyword.
10979
 */
12197
 */
10980
public void test0275(){
12198
public void test0275_Diet(){
10981
	String str =
12199
	String str =
10982
		"public class X {\n" +
12200
		"public class X {\n" +
10983
		"  void foo() {\n" +
12201
		"  void foo() {\n" +
Lines 11010-11028 Link Here
11010
		completionIdentifier,
12228
		completionIdentifier,
11011
		expectedReplacedSource,
12229
		expectedReplacedSource,
11012
		"diet ast");
12230
		"diet ast");
11013
	
12231
}
11014
	expectedCompletionNodeToString = "<CompleteOnName:int>";
12232
/*
11015
	expectedParentNodeToString = "<NONE>";
12233
 * Test for 'interface' keyword.
11016
	completionIdentifier = "int";
12234
 */
11017
	expectedReplacedSource = "int";
12235
public void test0275_Method(){
11018
	expectedUnitDisplayString =
12236
	String str =
11019
		"public class X {\n" +
12237
		"public class X {\n" +
11020
		"  public X() {\n" +
11021
		"  }\n" +
11022
		"  void foo() {\n" +
12238
		"  void foo() {\n" +
11023
		"    <CompleteOnName:int>;\n" +
12239
		"    #\n" +
12240
		"    abstract int\n" +
11024
		"  }\n" +
12241
		"  }\n" +
11025
		"}\n";
12242
		"}";
12243
12244
	String completeBehind = "int";
12245
	int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
12246
12247
	String expectedCompletionNodeToString = "<CompleteOnName:int>";
12248
	String expectedParentNodeToString = "<NONE>";
12249
	String completionIdentifier = "int";
12250
	String expectedReplacedSource = "int";
12251
	String expectedUnitDisplayString =
12252
			"public class X {\n" +
12253
			"  public X() {\n" +
12254
			"  }\n" +
12255
			"  void foo() {\n" +
12256
			"    <CompleteOnName:int>;\n" +
12257
			"  }\n" +
12258
			"}\n";
11026
	
12259
	
11027
	checkMethodParse(
12260
	checkMethodParse(
11028
		str.toCharArray(), 
12261
		str.toCharArray(), 
Lines 11037-11043 Link Here
11037
/*
12270
/*
11038
 * Test for 'interface' keyword.
12271
 * Test for 'interface' keyword.
11039
 */
12272
 */
11040
public void test0276(){
12273
public void test0276_Diet(){
11041
	String str =
12274
	String str =
11042
		"public class X {\n" +
12275
		"public class X {\n" +
11043
		"  void foo() {\n" +
12276
		"  void foo() {\n" +
Lines 11070-11088 Link Here
11070
		completionIdentifier,
12303
		completionIdentifier,
11071
		expectedReplacedSource,
12304
		expectedReplacedSource,
11072
		"diet ast");
12305
		"diet ast");
11073
	
12306
}
11074
	expectedCompletionNodeToString = "<CompleteOnName:int>";
12307
/*
11075
	expectedParentNodeToString = "<NONE>";
12308
 * Test for 'interface' keyword.
11076
	completionIdentifier = "int";
12309
 */
11077
	expectedReplacedSource = "int";
12310
public void test0276_Method(){
11078
	expectedUnitDisplayString =
12311
	String str =
11079
		"public class X {\n" +
12312
		"public class X {\n" +
11080
		"  public X() {\n" +
11081
		"  }\n" +
11082
		"  void foo() {\n" +
12313
		"  void foo() {\n" +
11083
		"    <CompleteOnName:int>;\n" +
12314
		"    #\n" +
12315
		"    abstract int Y\n" +
11084
		"  }\n" +
12316
		"  }\n" +
11085
		"}\n";
12317
		"}";
12318
12319
	String completeBehind = "int";
12320
	int cursorLocation = str.lastIndexOf("int") + completeBehind.length() - 1;
12321
12322
	String expectedCompletionNodeToString = "<CompleteOnName:int>";
12323
	String expectedParentNodeToString = "<NONE>";
12324
	String completionIdentifier = "int";
12325
	String expectedReplacedSource = "int";
12326
	String expectedUnitDisplayString =
12327
			"public class X {\n" +
12328
			"  public X() {\n" +
12329
			"  }\n" +
12330
			"  void foo() {\n" +
12331
			"    <CompleteOnName:int>;\n" +
12332
			"  }\n" +
12333
			"}\n";
11086
	
12334
	
11087
	checkMethodParse(
12335
	checkMethodParse(
11088
		str.toCharArray(), 
12336
		str.toCharArray(), 
Lines 11302-11308 Link Here
11302
/*
12550
/*
11303
 * Test for 'return' keyword.
12551
 * Test for 'return' keyword.
11304
 */
12552
 */
11305
public void test0284(){
12553
public void test0284_Diet(){
11306
	String str =
12554
	String str =
11307
		"public class X {\n" +
12555
		"public class X {\n" +
11308
		"  int foo() {\n" +
12556
		"  int foo() {\n" +
Lines 11335-11353 Link Here
11335
		completionIdentifier,
12583
		completionIdentifier,
11336
		expectedReplacedSource,
12584
		expectedReplacedSource,
11337
		"diet ast");
12585
		"diet ast");
11338
	
12586
}
11339
	expectedCompletionNodeToString = "<CompleteOnName:ret>";
12587
/*
11340
	expectedParentNodeToString = "<NONE>";
12588
 * Test for 'return' keyword.
11341
	completionIdentifier = "ret";
12589
 */
11342
	expectedReplacedSource = "ret";
12590
public void test0284_Method(){
11343
	expectedUnitDisplayString =
12591
	String str =
11344
		"public class X {\n" +
12592
		"public class X {\n" +
11345
		"  public X() {\n" +
11346
		"  }\n" +
11347
		"  int foo() {\n" +
12593
		"  int foo() {\n" +
11348
		"    <CompleteOnName:ret>;\n" +
12594
		"    #\n" +
12595
		"    ret\n" +
11349
		"  }\n" +
12596
		"  }\n" +
11350
		"}\n";
12597
		"}";
12598
12599
	String completeBehind = "ret";
12600
	int cursorLocation = str.lastIndexOf("ret") + completeBehind.length() - 1;
12601
12602
	String expectedCompletionNodeToString = "<CompleteOnName:ret>";
12603
	String expectedParentNodeToString = "<NONE>";
12604
	String completionIdentifier = "ret";
12605
	String expectedReplacedSource = "ret";
12606
	String expectedUnitDisplayString =
12607
			"public class X {\n" +
12608
			"  public X() {\n" +
12609
			"  }\n" +
12610
			"  int foo() {\n" +
12611
			"    <CompleteOnName:ret>;\n" +
12612
			"  }\n" +
12613
			"}\n";
11351
	
12614
	
11352
	checkMethodParse(
12615
	checkMethodParse(
11353
		str.toCharArray(), 
12616
		str.toCharArray(), 
Lines 11362-11368 Link Here
11362
/*
12625
/*
11363
 * Test for 'throw' keyword.
12626
 * Test for 'throw' keyword.
11364
 */
12627
 */
11365
public void test0285(){
12628
public void test0285_Diet(){
11366
	String str =
12629
	String str =
11367
		"public class X {\n" +
12630
		"public class X {\n" +
11368
		"  void foo() {\n" +
12631
		"  void foo() {\n" +
Lines 11395-11413 Link Here
11395
		completionIdentifier,
12658
		completionIdentifier,
11396
		expectedReplacedSource,
12659
		expectedReplacedSource,
11397
		"diet ast");
12660
		"diet ast");
11398
	
12661
}
11399
	expectedCompletionNodeToString = "<CompleteOnName:thr>";
12662
/*
11400
	expectedParentNodeToString = "<NONE>";
12663
 * Test for 'throw' keyword.
11401
	completionIdentifier = "thr";
12664
 */
11402
	expectedReplacedSource = "thr";
12665
public void test0285_Method(){
11403
	expectedUnitDisplayString =
12666
	String str =
11404
		"public class X {\n" +
12667
		"public class X {\n" +
11405
		"  public X() {\n" +
11406
		"  }\n" +
11407
		"  void foo() {\n" +
12668
		"  void foo() {\n" +
11408
		"    <CompleteOnName:thr>;\n" +
12669
		"    #\n" +
12670
		"    thr\n" +
11409
		"  }\n" +
12671
		"  }\n" +
11410
		"}\n";
12672
		"}";
12673
12674
	String completeBehind = "thr";
12675
	int cursorLocation = str.lastIndexOf("thr") + completeBehind.length() - 1;
12676
12677
	String expectedCompletionNodeToString = "<CompleteOnName:thr>";
12678
	String expectedParentNodeToString = "<NONE>";
12679
	String completionIdentifier = "thr";
12680
	String expectedReplacedSource = "thr";
12681
	String expectedUnitDisplayString =
12682
			"public class X {\n" +
12683
			"  public X() {\n" +
12684
			"  }\n" +
12685
			"  void foo() {\n" +
12686
			"    <CompleteOnName:thr>;\n" +
12687
			"  }\n" +
12688
			"}\n";
11411
	
12689
	
11412
	checkMethodParse(
12690
	checkMethodParse(
11413
		str.toCharArray(), 
12691
		str.toCharArray(), 
Lines 11422-11428 Link Here
11422
/*
12700
/*
11423
 * Test for 'try' keyword.
12701
 * Test for 'try' keyword.
11424
 */
12702
 */
11425
public void test0286(){
12703
public void test0286_Diet(){
11426
	String str =
12704
	String str =
11427
		"public class X {\n" +
12705
		"public class X {\n" +
11428
		"  void foo() {\n" +
12706
		"  void foo() {\n" +
Lines 11455-11473 Link Here
11455
		completionIdentifier,
12733
		completionIdentifier,
11456
		expectedReplacedSource,
12734
		expectedReplacedSource,
11457
		"diet ast");
12735
		"diet ast");
11458
	
12736
}
11459
	expectedCompletionNodeToString = "<CompleteOnName:try>";
12737
/*
11460
	expectedParentNodeToString = "<NONE>";
12738
 * Test for 'try' keyword.
11461
	completionIdentifier = "try";
12739
 */
11462
	expectedReplacedSource = "try";
12740
public void test0286_Method(){
11463
	expectedUnitDisplayString =
12741
	String str =
11464
		"public class X {\n" +
12742
		"public class X {\n" +
11465
		"  public X() {\n" +
11466
		"  }\n" +
11467
		"  void foo() {\n" +
12743
		"  void foo() {\n" +
11468
		"    <CompleteOnName:try>;\n" +
12744
		"    #\n" +
12745
		"    try\n" +
11469
		"  }\n" +
12746
		"  }\n" +
11470
		"}\n";
12747
		"}";
12748
12749
	String completeBehind = "try";
12750
	int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
12751
12752
	String expectedCompletionNodeToString = "<CompleteOnName:try>";
12753
	String expectedParentNodeToString = "<NONE>";
12754
	String completionIdentifier = "try";
12755
	String expectedReplacedSource = "try";
12756
	String expectedUnitDisplayString =
12757
			"public class X {\n" +
12758
			"  public X() {\n" +
12759
			"  }\n" +
12760
			"  void foo() {\n" +
12761
			"    <CompleteOnName:try>;\n" +
12762
			"  }\n" +
12763
			"}\n";
11471
	
12764
	
11472
	checkMethodParse(
12765
	checkMethodParse(
11473
		str.toCharArray(), 
12766
		str.toCharArray(), 
Lines 11482-11488 Link Here
11482
/*
12775
/*
11483
 * Test for 'try' keyword.
12776
 * Test for 'try' keyword.
11484
 */
12777
 */
11485
public void test0287(){
12778
public void test0287_Diet(){
11486
	String str =
12779
	String str =
11487
		"public class X {\n" +
12780
		"public class X {\n" +
11488
		"  void foo() {\n" +
12781
		"  void foo() {\n" +
Lines 11515-11533 Link Here
11515
		completionIdentifier,
12808
		completionIdentifier,
11516
		expectedReplacedSource,
12809
		expectedReplacedSource,
11517
		"diet ast");
12810
		"diet ast");
11518
	
12811
}
11519
	expectedCompletionNodeToString = "<CompleteOnName:try>";
12812
/*
11520
	expectedParentNodeToString = "<NONE>";
12813
 * Test for 'try' keyword.
11521
	completionIdentifier = "try";
12814
 */
11522
	expectedReplacedSource = "try";
12815
public void test0287_Method(){
11523
	expectedUnitDisplayString =
12816
	String str =
11524
		"public class X {\n" +
12817
		"public class X {\n" +
11525
		"  public X() {\n" +
11526
		"  }\n" +
11527
		"  void foo() {\n" +
12818
		"  void foo() {\n" +
11528
		"    <CompleteOnName:try>;\n" +
12819
		"    #\n" +
12820
		"    if(try\n" +
11529
		"  }\n" +
12821
		"  }\n" +
11530
		"}\n";
12822
		"}";
12823
12824
	String completeBehind = "try";
12825
	int cursorLocation = str.lastIndexOf("try") + completeBehind.length() - 1;
12826
12827
	String expectedCompletionNodeToString = "<CompleteOnName:try>";
12828
	String expectedParentNodeToString = "<NONE>";
12829
	String completionIdentifier = "try";
12830
	String expectedReplacedSource = "try";
12831
	String expectedUnitDisplayString =
12832
			"public class X {\n" +
12833
			"  public X() {\n" +
12834
			"  }\n" +
12835
			"  void foo() {\n" +
12836
			"    <CompleteOnName:try>;\n" +
12837
			"  }\n" +
12838
			"}\n";
11531
	
12839
	
11532
	checkMethodParse(
12840
	checkMethodParse(
11533
		str.toCharArray(), 
12841
		str.toCharArray(), 
Lines 11542-11548 Link Here
11542
/*
12850
/*
11543
 * Test for 'do' keyword.
12851
 * Test for 'do' keyword.
11544
 */
12852
 */
11545
public void test0288(){
12853
public void test0288_Diet(){
11546
	String str =
12854
	String str =
11547
		"public class X {\n" +
12855
		"public class X {\n" +
11548
		"  void foo() {\n" +
12856
		"  void foo() {\n" +
Lines 11575-11593 Link Here
11575
		completionIdentifier,
12883
		completionIdentifier,
11576
		expectedReplacedSource,
12884
		expectedReplacedSource,
11577
		"diet ast");
12885
		"diet ast");
11578
	
12886
}
11579
	expectedCompletionNodeToString = "<CompleteOnName:do>";
12887
/*
11580
	expectedParentNodeToString = "<NONE>";
12888
 * Test for 'do' keyword.
11581
	completionIdentifier = "do";
12889
 */
11582
	expectedReplacedSource = "do";
12890
public void test0288_Method(){
11583
	expectedUnitDisplayString =
12891
	String str =
11584
		"public class X {\n" +
12892
		"public class X {\n" +
11585
		"  public X() {\n" +
11586
		"  }\n" +
11587
		"  void foo() {\n" +
12893
		"  void foo() {\n" +
11588
		"    <CompleteOnName:do>;\n" +
12894
		"    #\n" +
12895
		"    if(do\n" +
11589
		"  }\n" +
12896
		"  }\n" +
11590
		"}\n";
12897
		"}";
12898
12899
	String completeBehind = "do";
12900
	int cursorLocation = str.lastIndexOf("do") + completeBehind.length() - 1;
12901
12902
	String expectedCompletionNodeToString = "<CompleteOnName:do>";
12903
	String expectedParentNodeToString = "<NONE>";
12904
	String completionIdentifier = "do";
12905
	String expectedReplacedSource = "do";
12906
	String expectedUnitDisplayString =
12907
			"public class X {\n" +
12908
			"  public X() {\n" +
12909
			"  }\n" +
12910
			"  void foo() {\n" +
12911
			"    <CompleteOnName:do>;\n" +
12912
			"  }\n" +
12913
			"}\n";
11591
	
12914
	
11592
	checkMethodParse(
12915
	checkMethodParse(
11593
		str.toCharArray(), 
12916
		str.toCharArray(), 
Lines 11602-11608 Link Here
11602
/*
12925
/*
11603
 * Test for 'for' keyword.
12926
 * Test for 'for' keyword.
11604
 */
12927
 */
11605
public void test0289(){
12928
public void test0289_Diet(){
11606
	String str =
12929
	String str =
11607
		"public class X {\n" +
12930
		"public class X {\n" +
11608
		"  void foo() {\n" +
12931
		"  void foo() {\n" +
Lines 11635-11653 Link Here
11635
		completionIdentifier,
12958
		completionIdentifier,
11636
		expectedReplacedSource,
12959
		expectedReplacedSource,
11637
		"diet ast");
12960
		"diet ast");
11638
	
12961
}
11639
	expectedCompletionNodeToString = "<CompleteOnName:for>";
12962
/*
11640
	expectedParentNodeToString = "<NONE>";
12963
 * Test for 'for' keyword.
11641
	completionIdentifier = "for";
12964
 */
11642
	expectedReplacedSource = "for";
12965
public void test0289_Method(){
11643
	expectedUnitDisplayString =
12966
	String str =
11644
		"public class X {\n" +
12967
		"public class X {\n" +
11645
		"  public X() {\n" +
11646
		"  }\n" +
11647
		"  void foo() {\n" +
12968
		"  void foo() {\n" +
11648
		"    <CompleteOnName:for>;\n" +
12969
		"    #\n" +
12970
		"    if(for\n" +
11649
		"  }\n" +
12971
		"  }\n" +
11650
		"}\n";
12972
		"}";
12973
12974
	String completeBehind = "for";
12975
	int cursorLocation = str.lastIndexOf("for") + completeBehind.length() - 1;
12976
12977
	String expectedCompletionNodeToString = "<CompleteOnName:for>";
12978
	String expectedParentNodeToString = "<NONE>";
12979
	String completionIdentifier = "for";
12980
	String expectedReplacedSource = "for";
12981
	String expectedUnitDisplayString =
12982
			"public class X {\n" +
12983
			"  public X() {\n" +
12984
			"  }\n" +
12985
			"  void foo() {\n" +
12986
			"    <CompleteOnName:for>;\n" +
12987
			"  }\n" +
12988
			"}\n";
11651
	
12989
	
11652
	checkMethodParse(
12990
	checkMethodParse(
11653
		str.toCharArray(), 
12991
		str.toCharArray(), 
Lines 11662-11668 Link Here
11662
/*
13000
/*
11663
 * Test for 'if' keyword.
13001
 * Test for 'if' keyword.
11664
 */
13002
 */
11665
public void test0290(){
13003
public void test0290_Diet(){
11666
	String str =
13004
	String str =
11667
		"public class X {\n" +
13005
		"public class X {\n" +
11668
		"  void foo() {\n" +
13006
		"  void foo() {\n" +
Lines 11695-11713 Link Here
11695
		completionIdentifier,
13033
		completionIdentifier,
11696
		expectedReplacedSource,
13034
		expectedReplacedSource,
11697
		"diet ast");
13035
		"diet ast");
11698
	
13036
}
11699
	expectedCompletionNodeToString = "<CompleteOnName:if>";
13037
/*
11700
	expectedParentNodeToString = "<NONE>";
13038
 * Test for 'if' keyword.
11701
	completionIdentifier = "if";
13039
 */
11702
	expectedReplacedSource = "if";
13040
public void test0290_Method(){
11703
	expectedUnitDisplayString =
13041
	String str =
11704
		"public class X {\n" +
13042
		"public class X {\n" +
11705
		"  public X() {\n" +
11706
		"  }\n" +
11707
		"  void foo() {\n" +
13043
		"  void foo() {\n" +
11708
		"    <CompleteOnName:if>;\n" +
13044
		"    #\n" +
13045
		"    if(if\n" +
11709
		"  }\n" +
13046
		"  }\n" +
11710
		"}\n";
13047
		"}";
13048
13049
	String completeBehind = "if";
13050
	int cursorLocation = str.lastIndexOf("if") + completeBehind.length() - 1;
13051
13052
	String expectedCompletionNodeToString = "<CompleteOnName:if>";
13053
	String expectedParentNodeToString = "<NONE>";
13054
	String completionIdentifier = "if";
13055
	String expectedReplacedSource = "if";
13056
	String expectedUnitDisplayString =
13057
			"public class X {\n" +
13058
			"  public X() {\n" +
13059
			"  }\n" +
13060
			"  void foo() {\n" +
13061
			"    <CompleteOnName:if>;\n" +
13062
			"  }\n" +
13063
			"}\n";
11711
	
13064
	
11712
	checkMethodParse(
13065
	checkMethodParse(
11713
		str.toCharArray(), 
13066
		str.toCharArray(), 
Lines 11722-11728 Link Here
11722
/*
13075
/*
11723
 * Test for 'switch' keyword.
13076
 * Test for 'switch' keyword.
11724
 */
13077
 */
11725
public void test0291(){
13078
public void test0291_Diet(){
11726
	String str =
13079
	String str =
11727
		"public class X {\n" +
13080
		"public class X {\n" +
11728
		"  void foo() {\n" +
13081
		"  void foo() {\n" +
Lines 11755-11773 Link Here
11755
		completionIdentifier,
13108
		completionIdentifier,
11756
		expectedReplacedSource,
13109
		expectedReplacedSource,
11757
		"diet ast");
13110
		"diet ast");
11758
	
13111
}
11759
	expectedCompletionNodeToString = "<CompleteOnName:swi>";
13112
/*
11760
	expectedParentNodeToString = "<NONE>";
13113
 * Test for 'switch' keyword.
11761
	completionIdentifier = "swi";
13114
 */
11762
	expectedReplacedSource = "swi";
13115
public void test0291_Method(){
11763
	expectedUnitDisplayString =
13116
	String str =
11764
		"public class X {\n" +
13117
		"public class X {\n" +
11765
		"  public X() {\n" +
11766
		"  }\n" +
11767
		"  void foo() {\n" +
13118
		"  void foo() {\n" +
11768
		"    <CompleteOnName:swi>;\n" +
13119
		"    #\n" +
13120
		"    if(swi\n" +
11769
		"  }\n" +
13121
		"  }\n" +
11770
		"}\n";
13122
		"}";
13123
13124
	String completeBehind = "swi";
13125
	int cursorLocation = str.lastIndexOf("swi") + completeBehind.length() - 1;
13126
13127
	String expectedCompletionNodeToString = "<CompleteOnName:swi>";
13128
	String expectedParentNodeToString = "<NONE>";
13129
	String completionIdentifier = "swi";
13130
	String expectedReplacedSource = "swi";
13131
	String expectedUnitDisplayString =
13132
			"public class X {\n" +
13133
			"  public X() {\n" +
13134
			"  }\n" +
13135
			"  void foo() {\n" +
13136
			"    <CompleteOnName:swi>;\n" +
13137
			"  }\n" +
13138
			"}\n";
11771
	
13139
	
11772
	checkMethodParse(
13140
	checkMethodParse(
11773
		str.toCharArray(), 
13141
		str.toCharArray(), 
Lines 11782-11788 Link Here
11782
/*
13150
/*
11783
 * Test for 'new' keyword.
13151
 * Test for 'new' keyword.
11784
 */
13152
 */
11785
public void test0292(){
13153
public void test0292_Diet(){
11786
	String str =
13154
	String str =
11787
		"public class X {\n" +
13155
		"public class X {\n" +
11788
		"  void foo() {\n" +
13156
		"  void foo() {\n" +
Lines 11815-11833 Link Here
11815
		completionIdentifier,
13183
		completionIdentifier,
11816
		expectedReplacedSource,
13184
		expectedReplacedSource,
11817
		"diet ast");
13185
		"diet ast");
11818
	
13186
}
11819
	expectedCompletionNodeToString = "<CompleteOnName:new>";
13187
/*
11820
	expectedParentNodeToString = "<NONE>";
13188
 * Test for 'new' keyword.
11821
	completionIdentifier = "new";
13189
 */
11822
	expectedReplacedSource = "new";
13190
public void test0292_Method(){
11823
	expectedUnitDisplayString =
13191
	String str =
11824
		"public class X {\n" +
13192
		"public class X {\n" +
11825
		"  public X() {\n" +
11826
		"  }\n" +
11827
		"  void foo() {\n" +
13193
		"  void foo() {\n" +
11828
		"    <CompleteOnName:new>;\n" +
13194
		"    #\n" +
13195
		"    new\n" +
11829
		"  }\n" +
13196
		"  }\n" +
11830
		"}\n";
13197
		"}";
13198
13199
	String completeBehind = "new";
13200
	int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
13201
13202
	String expectedCompletionNodeToString = "<CompleteOnName:new>";
13203
	String expectedParentNodeToString = "<NONE>";
13204
	String completionIdentifier = "new";
13205
	String expectedReplacedSource = "new";
13206
	String expectedUnitDisplayString =
13207
			"public class X {\n" +
13208
			"  public X() {\n" +
13209
			"  }\n" +
13210
			"  void foo() {\n" +
13211
			"    <CompleteOnName:new>;\n" +
13212
			"  }\n" +
13213
			"}\n";
11831
	
13214
	
11832
	checkMethodParse(
13215
	checkMethodParse(
11833
		str.toCharArray(), 
13216
		str.toCharArray(), 
Lines 11842-11848 Link Here
11842
/*
13225
/*
11843
 * Test for 'new' keyword.
13226
 * Test for 'new' keyword.
11844
 */
13227
 */
11845
public void test0293(){
13228
public void test0293_Diet(){
11846
	String str =
13229
	String str =
11847
		"public class X {\n" +
13230
		"public class X {\n" +
11848
		"  void foo() {\n" +
13231
		"  void foo() {\n" +
Lines 11875-11893 Link Here
11875
		completionIdentifier,
13258
		completionIdentifier,
11876
		expectedReplacedSource,
13259
		expectedReplacedSource,
11877
		"diet ast");
13260
		"diet ast");
11878
	
13261
}
11879
	expectedCompletionNodeToString = "<CompleteOnName:new>";
13262
/*
11880
	expectedParentNodeToString = "<NONE>";
13263
 * Test for 'new' keyword.
11881
	completionIdentifier = "new";
13264
 */
11882
	expectedReplacedSource = "new";
13265
public void test0293_Method(){
11883
	expectedUnitDisplayString =
13266
	String str =
11884
		"public class X {\n" +
13267
		"public class X {\n" +
11885
		"  public X() {\n" +
11886
		"  }\n" +
11887
		"  void foo() {\n" +
13268
		"  void foo() {\n" +
11888
		"    <CompleteOnName:new>;\n" +
13269
		"    #\n" +
13270
		"    new X\n" +
11889
		"  }\n" +
13271
		"  }\n" +
11890
		"}\n";
13272
		"}";
13273
13274
	String completeBehind = "new";
13275
	int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
13276
13277
	String expectedCompletionNodeToString = "<CompleteOnName:new>";
13278
	String expectedParentNodeToString = "<NONE>";
13279
	String completionIdentifier = "new";
13280
	String expectedReplacedSource = "new";
13281
	String expectedUnitDisplayString =
13282
			"public class X {\n" +
13283
			"  public X() {\n" +
13284
			"  }\n" +
13285
			"  void foo() {\n" +
13286
			"    <CompleteOnName:new>;\n" +
13287
			"  }\n" +
13288
			"}\n";
11891
	
13289
	
11892
	checkMethodParse(
13290
	checkMethodParse(
11893
		str.toCharArray(), 
13291
		str.toCharArray(), 
Lines 11902-11908 Link Here
11902
/*
13300
/*
11903
 * Test for 'new' keyword.
13301
 * Test for 'new' keyword.
11904
 */
13302
 */
11905
public void test0294(){
13303
public void test0294_Diet(){
11906
	String str =
13304
	String str =
11907
		"public class X {\n" +
13305
		"public class X {\n" +
11908
		"  void foo() {\n" +
13306
		"  void foo() {\n" +
Lines 11935-11953 Link Here
11935
		completionIdentifier,
13333
		completionIdentifier,
11936
		expectedReplacedSource,
13334
		expectedReplacedSource,
11937
		"diet ast");
13335
		"diet ast");
11938
	
13336
}
11939
	expectedCompletionNodeToString = "<CompleteOnName:new>";
13337
/*
11940
	expectedParentNodeToString = "<NONE>";
13338
 * Test for 'new' keyword.
11941
	completionIdentifier = "new";
13339
 */
11942
	expectedReplacedSource = "new";
13340
public void test0294_Method(){
11943
	expectedUnitDisplayString =
13341
	String str =
11944
		"public class X {\n" +
13342
		"public class X {\n" +
11945
		"  public X() {\n" +
11946
		"  }\n" +
11947
		"  void foo() {\n" +
13343
		"  void foo() {\n" +
11948
		"    <CompleteOnName:new>;\n" +
13344
		"    #\n" +
13345
		"    new X()\n" +
11949
		"  }\n" +
13346
		"  }\n" +
11950
		"}\n";
13347
		"}";
13348
13349
	String completeBehind = "new";
13350
	int cursorLocation = str.lastIndexOf("new") + completeBehind.length() - 1;
13351
13352
	String expectedCompletionNodeToString = "<CompleteOnName:new>";
13353
	String expectedParentNodeToString = "<NONE>";
13354
	String completionIdentifier = "new";
13355
	String expectedReplacedSource = "new";
13356
	String expectedUnitDisplayString =
13357
			"public class X {\n" +
13358
			"  public X() {\n" +
13359
			"  }\n" +
13360
			"  void foo() {\n" +
13361
			"    <CompleteOnName:new>;\n" +
13362
			"  }\n" +
13363
			"}\n";
11951
	
13364
	
11952
	checkMethodParse(
13365
	checkMethodParse(
11953
		str.toCharArray(), 
13366
		str.toCharArray(), 
Lines 12176-12182 Link Here
12176
/*
13589
/*
12177
 * Test for 'while' keyword.
13590
 * Test for 'while' keyword.
12178
 */
13591
 */
12179
public void test0301(){
13592
public void test0301_Diet(){
12180
	String str =
13593
	String str =
12181
		"public class X {\n" +
13594
		"public class X {\n" +
12182
		"  void foo() {\n" +
13595
		"  void foo() {\n" +
Lines 12209-12227 Link Here
12209
		completionIdentifier,
13622
		completionIdentifier,
12210
		expectedReplacedSource,
13623
		expectedReplacedSource,
12211
		"diet ast");
13624
		"diet ast");
12212
	
13625
}
12213
	expectedCompletionNodeToString = "<CompleteOnName:whi>";
13626
/*
12214
	expectedParentNodeToString = "<NONE>";
13627
 * Test for 'while' keyword.
12215
	completionIdentifier = "whi";
13628
 */
12216
	expectedReplacedSource = "whi";
13629
public void test0301_Method(){
12217
	expectedUnitDisplayString =
13630
	String str =
12218
		"public class X {\n" +
13631
		"public class X {\n" +
12219
		"  public X() {\n" +
12220
		"  }\n" +
12221
		"  void foo() {\n" +
13632
		"  void foo() {\n" +
12222
		"    <CompleteOnName:whi>;\n" +
13633
		"    #\n" +
13634
		"    whi\n" +
12223
		"  }\n" +
13635
		"  }\n" +
12224
		"}\n";
13636
		"}";
13637
13638
	String completeBehind = "whi";
13639
	int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
13640
13641
	String expectedCompletionNodeToString = "<CompleteOnName:whi>";
13642
	String expectedParentNodeToString = "<NONE>";
13643
	String completionIdentifier = "whi";
13644
	String expectedReplacedSource = "whi";
13645
	String expectedUnitDisplayString =
13646
			"public class X {\n" +
13647
			"  public X() {\n" +
13648
			"  }\n" +
13649
			"  void foo() {\n" +
13650
			"    <CompleteOnName:whi>;\n" +
13651
			"  }\n" +
13652
			"}\n";
12225
	
13653
	
12226
	checkMethodParse(
13654
	checkMethodParse(
12227
		str.toCharArray(), 
13655
		str.toCharArray(), 
Lines 12236-12242 Link Here
12236
/*
13664
/*
12237
 * Test for 'while' keyword.
13665
 * Test for 'while' keyword.
12238
 */
13666
 */
12239
public void test0302(){
13667
public void test0302_Diet(){
12240
	String str =
13668
	String str =
12241
		"public class X {\n" +
13669
		"public class X {\n" +
12242
		"  void foo() {\n" +
13670
		"  void foo() {\n" +
Lines 12269-12287 Link Here
12269
		completionIdentifier,
13697
		completionIdentifier,
12270
		expectedReplacedSource,
13698
		expectedReplacedSource,
12271
		"diet ast");
13699
		"diet ast");
12272
	
13700
}
12273
	expectedCompletionNodeToString = "<CompleteOnName:whi>";
13701
/*
12274
	expectedParentNodeToString = "<NONE>";
13702
 * Test for 'while' keyword.
12275
	completionIdentifier = "whi";
13703
 */
12276
	expectedReplacedSource = "whi";
13704
public void test0302_Method(){
12277
	expectedUnitDisplayString =
13705
	String str =
12278
		"public class X {\n" +
13706
		"public class X {\n" +
12279
		"  public X() {\n" +
12280
		"  }\n" +
12281
		"  void foo() {\n" +
13707
		"  void foo() {\n" +
12282
		"    <CompleteOnName:whi>;\n" +
13708
		"    #\n" +
13709
		"    if(whi\n" +
12283
		"  }\n" +
13710
		"  }\n" +
12284
		"}\n";
13711
		"}";
13712
13713
	String completeBehind = "whi";
13714
	int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
13715
13716
	String expectedCompletionNodeToString = "<CompleteOnName:whi>";
13717
	String expectedParentNodeToString = "<NONE>";
13718
	String completionIdentifier = "whi";
13719
	String expectedReplacedSource = "whi";
13720
	String expectedUnitDisplayString =
13721
			"public class X {\n" +
13722
			"  public X() {\n" +
13723
			"  }\n" +
13724
			"  void foo() {\n" +
13725
			"    <CompleteOnName:whi>;\n" +
13726
			"  }\n" +
13727
			"}\n";
12285
	
13728
	
12286
	checkMethodParse(
13729
	checkMethodParse(
12287
		str.toCharArray(), 
13730
		str.toCharArray(), 
Lines 12296-12302 Link Here
12296
/*
13739
/*
12297
 * Test for 'assert' keyword.
13740
 * Test for 'assert' keyword.
12298
 */
13741
 */
12299
public void test0303(){
13742
public void test0303_Diet(){
12300
	String str =
13743
	String str =
12301
		"public class X {\n" +
13744
		"public class X {\n" +
12302
		"  void foo() {\n" +
13745
		"  void foo() {\n" +
Lines 12329-12347 Link Here
12329
		completionIdentifier,
13772
		completionIdentifier,
12330
		expectedReplacedSource,
13773
		expectedReplacedSource,
12331
		"diet ast");
13774
		"diet ast");
12332
	
13775
}
12333
	expectedCompletionNodeToString = "<CompleteOnName:ass>";
13776
/*
12334
	expectedParentNodeToString = "<NONE>";
13777
 * Test for 'assert' keyword.
12335
	completionIdentifier = "ass";
13778
 */
12336
	expectedReplacedSource = "ass";
13779
public void test0303_Method(){
12337
	expectedUnitDisplayString =
13780
	String str =
12338
		"public class X {\n" +
13781
		"public class X {\n" +
12339
		"  public X() {\n" +
12340
		"  }\n" +
12341
		"  void foo() {\n" +
13782
		"  void foo() {\n" +
12342
		"    <CompleteOnName:ass>;\n" +
13783
		"    #\n" +
13784
		"    ass\n" +
12343
		"  }\n" +
13785
		"  }\n" +
12344
		"}\n";
13786
		"}";
13787
13788
	String completeBehind = "ass";
13789
	int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
13790
13791
	String expectedCompletionNodeToString = "<CompleteOnName:ass>";
13792
	String expectedParentNodeToString = "<NONE>";
13793
	String completionIdentifier = "ass";
13794
	String expectedReplacedSource = "ass";
13795
	String expectedUnitDisplayString =
13796
			"public class X {\n" +
13797
			"  public X() {\n" +
13798
			"  }\n" +
13799
			"  void foo() {\n" +
13800
			"    <CompleteOnName:ass>;\n" +
13801
			"  }\n" +
13802
			"}\n";
12345
	
13803
	
12346
	checkMethodParse(
13804
	checkMethodParse(
12347
		str.toCharArray(), 
13805
		str.toCharArray(), 
Lines 12356-12362 Link Here
12356
/*
13814
/*
12357
 * Test for 'assert' keyword.
13815
 * Test for 'assert' keyword.
12358
 */
13816
 */
12359
public void test0304(){
13817
public void test0304_Diet(){
12360
	String str =
13818
	String str =
12361
		"public class X {\n" +
13819
		"public class X {\n" +
12362
		"  void foo() {\n" +
13820
		"  void foo() {\n" +
Lines 12389-12407 Link Here
12389
		completionIdentifier,
13847
		completionIdentifier,
12390
		expectedReplacedSource,
13848
		expectedReplacedSource,
12391
		"diet ast");
13849
		"diet ast");
12392
	
13850
}
12393
	expectedCompletionNodeToString = "<CompleteOnName:ass>";
13851
/*
12394
	expectedParentNodeToString = "<NONE>";
13852
 * Test for 'assert' keyword.
12395
	completionIdentifier = "ass";
13853
 */
12396
	expectedReplacedSource = "ass";
13854
public void test0304_Method(){
12397
	expectedUnitDisplayString =
13855
	String str =
12398
		"public class X {\n" +
13856
		"public class X {\n" +
12399
		"  public X() {\n" +
12400
		"  }\n" +
12401
		"  void foo() {\n" +
13857
		"  void foo() {\n" +
12402
		"    <CompleteOnName:ass>;\n" +
13858
		"    #\n" +
13859
		"    if(ass\n" +
12403
		"  }\n" +
13860
		"  }\n" +
12404
		"}\n";
13861
		"}";
13862
13863
	String completeBehind = "ass";
13864
	int cursorLocation = str.lastIndexOf("ass") + completeBehind.length() - 1;
13865
13866
	String expectedCompletionNodeToString = "<CompleteOnName:ass>";
13867
	String expectedParentNodeToString = "<NONE>";
13868
	String completionIdentifier = "ass";
13869
	String expectedReplacedSource = "ass";
13870
	String expectedUnitDisplayString =
13871
			"public class X {\n" +
13872
			"  public X() {\n" +
13873
			"  }\n" +
13874
			"  void foo() {\n" +
13875
			"    <CompleteOnName:ass>;\n" +
13876
			"  }\n" +
13877
			"}\n";
12405
	
13878
	
12406
	checkMethodParse(
13879
	checkMethodParse(
12407
		str.toCharArray(), 
13880
		str.toCharArray(), 
Lines 13608-13614 Link Here
13608
/*
15081
/*
13609
 * Test for 'synchronized' keyword.
15082
 * Test for 'synchronized' keyword.
13610
 */
15083
 */
13611
public void test0341(){
15084
public void test0341_Diet(){
13612
	String str =
15085
	String str =
13613
		"public class X {\n" +
15086
		"public class X {\n" +
13614
		"  void foo() {\n" +
15087
		"  void foo() {\n" +
Lines 13641-13659 Link Here
13641
		completionIdentifier,
15114
		completionIdentifier,
13642
		expectedReplacedSource,
15115
		expectedReplacedSource,
13643
		"diet ast");
15116
		"diet ast");
13644
	
15117
}
13645
	expectedCompletionNodeToString = "<CompleteOnName:syn>";
15118
/*
13646
	expectedParentNodeToString = "<NONE>";
15119
 * Test for 'synchronized' keyword.
13647
	completionIdentifier = "syn";
15120
 */
13648
	expectedReplacedSource = "syn";
15121
public void test0341_Method(){
13649
	expectedUnitDisplayString =
15122
	String str =
13650
		"public class X {\n" +
15123
		"public class X {\n" +
13651
		"  public X() {\n" +
13652
		"  }\n" +
13653
		"  void foo() {\n" +
15124
		"  void foo() {\n" +
13654
		"    <CompleteOnName:syn>;\n" +
15125
		"    #\n" +
15126
		"    syn\n" +
13655
		"  }\n" +
15127
		"  }\n" +
13656
		"}\n";
15128
		"}";
15129
15130
	String completeBehind = "syn";
15131
	int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
15132
15133
	String expectedCompletionNodeToString = "<CompleteOnName:syn>";
15134
	String expectedParentNodeToString = "<NONE>";
15135
	String completionIdentifier = "syn";
15136
	String expectedReplacedSource = "syn";
15137
	String expectedUnitDisplayString =
15138
			"public class X {\n" +
15139
			"  public X() {\n" +
15140
			"  }\n" +
15141
			"  void foo() {\n" +
15142
			"    <CompleteOnName:syn>;\n" +
15143
			"  }\n" +
15144
			"}\n";
13657
	
15145
	
13658
	checkMethodParse(
15146
	checkMethodParse(
13659
		str.toCharArray(), 
15147
		str.toCharArray(), 
Lines 13668-13674 Link Here
13668
/*
15156
/*
13669
 * Test for 'synchronized' keyword.
15157
 * Test for 'synchronized' keyword.
13670
 */
15158
 */
13671
public void test0342(){
15159
public void test0342_Diet(){
13672
	String str =
15160
	String str =
13673
		"public class X {\n" +
15161
		"public class X {\n" +
13674
		"  void foo() {\n" +
15162
		"  void foo() {\n" +
Lines 13701-13719 Link Here
13701
		completionIdentifier,
15189
		completionIdentifier,
13702
		expectedReplacedSource,
15190
		expectedReplacedSource,
13703
		"diet ast");
15191
		"diet ast");
13704
	
15192
}
13705
	expectedCompletionNodeToString = "<CompleteOnName:syn>";
15193
/*
13706
	expectedParentNodeToString = "<NONE>";
15194
 * Test for 'synchronized' keyword.
13707
	completionIdentifier = "syn";
15195
 */
13708
	expectedReplacedSource = "syn";
15196
public void test0342_Method(){
13709
	expectedUnitDisplayString =
15197
	String str =
13710
		"public class X {\n" +
15198
		"public class X {\n" +
13711
		"  public X() {\n" +
13712
		"  }\n" +
13713
		"  void foo() {\n" +
15199
		"  void foo() {\n" +
13714
		"    <CompleteOnName:syn>;\n" +
15200
		"    #\n" +
15201
		"    if(syn\n" +
13715
		"  }\n" +
15202
		"  }\n" +
13716
		"}\n";
15203
		"}";
15204
15205
	String completeBehind = "syn";
15206
	int cursorLocation = str.lastIndexOf("syn") + completeBehind.length() - 1;
15207
15208
	String expectedCompletionNodeToString = "<CompleteOnName:syn>";
15209
	String expectedParentNodeToString = "<NONE>";
15210
	String completionIdentifier = "syn";
15211
	String expectedReplacedSource = "syn";
15212
	String expectedUnitDisplayString =
15213
			"public class X {\n" +
15214
			"  public X() {\n" +
15215
			"  }\n" +
15216
			"  void foo() {\n" +
15217
			"    <CompleteOnName:syn>;\n" +
15218
			"  }\n" +
15219
			"}\n";
13717
	
15220
	
13718
	checkMethodParse(
15221
	checkMethodParse(
13719
		str.toCharArray(), 
15222
		str.toCharArray(), 
Lines 14741-14747 Link Here
14741
/*
16244
/*
14742
 * Test for 'super' keyword.
16245
 * Test for 'super' keyword.
14743
 */
16246
 */
14744
public void test0375(){
16247
public void test0375_Diet(){
14745
	String str =
16248
	String str =
14746
		"public class X {\n" +
16249
		"public class X {\n" +
14747
		"  void foo(){\n" +
16250
		"  void foo(){\n" +
Lines 14774-14792 Link Here
14774
		completionIdentifier,
16277
		completionIdentifier,
14775
		expectedReplacedSource,
16278
		expectedReplacedSource,
14776
		"diet ast");
16279
		"diet ast");
14777
	
16280
}
14778
	expectedCompletionNodeToString = "<CompleteOnName:sup>";
16281
/*
14779
	expectedParentNodeToString = "<NONE>";
16282
 * Test for 'super' keyword.
14780
	completionIdentifier = "sup";
16283
 */
14781
	expectedReplacedSource = "sup";
16284
public void test0375_Method(){
14782
	expectedUnitDisplayString =
16285
	String str =
14783
		"public class X {\n" +
16286
		"public class X {\n" +
14784
		"  public X() {\n" +
16287
		"  void foo(){\n" +
14785
		"  }\n" +
16288
		"    #\n" +
14786
		"  void foo() {\n" +
16289
		"    sup\n" +
14787
		"    <CompleteOnName:sup>;\n" +
14788
		"  }\n" +
16290
		"  }\n" +
14789
		"}\n";
16291
		"}\n";
16292
16293
	String completeBehind = "sup";
16294
	int cursorLocation = str.lastIndexOf("sup") + completeBehind.length() - 1;
16295
16296
	String expectedCompletionNodeToString = "<CompleteOnName:sup>";
16297
	String expectedParentNodeToString = "<NONE>";
16298
	String completionIdentifier = "sup";
16299
	String expectedReplacedSource = "sup";
16300
	String expectedUnitDisplayString =
16301
			"public class X {\n" +
16302
			"  public X() {\n" +
16303
			"  }\n" +
16304
			"  void foo() {\n" +
16305
			"    <CompleteOnName:sup>;\n" +
16306
			"  }\n" +
16307
			"}\n";
14790
	
16308
	
14791
	checkMethodParse(
16309
	checkMethodParse(
14792
		str.toCharArray(), 
16310
		str.toCharArray(), 
Lines 14801-14807 Link Here
14801
/*
16319
/*
14802
 * Test for 'this' keyword.
16320
 * Test for 'this' keyword.
14803
 */
16321
 */
14804
public void test0376(){
16322
public void test0376_Diet(){
14805
	String str =
16323
	String str =
14806
		"public class X {\n" +
16324
		"public class X {\n" +
14807
		"  void foo(){\n" +
16325
		"  void foo(){\n" +
Lines 14834-14852 Link Here
14834
		completionIdentifier,
16352
		completionIdentifier,
14835
		expectedReplacedSource,
16353
		expectedReplacedSource,
14836
		"diet ast");
16354
		"diet ast");
14837
	
16355
}
14838
	expectedCompletionNodeToString = "<CompleteOnName:thi>";
16356
/*
14839
	expectedParentNodeToString = "<NONE>";
16357
 * Test for 'this' keyword.
14840
	completionIdentifier = "thi";
16358
 */
14841
	expectedReplacedSource = "thi";
16359
public void test0376_Method(){
14842
	expectedUnitDisplayString =
16360
	String str =
14843
		"public class X {\n" +
16361
		"public class X {\n" +
14844
		"  public X() {\n" +
16362
		"  void foo(){\n" +
14845
		"  }\n" +
16363
		"    #\n" +
14846
		"  void foo() {\n" +
16364
		"    thi\n" +
14847
		"    <CompleteOnName:thi>;\n" +
14848
		"  }\n" +
16365
		"  }\n" +
14849
		"}\n";
16366
		"}\n";
16367
16368
	String completeBehind = "thi";
16369
	int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
16370
16371
	String expectedCompletionNodeToString = "<CompleteOnName:thi>";
16372
	String expectedParentNodeToString = "<NONE>";
16373
	String completionIdentifier = "thi";
16374
	String expectedReplacedSource = "thi";
16375
	String expectedUnitDisplayString =
16376
			"public class X {\n" +
16377
			"  public X() {\n" +
16378
			"  }\n" +
16379
			"  void foo() {\n" +
16380
			"    <CompleteOnName:thi>;\n" +
16381
			"  }\n" +
16382
			"}\n";
14850
	
16383
	
14851
	checkMethodParse(
16384
	checkMethodParse(
14852
		str.toCharArray(), 
16385
		str.toCharArray(), 
Lines 14861-14867 Link Here
14861
/*
16394
/*
14862
 * Test for 'true' keyword.
16395
 * Test for 'true' keyword.
14863
 */
16396
 */
14864
public void test0377(){
16397
public void test0377_Diet(){
14865
	String str =
16398
	String str =
14866
		"public class X {\n" +
16399
		"public class X {\n" +
14867
		"  void foo(){\n" +
16400
		"  void foo(){\n" +
Lines 14894-14912 Link Here
14894
		completionIdentifier,
16427
		completionIdentifier,
14895
		expectedReplacedSource,
16428
		expectedReplacedSource,
14896
		"diet ast");
16429
		"diet ast");
14897
	
16430
}
14898
	expectedCompletionNodeToString = "<CompleteOnName:tru>";
16431
/*
14899
	expectedParentNodeToString = "<NONE>";
16432
 * Test for 'true' keyword.
14900
	completionIdentifier = "tru";
16433
 */
14901
	expectedReplacedSource = "tru";
16434
public void test0377_Method(){
14902
	expectedUnitDisplayString =
16435
	String str =
14903
		"public class X {\n" +
16436
		"public class X {\n" +
14904
		"  public X() {\n" +
16437
		"  void foo(){\n" +
14905
		"  }\n" +
16438
		"    #\n" +
14906
		"  void foo() {\n" +
16439
		"    tru\n" +
14907
		"    <CompleteOnName:tru>;\n" +
14908
		"  }\n" +
16440
		"  }\n" +
14909
		"}\n";
16441
		"}\n";
16442
16443
	String completeBehind = "tru";
16444
	int cursorLocation = str.lastIndexOf("tru") + completeBehind.length() - 1;
16445
16446
	String expectedCompletionNodeToString = "<CompleteOnName:tru>";
16447
	String expectedParentNodeToString = "<NONE>";
16448
	String completionIdentifier = "tru";
16449
	String expectedReplacedSource = "tru";
16450
	String expectedUnitDisplayString =
16451
			"public class X {\n" +
16452
			"  public X() {\n" +
16453
			"  }\n" +
16454
			"  void foo() {\n" +
16455
			"    <CompleteOnName:tru>;\n" +
16456
			"  }\n" +
16457
			"}\n";
14910
	
16458
	
14911
	checkMethodParse(
16459
	checkMethodParse(
14912
		str.toCharArray(), 
16460
		str.toCharArray(), 
Lines 14921-14927 Link Here
14921
/*
16469
/*
14922
 * Test for 'false' keyword.
16470
 * Test for 'false' keyword.
14923
 */
16471
 */
14924
public void test0378(){
16472
public void test0378_Diet(){
14925
	String str =
16473
	String str =
14926
		"public class X {\n" +
16474
		"public class X {\n" +
14927
		"  void foo(){\n" +
16475
		"  void foo(){\n" +
Lines 14954-14972 Link Here
14954
		completionIdentifier,
16502
		completionIdentifier,
14955
		expectedReplacedSource,
16503
		expectedReplacedSource,
14956
		"diet ast");
16504
		"diet ast");
14957
	
16505
}
14958
	expectedCompletionNodeToString = "<CompleteOnName:fal>";
16506
/*
14959
	expectedParentNodeToString = "<NONE>";
16507
 * Test for 'false' keyword.
14960
	completionIdentifier = "fal";
16508
 */
14961
	expectedReplacedSource = "fal";
16509
public void test0378_Method(){
14962
	expectedUnitDisplayString =
16510
	String str =
14963
		"public class X {\n" +
16511
		"public class X {\n" +
14964
		"  public X() {\n" +
16512
		"  void foo(){\n" +
14965
		"  }\n" +
16513
		"    #\n" +
14966
		"  void foo() {\n" +
16514
		"    fal\n" +
14967
		"    <CompleteOnName:fal>;\n" +
14968
		"  }\n" +
16515
		"  }\n" +
14969
		"}\n";
16516
		"}\n";
16517
16518
	String completeBehind = "fal";
16519
	int cursorLocation = str.lastIndexOf("fal") + completeBehind.length() - 1;
16520
16521
	String expectedCompletionNodeToString = "<CompleteOnName:fal>";
16522
	String expectedParentNodeToString = "<NONE>";
16523
	String completionIdentifier = "fal";
16524
	String expectedReplacedSource = "fal";
16525
	String expectedUnitDisplayString =
16526
			"public class X {\n" +
16527
			"  public X() {\n" +
16528
			"  }\n" +
16529
			"  void foo() {\n" +
16530
			"    <CompleteOnName:fal>;\n" +
16531
			"  }\n" +
16532
			"}\n";
14970
	
16533
	
14971
	checkMethodParse(
16534
	checkMethodParse(
14972
		str.toCharArray(), 
16535
		str.toCharArray(), 
Lines 14981-14987 Link Here
14981
/*
16544
/*
14982
 * Test for 'null' keyword.
16545
 * Test for 'null' keyword.
14983
 */
16546
 */
14984
public void test0379(){
16547
public void test0379_Diet(){
14985
	String str =
16548
	String str =
14986
		"public class X {\n" +
16549
		"public class X {\n" +
14987
		"  void foo(){\n" +
16550
		"  void foo(){\n" +
Lines 15014-15032 Link Here
15014
		completionIdentifier,
16577
		completionIdentifier,
15015
		expectedReplacedSource,
16578
		expectedReplacedSource,
15016
		"diet ast");
16579
		"diet ast");
15017
	
16580
}
15018
	expectedCompletionNodeToString = "<CompleteOnName:nul>";
16581
/*
15019
	expectedParentNodeToString = "<NONE>";
16582
 * Test for 'null' keyword.
15020
	completionIdentifier = "nul";
16583
 */
15021
	expectedReplacedSource = "nul";
16584
public void test0379_Method(){
15022
	expectedUnitDisplayString =
16585
	String str =
15023
		"public class X {\n" +
16586
		"public class X {\n" +
15024
		"  public X() {\n" +
16587
		"  void foo(){\n" +
15025
		"  }\n" +
16588
		"    #\n" +
15026
		"  void foo() {\n" +
16589
		"    nul\n" +
15027
		"    <CompleteOnName:nul>;\n" +
15028
		"  }\n" +
16590
		"  }\n" +
15029
		"}\n";
16591
		"}\n";
16592
16593
	String completeBehind = "nul";
16594
	int cursorLocation = str.lastIndexOf("nul") + completeBehind.length() - 1;
16595
16596
	String expectedCompletionNodeToString = "<CompleteOnName:nul>";
16597
	String expectedParentNodeToString = "<NONE>";
16598
	String completionIdentifier = "nul";
16599
	String expectedReplacedSource = "nul";
16600
	String expectedUnitDisplayString =
16601
			"public class X {\n" +
16602
			"  public X() {\n" +
16603
			"  }\n" +
16604
			"  void foo() {\n" +
16605
			"    <CompleteOnName:nul>;\n" +
16606
			"  }\n" +
16607
			"}\n";
15030
	
16608
	
15031
	checkMethodParse(
16609
	checkMethodParse(
15032
		str.toCharArray(), 
16610
		str.toCharArray(), 
Lines 15041-15047 Link Here
15041
/*
16619
/*
15042
 * Test for 'instanceof' keyword.
16620
 * Test for 'instanceof' keyword.
15043
 */
16621
 */
15044
public void test0380(){
16622
public void test0380_Diet(){
15045
	String str =
16623
	String str =
15046
		"public class X {\n" +
16624
		"public class X {\n" +
15047
		"  void foo(){\n" +
16625
		"  void foo(){\n" +
Lines 15074-15092 Link Here
15074
		completionIdentifier,
16652
		completionIdentifier,
15075
		expectedReplacedSource,
16653
		expectedReplacedSource,
15076
		"diet ast");
16654
		"diet ast");
15077
	
16655
}
15078
	expectedCompletionNodeToString = "<CompleteOnKeyword:ins>";
16656
/*
15079
	expectedParentNodeToString = "<NONE>";
16657
 * Test for 'instanceof' keyword.
15080
	completionIdentifier = "ins";
16658
 */
15081
	expectedReplacedSource = "ins";
16659
public void test0380_Method(){
15082
	expectedUnitDisplayString =
16660
	String str =
15083
		"public class X {\n" +
16661
		"public class X {\n" +
15084
		"  public X() {\n" +
16662
		"  void foo(){\n" +
15085
		"  }\n" +
16663
		"    #\n" +
15086
		"  void foo() {\n" +
16664
		"    if(zzz ins\n" +
15087
		"    <CompleteOnKeyword:ins>;\n" +
15088
		"  }\n" +
16665
		"  }\n" +
15089
		"}\n";
16666
		"}\n";
16667
16668
	String completeBehind = "ins";
16669
	int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
16670
16671
	String expectedCompletionNodeToString = "<CompleteOnKeyword:ins>";
16672
	String expectedParentNodeToString = "<NONE>";
16673
	String completionIdentifier = "ins";
16674
	String expectedReplacedSource = "ins";
16675
	String expectedUnitDisplayString =
16676
			"public class X {\n" +
16677
			"  public X() {\n" +
16678
			"  }\n" +
16679
			"  void foo() {\n" +
16680
			"    <CompleteOnKeyword:ins>;\n" +
16681
			"  }\n" +
16682
			"}\n";
15090
	
16683
	
15091
	checkMethodParse(
16684
	checkMethodParse(
15092
		str.toCharArray(), 
16685
		str.toCharArray(), 
Lines 15101-15107 Link Here
15101
/*
16694
/*
15102
 * Test for 'instanceof' keyword.
16695
 * Test for 'instanceof' keyword.
15103
 */
16696
 */
15104
public void test0381(){
16697
public void test0381_Diet(){
15105
	String str =
16698
	String str =
15106
		"public class X {\n" +
16699
		"public class X {\n" +
15107
		"  void foo(){\n" +
16700
		"  void foo(){\n" +
Lines 15134-15152 Link Here
15134
		completionIdentifier,
16727
		completionIdentifier,
15135
		expectedReplacedSource,
16728
		expectedReplacedSource,
15136
		"diet ast");
16729
		"diet ast");
15137
	
16730
}
15138
	expectedCompletionNodeToString = "<CompleteOnName:ins>";
16731
/*
15139
	expectedParentNodeToString = "<NONE>";
16732
 * Test for 'instanceof' keyword.
15140
	completionIdentifier = "ins";
16733
 */
15141
	expectedReplacedSource = "ins";
16734
public void test0381_Method(){
15142
	expectedUnitDisplayString =
16735
	String str =
15143
		"public class X {\n" +
16736
		"public class X {\n" +
15144
		"  public X() {\n" +
16737
		"  void foo(){\n" +
15145
		"  }\n" +
16738
		"    #\n" +
15146
		"  void foo() {\n" +
16739
		"    ins\n" +
15147
		"    <CompleteOnName:ins>;\n" +
15148
		"  }\n" +
16740
		"  }\n" +
15149
		"}\n";
16741
		"}\n";
16742
16743
	String completeBehind = "ins";
16744
	int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
16745
16746
	String expectedCompletionNodeToString = "<CompleteOnName:ins>";
16747
	String expectedParentNodeToString = "<NONE>";
16748
	String completionIdentifier = "ins";
16749
	String expectedReplacedSource = "ins";
16750
	String expectedUnitDisplayString =
16751
			"public class X {\n" +
16752
			"  public X() {\n" +
16753
			"  }\n" +
16754
			"  void foo() {\n" +
16755
			"    <CompleteOnName:ins>;\n" +
16756
			"  }\n" +
16757
			"}\n";
15150
	
16758
	
15151
	checkMethodParse(
16759
	checkMethodParse(
15152
		str.toCharArray(), 
16760
		str.toCharArray(), 
Lines 15161-15167 Link Here
15161
/*
16769
/*
15162
 * Test for 'instanceof' keyword.
16770
 * Test for 'instanceof' keyword.
15163
 */
16771
 */
15164
public void test0382(){
16772
public void test0382_Diet(){
15165
	String str =
16773
	String str =
15166
		"public class X {\n" +
16774
		"public class X {\n" +
15167
		"  void foo(){\n" +
16775
		"  void foo(){\n" +
Lines 15194-15213 Link Here
15194
		completionIdentifier,
16802
		completionIdentifier,
15195
		expectedReplacedSource,
16803
		expectedReplacedSource,
15196
		"diet ast");
16804
		"diet ast");
15197
	
16805
}
15198
	expectedCompletionNodeToString = "<CompleteOnName:ins>";
16806
/*
15199
	expectedParentNodeToString = "<NONE>";
16807
 * Test for 'instanceof' keyword.
15200
	completionIdentifier = "ins";
16808
 */
15201
	expectedReplacedSource = "ins";
16809
public void test0382_Method(){
15202
	expectedUnitDisplayString =
16810
	String str =
15203
		"public class X {\n" +
16811
		"public class X {\n" +
15204
		"  public X() {\n" +
16812
		"  void foo(){\n" +
15205
		"  }\n" +
16813
		"    #\n" +
15206
		"  void foo() {\n" +
16814
		"    if(zzz zzz ins\n" +
15207
		"    zzz zzz;\n" +
15208
		"    <CompleteOnName:ins>;\n" +
15209
		"  }\n" +
16815
		"  }\n" +
15210
		"}\n";
16816
		"}\n";
16817
16818
	String completeBehind = "ins";
16819
	int cursorLocation = str.lastIndexOf("ins") + completeBehind.length() - 1;
16820
16821
	String expectedCompletionNodeToString = "<CompleteOnName:ins>";
16822
	String expectedParentNodeToString = "<NONE>";
16823
	String completionIdentifier = "ins";
16824
	String expectedReplacedSource = "ins";
16825
	String expectedUnitDisplayString =
16826
			"public class X {\n" +
16827
			"  public X() {\n" +
16828
			"  }\n" +
16829
			"  void foo() {\n" +
16830
			"    zzz zzz;\n" +
16831
			"    <CompleteOnName:ins>;\n" +
16832
			"  }\n" +
16833
			"}\n";
15211
	
16834
	
15212
	checkMethodParse(
16835
	checkMethodParse(
15213
		str.toCharArray(), 
16836
		str.toCharArray(), 
Lines 15222-15228 Link Here
15222
/*
16845
/*
15223
 * Test for 'while' keyword.
16846
 * Test for 'while' keyword.
15224
 */
16847
 */
15225
public void test0384(){
16848
public void test0384_Diet(){
15226
	String str =
16849
	String str =
15227
		"public class X {\n" +
16850
		"public class X {\n" +
15228
		"  void foo() {\n" +
16851
		"  void foo() {\n" +
Lines 15256-15274 Link Here
15256
		completionIdentifier,
16879
		completionIdentifier,
15257
		expectedReplacedSource,
16880
		expectedReplacedSource,
15258
		"diet ast");
16881
		"diet ast");
15259
	
16882
}
15260
	expectedCompletionNodeToString = "<CompleteOnKeyword:whi>";
16883
/*
15261
	expectedParentNodeToString = "<NONE>";
16884
 * Test for 'while' keyword.
15262
	completionIdentifier = "whi";
16885
 */
15263
	expectedReplacedSource = "whi";
16886
public void test0384_Method(){
15264
	expectedUnitDisplayString =
16887
	String str =
15265
		"public class X {\n" +
16888
		"public class X {\n" +
15266
		"  public X() {\n" +
15267
		"  }\n" +
15268
		"  void foo() {\n" +
16889
		"  void foo() {\n" +
15269
		"    <CompleteOnKeyword:whi>;\n" +
16890
		"    #\n" +
16891
		"    do{\n" +
16892
		"    } whi\n" +
15270
		"  }\n" +
16893
		"  }\n" +
15271
		"}\n";
16894
		"}";
16895
16896
	String completeBehind = "whi";
16897
	int cursorLocation = str.lastIndexOf("whi") + completeBehind.length() - 1;
16898
16899
	String expectedCompletionNodeToString = "<CompleteOnKeyword:whi>";
16900
	String expectedParentNodeToString = "<NONE>";
16901
	String completionIdentifier = "whi";
16902
	String expectedReplacedSource = "whi";
16903
	String expectedUnitDisplayString =
16904
			"public class X {\n" +
16905
			"  public X() {\n" +
16906
			"  }\n" +
16907
			"  void foo() {\n" +
16908
			"    <CompleteOnKeyword:whi>;\n" +
16909
			"  }\n" +
16910
			"}\n";
15272
	
16911
	
15273
	checkMethodParse(
16912
	checkMethodParse(
15274
		str.toCharArray(), 
16913
		str.toCharArray(), 
Lines 15283-15289 Link Here
15283
/*
16922
/*
15284
 * Test for 'catch' keyword.
16923
 * Test for 'catch' keyword.
15285
 */
16924
 */
15286
public void test0385(){
16925
public void test0385_Diet(){
15287
	String str =
16926
	String str =
15288
		"package p;\n" +
16927
		"package p;\n" +
15289
		"public class X {\n" +
16928
		"public class X {\n" +
Lines 15320-15339 Link Here
15320
		completionIdentifier,
16959
		completionIdentifier,
15321
		expectedReplacedSource,
16960
		expectedReplacedSource,
15322
		"diet ast");
16961
		"diet ast");
15323
	
16962
}
15324
	expectedCompletionNodeToString = "<CompleteOnName:cat>";
16963
/*
15325
	expectedParentNodeToString = "<NONE>";
16964
 * Test for 'catch' keyword.
15326
	completionIdentifier = "cat";
16965
 */
15327
	expectedReplacedSource = "cat";
16966
public void test0385_Method(){
15328
	expectedUnitDisplayString =
16967
	String str =
15329
		"package p;\n" +
16968
		"package p;\n" +
15330
		"public class X {\n" +
16969
		"public class X {\n" +
15331
		"  public X() {\n" +
16970
		"  void foo(){\n" +
15332
		"  }\n" +
16971
		"    #\n" +
15333
		"  void foo() {\n" +
16972
		"    try {\n" +
15334
		"    <CompleteOnName:cat>;\n" +
16973
		"    } catch(E e) {\n" +
16974
		"    } cat\n" +
15335
		"  }\n" +
16975
		"  }\n" +
15336
		"}\n";
16976
		"}\n";
16977
16978
	String completeBehind = "cat";
16979
	int cursorLocation = str.lastIndexOf("cat") + completeBehind.length() - 1;
16980
16981
	String expectedCompletionNodeToString = "<CompleteOnName:cat>";
16982
	String expectedParentNodeToString = "<NONE>";
16983
	String completionIdentifier = "cat";
16984
	String expectedReplacedSource = "cat";
16985
	String expectedUnitDisplayString =
16986
			"package p;\n" +
16987
			"public class X {\n" +
16988
			"  public X() {\n" +
16989
			"  }\n" +
16990
			"  void foo() {\n" +
16991
			"    <CompleteOnName:cat>;\n" +
16992
			"  }\n" +
16993
			"}\n";
15337
	
16994
	
15338
	checkMethodParse(
16995
	checkMethodParse(
15339
		str.toCharArray(), 
16996
		str.toCharArray(), 
Lines 15348-15354 Link Here
15348
/*
17005
/*
15349
 * Test for 'finally' keyword.
17006
 * Test for 'finally' keyword.
15350
 */
17007
 */
15351
public void test0386(){
17008
public void test0386_Diet(){
15352
	String str =
17009
	String str =
15353
		"package p;\n" +
17010
		"package p;\n" +
15354
		"public class X {\n" +
17011
		"public class X {\n" +
Lines 15385-15404 Link Here
15385
		completionIdentifier,
17042
		completionIdentifier,
15386
		expectedReplacedSource,
17043
		expectedReplacedSource,
15387
		"diet ast");
17044
		"diet ast");
15388
	
17045
}
15389
	expectedCompletionNodeToString = "<CompleteOnName:fin>";
17046
/*
15390
	expectedParentNodeToString = "<NONE>";
17047
 * Test for 'finally' keyword.
15391
	completionIdentifier = "fin";
17048
 */
15392
	expectedReplacedSource = "fin";
17049
public void test0386_Method(){
15393
	expectedUnitDisplayString =
17050
	String str =
15394
		"package p;\n" +
17051
		"package p;\n" +
15395
		"public class X {\n" +
17052
		"public class X {\n" +
15396
		"  public X() {\n" +
17053
		"  void foo(){\n" +
15397
		"  }\n" +
17054
		"    #\n" +
15398
		"  void foo() {\n" +
17055
		"    try {" +
15399
		"    <CompleteOnName:fin>;\n" +
17056
		"    } catch(E e) {" +
17057
		"    } fin" +
15400
		"  }\n" +
17058
		"  }\n" +
15401
		"}\n";
17059
		"}\n";
17060
17061
	String completeBehind = "fin";
17062
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
17063
17064
	String expectedCompletionNodeToString = "<CompleteOnName:fin>";
17065
	String expectedParentNodeToString = "<NONE>";
17066
	String completionIdentifier = "fin";
17067
	String expectedReplacedSource = "fin";
17068
	String expectedUnitDisplayString =
17069
			"package p;\n" +
17070
			"public class X {\n" +
17071
			"  public X() {\n" +
17072
			"  }\n" +
17073
			"  void foo() {\n" +
17074
			"    <CompleteOnName:fin>;\n" +
17075
			"  }\n" +
17076
			"}\n";
15402
	
17077
	
15403
	checkMethodParse(
17078
	checkMethodParse(
15404
		str.toCharArray(), 
17079
		str.toCharArray(), 
Lines 15413-15419 Link Here
15413
/*
17088
/*
15414
 * Test for 'finally' keyword.
17089
 * Test for 'finally' keyword.
15415
 */
17090
 */
15416
public void test0387(){
17091
public void test0387_Diet(){
15417
	String str =
17092
	String str =
15418
		"package p;\n" +
17093
		"package p;\n" +
15419
		"public class X {\n" +
17094
		"public class X {\n" +
Lines 15450-15469 Link Here
15450
		completionIdentifier,
17125
		completionIdentifier,
15451
		expectedReplacedSource,
17126
		expectedReplacedSource,
15452
		"diet ast");
17127
		"diet ast");
15453
	
17128
}
15454
	expectedCompletionNodeToString = "<CompleteOnName:fin>";
17129
/*
15455
	expectedParentNodeToString = "<NONE>";
17130
 * Test for 'finally' keyword.
15456
	completionIdentifier = "fin";
17131
 */
15457
	expectedReplacedSource = "fin";
17132
public void test0387_Method(){
15458
	expectedUnitDisplayString =
17133
	String str =
15459
		"package p;\n" +
17134
		"package p;\n" +
15460
		"public class X {\n" +
17135
		"public class X {\n" +
15461
		"  public X() {\n" +
17136
		"  void foo(){\n" +
15462
		"  }\n" +
17137
		"    #\n" +
15463
		"  void foo() {\n" +
17138
		"    try {" +
15464
		"    <CompleteOnName:fin>;\n" +
17139
		"    } finally {" +
17140
		"    } fin" +
15465
		"  }\n" +
17141
		"  }\n" +
15466
		"}\n";
17142
		"}\n";
17143
17144
	String completeBehind = "fin";
17145
	int cursorLocation = str.lastIndexOf("fin") + completeBehind.length() - 1;
17146
17147
	String expectedCompletionNodeToString = "<CompleteOnName:fin>";
17148
	String expectedParentNodeToString = "<NONE>";
17149
	String completionIdentifier = "fin";
17150
	String expectedReplacedSource = "fin";
17151
	String expectedUnitDisplayString =
17152
			"package p;\n" +
17153
			"public class X {\n" +
17154
			"  public X() {\n" +
17155
			"  }\n" +
17156
			"  void foo() {\n" +
17157
			"    <CompleteOnName:fin>;\n" +
17158
			"  }\n" +
17159
			"}\n";
15467
	
17160
	
15468
	checkMethodParse(
17161
	checkMethodParse(
15469
		str.toCharArray(), 
17162
		str.toCharArray(), 
Lines 15478-15484 Link Here
15478
/*
17171
/*
15479
 * Test for 'this' keyword.
17172
 * Test for 'this' keyword.
15480
 */
17173
 */
15481
public void test0388(){
17174
public void test0388_Diet(){
15482
	String str =
17175
	String str =
15483
		"public class X {\n" +
17176
		"public class X {\n" +
15484
		"  void foo(){\n" +
17177
		"  void foo(){\n" +
Lines 15511-15529 Link Here
15511
		completionIdentifier,
17204
		completionIdentifier,
15512
		expectedReplacedSource,
17205
		expectedReplacedSource,
15513
		"diet ast");
17206
		"diet ast");
15514
	
17207
}
15515
	expectedCompletionNodeToString = "<CompleteOnName:X.thi>";
17208
/*
15516
	expectedParentNodeToString = "<NONE>";
17209
 * Test for 'this' keyword.
15517
	completionIdentifier = "thi";
17210
 */
15518
	expectedReplacedSource = "X.thi";
17211
public void test0388_Method(){
15519
	expectedUnitDisplayString =
17212
	String str =
15520
		"public class X {\n" +
17213
		"public class X {\n" +
15521
		"  public X() {\n" +
17214
		"  void foo(){\n" +
15522
		"  }\n" +
17215
		"    #\n" +
15523
		"  void foo() {\n" +
17216
		"    X.thi\n" +
15524
		"    <CompleteOnName:X.thi>;\n" +
15525
		"  }\n" +
17217
		"  }\n" +
15526
		"}\n";
17218
		"}\n";
17219
17220
	String completeBehind = "thi";
17221
	int cursorLocation = str.lastIndexOf("thi") + completeBehind.length() - 1;
17222
17223
	String expectedCompletionNodeToString = "<CompleteOnName:X.thi>";
17224
	String expectedParentNodeToString = "<NONE>";
17225
	String completionIdentifier = "thi";
17226
	String expectedReplacedSource = "X.thi";
17227
	String expectedUnitDisplayString =
17228
			"public class X {\n" +
17229
			"  public X() {\n" +
17230
			"  }\n" +
17231
			"  void foo() {\n" +
17232
			"    <CompleteOnName:X.thi>;\n" +
17233
			"  }\n" +
17234
			"}\n";
15527
	
17235
	
15528
	checkMethodParse(
17236
	checkMethodParse(
15529
		str.toCharArray(), 
17237
		str.toCharArray(), 
(-)src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java (-1898 / +3709 lines)
Lines 51-57 Link Here
51
		expectedReplacedSource,
51
		expectedReplacedSource,
52
		"diet ast");
52
		"diet ast");
53
}
53
}
54
public void test0002(){
54
public void test0002_Diet(){
55
	String str = 
55
	String str = 
56
		"package p;\n" +  
56
		"package p;\n" +  
57
		"public class X {\n" +
57
		"public class X {\n" +
Lines 85-105 Link Here
85
		completionIdentifier,
85
		completionIdentifier,
86
		expectedReplacedSource,
86
		expectedReplacedSource,
87
		"diet ast");
87
		"diet ast");
88
		
88
}
89
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
89
public void test0002_Method(){
90
	expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
90
	String str = 
91
	completionIdentifier = "zzz";
91
		"package p;\n" +  
92
	expectedReplacedSource = "zzz";
92
		"public class X {\n" +
93
	expectedUnitDisplayString =
94
		"package p;\n" + 
95
		"public class X {\n" + 
96
		"  {\n" + 
93
		"  {\n" + 
97
		"    Object o = <CompleteOnName:zzz>;\n" + 
94
		"    Object o = zzz;\n" + 
98
		"  }\n" + 
99
		"  public X() {\n" + 
100
		"  }\n" + 
95
		"  }\n" + 
101
		"}\n";
96
		"}\n";
102
97
98
	String completeBehind = "zzz";
99
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
100
	
101
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
102
	String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
103
	String completionIdentifier = "zzz";
104
	String expectedReplacedSource = "zzz";
105
	String expectedUnitDisplayString =
106
			"package p;\n" + 
107
			"public class X {\n" + 
108
			"  {\n" + 
109
			"    Object o = <CompleteOnName:zzz>;\n" + 
110
			"  }\n" + 
111
			"  public X() {\n" + 
112
			"  }\n" + 
113
			"}\n";
114
103
	checkMethodParse(
115
	checkMethodParse(
104
		str.toCharArray(), 
116
		str.toCharArray(), 
105
		cursorLocation, 
117
		cursorLocation, 
Lines 110-116 Link Here
110
		expectedReplacedSource,
122
		expectedReplacedSource,
111
		"full ast");
123
		"full ast");
112
}
124
}
113
public void test0003(){
125
public void test0003_Diet(){
114
	String str = 
126
	String str = 
115
		"package p;\n" +  
127
		"package p;\n" +  
116
		"public class X {\n" +
128
		"public class X {\n" +
Lines 144-163 Link Here
144
		completionIdentifier,
156
		completionIdentifier,
145
		expectedReplacedSource,
157
		expectedReplacedSource,
146
		"diet ast");
158
		"diet ast");
147
159
}
148
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
160
public void test0003_Method(){
149
	expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
161
	String str = 
150
	completionIdentifier = "zzz";
162
		"package p;\n" +  
151
	expectedReplacedSource = "zzz";
163
		"public class X {\n" +
152
	expectedUnitDisplayString =
164
		"  void foo(){\n" + 
153
		"package p;\n" + 
165
		"    Object o = zzz;\n" + 
154
		"public class X {\n" + 
155
		"  public X() {\n" + 
156
		"  }\n" + 
157
		"  void foo() {\n" + 
158
		"    Object o = <CompleteOnName:zzz>;\n" + 
159
		"  }\n" + 
166
		"  }\n" + 
160
		"}\n";
167
		"}\n";
168
169
	String completeBehind = "zzz";
170
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
171
	
172
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
173
	String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
174
	String completionIdentifier = "zzz";
175
	String expectedReplacedSource = "zzz";
176
	String expectedUnitDisplayString =
177
			"package p;\n" + 
178
			"public class X {\n" + 
179
			"  public X() {\n" + 
180
			"  }\n" + 
181
			"  void foo() {\n" + 
182
			"    Object o = <CompleteOnName:zzz>;\n" + 
183
			"  }\n" + 
184
			"}\n";
161
		
185
		
162
	checkMethodParse(
186
	checkMethodParse(
163
		str.toCharArray(), 
187
		str.toCharArray(), 
Lines 202-208 Link Here
202
		expectedReplacedSource,
226
		expectedReplacedSource,
203
		"diet ast");
227
		"diet ast");
204
}
228
}
205
public void test0005(){
229
public void test0005_Diet(){
206
	String str = 
230
	String str = 
207
		"package p;\n" +  
231
		"package p;\n" +  
208
		"public class X {\n" +
232
		"public class X {\n" +
Lines 237-258 Link Here
237
		completionIdentifier,
261
		completionIdentifier,
238
		expectedReplacedSource,
262
		expectedReplacedSource,
239
		"diet ast");
263
		"diet ast");
240
		
264
}
241
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
265
public void test0005_Method(){
242
	expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
266
	String str = 
243
	completionIdentifier = "zzz";
267
		"package p;\n" +  
244
	expectedReplacedSource = "zzz";
268
		"public class X {\n" +
245
	expectedUnitDisplayString =
246
		"package p;\n" + 
247
		"public class X {\n" + 
248
		"  {\n" + 
269
		"  {\n" + 
249
		"    {\n" + 
270
		"    #\n" +
250
		"      Object o = <CompleteOnName:zzz>;\n" + 
271
		"    Object o = zzz;\n" + 
251
		"    }\n" + 
252
		"  }\n" + 
253
		"  public X() {\n" + 
254
		"  }\n" + 
272
		"  }\n" + 
255
		"}\n";
273
		"}\n";
274
275
	String completeBehind = "zzz";
276
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
277
	
278
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
279
	String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
280
	String completionIdentifier = "zzz";
281
	String expectedReplacedSource = "zzz";
282
	String expectedUnitDisplayString =
283
			"package p;\n" + 
284
			"public class X {\n" + 
285
			"  {\n" + 
286
			"    {\n" + 
287
			"      Object o = <CompleteOnName:zzz>;\n" + 
288
			"    }\n" + 
289
			"  }\n" + 
290
			"  public X() {\n" + 
291
			"  }\n" + 
292
			"}\n";
256
	
293
	
257
	checkMethodParse(
294
	checkMethodParse(
258
		str.toCharArray(), 
295
		str.toCharArray(), 
Lines 264-270 Link Here
264
		expectedReplacedSource,
301
		expectedReplacedSource,
265
		"full ast");
302
		"full ast");
266
}
303
}
267
public void test0006(){
304
public void test0006_Diet(){
268
	String str = 
305
	String str = 
269
		"package p;\n" +  
306
		"package p;\n" +  
270
		"public class X {\n" +
307
		"public class X {\n" +
Lines 299-319 Link Here
299
		completionIdentifier,
336
		completionIdentifier,
300
		expectedReplacedSource,
337
		expectedReplacedSource,
301
		"diet ast");
338
		"diet ast");
302
339
}
303
	
340
public void test0006_Method(){
304
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
341
	String str = 
305
	expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
342
		"package p;\n" +  
306
	completionIdentifier = "zzz";
343
		"public class X {\n" +
307
	expectedReplacedSource = "zzz";
344
		"  void foo(){\n" + 
308
	expectedUnitDisplayString =
345
		"    #\n" +
309
		"package p;\n" + 
346
		"    Object o = zzz;\n" + 
310
		"public class X {\n" + 
311
		"  public X() {\n" + 
312
		"  }\n" + 
313
		"  void foo() {\n" + 
314
		"    Object o = <CompleteOnName:zzz>;\n" + 
315
		"  }\n" + 
347
		"  }\n" + 
316
		"}\n";
348
		"}\n";
349
350
	String completeBehind = "zzz";
351
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
352
	
353
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
354
	String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
355
	String completionIdentifier = "zzz";
356
	String expectedReplacedSource = "zzz";
357
	String expectedUnitDisplayString =
358
			"package p;\n" + 
359
			"public class X {\n" + 
360
			"  public X() {\n" + 
361
			"  }\n" + 
362
			"  void foo() {\n" + 
363
			"    Object o = <CompleteOnName:zzz>;\n" + 
364
			"  }\n" + 
365
			"}\n";
317
	checkMethodParse(
366
	checkMethodParse(
318
		str.toCharArray(), 
367
		str.toCharArray(), 
319
		cursorLocation, 
368
		cursorLocation, 
Lines 356-362 Link Here
356
		expectedReplacedSource,
405
		expectedReplacedSource,
357
		"diet ast"); 
406
		"diet ast"); 
358
}
407
}
359
public void test0008(){
408
public void test0008_Diet(){
360
	String str = 
409
	String str = 
361
		"package p;\n" +  
410
		"package p;\n" +  
362
		"public class X {\n" +
411
		"public class X {\n" +
Lines 389-409 Link Here
389
		expectedUnitDisplayString,
438
		expectedUnitDisplayString,
390
		completionIdentifier,
439
		completionIdentifier,
391
		expectedReplacedSource,
440
		expectedReplacedSource,
392
		"diet ast");
441
		"diet ast"); 
393
	
442
}
394
	expectedCompletionNodeToString = "<CompleteOnType:zzz>";
443
public void test0008_Method(){
395
	expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
444
	String str = 
396
	completionIdentifier = "zzz";
445
		"package p;\n" +  
397
	expectedReplacedSource = "zzz";
446
		"public class X {\n" +
398
	expectedUnitDisplayString =
399
		"package p;\n" + 
400
		"public class X {\n" + 
401
		"  {\n" + 
447
		"  {\n" + 
402
		"    Object o = new <CompleteOnType:zzz>();\n" + 
448
		"    Object o = new zzz;\n" + 
403
		"  }\n" + 
404
		"  public X() {\n" + 
405
		"  }\n" + 
449
		"  }\n" + 
406
		"}\n";
450
		"}\n";
451
452
	String completeBehind = "zzz";
453
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
454
	
455
	String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
456
	String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
457
	String completionIdentifier = "zzz";
458
	String expectedReplacedSource = "zzz";
459
	String expectedUnitDisplayString =
460
			"package p;\n" + 
461
			"public class X {\n" + 
462
			"  {\n" + 
463
			"    Object o = new <CompleteOnType:zzz>();\n" + 
464
			"  }\n" + 
465
			"  public X() {\n" + 
466
			"  }\n" + 
467
			"}\n";
407
	
468
	
408
	checkMethodParse(
469
	checkMethodParse(
409
		str.toCharArray(), 
470
		str.toCharArray(), 
Lines 415-421 Link Here
415
		expectedReplacedSource,
476
		expectedReplacedSource,
416
		"full ast"); 
477
		"full ast"); 
417
}
478
}
418
public void test0009(){
479
public void test0009_Diet(){
419
	String str = 
480
	String str = 
420
		"package p;\n" +  
481
		"package p;\n" +  
421
		"public class X {\n" +
482
		"public class X {\n" +
Lines 448-468 Link Here
448
		expectedUnitDisplayString,
509
		expectedUnitDisplayString,
449
		completionIdentifier,
510
		completionIdentifier,
450
		expectedReplacedSource,
511
		expectedReplacedSource,
451
		"diet ast");
512
		"diet ast"); 
452
	
513
}
453
	expectedCompletionNodeToString = "<CompleteOnType:zzz>";
514
public void test0009_Method(){
454
	expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
515
	String str = 
455
	completionIdentifier = "zzz";
516
		"package p;\n" +  
456
	expectedReplacedSource = "zzz";
517
		"public class X {\n" +
457
	expectedUnitDisplayString =
518
		"  void foo(){\n" + 
458
		"package p;\n" + 
519
		"    Object o = new zzz;\n" + 
459
		"public class X {\n" + 
460
		"  public X() {\n" + 
461
		"  }\n" + 
462
		"  void foo() {\n" + 
463
		"    Object o = new <CompleteOnType:zzz>();\n" + 
464
		"  }\n" + 
520
		"  }\n" + 
465
		"}\n";
521
		"}\n";
522
523
	String completeBehind = "zzz";
524
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
525
	
526
	String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
527
	String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
528
	String completionIdentifier = "zzz";
529
	String expectedReplacedSource = "zzz";
530
	String expectedUnitDisplayString =
531
			"package p;\n" + 
532
			"public class X {\n" + 
533
			"  public X() {\n" + 
534
			"  }\n" + 
535
			"  void foo() {\n" + 
536
			"    Object o = new <CompleteOnType:zzz>();\n" + 
537
			"  }\n" + 
538
			"}\n";
466
	
539
	
467
	checkMethodParse(
540
	checkMethodParse(
468
		str.toCharArray(), 
541
		str.toCharArray(), 
Lines 507-513 Link Here
507
		expectedReplacedSource,
580
		expectedReplacedSource,
508
		"diet ast"); 
581
		"diet ast"); 
509
}
582
}
510
public void test0011(){
583
public void test0011_Diet(){
511
	String str = 
584
	String str = 
512
		"package p;\n" +  
585
		"package p;\n" +  
513
		"public class X {\n" +
586
		"public class X {\n" +
Lines 541-564 Link Here
541
		expectedUnitDisplayString,
614
		expectedUnitDisplayString,
542
		completionIdentifier,
615
		completionIdentifier,
543
		expectedReplacedSource,
616
		expectedReplacedSource,
544
		"diet ast");
617
		"diet ast"); 
545
	
618
}
546
	expectedCompletionNodeToString = "<CompleteOnType:zzz>";
619
public void test0011_Method(){
547
	expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
620
	String str = 
548
	completionIdentifier = "zzz";
621
		"package p;\n" +  
549
	expectedReplacedSource = "zzz";
622
		"public class X {\n" +
550
	expectedUnitDisplayString =
623
		"  {\n" + 
551
		"package p;\n" + 
624
		"    #\n" +
552
		"public class X {\n" + 
625
		"    Object o = new zzz;\n" + 
553
		"  {\n" +
554
		"    {\n" +
555
		"      Object o = new <CompleteOnType:zzz>();\n" +
556
		"    }\n" +
557
		"  }\n" +
558
		"  public X() {\n" + 
559
		"  }\n" + 
626
		"  }\n" + 
560
		"}\n";
627
		"}\n";
561
628
629
	String completeBehind = "zzz";
630
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
631
	
632
	String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
633
	String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
634
	String completionIdentifier = "zzz";
635
	String expectedReplacedSource = "zzz";
636
	String expectedUnitDisplayString =
637
			"package p;\n" + 
638
			"public class X {\n" + 
639
			"  {\n" +
640
			"    {\n" +
641
			"      Object o = new <CompleteOnType:zzz>();\n" +
642
			"    }\n" +
643
			"  }\n" +
644
			"  public X() {\n" + 
645
			"  }\n" + 
646
			"}\n";
647
562
	checkMethodParse(
648
	checkMethodParse(
563
		str.toCharArray(), 
649
		str.toCharArray(), 
564
		cursorLocation, 
650
		cursorLocation, 
Lines 569-575 Link Here
569
		expectedReplacedSource,
655
		expectedReplacedSource,
570
		"full ast"); 
656
		"full ast"); 
571
}
657
}
572
public void test0012(){
658
public void test0012_Diet(){
573
	String str = 
659
	String str = 
574
		"package p;\n" +  
660
		"package p;\n" +  
575
		"public class X {\n" +
661
		"public class X {\n" +
Lines 603-623 Link Here
603
		expectedUnitDisplayString,
689
		expectedUnitDisplayString,
604
		completionIdentifier,
690
		completionIdentifier,
605
		expectedReplacedSource,
691
		expectedReplacedSource,
606
		"diet ast");
692
		"diet ast"); 
607
	
693
}
608
	expectedCompletionNodeToString = "<CompleteOnType:zzz>";
694
public void test0012_Method(){
609
	expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
695
	String str = 
610
	completionIdentifier = "zzz";
696
		"package p;\n" +  
611
	expectedReplacedSource = "zzz";
697
		"public class X {\n" +
612
	expectedUnitDisplayString =
698
		"  void foo(){\n" + 
613
		"package p;\n" + 
699
		"    #\n" +
614
		"public class X {\n" + 
700
		"    Object o = new zzz;\n" + 
615
		"  public X() {\n" + 
616
		"  }\n" + 
617
		"  void foo() {\n" + 
618
		"    Object o = new <CompleteOnType:zzz>();\n" + 
619
		"  }\n" + 
701
		"  }\n" + 
620
		"}\n";
702
		"}\n";
703
704
	String completeBehind = "zzz";
705
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
706
	
707
	String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
708
	String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
709
	String completionIdentifier = "zzz";
710
	String expectedReplacedSource = "zzz";
711
	String expectedUnitDisplayString =
712
			"package p;\n" + 
713
			"public class X {\n" + 
714
			"  public X() {\n" + 
715
			"  }\n" + 
716
			"  void foo() {\n" + 
717
			"    Object o = new <CompleteOnType:zzz>();\n" + 
718
			"  }\n" + 
719
			"}\n";
621
	
720
	
622
	checkMethodParse(
721
	checkMethodParse(
623
		str.toCharArray(), 
722
		str.toCharArray(), 
Lines 664-670 Link Here
664
		"diet ast");
763
		"diet ast");
665
}
764
}
666
765
667
public void test0014(){
766
public void test0014_Diet(){
668
	String str = 
767
	String str = 
669
		"package p;\n" +  
768
		"package p;\n" +  
670
		"public class X {\n" +
769
		"public class X {\n" +
Lines 698-719 Link Here
698
		expectedUnitDisplayString,
797
		expectedUnitDisplayString,
699
		completionIdentifier,
798
		completionIdentifier,
700
		expectedReplacedSource,
799
		expectedReplacedSource,
701
		"diet ast");
800
		"diet ast"); 
702
	
801
}
703
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
802
public void test0014_Method(){
704
	expectedParentNodeToString = "<NONE>";
803
	String str = 
705
	completionIdentifier = "zzz";
804
		"package p;\n" +  
706
	expectedReplacedSource = "zzz";
805
		"public class X {\n" +
707
	expectedUnitDisplayString =
708
		"package p;\n" + 
709
		"public class X {\n" + 
710
		"  {\n" + 
806
		"  {\n" + 
711
		"    Object o;\n" +
807
		"    Object o = yyy;\n" + 
712
		"    <CompleteOnName:zzz>;\n" + 
808
		"    zzz\n" + 
713
		"  }\n" + 
714
		"  public X() {\n" + 
715
		"  }\n" + 
809
		"  }\n" + 
716
		"}\n";
810
		"}\n";
811
812
	String completeBehind = "zzz";
813
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
814
	
815
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
816
	String expectedParentNodeToString = "<NONE>";
817
	String completionIdentifier = "zzz";
818
	String expectedReplacedSource = "zzz";
819
	String expectedUnitDisplayString =
820
			"package p;\n" + 
821
			"public class X {\n" + 
822
			"  {\n" + 
823
			"    Object o;\n" +
824
			"    <CompleteOnName:zzz>;\n" + 
825
			"  }\n" + 
826
			"  public X() {\n" + 
827
			"  }\n" + 
828
			"}\n";
717
	
829
	
718
	checkMethodParse(
830
	checkMethodParse(
719
		str.toCharArray(), 
831
		str.toCharArray(), 
Lines 726-732 Link Here
726
		"full ast"); 
838
		"full ast"); 
727
}
839
}
728
840
729
public void test0015(){
841
public void test0015_Diet(){
730
	String str = 
842
	String str = 
731
		"package p;\n" +  
843
		"package p;\n" +  
732
		"public class X {\n" +
844
		"public class X {\n" +
Lines 760-781 Link Here
760
		expectedUnitDisplayString,
872
		expectedUnitDisplayString,
761
		completionIdentifier,
873
		completionIdentifier,
762
		expectedReplacedSource,
874
		expectedReplacedSource,
763
		"diet ast");
875
		"diet ast"); 
764
	
876
}
765
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
877
public void test0015_Method(){
766
	expectedParentNodeToString = "<NONE>";
878
	String str = 
767
	completionIdentifier = "zzz";
879
		"package p;\n" +  
768
	expectedReplacedSource = "zzz";
880
		"public class X {\n" +
769
	expectedUnitDisplayString =
881
		"  void foo(){\n" + 
770
		"package p;\n" + 
882
		"    Object o = yyy;\n" + 
771
		"public class X {\n" + 
883
		"    zzz\n" + 
772
		"  public X() {\n" + 
773
		"  }\n" + 
774
		"  void foo() {\n" + 
775
		"    Object o;\n" +
776
		"    <CompleteOnName:zzz>;\n" + 
777
		"  }\n" + 
884
		"  }\n" + 
778
		"}\n";
885
		"}\n";
886
887
	String completeBehind = "zzz";
888
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
889
	
890
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
891
	String expectedParentNodeToString = "<NONE>";
892
	String completionIdentifier = "zzz";
893
	String expectedReplacedSource = "zzz";
894
	String expectedUnitDisplayString =
895
			"package p;\n" + 
896
			"public class X {\n" + 
897
			"  public X() {\n" + 
898
			"  }\n" + 
899
			"  void foo() {\n" + 
900
			"    Object o;\n" +
901
			"    <CompleteOnName:zzz>;\n" + 
902
			"  }\n" + 
903
			"}\n";
779
	
904
	
780
	checkMethodParse(
905
	checkMethodParse(
781
		str.toCharArray(), 
906
		str.toCharArray(), 
Lines 824-830 Link Here
824
		"diet ast"); 
949
		"diet ast"); 
825
}
950
}
826
951
827
public void test0017(){
952
public void test0017_Diet(){
828
	String str = 
953
	String str = 
829
		"package p;\n" +  
954
		"package p;\n" +  
830
		"public class X {\n" +
955
		"public class X {\n" +
Lines 859-882 Link Here
859
		expectedUnitDisplayString,
984
		expectedUnitDisplayString,
860
		completionIdentifier,
985
		completionIdentifier,
861
		expectedReplacedSource,
986
		expectedReplacedSource,
862
		"diet ast");
987
		"diet ast"); 
863
	
988
}
864
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
989
public void test0017_Method(){
865
	expectedParentNodeToString = "<NONE>";
990
	String str = 
866
	completionIdentifier = "zzz";
991
		"package p;\n" +  
867
	expectedReplacedSource = "zzz";
992
		"public class X {\n" +
868
	expectedUnitDisplayString =
869
		"package p;\n" + 
870
		"public class X {\n" + 
871
		"  {\n" + 
993
		"  {\n" + 
872
		"    {\n" + 
994
		"    #\n" +
873
		"      Object o;\n" +
995
		"    Object o = yyy;\n" + 
874
		"      <CompleteOnName:zzz>;\n" + 
996
		"    zzz\n" + 
875
		"    }\n" + 
876
		"  }\n" + 
877
		"  public X() {\n" + 
878
		"  }\n" + 
997
		"  }\n" + 
879
		"}\n";
998
		"}\n";
999
1000
	String completeBehind = "zzz";
1001
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1002
	
1003
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1004
	String expectedParentNodeToString = "<NONE>";
1005
	String completionIdentifier = "zzz";
1006
	String expectedReplacedSource = "zzz";
1007
	String expectedUnitDisplayString =
1008
			"package p;\n" + 
1009
			"public class X {\n" + 
1010
			"  {\n" + 
1011
			"    {\n" + 
1012
			"      Object o;\n" +
1013
			"      <CompleteOnName:zzz>;\n" + 
1014
			"    }\n" + 
1015
			"  }\n" + 
1016
			"  public X() {\n" + 
1017
			"  }\n" + 
1018
			"}\n";
880
	
1019
	
881
	checkMethodParse(
1020
	checkMethodParse(
882
		str.toCharArray(), 
1021
		str.toCharArray(), 
Lines 889-895 Link Here
889
		"full ast"); 
1028
		"full ast"); 
890
}
1029
}
891
1030
892
public void test0018(){
1031
public void test0018_Diet(){
893
	String str = 
1032
	String str = 
894
		"package p;\n" +  
1033
		"package p;\n" +  
895
		"public class X {\n" +
1034
		"public class X {\n" +
Lines 924-945 Link Here
924
		expectedUnitDisplayString,
1063
		expectedUnitDisplayString,
925
		completionIdentifier,
1064
		completionIdentifier,
926
		expectedReplacedSource,
1065
		expectedReplacedSource,
927
		"diet ast");
1066
		"diet ast"); 
928
	
1067
}
929
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1068
public void test0018_Method(){
930
	expectedParentNodeToString = "<NONE>";
1069
	String str = 
931
	completionIdentifier = "zzz";
1070
		"package p;\n" +  
932
	expectedReplacedSource = "zzz";
1071
		"public class X {\n" +
933
	expectedUnitDisplayString =
1072
		"  void foo(){\n" + 
934
		"package p;\n" + 
1073
		"    #\n" +
935
		"public class X {\n" + 
1074
		"    Object o = yyy;\n" + 
936
		"  public X() {\n" + 
1075
		"    zzz\n" + 
937
		"  }\n" + 
938
		"  void foo() {\n" + 
939
		"    Object o;\n" +
940
		"    <CompleteOnName:zzz>;\n" + 
941
		"  }\n" + 
1076
		"  }\n" + 
942
		"}\n";
1077
		"}\n";
1078
1079
	String completeBehind = "zzz";
1080
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1081
	
1082
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1083
	String expectedParentNodeToString = "<NONE>";
1084
	String completionIdentifier = "zzz";
1085
	String expectedReplacedSource = "zzz";
1086
	String expectedUnitDisplayString =
1087
			"package p;\n" + 
1088
			"public class X {\n" + 
1089
			"  public X() {\n" + 
1090
			"  }\n" + 
1091
			"  void foo() {\n" + 
1092
			"    Object o;\n" +
1093
			"    <CompleteOnName:zzz>;\n" + 
1094
			"  }\n" + 
1095
			"}\n";
943
	
1096
	
944
	checkMethodParse(
1097
	checkMethodParse(
945
		str.toCharArray(), 
1098
		str.toCharArray(), 
Lines 984-990 Link Here
984
		"diet ast"); 
1137
		"diet ast"); 
985
}
1138
}
986
1139
987
public void test0020(){
1140
public void test0020_Diet(){
988
	String str = 
1141
	String str = 
989
		"package p;\n" +  
1142
		"package p;\n" +  
990
		"public class X {\n" +
1143
		"public class X {\n" +
Lines 1017-1037 Link Here
1017
		expectedUnitDisplayString,
1170
		expectedUnitDisplayString,
1018
		completionIdentifier,
1171
		completionIdentifier,
1019
		expectedReplacedSource,
1172
		expectedReplacedSource,
1020
		"diet ast");
1173
		"diet ast"); 
1021
	
1174
}
1022
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1175
public void test0020_Method(){
1023
	expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1176
	String str = 
1024
	completionIdentifier = "zzz";
1177
		"package p;\n" +  
1025
	expectedReplacedSource = "zzz";
1178
		"public class X {\n" +
1026
	expectedUnitDisplayString =
1027
		"package p;\n" + 
1028
		"public class X {\n" + 
1029
		"  {\n" + 
1179
		"  {\n" + 
1030
		"    Object o = bar(<CompleteOnName:zzz>);\n" + 
1180
		"    Object o = bar(zzz;\n" + 
1031
		"  }\n" + 
1032
		"  public X() {\n" + 
1033
		"  }\n" + 
1181
		"  }\n" + 
1034
		"}\n";
1182
		"}\n";
1183
1184
	String completeBehind = "zzz";
1185
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1186
	
1187
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1188
	String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1189
	String completionIdentifier = "zzz";
1190
	String expectedReplacedSource = "zzz";
1191
	String expectedUnitDisplayString =
1192
			"package p;\n" + 
1193
			"public class X {\n" + 
1194
			"  {\n" + 
1195
			"    Object o = bar(<CompleteOnName:zzz>);\n" + 
1196
			"  }\n" + 
1197
			"  public X() {\n" + 
1198
			"  }\n" + 
1199
			"}\n";
1035
	
1200
	
1036
	checkMethodParse(
1201
	checkMethodParse(
1037
		str.toCharArray(), 
1202
		str.toCharArray(), 
Lines 1044-1050 Link Here
1044
		"full ast"); 
1209
		"full ast"); 
1045
}
1210
}
1046
1211
1047
public void test0021(){
1212
public void test0021_Diet(){
1048
	String str = 
1213
	String str = 
1049
		"package p;\n" +  
1214
		"package p;\n" +  
1050
		"public class X {\n" +
1215
		"public class X {\n" +
Lines 1077-1097 Link Here
1077
		expectedUnitDisplayString,
1242
		expectedUnitDisplayString,
1078
		completionIdentifier,
1243
		completionIdentifier,
1079
		expectedReplacedSource,
1244
		expectedReplacedSource,
1080
		"diet ast");
1245
		"diet ast"); 
1081
	
1246
}
1082
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1247
public void test0021_Method(){
1083
	expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1248
	String str = 
1084
	completionIdentifier = "zzz";
1249
		"package p;\n" +  
1085
	expectedReplacedSource = "zzz";
1250
		"public class X {\n" +
1086
	expectedUnitDisplayString =
1251
		"  void foo(){\n" + 
1087
		"package p;\n" + 
1252
		"    Object o = bar(zzz;\n" + 
1088
		"public class X {\n" + 
1089
		"  public X() {\n" + 
1090
		"  }\n" + 
1091
		"  void foo() {\n" + 
1092
		"    Object o = bar(<CompleteOnName:zzz>);\n" + 
1093
		"  }\n" + 
1253
		"  }\n" + 
1094
		"}\n";
1254
		"}\n";
1255
1256
	String completeBehind = "zzz";
1257
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1258
	
1259
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1260
	String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1261
	String completionIdentifier = "zzz";
1262
	String expectedReplacedSource = "zzz";
1263
	String expectedUnitDisplayString =
1264
			"package p;\n" + 
1265
			"public class X {\n" + 
1266
			"  public X() {\n" + 
1267
			"  }\n" + 
1268
			"  void foo() {\n" + 
1269
			"    Object o = bar(<CompleteOnName:zzz>);\n" + 
1270
			"  }\n" + 
1271
			"}\n";
1095
	
1272
	
1096
	checkMethodParse(
1273
	checkMethodParse(
1097
		str.toCharArray(), 
1274
		str.toCharArray(), 
Lines 1138-1144 Link Here
1138
		"diet ast"); 
1315
		"diet ast"); 
1139
}
1316
}
1140
1317
1141
public void test0023(){
1318
public void test0023_Diet(){
1142
	String str = 
1319
	String str = 
1143
		"package p;\n" +  
1320
		"package p;\n" +  
1144
		"public class X {\n" +
1321
		"public class X {\n" +
Lines 1172-1194 Link Here
1172
		expectedUnitDisplayString,
1349
		expectedUnitDisplayString,
1173
		completionIdentifier,
1350
		completionIdentifier,
1174
		expectedReplacedSource,
1351
		expectedReplacedSource,
1175
		"diet ast");
1352
		"diet ast"); 
1176
	
1353
}
1177
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1354
public void test0023_Method(){
1178
	expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1355
	String str = 
1179
	completionIdentifier = "zzz";
1356
		"package p;\n" +  
1180
	expectedReplacedSource = "zzz";
1357
		"public class X {\n" +
1181
	expectedUnitDisplayString =
1182
		"package p;\n" + 
1183
		"public class X {\n" + 
1184
		"  {\n" + 
1358
		"  {\n" + 
1185
		"    {\n" + 
1359
		"    #\n" +
1186
		"      Object o = bar(<CompleteOnName:zzz>);\n" + 
1360
		"    Object o = bar(zzz;\n" + 
1187
		"    }\n" + 
1188
		"  }\n" + 
1189
		"  public X() {\n" + 
1190
		"  }\n" + 
1361
		"  }\n" + 
1191
		"}\n";
1362
		"}\n";
1363
1364
	String completeBehind = "zzz";
1365
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1366
	
1367
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1368
	String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1369
	String completionIdentifier = "zzz";
1370
	String expectedReplacedSource = "zzz";
1371
	String expectedUnitDisplayString =
1372
			"package p;\n" + 
1373
			"public class X {\n" + 
1374
			"  {\n" + 
1375
			"    {\n" + 
1376
			"      Object o = bar(<CompleteOnName:zzz>);\n" + 
1377
			"    }\n" + 
1378
			"  }\n" + 
1379
			"  public X() {\n" + 
1380
			"  }\n" + 
1381
			"}\n";
1192
	
1382
	
1193
	checkMethodParse(
1383
	checkMethodParse(
1194
		str.toCharArray(), 
1384
		str.toCharArray(), 
Lines 1201-1207 Link Here
1201
		"full ast"); 
1391
		"full ast"); 
1202
}
1392
}
1203
1393
1204
public void test0024(){
1394
public void test0024_Diet(){
1205
	String str = 
1395
	String str = 
1206
		"package p;\n" +  
1396
		"package p;\n" +  
1207
		"public class X {\n" +
1397
		"public class X {\n" +
Lines 1235-1255 Link Here
1235
		expectedUnitDisplayString,
1425
		expectedUnitDisplayString,
1236
		completionIdentifier,
1426
		completionIdentifier,
1237
		expectedReplacedSource,
1427
		expectedReplacedSource,
1238
		"diet ast");
1428
		"diet ast"); 
1239
	
1429
}
1240
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1430
public void test0024_Method(){
1241
	expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1431
	String str = 
1242
	completionIdentifier = "zzz";
1432
		"package p;\n" +  
1243
	expectedReplacedSource = "zzz";
1433
		"public class X {\n" +
1244
	expectedUnitDisplayString =
1434
		"  void foo(){\n" + 
1245
		"package p;\n" + 
1435
		"    #\n" +
1246
		"public class X {\n" + 
1436
		"    Object o = bar(zzz;\n" + 
1247
		"  public X() {\n" + 
1248
		"  }\n" + 
1249
		"  void foo() {\n" + 
1250
		"    Object o = bar(<CompleteOnName:zzz>);\n" + 
1251
		"  }\n" + 
1437
		"  }\n" + 
1252
		"}\n";
1438
		"}\n";
1439
1440
	String completeBehind = "zzz";
1441
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1442
	
1443
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1444
	String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
1445
	String completionIdentifier = "zzz";
1446
	String expectedReplacedSource = "zzz";
1447
	String expectedUnitDisplayString =
1448
			"package p;\n" + 
1449
			"public class X {\n" + 
1450
			"  public X() {\n" + 
1451
			"  }\n" + 
1452
			"  void foo() {\n" + 
1453
			"    Object o = bar(<CompleteOnName:zzz>);\n" + 
1454
			"  }\n" + 
1455
			"}\n";
1253
	
1456
	
1254
	checkMethodParse(
1457
	checkMethodParse(
1255
		str.toCharArray(), 
1458
		str.toCharArray(), 
Lines 1295-1301 Link Here
1295
}
1498
}
1296
1499
1297
1500
1298
public void test0026(){
1501
public void test0026_Diet(){
1299
	String str = 
1502
	String str = 
1300
		"package p;\n" +  
1503
		"package p;\n" +  
1301
		"public class X {\n" +
1504
		"public class X {\n" +
Lines 1328-1348 Link Here
1328
		expectedUnitDisplayString,
1531
		expectedUnitDisplayString,
1329
		completionIdentifier,
1532
		completionIdentifier,
1330
		expectedReplacedSource,
1533
		expectedReplacedSource,
1331
		"diet ast");
1534
		"diet ast"); 
1332
	
1535
}
1333
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1536
public void test0026_Method(){
1334
	expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1537
	String str = 
1335
	completionIdentifier = "zzz";
1538
		"package p;\n" +  
1336
	expectedReplacedSource = "zzz";
1539
		"public class X {\n" +
1337
	expectedUnitDisplayString =
1338
		"package p;\n" + 
1339
		"public class X {\n" + 
1340
		"  {\n" + 
1540
		"  {\n" + 
1341
		"    Object o = new X(<CompleteOnName:zzz>);\n" + 
1541
		"    Object o = new X(zzz;\n" + 
1342
		"  }\n" + 
1343
		"  public X() {\n" + 
1344
		"  }\n" + 
1542
		"  }\n" + 
1345
		"}\n";
1543
		"}\n";
1544
1545
	String completeBehind = "zzz";
1546
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1547
	
1548
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1549
	String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1550
	String completionIdentifier = "zzz";
1551
	String expectedReplacedSource = "zzz";
1552
	String expectedUnitDisplayString =
1553
			"package p;\n" + 
1554
			"public class X {\n" + 
1555
			"  {\n" + 
1556
			"    Object o = new X(<CompleteOnName:zzz>);\n" + 
1557
			"  }\n" + 
1558
			"  public X() {\n" + 
1559
			"  }\n" + 
1560
			"}\n";
1346
	
1561
	
1347
	checkMethodParse(
1562
	checkMethodParse(
1348
		str.toCharArray(), 
1563
		str.toCharArray(), 
Lines 1356-1362 Link Here
1356
}
1571
}
1357
1572
1358
1573
1359
public void test0027(){
1574
public void test0027_Diet(){
1360
	String str = 
1575
	String str = 
1361
		"package p;\n" +  
1576
		"package p;\n" +  
1362
		"public class X {\n" +
1577
		"public class X {\n" +
Lines 1389-1409 Link Here
1389
		expectedUnitDisplayString,
1604
		expectedUnitDisplayString,
1390
		completionIdentifier,
1605
		completionIdentifier,
1391
		expectedReplacedSource,
1606
		expectedReplacedSource,
1392
		"diet ast");
1607
		"diet ast"); 
1393
	
1608
}
1394
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1609
public void test0027_Method(){
1395
	expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1610
	String str = 
1396
	completionIdentifier = "zzz";
1611
		"package p;\n" +  
1397
	expectedReplacedSource = "zzz";
1612
		"public class X {\n" +
1398
	expectedUnitDisplayString =
1613
		"  void foo(){\n" + 
1399
		"package p;\n" + 
1614
		"    Object o = new X(zzz;\n" + 
1400
		"public class X {\n" + 
1401
		"  public X() {\n" + 
1402
		"  }\n" + 
1403
		"  void foo() {\n" + 
1404
		"    Object o = new X(<CompleteOnName:zzz>);\n" + 
1405
		"  }\n" + 
1615
		"  }\n" + 
1406
		"}\n";
1616
		"}\n";
1617
1618
	String completeBehind = "zzz";
1619
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1620
	
1621
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1622
	String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1623
	String completionIdentifier = "zzz";
1624
	String expectedReplacedSource = "zzz";
1625
	String expectedUnitDisplayString =
1626
			"package p;\n" + 
1627
			"public class X {\n" + 
1628
			"  public X() {\n" + 
1629
			"  }\n" + 
1630
			"  void foo() {\n" + 
1631
			"    Object o = new X(<CompleteOnName:zzz>);\n" + 
1632
			"  }\n" + 
1633
			"}\n";
1407
	
1634
	
1408
	checkMethodParse(
1635
	checkMethodParse(
1409
		str.toCharArray(), 
1636
		str.toCharArray(), 
Lines 1452-1458 Link Here
1452
}
1679
}
1453
1680
1454
1681
1455
public void test0029(){
1682
public void test0029_Diet(){
1456
	String str = 
1683
	String str = 
1457
		"package p;\n" +  
1684
		"package p;\n" +  
1458
		"public class X {\n" +
1685
		"public class X {\n" +
Lines 1486-1508 Link Here
1486
		expectedUnitDisplayString,
1713
		expectedUnitDisplayString,
1487
		completionIdentifier,
1714
		completionIdentifier,
1488
		expectedReplacedSource,
1715
		expectedReplacedSource,
1489
		"diet ast");
1716
		"diet ast"); 
1490
	
1717
}
1491
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1718
public void test0029_Method(){
1492
	expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1719
	String str = 
1493
	completionIdentifier = "zzz";
1720
		"package p;\n" +  
1494
	expectedReplacedSource = "zzz";
1721
		"public class X {\n" +
1495
	expectedUnitDisplayString =
1496
		"package p;\n" + 
1497
		"public class X {\n" + 
1498
		"  {\n" + 
1722
		"  {\n" + 
1499
		"    {\n" + 
1723
		"    #\n" +
1500
		"      Object o = new X(<CompleteOnName:zzz>);\n" + 
1724
		"    Object o = new X(zzz;\n" + 
1501
		"    }\n" + 
1502
		"  }\n" + 
1503
		"  public X() {\n" + 
1504
		"  }\n" + 
1725
		"  }\n" + 
1505
		"}\n";
1726
		"}\n";
1727
1728
	String completeBehind = "zzz";
1729
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1730
	
1731
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1732
	String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1733
	String completionIdentifier = "zzz";
1734
	String expectedReplacedSource = "zzz";
1735
	String expectedUnitDisplayString =
1736
			"package p;\n" + 
1737
			"public class X {\n" + 
1738
			"  {\n" + 
1739
			"    {\n" + 
1740
			"      Object o = new X(<CompleteOnName:zzz>);\n" + 
1741
			"    }\n" + 
1742
			"  }\n" + 
1743
			"  public X() {\n" + 
1744
			"  }\n" + 
1745
			"}\n";
1506
	
1746
	
1507
	checkMethodParse(
1747
	checkMethodParse(
1508
		str.toCharArray(), 
1748
		str.toCharArray(), 
Lines 1516-1522 Link Here
1516
}
1756
}
1517
1757
1518
1758
1519
public void test0030(){
1759
public void test0030_Diet(){
1520
	String str = 
1760
	String str = 
1521
		"package p;\n" +  
1761
		"package p;\n" +  
1522
		"public class X {\n" +
1762
		"public class X {\n" +
Lines 1550-1570 Link Here
1550
		expectedUnitDisplayString,
1790
		expectedUnitDisplayString,
1551
		completionIdentifier,
1791
		completionIdentifier,
1552
		expectedReplacedSource,
1792
		expectedReplacedSource,
1553
		"diet ast");
1793
		"diet ast"); 
1554
	
1794
}
1555
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1795
public void test0030_Method(){
1556
	expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1796
	String str = 
1557
	completionIdentifier = "zzz";
1797
		"package p;\n" +  
1558
	expectedReplacedSource = "zzz";
1798
		"public class X {\n" +
1559
	expectedUnitDisplayString =
1799
		"  void foo(){\n" + 
1560
		"package p;\n" + 
1800
		"    #\n" +
1561
		"public class X {\n" + 
1801
		"    Object o = new X(zzz;\n" + 
1562
		"  public X() {\n" + 
1563
		"  }\n" + 
1564
		"  void foo() {\n" + 
1565
		"    Object o = new X(<CompleteOnName:zzz>);\n" + 
1566
		"  }\n" + 
1802
		"  }\n" + 
1567
		"}\n";
1803
		"}\n";
1804
1805
	String completeBehind = "zzz";
1806
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1807
	
1808
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1809
	String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
1810
	String completionIdentifier = "zzz";
1811
	String expectedReplacedSource = "zzz";
1812
	String expectedUnitDisplayString =
1813
			"package p;\n" + 
1814
			"public class X {\n" + 
1815
			"  public X() {\n" + 
1816
			"  }\n" + 
1817
			"  void foo() {\n" + 
1818
			"    Object o = new X(<CompleteOnName:zzz>);\n" + 
1819
			"  }\n" + 
1820
			"}\n";
1568
	
1821
	
1569
	checkMethodParse(
1822
	checkMethodParse(
1570
		str.toCharArray(), 
1823
		str.toCharArray(), 
Lines 1576-1582 Link Here
1576
		expectedReplacedSource,
1829
		expectedReplacedSource,
1577
		"full ast"); 
1830
		"full ast"); 
1578
}
1831
}
1579
public void test0031(){
1832
public void test0031_Diet(){
1580
	String str = 
1833
	String str = 
1581
		"package p;\n" +  
1834
		"package p;\n" +  
1582
		"public class X {\n" +
1835
		"public class X {\n" +
Lines 1609-1629 Link Here
1609
		completionIdentifier,
1862
		completionIdentifier,
1610
		expectedReplacedSource,
1863
		expectedReplacedSource,
1611
		"diet ast");
1864
		"diet ast");
1612
	
1865
}
1613
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1866
public void test0031_Method(){
1614
	expectedParentNodeToString = "<NONE>";
1867
	String str = 
1615
	completionIdentifier = "zzz";
1868
		"package p;\n" +  
1616
	expectedReplacedSource = "zzz";
1869
		"public class X {\n" +
1617
	expectedUnitDisplayString =
1870
		"  Object o = {zzz;\n" + 
1618
		"package p;\n" + 
1619
		"public class X {\n" + 
1620
		"  Object o;\n" +
1621
		"  {\n" +
1622
		"    <CompleteOnName:zzz>;\n" + 
1623
		"  }\n" +
1624
		"  public X() {\n" + 
1625
		"  }\n" + 
1626
		"}\n";
1871
		"}\n";
1872
1873
	String completeBehind = "zzz";
1874
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1875
	
1876
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1877
	String expectedParentNodeToString = "<NONE>";
1878
	String completionIdentifier = "zzz";
1879
	String expectedReplacedSource = "zzz";
1880
	String expectedUnitDisplayString =
1881
			"package p;\n" + 
1882
			"public class X {\n" + 
1883
			"  Object o;\n" +
1884
			"  {\n" +
1885
			"    <CompleteOnName:zzz>;\n" + 
1886
			"  }\n" +
1887
			"  public X() {\n" + 
1888
			"  }\n" + 
1889
			"}\n";
1627
	
1890
	
1628
	checkMethodParse(
1891
	checkMethodParse(
1629
		str.toCharArray(), 
1892
		str.toCharArray(), 
Lines 1636-1642 Link Here
1636
		"full ast");
1899
		"full ast");
1637
}
1900
}
1638
1901
1639
public void test0032(){
1902
public void test0032_Diet(){
1640
	String str = 
1903
	String str = 
1641
		"package p;\n" +  
1904
		"package p;\n" +  
1642
		"public class X {\n" +
1905
		"public class X {\n" +
Lines 1670-1692 Link Here
1670
		completionIdentifier,
1933
		completionIdentifier,
1671
		expectedReplacedSource,
1934
		expectedReplacedSource,
1672
		"diet ast");
1935
		"diet ast");
1673
	
1936
}
1674
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1937
public void test0032_Method(){
1675
	expectedParentNodeToString = "<NONE>";
1938
	String str = 
1676
	completionIdentifier = "zzz";
1939
		"package p;\n" +  
1677
	expectedReplacedSource = "zzz";
1940
		"public class X {\n" +
1678
	expectedUnitDisplayString =
1679
		"package p;\n" + 
1680
		"public class X {\n" + 
1681
		"  {\n" + 
1941
		"  {\n" + 
1682
		"    Object o;\n" +
1942
		"    Object o = {zzz;\n" + 
1683
		"    {\n" +
1684
		"      <CompleteOnName:zzz>;\n" + 
1685
		"    }\n" +
1686
		"  }\n" + 
1687
		"  public X() {\n" + 
1688
		"  }\n" + 
1943
		"  }\n" + 
1689
		"}\n";
1944
		"}\n";
1945
1946
	String completeBehind = "zzz";
1947
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
1948
	
1949
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
1950
	String expectedParentNodeToString = "<NONE>";
1951
	String completionIdentifier = "zzz";
1952
	String expectedReplacedSource = "zzz";
1953
	String expectedUnitDisplayString =
1954
			"package p;\n" + 
1955
			"public class X {\n" + 
1956
			"  {\n" + 
1957
			"    Object o;\n" +
1958
			"    {\n" +
1959
			"      <CompleteOnName:zzz>;\n" + 
1960
			"    }\n" +
1961
			"  }\n" + 
1962
			"  public X() {\n" + 
1963
			"  }\n" + 
1964
			"}\n";
1690
	
1965
	
1691
	checkMethodParse(
1966
	checkMethodParse(
1692
		str.toCharArray(), 
1967
		str.toCharArray(), 
Lines 1699-1705 Link Here
1699
		"full ast");
1974
		"full ast");
1700
}
1975
}
1701
1976
1702
public void test0033(){
1977
public void test0033_Diet(){
1703
	String str = 
1978
	String str = 
1704
		"package p;\n" +  
1979
		"package p;\n" +  
1705
		"public class X {\n" +
1980
		"public class X {\n" +
Lines 1736-1758 Link Here
1736
		completionIdentifier,
2011
		completionIdentifier,
1737
		expectedReplacedSource,
2012
		expectedReplacedSource,
1738
		"diet ast");
2013
		"diet ast");
1739
	
2014
}
1740
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2015
public void test0033_Method(){
1741
	expectedParentNodeToString = "<NONE>";
2016
	String str = 
1742
	completionIdentifier = "zzz";
2017
		"package p;\n" +  
1743
	expectedReplacedSource = "zzz";
2018
		"public class X {\n" +
1744
	expectedUnitDisplayString =
2019
		"  void foo(){\n" + 
1745
		"package p;\n" + 
2020
		"    Object o = {zzz;\n" + 
1746
		"public class X {\n" + 
1747
		"  public X() {\n" + 
1748
		"  }\n" + 
1749
		"  void foo() {\n" + 
1750
		"    Object o;\n" +
1751
		"    {\n" +
1752
		"      <CompleteOnName:zzz>;\n" + 
1753
		"    }\n" +
1754
		"  }\n" + 
2021
		"  }\n" + 
1755
		"}\n";
2022
		"}\n";
2023
2024
	String completeBehind = "zzz";
2025
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2026
	
2027
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2028
	String expectedParentNodeToString = "<NONE>";
2029
	String completionIdentifier = "zzz";
2030
	String expectedReplacedSource = "zzz";
2031
	String expectedUnitDisplayString =
2032
			"package p;\n" + 
2033
			"public class X {\n" + 
2034
			"  public X() {\n" + 
2035
			"  }\n" + 
2036
			"  void foo() {\n" + 
2037
			"    Object o;\n" +
2038
			"    {\n" +
2039
			"      <CompleteOnName:zzz>;\n" + 
2040
			"    }\n" +
2041
			"  }\n" + 
2042
			"}\n";
1756
	
2043
	
1757
	checkMethodParse(
2044
	checkMethodParse(
1758
		str.toCharArray(), 
2045
		str.toCharArray(), 
Lines 1765-1771 Link Here
1765
		"full ast");
2052
		"full ast");
1766
}
2053
}
1767
2054
1768
public void test0034(){
2055
public void test0034_Diet(){
1769
	String str = 
2056
	String str = 
1770
		"package p;\n" +  
2057
		"package p;\n" +  
1771
		"public class X {\n" +
2058
		"public class X {\n" +
Lines 1799-1819 Link Here
1799
		completionIdentifier,
2086
		completionIdentifier,
1800
		expectedReplacedSource,
2087
		expectedReplacedSource,
1801
		"diet ast");
2088
		"diet ast");
1802
	
2089
}
1803
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2090
public void test0034_Method(){
1804
	expectedParentNodeToString = "<NONE>";
2091
	String str = 
1805
	completionIdentifier = "zzz";
2092
		"package p;\n" +  
1806
	expectedReplacedSource = "zzz";
2093
		"public class X {\n" +
1807
	expectedUnitDisplayString =
2094
		"  #\n" + 
1808
		"package p;\n" + 
2095
		"  Object o = {zzz;\n" + 
1809
		"public class X {\n" + 
1810
		"  Object o;\n" +
1811
		"  {\n" +
1812
		"    <CompleteOnName:zzz>;\n" + 
1813
		"  }\n" +
1814
		"  public X() {\n" + 
1815
		"  }\n" + 
1816
		"}\n";
2096
		"}\n";
2097
2098
	String completeBehind = "zzz";
2099
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2100
	
2101
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2102
	String expectedParentNodeToString = "<NONE>";
2103
	String completionIdentifier = "zzz";
2104
	String expectedReplacedSource = "zzz";
2105
	String expectedUnitDisplayString =
2106
			"package p;\n" + 
2107
			"public class X {\n" + 
2108
			"  Object o;\n" +
2109
			"  {\n" +
2110
			"    <CompleteOnName:zzz>;\n" + 
2111
			"  }\n" +
2112
			"  public X() {\n" + 
2113
			"  }\n" + 
2114
			"}\n";
1817
	
2115
	
1818
	checkMethodParse(
2116
	checkMethodParse(
1819
		str.toCharArray(), 
2117
		str.toCharArray(), 
Lines 1826-1832 Link Here
1826
		"full ast");
2124
		"full ast");
1827
}
2125
}
1828
2126
1829
public void test0035(){
2127
public void test0035_Diet(){
1830
	String str = 
2128
	String str = 
1831
		"package p;\n" +  
2129
		"package p;\n" +  
1832
		"public class X {\n" +
2130
		"public class X {\n" +
Lines 1861-1885 Link Here
1861
		completionIdentifier,
2159
		completionIdentifier,
1862
		expectedReplacedSource,
2160
		expectedReplacedSource,
1863
		"diet ast");
2161
		"diet ast");
1864
	
2162
}
1865
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2163
public void test0035_Method(){
1866
	expectedParentNodeToString = "<NONE>";
2164
	String str = 
1867
	completionIdentifier = "zzz";
2165
		"package p;\n" +  
1868
	expectedReplacedSource = "zzz";
2166
		"public class X {\n" +
1869
	expectedUnitDisplayString =
1870
		"package p;\n" + 
1871
		"public class X {\n" + 
1872
		"  {\n" + 
2167
		"  {\n" + 
1873
		"    {\n" + 
2168
		"    #\n" +
1874
		"      Object o;\n" +
2169
		"    Object o = {zzz;\n" + 
1875
		"      {\n" +
1876
		"        <CompleteOnName:zzz>;\n" + 
1877
		"      }\n" +
1878
		"    }\n" + 
1879
		"  }\n" + 
1880
		"  public X() {\n" + 
1881
		"  }\n" + 
2170
		"  }\n" + 
1882
		"}\n";
2171
		"}\n";
2172
2173
	String completeBehind = "zzz";
2174
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2175
	
2176
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2177
	String expectedParentNodeToString = "<NONE>";
2178
	String completionIdentifier = "zzz";
2179
	String expectedReplacedSource = "zzz";
2180
	String expectedUnitDisplayString =
2181
			"package p;\n" + 
2182
			"public class X {\n" + 
2183
			"  {\n" + 
2184
			"    {\n" + 
2185
			"      Object o;\n" +
2186
			"      {\n" +
2187
			"        <CompleteOnName:zzz>;\n" + 
2188
			"      }\n" +
2189
			"    }\n" + 
2190
			"  }\n" + 
2191
			"  public X() {\n" + 
2192
			"  }\n" + 
2193
			"}\n";
1883
	
2194
	
1884
	checkMethodParse(
2195
	checkMethodParse(
1885
		str.toCharArray(), 
2196
		str.toCharArray(), 
Lines 1892-1898 Link Here
1892
		"full ast");
2203
		"full ast");
1893
}
2204
}
1894
2205
1895
public void test0036(){
2206
public void test0036_Diet(){
1896
	String str = 
2207
	String str = 
1897
		"package p;\n" +  
2208
		"package p;\n" +  
1898
		"public class X {\n" +
2209
		"public class X {\n" +
Lines 1930-1952 Link Here
1930
		completionIdentifier,
2241
		completionIdentifier,
1931
		expectedReplacedSource,
2242
		expectedReplacedSource,
1932
		"diet ast");
2243
		"diet ast");
1933
	
2244
}
1934
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2245
public void test0036_Method(){
1935
	expectedParentNodeToString = "<NONE>";
2246
	String str = 
1936
	completionIdentifier = "zzz";
2247
		"package p;\n" +  
1937
	expectedReplacedSource = "zzz";
2248
		"public class X {\n" +
1938
	expectedUnitDisplayString =
2249
		"  void foo(){\n" + 
1939
		"package p;\n" + 
2250
		"    #\n" +
1940
		"public class X {\n" + 
2251
		"    Object o = {zzz;\n" + 
1941
		"  public X() {\n" + 
1942
		"  }\n" + 
1943
		"  void foo() {\n" + 
1944
		"    Object o;\n" +
1945
		"    {\n" +
1946
		"      <CompleteOnName:zzz>;\n" + 
1947
		"    }\n" +
1948
		"  }\n" + 
2252
		"  }\n" + 
1949
		"}\n";
2253
		"}\n";
2254
2255
	String completeBehind = "zzz";
2256
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2257
	
2258
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2259
	String expectedParentNodeToString = "<NONE>";
2260
	String completionIdentifier = "zzz";
2261
	String expectedReplacedSource = "zzz";
2262
	String expectedUnitDisplayString =
2263
			"package p;\n" + 
2264
			"public class X {\n" + 
2265
			"  public X() {\n" + 
2266
			"  }\n" + 
2267
			"  void foo() {\n" + 
2268
			"    Object o;\n" +
2269
			"    {\n" +
2270
			"      <CompleteOnName:zzz>;\n" + 
2271
			"    }\n" +
2272
			"  }\n" + 
2273
			"}\n";
1950
	
2274
	
1951
	checkMethodParse(
2275
	checkMethodParse(
1952
		str.toCharArray(), 
2276
		str.toCharArray(), 
Lines 1992-1998 Link Here
1992
}
2316
}
1993
2317
1994
2318
1995
public void test0038(){
2319
public void test0038_Diet(){
1996
	String str = 
2320
	String str = 
1997
		"package p;\n" +  
2321
		"package p;\n" +  
1998
		"public class X {\n" +
2322
		"public class X {\n" +
Lines 2026-2045 Link Here
2026
		completionIdentifier,
2350
		completionIdentifier,
2027
		expectedReplacedSource,
2351
		expectedReplacedSource,
2028
		"diet ast");
2352
		"diet ast");
2029
	
2353
}
2030
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2354
public void test0038_Method(){
2031
	expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2355
	String str = 
2032
	completionIdentifier = "zzz";
2356
		"package p;\n" +  
2033
	expectedReplacedSource = "zzz";
2357
		"public class X {\n" +
2034
	expectedUnitDisplayString =
2035
		"package p;\n" + 
2036
		"public class X {\n" + 
2037
		"  {\n" + 
2358
		"  {\n" + 
2038
		"    Object[] o = {<CompleteOnName:zzz>};\n" + 
2359
		"    Object[] o = {zzz;\n" + 
2039
		"  }\n" + 
2040
		"  public X() {\n" + 
2041
		"  }\n" + 
2360
		"  }\n" + 
2042
		"}\n";
2361
		"}\n";
2362
2363
	String completeBehind = "zzz";
2364
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2365
	
2366
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2367
	String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2368
	String completionIdentifier = "zzz";
2369
	String expectedReplacedSource = "zzz";
2370
	String expectedUnitDisplayString =
2371
			"package p;\n" + 
2372
			"public class X {\n" + 
2373
			"  {\n" + 
2374
			"    Object[] o = {<CompleteOnName:zzz>};\n" + 
2375
			"  }\n" + 
2376
			"  public X() {\n" + 
2377
			"  }\n" + 
2378
			"}\n";
2043
	
2379
	
2044
	checkMethodParse(
2380
	checkMethodParse(
2045
		str.toCharArray(), 
2381
		str.toCharArray(), 
Lines 2053-2059 Link Here
2053
}
2389
}
2054
2390
2055
2391
2056
public void test0039(){
2392
public void test0039_Diet(){
2057
	String str = 
2393
	String str = 
2058
		"package p;\n" +  
2394
		"package p;\n" +  
2059
		"public class X {\n" +
2395
		"public class X {\n" +
Lines 2090-2109 Link Here
2090
		completionIdentifier,
2426
		completionIdentifier,
2091
		expectedReplacedSource,
2427
		expectedReplacedSource,
2092
		"diet ast");
2428
		"diet ast");
2093
	
2429
}
2094
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2430
public void test0039_Method(){
2095
	expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2431
	String str = 
2096
	completionIdentifier = "zzz";
2432
		"package p;\n" +  
2097
	expectedReplacedSource = "zzz";
2433
		"public class X {\n" +
2098
	expectedUnitDisplayString =
2434
		"  void foo(){\n" + 
2099
		"package p;\n" + 
2435
		"    Object[] o = {zzz;\n" + 
2100
		"public class X {\n" + 
2101
		"  public X() {\n" + 
2102
		"  }\n" + 
2103
		"  void foo() {\n" + 
2104
		"    Object[] o = {<CompleteOnName:zzz>};\n" + 
2105
		"  }\n" + 
2436
		"  }\n" + 
2106
		"}\n";
2437
		"}\n";
2438
2439
	String completeBehind = "zzz";
2440
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2441
	
2442
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2443
	String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2444
	String completionIdentifier = "zzz";
2445
	String expectedReplacedSource = "zzz";
2446
	String expectedUnitDisplayString =
2447
			"package p;\n" + 
2448
			"public class X {\n" + 
2449
			"  public X() {\n" + 
2450
			"  }\n" + 
2451
			"  void foo() {\n" + 
2452
			"    Object[] o = {<CompleteOnName:zzz>};\n" + 
2453
			"  }\n" + 
2454
			"}\n";
2107
	
2455
	
2108
	checkMethodParse(
2456
	checkMethodParse(
2109
		str.toCharArray(), 
2457
		str.toCharArray(), 
Lines 2152-2158 Link Here
2152
}
2500
}
2153
2501
2154
2502
2155
public void test0041(){
2503
public void test0041_Diet(){
2156
	String str = 
2504
	String str = 
2157
		"package p;\n" +  
2505
		"package p;\n" +  
2158
		"public class X {\n" +
2506
		"public class X {\n" +
Lines 2187-2208 Link Here
2187
		completionIdentifier,
2535
		completionIdentifier,
2188
		expectedReplacedSource,
2536
		expectedReplacedSource,
2189
		"diet ast");
2537
		"diet ast");
2190
	
2538
}
2191
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2539
public void test0041_Method(){
2192
	expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2540
	String str = 
2193
	completionIdentifier = "zzz";
2541
		"package p;\n" +  
2194
	expectedReplacedSource = "zzz";
2542
		"public class X {\n" +
2195
	expectedUnitDisplayString =
2196
		"package p;\n" + 
2197
		"public class X {\n" + 
2198
		"  {\n" + 
2543
		"  {\n" + 
2199
		"    {\n" + 
2544
		"    #\n" +
2200
		"      Object[] o = {<CompleteOnName:zzz>};\n" + 
2545
		"    Object[] o = {zzz;\n" + 
2201
		"    }\n" + 
2202
		"  }\n" + 
2203
		"  public X() {\n" + 
2204
		"  }\n" + 
2546
		"  }\n" + 
2205
		"}\n";
2547
		"}\n";
2548
2549
	String completeBehind = "zzz";
2550
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2551
	
2552
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2553
	String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2554
	String completionIdentifier = "zzz";
2555
	String expectedReplacedSource = "zzz";
2556
	String expectedUnitDisplayString =
2557
			"package p;\n" + 
2558
			"public class X {\n" + 
2559
			"  {\n" + 
2560
			"    {\n" + 
2561
			"      Object[] o = {<CompleteOnName:zzz>};\n" + 
2562
			"    }\n" + 
2563
			"  }\n" + 
2564
			"  public X() {\n" + 
2565
			"  }\n" + 
2566
			"}\n";
2206
	
2567
	
2207
	checkMethodParse(
2568
	checkMethodParse(
2208
		str.toCharArray(), 
2569
		str.toCharArray(), 
Lines 2216-2222 Link Here
2216
}
2577
}
2217
2578
2218
2579
2219
public void test0042(){
2580
public void test0042_Diet(){
2220
	String str = 
2581
	String str = 
2221
		"package p;\n" +  
2582
		"package p;\n" +  
2222
		"public class X {\n" +
2583
		"public class X {\n" +
Lines 2254-2273 Link Here
2254
		completionIdentifier,
2615
		completionIdentifier,
2255
		expectedReplacedSource,
2616
		expectedReplacedSource,
2256
		"diet ast");
2617
		"diet ast");
2257
	
2618
}
2258
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2619
public void test0042_Method(){
2259
	expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2620
	String str = 
2260
	completionIdentifier = "zzz";
2621
		"package p;\n" +  
2261
	expectedReplacedSource = "zzz";
2622
		"public class X {\n" +
2262
	expectedUnitDisplayString =
2623
		"  void foo(){\n" + 
2263
		"package p;\n" + 
2624
		"    #\n" +
2264
		"public class X {\n" + 
2625
		"    Object[] o = {zzz;\n" + 
2265
		"  public X() {\n" + 
2266
		"  }\n" + 
2267
		"  void foo() {\n" + 
2268
		"    Object[] o = {<CompleteOnName:zzz>};\n" + 
2269
		"  }\n" + 
2626
		"  }\n" + 
2270
		"}\n";
2627
		"}\n";
2628
2629
	String completeBehind = "zzz";
2630
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2631
	
2632
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2633
	String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
2634
	String completionIdentifier = "zzz";
2635
	String expectedReplacedSource = "zzz";
2636
	String expectedUnitDisplayString =
2637
			"package p;\n" + 
2638
			"public class X {\n" + 
2639
			"  public X() {\n" + 
2640
			"  }\n" + 
2641
			"  void foo() {\n" + 
2642
			"    Object[] o = {<CompleteOnName:zzz>};\n" + 
2643
			"  }\n" + 
2644
			"}\n";
2271
	
2645
	
2272
	checkMethodParse(
2646
	checkMethodParse(
2273
		str.toCharArray(), 
2647
		str.toCharArray(), 
Lines 2314-2320 Link Here
2314
2688
2315
2689
2316
2690
2317
public void test0044(){
2691
public void test0044_Diet(){
2318
	String str = 
2692
	String str = 
2319
		"package p;\n" +  
2693
		"package p;\n" +  
2320
		"public class X {\n" +
2694
		"public class X {\n" +
Lines 2348-2367 Link Here
2348
		completionIdentifier,
2722
		completionIdentifier,
2349
		expectedReplacedSource,
2723
		expectedReplacedSource,
2350
		"diet ast");
2724
		"diet ast");
2351
	
2725
}
2352
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2726
public void test0044_Method(){
2353
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2727
	String str = 
2354
	completionIdentifier = "zzz";
2728
		"package p;\n" +  
2355
	expectedReplacedSource = "zzz";
2729
		"public class X {\n" +
2356
	expectedUnitDisplayString =
2730
		"  {\n" + 
2357
		"package p;\n" + 
2731
		"    Object[] o = new X[zzz;\n" + 
2358
		"public class X {\n" + 
2359
		"  {\n" +
2360
		"    Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2361
		"  }\n" + 
2362
		"  public X() {\n" + 
2363
		"  }\n" + 
2732
		"  }\n" + 
2364
		"}\n";
2733
		"}\n";
2734
2735
	String completeBehind = "zzz";
2736
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2737
	
2738
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2739
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2740
	String completionIdentifier = "zzz";
2741
	String expectedReplacedSource = "zzz";
2742
	String expectedUnitDisplayString =
2743
			"package p;\n" + 
2744
			"public class X {\n" + 
2745
			"  {\n" +
2746
			"    Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2747
			"  }\n" + 
2748
			"  public X() {\n" + 
2749
			"  }\n" + 
2750
			"}\n";
2365
	
2751
	
2366
	checkMethodParse(
2752
	checkMethodParse(
2367
		str.toCharArray(), 
2753
		str.toCharArray(), 
Lines 2376-2382 Link Here
2376
2762
2377
2763
2378
2764
2379
public void test0045(){
2765
public void test0045_Diet(){
2380
	String str = 
2766
	String str = 
2381
		"package p;\n" +  
2767
		"package p;\n" +  
2382
		"public class X {\n" +
2768
		"public class X {\n" +
Lines 2409-2429 Link Here
2409
		expectedUnitDisplayString,
2795
		expectedUnitDisplayString,
2410
		completionIdentifier,
2796
		completionIdentifier,
2411
		expectedReplacedSource,
2797
		expectedReplacedSource,
2412
		"diet ast");
2798
		"diet ast"); 
2413
	
2799
}
2414
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2800
public void test0045_Method(){
2415
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2801
	String str = 
2416
	completionIdentifier = "zzz";
2802
		"package p;\n" +  
2417
	expectedReplacedSource = "zzz";
2803
		"public class X {\n" +
2418
	expectedUnitDisplayString =
2804
		"  void foo(){\n" + 
2419
		"package p;\n" + 
2805
		"    Object[] o = new X[zzz;\n" + 
2420
		"public class X {\n" + 
2421
		"  public X() {\n" + 
2422
		"  }\n" + 
2423
		"  void foo() {\n" + 
2424
		"    Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2425
		"  }\n" + 
2806
		"  }\n" + 
2426
		"}\n";
2807
		"}\n";
2808
2809
	String completeBehind = "zzz";
2810
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2811
	
2812
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2813
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2814
	String completionIdentifier = "zzz";
2815
	String expectedReplacedSource = "zzz";
2816
	String expectedUnitDisplayString =
2817
			"package p;\n" + 
2818
			"public class X {\n" + 
2819
			"  public X() {\n" + 
2820
			"  }\n" + 
2821
			"  void foo() {\n" + 
2822
			"    Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2823
			"  }\n" + 
2824
			"}\n";
2427
	
2825
	
2428
	checkMethodParse(
2826
	checkMethodParse(
2429
		str.toCharArray(), 
2827
		str.toCharArray(), 
Lines 2474-2480 Link Here
2474
2872
2475
2873
2476
2874
2477
public void test0047(){
2875
public void test0047_Diet(){
2478
	String str = 
2876
	String str = 
2479
		"package p;\n" +  
2877
		"package p;\n" +  
2480
		"public class X {\n" +
2878
		"public class X {\n" +
Lines 2509-2530 Link Here
2509
		completionIdentifier,
2907
		completionIdentifier,
2510
		expectedReplacedSource,
2908
		expectedReplacedSource,
2511
		"diet ast");
2909
		"diet ast");
2512
	
2910
}
2513
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2911
public void test0047_Method(){
2514
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2912
	String str = 
2515
	completionIdentifier = "zzz";
2913
		"package p;\n" +  
2516
	expectedReplacedSource = "zzz";
2914
		"public class X {\n" +
2517
	expectedUnitDisplayString =
2915
		"  {\n" + 
2518
		"package p;\n" + 
2916
		"    #\n" +
2519
		"public class X {\n" + 
2917
		"    Object[] o = new X[zzz;\n" + 
2520
		"  {\n" +
2521
		"    {\n" +
2522
		"      Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2523
		"    }\n" +
2524
		"  }\n" + 
2525
		"  public X() {\n" + 
2526
		"  }\n" + 
2918
		"  }\n" + 
2527
		"}\n";
2919
		"}\n";
2920
2921
	String completeBehind = "zzz";
2922
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
2923
	
2924
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2925
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2926
	String completionIdentifier = "zzz";
2927
	String expectedReplacedSource = "zzz";
2928
	String expectedUnitDisplayString =
2929
			"package p;\n" + 
2930
			"public class X {\n" + 
2931
			"  {\n" +
2932
			"    {\n" +
2933
			"      Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2934
			"    }\n" +
2935
			"  }\n" + 
2936
			"  public X() {\n" + 
2937
			"  }\n" + 
2938
			"}\n";
2528
	
2939
	
2529
	checkMethodParse(
2940
	checkMethodParse(
2530
		str.toCharArray(), 
2941
		str.toCharArray(), 
Lines 2539-2545 Link Here
2539
2950
2540
2951
2541
2952
2542
public void test0048(){
2953
public void test0048_Diet(){
2543
	String str = 
2954
	String str = 
2544
		"package p;\n" +  
2955
		"package p;\n" +  
2545
		"public class X {\n" +
2956
		"public class X {\n" +
Lines 2574-2593 Link Here
2574
		completionIdentifier,
2985
		completionIdentifier,
2575
		expectedReplacedSource,
2986
		expectedReplacedSource,
2576
		"diet ast");
2987
		"diet ast");
2577
	
2988
}
2578
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
2989
public void test0048_Method(){
2579
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
2990
	String str = 
2580
	completionIdentifier = "zzz";
2991
		"package p;\n" +  
2581
	expectedReplacedSource = "zzz";
2992
		"public class X {\n" +
2582
	expectedUnitDisplayString =
2993
		"  void foo(){\n" + 
2583
		"package p;\n" + 
2994
		"    #\n" +
2584
		"public class X {\n" + 
2995
		"    Object[] o = new X[zzz;\n" + 
2585
		"  public X() {\n" + 
2586
		"  }\n" + 
2587
		"  void foo() {\n" + 
2588
		"    Object[] o = new X[<CompleteOnName:zzz>];\n" + 
2589
		"  }\n" + 
2996
		"  }\n" + 
2590
		"}\n";
2997
		"}\n";
2998
2999
	String completeBehind = "zzz";
3000
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3001
	
3002
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3003
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
3004
	String completionIdentifier = "zzz";
3005
	String expectedReplacedSource = "zzz";
3006
	String expectedUnitDisplayString =
3007
			"package p;\n" + 
3008
			"public class X {\n" + 
3009
			"  public X() {\n" + 
3010
			"  }\n" + 
3011
			"  void foo() {\n" + 
3012
			"    Object[] o = new X[<CompleteOnName:zzz>];\n" + 
3013
			"  }\n" + 
3014
			"}\n";
2591
	
3015
	
2592
	checkMethodParse(
3016
	checkMethodParse(
2593
		str.toCharArray(), 
3017
		str.toCharArray(), 
Lines 2631-2637 Link Here
2631
		expectedReplacedSource,
3055
		expectedReplacedSource,
2632
		"diet ast");
3056
		"diet ast");
2633
}
3057
}
2634
public void test0050(){
3058
public void test0050_Diet(){
2635
	String str = 
3059
	String str = 
2636
		"package p;\n" +  
3060
		"package p;\n" +  
2637
		"public class X {\n" +
3061
		"public class X {\n" +
Lines 2665-2684 Link Here
2665
		completionIdentifier,
3089
		completionIdentifier,
2666
		expectedReplacedSource,
3090
		expectedReplacedSource,
2667
		"diet ast");
3091
		"diet ast");
2668
	
3092
}
2669
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3093
public void test0050_Method(){
2670
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3094
	String str = 
2671
	completionIdentifier = "zzz";
3095
		"package p;\n" +  
2672
	expectedReplacedSource = "zzz";
3096
		"public class X {\n" +
2673
	expectedUnitDisplayString =
2674
		"package p;\n" + 
2675
		"public class X {\n" + 
2676
		"  {\n" + 
3097
		"  {\n" + 
2677
		"    Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
3098
		"    Object[] o = new X[]{zzz;\n" + 
2678
		"  }\n" + 
2679
		"  public X() {\n" + 
2680
		"  }\n" + 
3099
		"  }\n" + 
2681
		"}\n";
3100
		"}\n";
3101
3102
	String completeBehind = "zzz";
3103
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3104
	
3105
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3106
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3107
	String completionIdentifier = "zzz";
3108
	String expectedReplacedSource = "zzz";
3109
	String expectedUnitDisplayString =
3110
			"package p;\n" + 
3111
			"public class X {\n" + 
3112
			"  {\n" + 
3113
			"    Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
3114
			"  }\n" + 
3115
			"  public X() {\n" + 
3116
			"  }\n" + 
3117
			"}\n";
2682
	
3118
	
2683
	checkMethodParse(
3119
	checkMethodParse(
2684
		str.toCharArray(), 
3120
		str.toCharArray(), 
Lines 2690-2696 Link Here
2690
		expectedReplacedSource,
3126
		expectedReplacedSource,
2691
		"full ast");
3127
		"full ast");
2692
}
3128
}
2693
public void test0051(){
3129
public void test0051_Diet(){
2694
	String str = 
3130
	String str = 
2695
		"package p;\n" +  
3131
		"package p;\n" +  
2696
		"public class X {\n" +
3132
		"public class X {\n" +
Lines 2726-2746 Link Here
2726
		expectedUnitDisplayString,
3162
		expectedUnitDisplayString,
2727
		completionIdentifier,
3163
		completionIdentifier,
2728
		expectedReplacedSource,
3164
		expectedReplacedSource,
2729
		"diet ast");
3165
		"diet ast"); 
2730
	
3166
}
2731
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3167
public void test0051_Method(){
2732
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3168
	String str = 
2733
	completionIdentifier = "zzz";
3169
		"package p;\n" +  
2734
	expectedReplacedSource = "zzz";
3170
		"public class X {\n" +
2735
	expectedUnitDisplayString =
3171
		"  void foo(){\n" + 
2736
		"package p;\n" + 
3172
		"    Object[] o = new X[]{zzz;\n" + 
2737
		"public class X {\n" + 
2738
		"  public X() {\n" + 
2739
		"  }\n" + 
2740
		"  void foo() {\n" + 
2741
		"    Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
2742
		"  }\n" + 
3173
		"  }\n" + 
2743
		"}\n";
3174
		"}\n";
3175
3176
	String completeBehind = "zzz";
3177
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3178
	
3179
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3180
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3181
	String completionIdentifier = "zzz";
3182
	String expectedReplacedSource = "zzz";
3183
	String expectedUnitDisplayString =
3184
			"package p;\n" + 
3185
			"public class X {\n" + 
3186
			"  public X() {\n" + 
3187
			"  }\n" + 
3188
			"  void foo() {\n" + 
3189
			"    Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
3190
			"  }\n" + 
3191
			"}\n";
2744
	
3192
	
2745
	checkMethodParse(
3193
	checkMethodParse(
2746
		str.toCharArray(), 
3194
		str.toCharArray(), 
Lines 2785-2791 Link Here
2785
		expectedReplacedSource,
3233
		expectedReplacedSource,
2786
		"diet ast");
3234
		"diet ast");
2787
}
3235
}
2788
public void test0053(){
3236
public void test0053_Diet(){
2789
	String str = 
3237
	String str = 
2790
		"package p;\n" +  
3238
		"package p;\n" +  
2791
		"public class X {\n" +
3239
		"public class X {\n" +
Lines 2820-2841 Link Here
2820
		completionIdentifier,
3268
		completionIdentifier,
2821
		expectedReplacedSource,
3269
		expectedReplacedSource,
2822
		"diet ast");
3270
		"diet ast");
2823
	
3271
}
2824
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3272
public void test0053_Method(){
2825
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3273
	String str = 
2826
	completionIdentifier = "zzz";
3274
		"package p;\n" +  
2827
	expectedReplacedSource = "zzz";
3275
		"public class X {\n" +
2828
	expectedUnitDisplayString =
2829
		"package p;\n" + 
2830
		"public class X {\n" + 
2831
		"  {\n" + 
3276
		"  {\n" + 
2832
		"    {\n" + 
3277
		"    #\n" +
2833
		"      Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
3278
		"    Object[] o = new X[]{zzz;\n" + 
2834
		"    }\n" + 
2835
		"  }\n" + 
2836
		"  public X() {\n" + 
2837
		"  }\n" + 
3279
		"  }\n" + 
2838
		"}\n";
3280
		"}\n";
3281
3282
	String completeBehind = "zzz";
3283
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3284
	
3285
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3286
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3287
	String completionIdentifier = "zzz";
3288
	String expectedReplacedSource = "zzz";
3289
	String expectedUnitDisplayString =
3290
			"package p;\n" + 
3291
			"public class X {\n" + 
3292
			"  {\n" + 
3293
			"    {\n" + 
3294
			"      Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
3295
			"    }\n" + 
3296
			"  }\n" + 
3297
			"  public X() {\n" + 
3298
			"  }\n" + 
3299
			"}\n";
2839
	
3300
	
2840
	checkMethodParse(
3301
	checkMethodParse(
2841
		str.toCharArray(), 
3302
		str.toCharArray(), 
Lines 2847-2853 Link Here
2847
		expectedReplacedSource,
3308
		expectedReplacedSource,
2848
		"full ast");
3309
		"full ast");
2849
}
3310
}
2850
public void test0054(){
3311
public void test0054_Diet(){
2851
	String str = 
3312
	String str = 
2852
		"package p;\n" +  
3313
		"package p;\n" +  
2853
		"public class X {\n" +
3314
		"public class X {\n" +
Lines 2885-2904 Link Here
2885
		completionIdentifier,
3346
		completionIdentifier,
2886
		expectedReplacedSource,
3347
		expectedReplacedSource,
2887
		"diet ast");
3348
		"diet ast");
2888
	
3349
}
2889
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3350
public void test0054_Method(){
2890
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3351
	String str = 
2891
	completionIdentifier = "zzz";
3352
		"package p;\n" +  
2892
	expectedReplacedSource = "zzz";
3353
		"public class X {\n" +
2893
	expectedUnitDisplayString =
3354
		"  void foo(){\n" + 
2894
		"package p;\n" + 
3355
		"    #\n" +
2895
		"public class X {\n" + 
3356
		"    Object[] o = new X[]{zzz;\n" + 
2896
		"  public X() {\n" + 
2897
		"  }\n" + 
2898
		"  void foo() {\n" + 
2899
		"    Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
2900
		"  }\n" + 
3357
		"  }\n" + 
2901
		"}\n";
3358
		"}\n";
3359
3360
	String completeBehind = "zzz";
3361
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3362
	
3363
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3364
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
3365
	String completionIdentifier = "zzz";
3366
	String expectedReplacedSource = "zzz";
3367
	String expectedUnitDisplayString =
3368
			"package p;\n" + 
3369
			"public class X {\n" + 
3370
			"  public X() {\n" + 
3371
			"  }\n" + 
3372
			"  void foo() {\n" + 
3373
			"    Object[] o = new X[]{<CompleteOnName:zzz>};\n" + 
3374
			"  }\n" + 
3375
			"}\n";
2902
	
3376
	
2903
	checkMethodParse(
3377
	checkMethodParse(
2904
		str.toCharArray(), 
3378
		str.toCharArray(), 
Lines 2944-2950 Link Here
2944
		"diet ast");
3418
		"diet ast");
2945
}
3419
}
2946
3420
2947
public void test0056(){
3421
public void test0056_Diet(){
2948
	String str = 
3422
	String str = 
2949
		"package p;\n" +  
3423
		"package p;\n" +  
2950
		"public class X {\n" +
3424
		"public class X {\n" +
Lines 2978-2997 Link Here
2978
		completionIdentifier,
3452
		completionIdentifier,
2979
		expectedReplacedSource,
3453
		expectedReplacedSource,
2980
		"diet ast");
3454
		"diet ast");
2981
	
3455
}
2982
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3456
public void test0056_Method(){
2983
	expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3457
	String str = 
2984
	completionIdentifier = "zzz";
3458
		"package p;\n" +  
2985
	expectedReplacedSource = "zzz";
3459
		"public class X {\n" +
2986
	expectedUnitDisplayString =
2987
		"package p;\n" + 
2988
		"public class X {\n" + 
2989
		"  {\n" + 
3460
		"  {\n" + 
2990
		"    Object[] o = <CompleteOnName:zzz>;\n" + 
3461
		"    Object[] o = zzz;\n" + 
2991
		"  }\n" + 
2992
		"  public X() {\n" + 
2993
		"  }\n" + 
3462
		"  }\n" + 
2994
		"}\n";
3463
		"}\n";
3464
3465
	String completeBehind = "zzz";
3466
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3467
	
3468
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3469
	String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3470
	String completionIdentifier = "zzz";
3471
	String expectedReplacedSource = "zzz";
3472
	String expectedUnitDisplayString =
3473
			"package p;\n" + 
3474
			"public class X {\n" + 
3475
			"  {\n" + 
3476
			"    Object[] o = <CompleteOnName:zzz>;\n" + 
3477
			"  }\n" + 
3478
			"  public X() {\n" + 
3479
			"  }\n" + 
3480
			"}\n";
2995
	
3481
	
2996
	checkMethodParse(
3482
	checkMethodParse(
2997
		str.toCharArray(), 
3483
		str.toCharArray(), 
Lines 3004-3010 Link Here
3004
		"full ast");
3490
		"full ast");
3005
}
3491
}
3006
3492
3007
public void test0057(){
3493
public void test0057_Diet(){
3008
	String str = 
3494
	String str = 
3009
		"package p;\n" +  
3495
		"package p;\n" +  
3010
		"public class X {\n" +
3496
		"public class X {\n" +
Lines 3037-3057 Link Here
3037
		expectedUnitDisplayString,
3523
		expectedUnitDisplayString,
3038
		completionIdentifier,
3524
		completionIdentifier,
3039
		expectedReplacedSource,
3525
		expectedReplacedSource,
3040
		"diet ast");
3526
		"diet ast"); 
3041
	
3527
}
3042
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3528
public void test0057_Method(){
3043
	expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3529
	String str = 
3044
	completionIdentifier = "zzz";
3530
		"package p;\n" +  
3045
	expectedReplacedSource = "zzz";
3531
		"public class X {\n" +
3046
	expectedUnitDisplayString =
3532
		"  void foo(){\n" + 
3047
		"package p;\n" + 
3533
		"    Object[] o = zzz;\n" + 
3048
		"public class X {\n" + 
3049
		"  public X() {\n" + 
3050
		"  }\n" + 
3051
		"  void foo() {\n" + 
3052
		"    Object[] o = <CompleteOnName:zzz>;\n" + 
3053
		"  }\n" + 
3534
		"  }\n" + 
3054
		"}\n";
3535
		"}\n";
3536
3537
	String completeBehind = "zzz";
3538
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3539
	
3540
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3541
	String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3542
	String completionIdentifier = "zzz";
3543
	String expectedReplacedSource = "zzz";
3544
	String expectedUnitDisplayString =
3545
			"package p;\n" + 
3546
			"public class X {\n" + 
3547
			"  public X() {\n" + 
3548
			"  }\n" + 
3549
			"  void foo() {\n" + 
3550
			"    Object[] o = <CompleteOnName:zzz>;\n" + 
3551
			"  }\n" + 
3552
			"}\n";
3055
	
3553
	
3056
	checkMethodParse(
3554
	checkMethodParse(
3057
		str.toCharArray(), 
3555
		str.toCharArray(), 
Lines 3098-3104 Link Here
3098
		"diet ast");
3596
		"diet ast");
3099
}
3597
}
3100
3598
3101
public void test0059(){
3599
public void test0059_Diet(){
3102
	String str = 
3600
	String str = 
3103
		"package p;\n" +  
3601
		"package p;\n" +  
3104
		"public class X {\n" +
3602
		"public class X {\n" +
Lines 3133-3154 Link Here
3133
		completionIdentifier,
3631
		completionIdentifier,
3134
		expectedReplacedSource,
3632
		expectedReplacedSource,
3135
		"diet ast");
3633
		"diet ast");
3136
	
3634
}
3137
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3635
public void test0059_Method(){
3138
	expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3636
	String str = 
3139
	completionIdentifier = "zzz";
3637
		"package p;\n" +  
3140
	expectedReplacedSource = "zzz";
3638
		"public class X {\n" +
3141
	expectedUnitDisplayString =
3639
		"  {\n" + 
3142
		"package p;\n" + 
3640
		"    #\n" +
3143
		"public class X {\n" + 
3641
		"    Object[] o = zzz;\n" + 
3144
		"  {\n" +
3145
		"    {\n" +
3146
		"      Object[] o = <CompleteOnName:zzz>;\n" + 
3147
		"    }\n" +
3148
		"  }\n" + 
3149
		"  public X() {\n" + 
3150
		"  }\n" + 
3642
		"  }\n" + 
3151
		"}\n";
3643
		"}\n";
3644
3645
	String completeBehind = "zzz";
3646
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3647
	
3648
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3649
	String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3650
	String completionIdentifier = "zzz";
3651
	String expectedReplacedSource = "zzz";
3652
	String expectedUnitDisplayString =
3653
			"package p;\n" + 
3654
			"public class X {\n" + 
3655
			"  {\n" +
3656
			"    {\n" +
3657
			"      Object[] o = <CompleteOnName:zzz>;\n" + 
3658
			"    }\n" +
3659
			"  }\n" + 
3660
			"  public X() {\n" + 
3661
			"  }\n" + 
3662
			"}\n";
3152
	
3663
	
3153
	checkMethodParse(
3664
	checkMethodParse(
3154
		str.toCharArray(), 
3665
		str.toCharArray(), 
Lines 3161-3167 Link Here
3161
		"full ast");
3672
		"full ast");
3162
}
3673
}
3163
3674
3164
public void test0060(){
3675
public void test0060_Diet(){
3165
	String str = 
3676
	String str = 
3166
		"package p;\n" +  
3677
		"package p;\n" +  
3167
		"public class X {\n" +
3678
		"public class X {\n" +
Lines 3196-3215 Link Here
3196
		completionIdentifier,
3707
		completionIdentifier,
3197
		expectedReplacedSource,
3708
		expectedReplacedSource,
3198
		"diet ast");
3709
		"diet ast");
3199
	
3710
}
3200
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3711
public void test0060_Method(){
3201
	expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3712
	String str = 
3202
	completionIdentifier = "zzz";
3713
		"package p;\n" +  
3203
	expectedReplacedSource = "zzz";
3714
		"public class X {\n" +
3204
	expectedUnitDisplayString =
3715
		"  void foo(){\n" + 
3205
		"package p;\n" + 
3716
		"    #\n" +
3206
		"public class X {\n" + 
3717
		"    Object[] o = zzz;\n" + 
3207
		"  public X() {\n" + 
3208
		"  }\n" + 
3209
		"  void foo() {\n" + 
3210
		"    Object[] o = <CompleteOnName:zzz>;\n" + 
3211
		"  }\n" + 
3718
		"  }\n" + 
3212
		"}\n";
3719
		"}\n";
3720
3721
	String completeBehind = "zzz";
3722
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3723
	
3724
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3725
	String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
3726
	String completionIdentifier = "zzz";
3727
	String expectedReplacedSource = "zzz";
3728
	String expectedUnitDisplayString =
3729
			"package p;\n" + 
3730
			"public class X {\n" + 
3731
			"  public X() {\n" + 
3732
			"  }\n" + 
3733
			"  void foo() {\n" + 
3734
			"    Object[] o = <CompleteOnName:zzz>;\n" + 
3735
			"  }\n" + 
3736
			"}\n";
3213
	
3737
	
3214
	checkMethodParse(
3738
	checkMethodParse(
3215
		str.toCharArray(), 
3739
		str.toCharArray(), 
Lines 3254-3260 Link Here
3254
		"diet ast");
3778
		"diet ast");
3255
}
3779
}
3256
3780
3257
public void test0062(){
3781
public void test0062_Diet(){
3258
	String str = 
3782
	String str = 
3259
		"package p;\n" +  
3783
		"package p;\n" +  
3260
		"public class X {\n" +
3784
		"public class X {\n" +
Lines 3288-3307 Link Here
3288
		completionIdentifier,
3812
		completionIdentifier,
3289
		expectedReplacedSource,
3813
		expectedReplacedSource,
3290
		"diet ast");
3814
		"diet ast");
3291
	
3815
}
3292
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3816
public void test0062_Method(){
3293
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
3817
	String str = 
3294
	completionIdentifier = "zzz";
3818
		"package p;\n" +  
3295
	expectedReplacedSource = "zzz";
3819
		"public class X {\n" +
3296
	expectedUnitDisplayString =
3297
		"package p;\n" + 
3298
		"public class X {\n" + 
3299
		"  {\n" + 
3820
		"  {\n" + 
3300
		"    Object o = new X[<CompleteOnName:zzz>];\n" + 
3821
		"    Object o = new X[zzz;\n" + 
3301
		"  }\n" + 
3302
		"  public X() {\n" + 
3303
		"  }\n" + 
3822
		"  }\n" + 
3304
		"}\n";
3823
		"}\n";
3824
3825
	String completeBehind = "zzz";
3826
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3827
	
3828
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3829
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
3830
	String completionIdentifier = "zzz";
3831
	String expectedReplacedSource = "zzz";
3832
	String expectedUnitDisplayString =
3833
			"package p;\n" + 
3834
			"public class X {\n" + 
3835
			"  {\n" + 
3836
			"    Object o = new X[<CompleteOnName:zzz>];\n" + 
3837
			"  }\n" + 
3838
			"  public X() {\n" + 
3839
			"  }\n" + 
3840
			"}\n";
3305
	
3841
	
3306
	checkMethodParse(
3842
	checkMethodParse(
3307
		str.toCharArray(), 
3843
		str.toCharArray(), 
Lines 3314-3320 Link Here
3314
		"full ast");
3850
		"full ast");
3315
}
3851
}
3316
3852
3317
public void test0063(){
3853
public void test0063_Diet(){
3318
	String str = 
3854
	String str = 
3319
		"package p;\n" +  
3855
		"package p;\n" +  
3320
		"public class X {\n" +
3856
		"public class X {\n" +
Lines 3347-3367 Link Here
3347
		expectedUnitDisplayString,
3883
		expectedUnitDisplayString,
3348
		completionIdentifier,
3884
		completionIdentifier,
3349
		expectedReplacedSource,
3885
		expectedReplacedSource,
3350
		"diet ast");
3886
		"diet ast"); 
3351
	
3887
}
3352
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3888
public void test0063_Method(){
3353
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
3889
	String str = 
3354
	completionIdentifier = "zzz";
3890
		"package p;\n" +  
3355
	expectedReplacedSource = "zzz";
3891
		"public class X {\n" +
3356
	expectedUnitDisplayString =
3892
		"  void foo(){\n" + 
3357
		"package p;\n" + 
3893
		"    Object o = new X[zzz;\n" + 
3358
		"public class X {\n" + 
3359
		"  public X() {\n" + 
3360
		"  }\n" + 
3361
		"  void foo() {\n" + 
3362
		"    Object o = new X[<CompleteOnName:zzz>];\n" + 
3363
		"  }\n" + 
3894
		"  }\n" + 
3364
		"}\n";
3895
		"}\n";
3896
3897
	String completeBehind = "zzz";
3898
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
3899
	
3900
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3901
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
3902
	String completionIdentifier = "zzz";
3903
	String expectedReplacedSource = "zzz";
3904
	String expectedUnitDisplayString =
3905
			"package p;\n" + 
3906
			"public class X {\n" + 
3907
			"  public X() {\n" + 
3908
			"  }\n" + 
3909
			"  void foo() {\n" + 
3910
			"    Object o = new X[<CompleteOnName:zzz>];\n" + 
3911
			"  }\n" + 
3912
			"}\n";
3365
	
3913
	
3366
	checkMethodParse(
3914
	checkMethodParse(
3367
		str.toCharArray(), 
3915
		str.toCharArray(), 
Lines 3408-3414 Link Here
3408
		"diet ast");
3956
		"diet ast");
3409
}
3957
}
3410
3958
3411
public void test0065(){
3959
public void test0065_Diet(){
3412
	String str = 
3960
	String str = 
3413
		"package p;\n" +  
3961
		"package p;\n" +  
3414
		"public class X {\n" +
3962
		"public class X {\n" +
Lines 3443-3464 Link Here
3443
		completionIdentifier,
3991
		completionIdentifier,
3444
		expectedReplacedSource,
3992
		expectedReplacedSource,
3445
		"diet ast");
3993
		"diet ast");
3446
	
3994
}
3447
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
3995
public void test0065_Method(){
3448
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
3996
	String str = 
3449
	completionIdentifier = "zzz";
3997
		"package p;\n" +  
3450
	expectedReplacedSource = "zzz";
3998
		"public class X {\n" +
3451
	expectedUnitDisplayString =
3452
		"package p;\n" + 
3453
		"public class X {\n" + 
3454
		"  {\n" + 
3999
		"  {\n" + 
3455
		"    {\n" + 
4000
		"    #\n" +
3456
		"      Object o = new X[<CompleteOnName:zzz>];\n" + 
4001
		"    Object o = new X[zzz;\n" + 
3457
		"    }\n" + 
3458
		"  }\n" + 
3459
		"  public X() {\n" + 
3460
		"  }\n" + 
4002
		"  }\n" + 
3461
		"}\n";
4003
		"}\n";
4004
4005
	String completeBehind = "zzz";
4006
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4007
	
4008
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4009
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
4010
	String completionIdentifier = "zzz";
4011
	String expectedReplacedSource = "zzz";
4012
	String expectedUnitDisplayString =
4013
			"package p;\n" + 
4014
			"public class X {\n" + 
4015
			"  {\n" + 
4016
			"    {\n" + 
4017
			"      Object o = new X[<CompleteOnName:zzz>];\n" + 
4018
			"    }\n" + 
4019
			"  }\n" + 
4020
			"  public X() {\n" + 
4021
			"  }\n" + 
4022
			"}\n";
3462
	
4023
	
3463
	checkMethodParse(
4024
	checkMethodParse(
3464
		str.toCharArray(), 
4025
		str.toCharArray(), 
Lines 3471-3477 Link Here
3471
		"full ast");
4032
		"full ast");
3472
}
4033
}
3473
4034
3474
public void test0066(){
4035
public void test0066_Diet(){
3475
	String str = 
4036
	String str = 
3476
		"package p;\n" +  
4037
		"package p;\n" +  
3477
		"public class X {\n" +
4038
		"public class X {\n" +
Lines 3506-3526 Link Here
3506
		completionIdentifier,
4067
		completionIdentifier,
3507
		expectedReplacedSource,
4068
		expectedReplacedSource,
3508
		"diet ast");
4069
		"diet ast");
3509
	
4070
}
3510
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4071
public void test0066_Method(){
3511
	expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
4072
	String str = 
3512
	completionIdentifier = "zzz";
4073
		"package p;\n" +  
3513
	expectedReplacedSource = "zzz";
4074
		"public class X {\n" +
3514
	expectedUnitDisplayString =
4075
		"  void foo(){\n" + 
3515
		"package p;\n" + 
4076
		"    #\n" +
3516
		"public class X {\n" + 
4077
		"    Object o = new X[zzz;\n" + 
3517
		"  public X() {\n" + 
3518
		"  }\n" + 
3519
		"  void foo() {\n" + 
3520
		"    Object o = new X[<CompleteOnName:zzz>];\n" + 
3521
		"  }\n" + 
4078
		"  }\n" + 
3522
		"}\n";
4079
		"}\n";
3523
	
4080
4081
	String completeBehind = "zzz";
4082
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4083
	
4084
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4085
	String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
4086
	String completionIdentifier = "zzz";
4087
	String expectedReplacedSource = "zzz";
4088
	String expectedUnitDisplayString =
4089
			"package p;\n" + 
4090
			"public class X {\n" + 
4091
			"  public X() {\n" + 
4092
			"  }\n" + 
4093
			"  void foo() {\n" + 
4094
			"    Object o = new X[<CompleteOnName:zzz>];\n" + 
4095
			"  }\n" + 
4096
			"}\n";
4097
	
3524
	checkMethodParse(
4098
	checkMethodParse(
3525
		str.toCharArray(), 
4099
		str.toCharArray(), 
3526
		cursorLocation, 
4100
		cursorLocation, 
Lines 3531-3537 Link Here
3531
		expectedReplacedSource,
4105
		expectedReplacedSource,
3532
		"full ast");
4106
		"full ast");
3533
}
4107
}
3534
public void test0067(){
4108
public void test0067_Diet(){
3535
	String str = 
4109
	String str = 
3536
		"package p;\n" +  
4110
		"package p;\n" +  
3537
		"public class X {\n" +
4111
		"public class X {\n" +
Lines 3564-3585 Link Here
3564
		completionIdentifier,
4138
		completionIdentifier,
3565
		expectedReplacedSource,
4139
		expectedReplacedSource,
3566
		"diet ast");
4140
		"diet ast");
3567
	
4141
}
3568
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4142
public void test0067_Method(){
3569
	expectedParentNodeToString = "<NONE>";
4143
	String str = 
3570
	completionIdentifier = "zzz";
4144
		"package p;\n" +  
3571
	expectedReplacedSource = "zzz";
4145
		"public class X {\n" +
3572
	expectedUnitDisplayString =
4146
		"  Object o = new X[]{zzz;\n" + 
3573
		"package p;\n" + 
3574
		"public class X {\n" + 
3575
		"  Object o;\n" +
3576
		"  {\n" +
3577
		"    <CompleteOnName:zzz>;\n" +
3578
		"  }\n" + 
3579
		"  public X() {\n" + 
3580
		"  }\n" + 
3581
		"}\n";
4147
		"}\n";
3582
4148
4149
	String completeBehind = "zzz";
4150
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4151
	
4152
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4153
	String expectedParentNodeToString = "<NONE>";
4154
	String completionIdentifier = "zzz";
4155
	String expectedReplacedSource = "zzz";
4156
	String expectedUnitDisplayString =
4157
			"package p;\n" + 
4158
			"public class X {\n" + 
4159
			"  Object o;\n" +
4160
			"  {\n" +
4161
			"    <CompleteOnName:zzz>;\n" +
4162
			"  }\n" + 
4163
			"  public X() {\n" + 
4164
			"  }\n" + 
4165
			"}\n";
4166
3583
	checkMethodParse(
4167
	checkMethodParse(
3584
		str.toCharArray(), 
4168
		str.toCharArray(), 
3585
		cursorLocation, 
4169
		cursorLocation, 
Lines 3591-3597 Link Here
3591
		"full ast");
4175
		"full ast");
3592
}
4176
}
3593
4177
3594
public void test0068(){
4178
public void test0068_Diet(){
3595
	String str = 
4179
	String str = 
3596
		"package p;\n" +  
4180
		"package p;\n" +  
3597
		"public class X {\n" +
4181
		"public class X {\n" +
Lines 3625-3644 Link Here
3625
		completionIdentifier,
4209
		completionIdentifier,
3626
		expectedReplacedSource,
4210
		expectedReplacedSource,
3627
		"diet ast");
4211
		"diet ast");
3628
	
4212
}
3629
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4213
public void test0068_Method(){
3630
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
4214
	String str = 
3631
	completionIdentifier = "zzz";
4215
		"package p;\n" +  
3632
	expectedReplacedSource = "zzz";
4216
		"public class X {\n" +
3633
	expectedUnitDisplayString =
3634
		"package p;\n" + 
3635
		"public class X {\n" + 
3636
		"  {\n" + 
4217
		"  {\n" + 
3637
		"    Object o = new X[]{<CompleteOnName:zzz>};\n" + 
4218
		"    Object o = new X[]{zzz;\n" + 
3638
		"  }\n" + 
3639
		"  public X() {\n" + 
3640
		"  }\n" + 
4219
		"  }\n" + 
3641
		"}\n";
4220
		"}\n";
4221
4222
	String completeBehind = "zzz";
4223
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4224
	
4225
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4226
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
4227
	String completionIdentifier = "zzz";
4228
	String expectedReplacedSource = "zzz";
4229
	String expectedUnitDisplayString =
4230
			"package p;\n" + 
4231
			"public class X {\n" + 
4232
			"  {\n" + 
4233
			"    Object o = new X[]{<CompleteOnName:zzz>};\n" + 
4234
			"  }\n" + 
4235
			"  public X() {\n" + 
4236
			"  }\n" + 
4237
			"}\n";
3642
	
4238
	
3643
	checkMethodParse(
4239
	checkMethodParse(
3644
		str.toCharArray(), 
4240
		str.toCharArray(), 
Lines 3650-3656 Link Here
3650
		expectedReplacedSource,
4246
		expectedReplacedSource,
3651
		"full ast");
4247
		"full ast");
3652
}
4248
}
3653
public void test0069(){
4249
public void test0069_Diet(){
3654
	String str = 
4250
	String str = 
3655
		"package p;\n" +  
4251
		"package p;\n" +  
3656
		"public class X {\n" +
4252
		"public class X {\n" +
Lines 3686-3706 Link Here
3686
		expectedUnitDisplayString,
4282
		expectedUnitDisplayString,
3687
		completionIdentifier,
4283
		completionIdentifier,
3688
		expectedReplacedSource,
4284
		expectedReplacedSource,
3689
		"diet ast");
4285
		"diet ast"); 
3690
	
4286
}
3691
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4287
public void test0069_Method(){
3692
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
4288
	String str = 
3693
	completionIdentifier = "zzz";
4289
		"package p;\n" +  
3694
	expectedReplacedSource = "zzz";
4290
		"public class X {\n" +
3695
	expectedUnitDisplayString =
4291
		"  void foo(){\n" + 
3696
		"package p;\n" + 
4292
		"    Object o = new X[]{zzz;\n" + 
3697
		"public class X {\n" + 
3698
		"  public X() {\n" + 
3699
		"  }\n" + 
3700
		"  void foo() {\n" + 
3701
		"    Object o = new X[]{<CompleteOnName:zzz>};\n" + 
3702
		"  }\n" + 
4293
		"  }\n" + 
3703
		"}\n";
4294
		"}\n";
4295
4296
	String completeBehind = "zzz";
4297
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4298
	
4299
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4300
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
4301
	String completionIdentifier = "zzz";
4302
	String expectedReplacedSource = "zzz";
4303
	String expectedUnitDisplayString =
4304
			"package p;\n" + 
4305
			"public class X {\n" + 
4306
			"  public X() {\n" + 
4307
			"  }\n" + 
4308
			"  void foo() {\n" + 
4309
			"    Object o = new X[]{<CompleteOnName:zzz>};\n" + 
4310
			"  }\n" + 
4311
			"}\n";
3704
	
4312
	
3705
	checkMethodParse(
4313
	checkMethodParse(
3706
		str.toCharArray(), 
4314
		str.toCharArray(), 
Lines 3713-3719 Link Here
3713
		"full ast"); 
4321
		"full ast"); 
3714
}
4322
}
3715
4323
3716
public void test0070(){
4324
public void test0070_Diet(){
3717
	String str = 
4325
	String str = 
3718
		"package p;\n" +  
4326
		"package p;\n" +  
3719
		"public class X {\n" +
4327
		"public class X {\n" +
Lines 3747-3767 Link Here
3747
		completionIdentifier,
4355
		completionIdentifier,
3748
		expectedReplacedSource,
4356
		expectedReplacedSource,
3749
		"diet ast");
4357
		"diet ast");
3750
	
4358
}
3751
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4359
public void test0070_Method(){
3752
	expectedParentNodeToString = "<NONE>";
4360
	String str = 
3753
	completionIdentifier = "zzz";
4361
		"package p;\n" +  
3754
	expectedReplacedSource = "zzz";
4362
		"public class X {\n" +
3755
	expectedUnitDisplayString =
4363
		"  #\n" + 
3756
		"package p;\n" + 
4364
		"  Object o = new X[]{zzz;\n" + 
3757
		"public class X {\n" + 
3758
		"  Object o;\n" +
3759
		"  {\n" +
3760
		"    <CompleteOnName:zzz>;\n" +
3761
		"  }\n" + 
3762
		"  public X() {\n" + 
3763
		"  }\n" + 
3764
		"}\n";
4365
		"}\n";
4366
4367
	String completeBehind = "zzz";
4368
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4369
	
4370
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4371
	String expectedParentNodeToString = "<NONE>";
4372
	String completionIdentifier = "zzz";
4373
	String expectedReplacedSource = "zzz";
4374
	String expectedUnitDisplayString =
4375
			"package p;\n" + 
4376
			"public class X {\n" + 
4377
			"  Object o;\n" +
4378
			"  {\n" +
4379
			"    <CompleteOnName:zzz>;\n" +
4380
			"  }\n" + 
4381
			"  public X() {\n" + 
4382
			"  }\n" + 
4383
			"}\n";
3765
	
4384
	
3766
	checkMethodParse(
4385
	checkMethodParse(
3767
		str.toCharArray(), 
4386
		str.toCharArray(), 
Lines 3774-3780 Link Here
3774
		"full ast");
4393
		"full ast");
3775
}
4394
}
3776
4395
3777
public void test0071(){
4396
public void test0071_Diet(){
3778
	String str = 
4397
	String str = 
3779
		"package p;\n" +  
4398
		"package p;\n" +  
3780
		"public class X {\n" +
4399
		"public class X {\n" +
Lines 3809-3833 Link Here
3809
		completionIdentifier,
4428
		completionIdentifier,
3810
		expectedReplacedSource,
4429
		expectedReplacedSource,
3811
		"diet ast");
4430
		"diet ast");
3812
	
4431
}
3813
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4432
public void test0071_Method(){
3814
	expectedParentNodeToString = "<NONE>";
4433
	String str = 
3815
	completionIdentifier = "zzz";
4434
		"package p;\n" +  
3816
	expectedReplacedSource = "zzz";
4435
		"public class X {\n" +
3817
	expectedUnitDisplayString =
3818
		"package p;\n" + 
3819
		"public class X {\n" + 
3820
		"  {\n" + 
4436
		"  {\n" + 
3821
		"    {\n" + 
4437
		"    #\n" +
3822
		"      Object o;\n" +
4438
		"    Object o = new X[]{zzz;\n" + 
3823
		"      {\n" +
3824
		"        <CompleteOnName:zzz>;\n" +
3825
		"      }\n" + 
3826
		"    }\n" + 
3827
		"  }\n" + 
3828
		"  public X() {\n" + 
3829
		"  }\n" + 
4439
		"  }\n" + 
3830
		"}\n";
4440
		"}\n";
4441
4442
	String completeBehind = "zzz";
4443
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4444
	
4445
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4446
	String expectedParentNodeToString = "<NONE>";
4447
	String completionIdentifier = "zzz";
4448
	String expectedReplacedSource = "zzz";
4449
	String expectedUnitDisplayString =
4450
			"package p;\n" + 
4451
			"public class X {\n" + 
4452
			"  {\n" + 
4453
			"    {\n" + 
4454
			"      Object o;\n" +
4455
			"      {\n" +
4456
			"        <CompleteOnName:zzz>;\n" +
4457
			"      }\n" + 
4458
			"    }\n" + 
4459
			"  }\n" + 
4460
			"  public X() {\n" + 
4461
			"  }\n" + 
4462
			"}\n";
3831
	
4463
	
3832
	checkMethodParse(
4464
	checkMethodParse(
3833
		str.toCharArray(), 
4465
		str.toCharArray(), 
Lines 3840-3846 Link Here
3840
		"full ast");
4472
		"full ast");
3841
}
4473
}
3842
4474
3843
public void test0072(){
4475
public void test0072_Diet(){
3844
	String str = 
4476
	String str = 
3845
		"package p;\n" +  
4477
		"package p;\n" +  
3846
		"public class X {\n" +
4478
		"public class X {\n" +
Lines 3878-3900 Link Here
3878
		completionIdentifier,
4510
		completionIdentifier,
3879
		expectedReplacedSource,
4511
		expectedReplacedSource,
3880
		"diet ast");
4512
		"diet ast");
3881
	
4513
}
3882
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4514
public void test0072_Method(){
3883
	expectedParentNodeToString = "<NONE>";
4515
	String str = 
3884
	completionIdentifier = "zzz";
4516
		"package p;\n" +  
3885
	expectedReplacedSource = "zzz";
4517
		"public class X {\n" +
3886
	expectedUnitDisplayString =
4518
		"  void foo(){\n" + 
3887
		"package p;\n" + 
4519
		"    #\n" +
3888
		"public class X {\n" + 
4520
		"    Object o = new X[]{zzz;\n" + 
3889
		"  public X() {\n" + 
3890
		"  }\n" + 
3891
		"  void foo() {\n" + 
3892
		"    Object o;\n" +
3893
		"    {\n" +
3894
		"      <CompleteOnName:zzz>;\n" +
3895
		"    }\n" + 
3896
		"  }\n" + 
4521
		"  }\n" + 
3897
		"}\n";
4522
		"}\n";
4523
4524
	String completeBehind = "zzz";
4525
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4526
	
4527
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4528
	String expectedParentNodeToString = "<NONE>";
4529
	String completionIdentifier = "zzz";
4530
	String expectedReplacedSource = "zzz";
4531
	String expectedUnitDisplayString =
4532
			"package p;\n" + 
4533
			"public class X {\n" + 
4534
			"  public X() {\n" + 
4535
			"  }\n" + 
4536
			"  void foo() {\n" + 
4537
			"    Object o;\n" +
4538
			"    {\n" +
4539
			"      <CompleteOnName:zzz>;\n" +
4540
			"    }\n" + 
4541
			"  }\n" + 
4542
			"}\n";
3898
	
4543
	
3899
	checkMethodParse(
4544
	checkMethodParse(
3900
		str.toCharArray(), 
4545
		str.toCharArray(), 
Lines 3940-3946 Link Here
3940
}
4585
}
3941
4586
3942
4587
3943
public void test0074(){
4588
public void test0074_Diet(){
3944
	String str = 
4589
	String str = 
3945
		"package p;\n" +  
4590
		"package p;\n" +  
3946
		"public class X {\n" +
4591
		"public class X {\n" +
Lines 3974-3993 Link Here
3974
		completionIdentifier,
4619
		completionIdentifier,
3975
		expectedReplacedSource,
4620
		expectedReplacedSource,
3976
		"diet ast");
4621
		"diet ast");
3977
	
4622
}
3978
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4623
public void test0074_Method(){
3979
	expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4624
	String str = 
3980
	completionIdentifier = "zzz";
4625
		"package p;\n" +  
3981
	expectedReplacedSource = "zzz";
4626
		"public class X {\n" +
3982
	expectedUnitDisplayString =
3983
		"package p;\n" + 
3984
		"public class X {\n" + 
3985
		"  {\n" + 
4627
		"  {\n" + 
3986
		"    int o = new int[<CompleteOnName:zzz>];\n" + 
4628
		"    int o = new int[zzz;\n" + 
3987
		"  }\n" + 
3988
		"  public X() {\n" + 
3989
		"  }\n" + 
4629
		"  }\n" + 
3990
		"}\n";
4630
		"}\n";
4631
4632
	String completeBehind = "zzz";
4633
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4634
	
4635
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4636
	String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4637
	String completionIdentifier = "zzz";
4638
	String expectedReplacedSource = "zzz";
4639
	String expectedUnitDisplayString =
4640
			"package p;\n" + 
4641
			"public class X {\n" + 
4642
			"  {\n" + 
4643
			"    int o = new int[<CompleteOnName:zzz>];\n" + 
4644
			"  }\n" + 
4645
			"  public X() {\n" + 
4646
			"  }\n" + 
4647
			"}\n";
3991
	
4648
	
3992
	checkMethodParse(
4649
	checkMethodParse(
3993
		str.toCharArray(), 
4650
		str.toCharArray(), 
Lines 4001-4007 Link Here
4001
}
4658
}
4002
4659
4003
4660
4004
public void test0075(){
4661
public void test0075_Diet(){
4005
	String str = 
4662
	String str = 
4006
		"package p;\n" +  
4663
		"package p;\n" +  
4007
		"public class X {\n" +
4664
		"public class X {\n" +
Lines 4034-4054 Link Here
4034
		expectedUnitDisplayString,
4691
		expectedUnitDisplayString,
4035
		completionIdentifier,
4692
		completionIdentifier,
4036
		expectedReplacedSource,
4693
		expectedReplacedSource,
4037
		"diet ast");
4694
		"diet ast"); 
4038
	
4695
}
4039
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4696
public void test0075_Method(){
4040
	expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4697
	String str = 
4041
	completionIdentifier = "zzz";
4698
		"package p;\n" +  
4042
	expectedReplacedSource = "zzz";
4699
		"public class X {\n" +
4043
	expectedUnitDisplayString =
4700
		"  void foo(){\n" + 
4044
		"package p;\n" + 
4701
		"    int o = new int[zzz;\n" + 
4045
		"public class X {\n" + 
4046
		"  public X() {\n" + 
4047
		"  }\n" + 
4048
		"  void foo() {\n" + 
4049
		"    int o = new int[<CompleteOnName:zzz>];\n" +  
4050
		"  }\n" + 
4702
		"  }\n" + 
4051
		"}\n";
4703
		"}\n";
4704
4705
	String completeBehind = "zzz";
4706
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4707
	
4708
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4709
	String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4710
	String completionIdentifier = "zzz";
4711
	String expectedReplacedSource = "zzz";
4712
	String expectedUnitDisplayString =
4713
			"package p;\n" + 
4714
			"public class X {\n" + 
4715
			"  public X() {\n" + 
4716
			"  }\n" + 
4717
			"  void foo() {\n" + 
4718
			"    int o = new int[<CompleteOnName:zzz>];\n" +  
4719
			"  }\n" + 
4720
			"}\n";
4052
	
4721
	
4053
	checkMethodParse(
4722
	checkMethodParse(
4054
		str.toCharArray(), 
4723
		str.toCharArray(), 
Lines 4097-4103 Link Here
4097
}
4766
}
4098
4767
4099
4768
4100
public void test0077(){
4769
public void test0077_Diet(){
4101
	String str = 
4770
	String str = 
4102
		"package p;\n" +  
4771
		"package p;\n" +  
4103
		"public class X {\n" +
4772
		"public class X {\n" +
Lines 4132-4153 Link Here
4132
		completionIdentifier,
4801
		completionIdentifier,
4133
		expectedReplacedSource,
4802
		expectedReplacedSource,
4134
		"diet ast");
4803
		"diet ast");
4135
	
4804
}
4136
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4805
public void test0077_Method(){
4137
	expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4806
	String str = 
4138
	completionIdentifier = "zzz";
4807
		"package p;\n" +  
4139
	expectedReplacedSource = "zzz";
4808
		"public class X {\n" +
4140
	expectedUnitDisplayString =
4141
		"package p;\n" + 
4142
		"public class X {\n" + 
4143
		"  {\n" + 
4809
		"  {\n" + 
4144
		"    {\n" + 
4810
		"    #\n" +
4145
		"      int o = new int[<CompleteOnName:zzz>];\n" + 
4811
		"    int o = new int[zzz;\n" + 
4146
		"    }\n" + 
4147
		"  }\n" + 
4148
		"  public X() {\n" + 
4149
		"  }\n" + 
4812
		"  }\n" + 
4150
		"}\n";
4813
		"}\n";
4814
4815
	String completeBehind = "zzz";
4816
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4817
	
4818
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4819
	String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4820
	String completionIdentifier = "zzz";
4821
	String expectedReplacedSource = "zzz";
4822
	String expectedUnitDisplayString =
4823
			"package p;\n" + 
4824
			"public class X {\n" + 
4825
			"  {\n" + 
4826
			"    {\n" + 
4827
			"      int o = new int[<CompleteOnName:zzz>];\n" + 
4828
			"    }\n" + 
4829
			"  }\n" + 
4830
			"  public X() {\n" + 
4831
			"  }\n" + 
4832
			"}\n";
4151
	
4833
	
4152
	checkMethodParse(
4834
	checkMethodParse(
4153
		str.toCharArray(), 
4835
		str.toCharArray(), 
Lines 4161-4167 Link Here
4161
}
4843
}
4162
4844
4163
4845
4164
public void test0078(){
4846
public void test0078_Diet(){
4165
	String str = 
4847
	String str = 
4166
		"package p;\n" +  
4848
		"package p;\n" +  
4167
		"public class X {\n" +
4849
		"public class X {\n" +
Lines 4196-4215 Link Here
4196
		completionIdentifier,
4878
		completionIdentifier,
4197
		expectedReplacedSource,
4879
		expectedReplacedSource,
4198
		"diet ast");
4880
		"diet ast");
4199
	
4881
}
4200
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4882
public void test0078_Method(){
4201
	expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4883
	String str = 
4202
	completionIdentifier = "zzz";
4884
		"package p;\n" +  
4203
	expectedReplacedSource = "zzz";
4885
		"public class X {\n" +
4204
	expectedUnitDisplayString =
4886
		"  void foo(){\n" + 
4205
		"package p;\n" + 
4887
		"    #\n" +
4206
		"public class X {\n" + 
4888
		"    int o = new int[zzz;\n" + 
4207
		"  public X() {\n" + 
4208
		"  }\n" + 
4209
		"  void foo() {\n" + 
4210
		"    int o = new int[<CompleteOnName:zzz>];\n" + 
4211
		"  }\n" + 
4889
		"  }\n" + 
4212
		"}\n";
4890
		"}\n";
4891
4892
	String completeBehind = "zzz";
4893
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4894
	
4895
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4896
	String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
4897
	String completionIdentifier = "zzz";
4898
	String expectedReplacedSource = "zzz";
4899
	String expectedUnitDisplayString =
4900
			"package p;\n" + 
4901
			"public class X {\n" + 
4902
			"  public X() {\n" + 
4903
			"  }\n" + 
4904
			"  void foo() {\n" + 
4905
			"    int o = new int[<CompleteOnName:zzz>];\n" + 
4906
			"  }\n" + 
4907
			"}\n";
4213
	
4908
	
4214
	checkMethodParse(
4909
	checkMethodParse(
4215
		str.toCharArray(), 
4910
		str.toCharArray(), 
Lines 4222-4228 Link Here
4222
		"full ast");
4917
		"full ast");
4223
}
4918
}
4224
4919
4225
public void test0079(){
4920
public void test0079_Diet(){
4226
	String str = 
4921
	String str = 
4227
		"package p;\n" +  
4922
		"package p;\n" +  
4228
		"public class X {\n" +
4923
		"public class X {\n" +
Lines 4255-4275 Link Here
4255
		completionIdentifier,
4950
		completionIdentifier,
4256
		expectedReplacedSource,
4951
		expectedReplacedSource,
4257
		"diet ast");
4952
		"diet ast");
4258
	
4953
}
4259
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4954
public void test0079_Method(){
4260
	expectedParentNodeToString = "<NONE>";
4955
	String str = 
4261
	completionIdentifier = "zzz";
4956
		"package p;\n" +  
4262
	expectedReplacedSource = "zzz";
4957
		"public class X {\n" +
4263
	expectedUnitDisplayString =
4958
		"  int o = new int[]{zzz;\n" + 
4264
		"package p;\n" + 
4265
		"public class X {\n" + 
4266
		"  int o;\n" +
4267
		"  {\n" +
4268
		"    <CompleteOnName:zzz>;\n" +
4269
		"  }\n" + 
4270
		"  public X() {\n" + 
4271
		"  }\n" + 
4272
		"}\n";
4959
		"}\n";
4960
4961
	String completeBehind = "zzz";
4962
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
4963
	
4964
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
4965
	String expectedParentNodeToString = "<NONE>";
4966
	String completionIdentifier = "zzz";
4967
	String expectedReplacedSource = "zzz";
4968
	String expectedUnitDisplayString =
4969
			"package p;\n" + 
4970
			"public class X {\n" + 
4971
			"  int o;\n" +
4972
			"  {\n" +
4973
			"    <CompleteOnName:zzz>;\n" +
4974
			"  }\n" + 
4975
			"  public X() {\n" + 
4976
			"  }\n" + 
4977
			"}\n";
4273
		
4978
		
4274
	checkMethodParse(
4979
	checkMethodParse(
4275
		str.toCharArray(), 
4980
		str.toCharArray(), 
Lines 4283-4289 Link Here
4283
}
4988
}
4284
4989
4285
4990
4286
public void test0080(){
4991
public void test0080_Diet(){
4287
	String str = 
4992
	String str = 
4288
		"package p;\n" +  
4993
		"package p;\n" +  
4289
		"public class X {\n" +
4994
		"public class X {\n" +
Lines 4317-4336 Link Here
4317
		completionIdentifier,
5022
		completionIdentifier,
4318
		expectedReplacedSource,
5023
		expectedReplacedSource,
4319
		"diet ast");
5024
		"diet ast");
4320
	
5025
}
4321
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5026
public void test0080_Method(){
4322
	expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
5027
	String str = 
4323
	completionIdentifier = "zzz";
5028
		"package p;\n" +  
4324
	expectedReplacedSource = "zzz";
5029
		"public class X {\n" +
4325
	expectedUnitDisplayString =
5030
		"  {\n" + 
4326
		"package p;\n" + 
5031
		"    int o = new int[]{zzz;\n" + 
4327
		"public class X {\n" + 
4328
		"  {\n" + 
4329
		"    int o = new int[]{<CompleteOnName:zzz>};\n" + 
4330
		"  }\n" + 
4331
		"  public X() {\n" + 
4332
		"  }\n" + 
5032
		"  }\n" + 
4333
		"}\n";
5033
		"}\n";
5034
5035
	String completeBehind = "zzz";
5036
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5037
	
5038
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5039
	String expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
5040
	String completionIdentifier = "zzz";
5041
	String expectedReplacedSource = "zzz";
5042
	String expectedUnitDisplayString =
5043
			"package p;\n" + 
5044
			"public class X {\n" + 
5045
			"  {\n" + 
5046
			"    int o = new int[]{<CompleteOnName:zzz>};\n" + 
5047
			"  }\n" + 
5048
			"  public X() {\n" + 
5049
			"  }\n" + 
5050
			"}\n";
4334
	
5051
	
4335
	checkMethodParse(
5052
	checkMethodParse(
4336
		str.toCharArray(), 
5053
		str.toCharArray(), 
Lines 4344-4350 Link Here
4344
}
5061
}
4345
5062
4346
5063
4347
public void test0081(){
5064
public void test0081_Diet(){
4348
	String str = 
5065
	String str = 
4349
		"package p;\n" +  
5066
		"package p;\n" +  
4350
		"public class X {\n" +
5067
		"public class X {\n" +
Lines 4380-4400 Link Here
4380
		expectedUnitDisplayString,
5097
		expectedUnitDisplayString,
4381
		completionIdentifier,
5098
		completionIdentifier,
4382
		expectedReplacedSource,
5099
		expectedReplacedSource,
4383
		"diet ast");
5100
		"diet ast"); 
4384
	
5101
}
4385
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5102
public void test0081_Method(){
4386
	expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
5103
	String str = 
4387
	completionIdentifier = "zzz";
5104
		"package p;\n" +  
4388
	expectedReplacedSource = "zzz";
5105
		"public class X {\n" +
4389
	expectedUnitDisplayString =
5106
		"  void foo(){\n" + 
4390
		"package p;\n" + 
5107
		"    int o = new int[]{zzz;\n" + 
4391
		"public class X {\n" + 
4392
		"  public X() {\n" + 
4393
		"  }\n" + 
4394
		"  void foo() {\n" + 
4395
		"    int o = new int[]{<CompleteOnName:zzz>};\n" +  
4396
		"  }\n" + 
5108
		"  }\n" + 
4397
		"}\n";
5109
		"}\n";
5110
5111
	String completeBehind = "zzz";
5112
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5113
	
5114
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5115
	String expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
5116
	String completionIdentifier = "zzz";
5117
	String expectedReplacedSource = "zzz";
5118
	String expectedUnitDisplayString =
5119
			"package p;\n" + 
5120
			"public class X {\n" + 
5121
			"  public X() {\n" + 
5122
			"  }\n" + 
5123
			"  void foo() {\n" + 
5124
			"    int o = new int[]{<CompleteOnName:zzz>};\n" +  
5125
			"  }\n" + 
5126
			"}\n";
4398
	
5127
	
4399
	checkMethodParse(
5128
	checkMethodParse(
4400
		str.toCharArray(), 
5129
		str.toCharArray(), 
Lines 4408-4414 Link Here
4408
}
5137
}
4409
5138
4410
5139
4411
public void test0082(){
5140
public void test0082_Diet(){
4412
	String str = 
5141
	String str = 
4413
		"package p;\n" +  
5142
		"package p;\n" +  
4414
		"public class X {\n" +
5143
		"public class X {\n" +
Lines 4442-4462 Link Here
4442
		completionIdentifier,
5171
		completionIdentifier,
4443
		expectedReplacedSource,
5172
		expectedReplacedSource,
4444
		"diet ast");
5173
		"diet ast");
4445
	
5174
}
4446
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5175
public void test0082_Method(){
4447
	expectedParentNodeToString = "<NONE>";
5176
	String str = 
4448
	completionIdentifier = "zzz";
5177
		"package p;\n" +  
4449
	expectedReplacedSource = "zzz";
5178
		"public class X {\n" +
4450
	expectedUnitDisplayString =
5179
		"  #\n" + 
4451
		"package p;\n" + 
5180
		"  int o = new int[]{zzz;\n" + 
4452
		"public class X {\n" + 
4453
		"  int o;\n" +
4454
		"  {\n" +
4455
		"    <CompleteOnName:zzz>;\n" +
4456
		"  }\n" +
4457
		"  public X() {\n" + 
4458
		"  }\n" + 
4459
		"}\n";
5181
		"}\n";
5182
5183
	String completeBehind = "zzz";
5184
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5185
	
5186
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5187
	String expectedParentNodeToString = "<NONE>";
5188
	String completionIdentifier = "zzz";
5189
	String expectedReplacedSource = "zzz";
5190
	String expectedUnitDisplayString =
5191
			"package p;\n" + 
5192
			"public class X {\n" + 
5193
			"  int o;\n" +
5194
			"  {\n" +
5195
			"    <CompleteOnName:zzz>;\n" +
5196
			"  }\n" +
5197
			"  public X() {\n" + 
5198
			"  }\n" + 
5199
			"}\n";
4460
	
5200
	
4461
	checkMethodParse(
5201
	checkMethodParse(
4462
		str.toCharArray(), 
5202
		str.toCharArray(), 
Lines 4470-4476 Link Here
4470
}
5210
}
4471
5211
4472
5212
4473
public void test0083(){
5213
public void test0083_Diet(){
4474
	String str = 
5214
	String str = 
4475
		"package p;\n" +  
5215
		"package p;\n" +  
4476
		"public class X {\n" +
5216
		"public class X {\n" +
Lines 4505-4529 Link Here
4505
		completionIdentifier,
5245
		completionIdentifier,
4506
		expectedReplacedSource,
5246
		expectedReplacedSource,
4507
		"diet ast");
5247
		"diet ast");
4508
	
5248
}
4509
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5249
public void test0083_Method(){
4510
	expectedParentNodeToString = "<NONE>";
5250
	String str = 
4511
	completionIdentifier = "zzz";
5251
		"package p;\n" +  
4512
	expectedReplacedSource = "zzz";
5252
		"public class X {\n" +
4513
	expectedUnitDisplayString =
4514
		"package p;\n" + 
4515
		"public class X {\n" + 
4516
		"  {\n" + 
5253
		"  {\n" + 
4517
		"    {\n" + 
5254
		"    #\n" +
4518
		"      int o;\n" +
5255
		"    int o = new int[]{zzz;\n" + 
4519
		"      {\n" +
4520
		"        <CompleteOnName:zzz>;\n" +
4521
		"      }\n" + 
4522
		"    }\n" + 
4523
		"  }\n" + 
4524
		"  public X() {\n" + 
4525
		"  }\n" + 
5256
		"  }\n" + 
4526
		"}\n";
5257
		"}\n";
5258
5259
	String completeBehind = "zzz";
5260
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5261
	
5262
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5263
	String expectedParentNodeToString = "<NONE>";
5264
	String completionIdentifier = "zzz";
5265
	String expectedReplacedSource = "zzz";
5266
	String expectedUnitDisplayString =
5267
			"package p;\n" + 
5268
			"public class X {\n" + 
5269
			"  {\n" + 
5270
			"    {\n" + 
5271
			"      int o;\n" +
5272
			"      {\n" +
5273
			"        <CompleteOnName:zzz>;\n" +
5274
			"      }\n" + 
5275
			"    }\n" + 
5276
			"  }\n" + 
5277
			"  public X() {\n" + 
5278
			"  }\n" + 
5279
			"}\n";
4527
	
5280
	
4528
	checkMethodParse(
5281
	checkMethodParse(
4529
		str.toCharArray(), 
5282
		str.toCharArray(), 
Lines 4535-4541 Link Here
4535
		expectedReplacedSource,
5288
		expectedReplacedSource,
4536
		"full ast");
5289
		"full ast");
4537
}
5290
}
4538
public void test0084(){
5291
public void test0084_Diet(){
4539
5292
4540
5293
4541
	String str = 
5294
	String str = 
Lines 4575-4597 Link Here
4575
		completionIdentifier,
5328
		completionIdentifier,
4576
		expectedReplacedSource,
5329
		expectedReplacedSource,
4577
		"diet ast");
5330
		"diet ast");
4578
	
5331
}
4579
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5332
public void test0084_Method(){
4580
	expectedParentNodeToString = "<NONE>";
5333
4581
	completionIdentifier = "zzz";
5334
4582
	expectedReplacedSource = "zzz";
5335
	String str = 
4583
	expectedUnitDisplayString =
5336
		"package p;\n" +  
4584
		"package p;\n" + 
5337
		"public class X {\n" +
4585
		"public class X {\n" + 
5338
		"  void foo(){\n" + 
4586
		"  public X() {\n" + 
5339
		"    #\n" +
4587
		"  }\n" + 
5340
		"    int o = new int[]{zzz;\n" + 
4588
		"  void foo() {\n" + 
4589
		"    int o;\n" +
4590
		"    {\n" +
4591
		"      <CompleteOnName:zzz>;\n" +
4592
		"    }\n" + 
4593
		"  }\n" + 
5341
		"  }\n" + 
4594
		"}\n";
5342
		"}\n";
5343
5344
	String completeBehind = "zzz";
5345
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5346
	
5347
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5348
	String expectedParentNodeToString = "<NONE>";
5349
	String completionIdentifier = "zzz";
5350
	String expectedReplacedSource = "zzz";
5351
	String expectedUnitDisplayString =
5352
			"package p;\n" + 
5353
			"public class X {\n" + 
5354
			"  public X() {\n" + 
5355
			"  }\n" + 
5356
			"  void foo() {\n" + 
5357
			"    int o;\n" +
5358
			"    {\n" +
5359
			"      <CompleteOnName:zzz>;\n" +
5360
			"    }\n" + 
5361
			"  }\n" + 
5362
			"}\n";
4595
	
5363
	
4596
	checkMethodParse(
5364
	checkMethodParse(
4597
		str.toCharArray(), 
5365
		str.toCharArray(), 
Lines 4603-4609 Link Here
4603
		expectedReplacedSource,
5371
		expectedReplacedSource,
4604
		"full ast");
5372
		"full ast");
4605
}
5373
}
4606
public void test0085(){
5374
public void test0085_Diet(){
4607
	String str = 
5375
	String str = 
4608
		"package p;\n" +  
5376
		"package p;\n" +  
4609
		"public class X {\n" +
5377
		"public class X {\n" +
Lines 4636-4656 Link Here
4636
		completionIdentifier,
5404
		completionIdentifier,
4637
		expectedReplacedSource,
5405
		expectedReplacedSource,
4638
		"diet ast");
5406
		"diet ast");
4639
	
5407
}
4640
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5408
public void test0085_Method(){
4641
	expectedParentNodeToString = "<NONE>";
5409
	String str = 
4642
	completionIdentifier = "zzz";
5410
		"package p;\n" +  
4643
	expectedReplacedSource = "zzz";
5411
		"public class X {\n" +
4644
	expectedUnitDisplayString =
5412
		"  X o = new X[]{zzz;\n" + 
4645
		"package p;\n" + 
4646
		"public class X {\n" + 
4647
		"  X o;\n" +
4648
		"  {\n" +
4649
		"    <CompleteOnName:zzz>;\n" +
4650
		"  }\n" + 
4651
		"  public X() {\n" + 
4652
		"  }\n" + 
4653
		"}\n";
5413
		"}\n";
5414
5415
	String completeBehind = "zzz";
5416
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5417
	
5418
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5419
	String expectedParentNodeToString = "<NONE>";
5420
	String completionIdentifier = "zzz";
5421
	String expectedReplacedSource = "zzz";
5422
	String expectedUnitDisplayString =
5423
			"package p;\n" + 
5424
			"public class X {\n" + 
5425
			"  X o;\n" +
5426
			"  {\n" +
5427
			"    <CompleteOnName:zzz>;\n" +
5428
			"  }\n" + 
5429
			"  public X() {\n" + 
5430
			"  }\n" + 
5431
			"}\n";
4654
	
5432
	
4655
	checkMethodParse(
5433
	checkMethodParse(
4656
		str.toCharArray(), 
5434
		str.toCharArray(), 
Lines 4664-4670 Link Here
4664
}
5442
}
4665
5443
4666
5444
4667
public void test0086(){
5445
public void test0086_Diet(){
4668
	String str = 
5446
	String str = 
4669
		"package p;\n" +  
5447
		"package p;\n" +  
4670
		"public class X {\n" +
5448
		"public class X {\n" +
Lines 4698-4717 Link Here
4698
		completionIdentifier,
5476
		completionIdentifier,
4699
		expectedReplacedSource,
5477
		expectedReplacedSource,
4700
		"diet ast");
5478
		"diet ast");
4701
	
5479
}
4702
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5480
public void test0086_Method(){
4703
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
5481
	String str = 
4704
	completionIdentifier = "zzz";
5482
		"package p;\n" +  
4705
	expectedReplacedSource = "zzz";
5483
		"public class X {\n" +
4706
	expectedUnitDisplayString =
4707
		"package p;\n" + 
4708
		"public class X {\n" + 
4709
		"  {\n" + 
5484
		"  {\n" + 
4710
		"    X o = new X[]{<CompleteOnName:zzz>};\n" + 
5485
		"    X o = new X[]{zzz;\n" + 
4711
		"  }\n" + 
4712
		"  public X() {\n" + 
4713
		"  }\n" + 
5486
		"  }\n" + 
4714
		"}\n";
5487
		"}\n";
5488
5489
	String completeBehind = "zzz";
5490
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5491
	
5492
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5493
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
5494
	String completionIdentifier = "zzz";
5495
	String expectedReplacedSource = "zzz";
5496
	String expectedUnitDisplayString =
5497
			"package p;\n" + 
5498
			"public class X {\n" + 
5499
			"  {\n" + 
5500
			"    X o = new X[]{<CompleteOnName:zzz>};\n" + 
5501
			"  }\n" + 
5502
			"  public X() {\n" + 
5503
			"  }\n" + 
5504
			"}\n";
4715
	
5505
	
4716
	checkMethodParse(
5506
	checkMethodParse(
4717
		str.toCharArray(), 
5507
		str.toCharArray(), 
Lines 4724-4730 Link Here
4724
		"full ast");
5514
		"full ast");
4725
}
5515
}
4726
5516
4727
public void test0087(){
5517
public void test0087_Diet(){
4728
	String str = 
5518
	String str = 
4729
		"package p;\n" +  
5519
		"package p;\n" +  
4730
		"public class X {\n" +
5520
		"public class X {\n" +
Lines 4760-4780 Link Here
4760
		expectedUnitDisplayString,
5550
		expectedUnitDisplayString,
4761
		completionIdentifier,
5551
		completionIdentifier,
4762
		expectedReplacedSource,
5552
		expectedReplacedSource,
4763
		"diet ast");
5553
		"diet ast"); 
4764
	
5554
}
4765
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5555
public void test0087_Method(){
4766
	expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
5556
	String str = 
4767
	completionIdentifier = "zzz";
5557
		"package p;\n" +  
4768
	expectedReplacedSource = "zzz";
5558
		"public class X {\n" +
4769
	expectedUnitDisplayString =
5559
		"  void foo(){\n" + 
4770
		"package p;\n" + 
5560
		"    X o = new X[]{zzz;\n" + 
4771
		"public class X {\n" + 
4772
		"  public X() {\n" + 
4773
		"  }\n" + 
4774
		"  void foo() {\n" + 
4775
		"    X o = new X[]{<CompleteOnName:zzz>};\n" + 
4776
		"  }\n" + 
5561
		"  }\n" + 
4777
		"}\n";
5562
		"}\n";
5563
5564
	String completeBehind = "zzz";
5565
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5566
	
5567
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5568
	String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
5569
	String completionIdentifier = "zzz";
5570
	String expectedReplacedSource = "zzz";
5571
	String expectedUnitDisplayString =
5572
			"package p;\n" + 
5573
			"public class X {\n" + 
5574
			"  public X() {\n" + 
5575
			"  }\n" + 
5576
			"  void foo() {\n" + 
5577
			"    X o = new X[]{<CompleteOnName:zzz>};\n" + 
5578
			"  }\n" + 
5579
			"}\n";
4778
	
5580
	
4779
	checkMethodParse(
5581
	checkMethodParse(
4780
		str.toCharArray(), 
5582
		str.toCharArray(), 
Lines 4788-4794 Link Here
4788
}
5590
}
4789
5591
4790
5592
4791
public void test0088(){
5593
public void test0088_Diet(){
4792
	String str = 
5594
	String str = 
4793
		"package p;\n" +  
5595
		"package p;\n" +  
4794
		"public class X {\n" +
5596
		"public class X {\n" +
Lines 4822-4842 Link Here
4822
		completionIdentifier,
5624
		completionIdentifier,
4823
		expectedReplacedSource,
5625
		expectedReplacedSource,
4824
		"diet ast");
5626
		"diet ast");
4825
	
5627
}
4826
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5628
public void test0088_Method(){
4827
	expectedParentNodeToString = "<NONE>";
5629
	String str = 
4828
	completionIdentifier = "zzz";
5630
		"package p;\n" +  
4829
	expectedReplacedSource = "zzz";
5631
		"public class X {\n" +
4830
	expectedUnitDisplayString =
5632
		"  #\n" + 
4831
		"package p;\n" + 
5633
		"  X o = new X[]{zzz;\n" + 
4832
		"public class X {\n" + 
4833
		"  X o;\n" +
4834
		"  {\n" +
4835
		"    <CompleteOnName:zzz>;\n" +
4836
		"  }\n" + 
4837
		"  public X() {\n" + 
4838
		"  }\n" + 
4839
		"}\n";
5634
		"}\n";
5635
5636
	String completeBehind = "zzz";
5637
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5638
	
5639
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5640
	String expectedParentNodeToString = "<NONE>";
5641
	String completionIdentifier = "zzz";
5642
	String expectedReplacedSource = "zzz";
5643
	String expectedUnitDisplayString =
5644
			"package p;\n" + 
5645
			"public class X {\n" + 
5646
			"  X o;\n" +
5647
			"  {\n" +
5648
			"    <CompleteOnName:zzz>;\n" +
5649
			"  }\n" + 
5650
			"  public X() {\n" + 
5651
			"  }\n" + 
5652
			"}\n";
4840
	
5653
	
4841
	checkMethodParse(
5654
	checkMethodParse(
4842
		str.toCharArray(), 
5655
		str.toCharArray(), 
Lines 4850-4856 Link Here
4850
}
5663
}
4851
5664
4852
5665
4853
public void test0089(){
5666
public void test0089_Diet(){
4854
	String str = 
5667
	String str = 
4855
		"package p;\n" +  
5668
		"package p;\n" +  
4856
		"public class X {\n" +
5669
		"public class X {\n" +
Lines 4885-4909 Link Here
4885
		completionIdentifier,
5698
		completionIdentifier,
4886
		expectedReplacedSource,
5699
		expectedReplacedSource,
4887
		"diet ast");
5700
		"diet ast");
4888
	
5701
}
4889
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5702
public void test0089_Method(){
4890
	expectedParentNodeToString = "<NONE>";
5703
	String str = 
4891
	completionIdentifier = "zzz";
5704
		"package p;\n" +  
4892
	expectedReplacedSource = "zzz";
5705
		"public class X {\n" +
4893
	expectedUnitDisplayString =
4894
		"package p;\n" + 
4895
		"public class X {\n" + 
4896
		"  {\n" + 
5706
		"  {\n" + 
4897
		"    {\n" + 
5707
		"    #\n" +
4898
		"      X o;\n" +
5708
		"    X o = new X[]{zzz;\n" + 
4899
		"      {\n" +
4900
		"        <CompleteOnName:zzz>;\n" +
4901
		"      }\n" + 
4902
		"    }\n" + 
4903
		"  }\n" + 
4904
		"  public X() {\n" + 
4905
		"  }\n" + 
5709
		"  }\n" + 
4906
		"}\n";
5710
		"}\n";
5711
5712
	String completeBehind = "zzz";
5713
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5714
	
5715
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5716
	String expectedParentNodeToString = "<NONE>";
5717
	String completionIdentifier = "zzz";
5718
	String expectedReplacedSource = "zzz";
5719
	String expectedUnitDisplayString =
5720
			"package p;\n" + 
5721
			"public class X {\n" + 
5722
			"  {\n" + 
5723
			"    {\n" + 
5724
			"      X o;\n" +
5725
			"      {\n" +
5726
			"        <CompleteOnName:zzz>;\n" +
5727
			"      }\n" + 
5728
			"    }\n" + 
5729
			"  }\n" + 
5730
			"  public X() {\n" + 
5731
			"  }\n" + 
5732
			"}\n";
4907
	
5733
	
4908
	checkMethodParse(
5734
	checkMethodParse(
4909
		str.toCharArray(), 
5735
		str.toCharArray(), 
Lines 4917-4923 Link Here
4917
}
5743
}
4918
5744
4919
5745
4920
public void test0090(){
5746
public void test0090_Diet(){
4921
	String str = 
5747
	String str = 
4922
		"package p;\n" +  
5748
		"package p;\n" +  
4923
		"public class X {\n" +
5749
		"public class X {\n" +
Lines 4955-4977 Link Here
4955
		completionIdentifier,
5781
		completionIdentifier,
4956
		expectedReplacedSource,
5782
		expectedReplacedSource,
4957
		"diet ast");
5783
		"diet ast");
4958
	
5784
}
4959
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5785
public void test0090_Method(){
4960
	expectedParentNodeToString = "<NONE>";
5786
	String str = 
4961
	completionIdentifier = "zzz";
5787
		"package p;\n" +  
4962
	expectedReplacedSource = "zzz";
5788
		"public class X {\n" +
4963
	expectedUnitDisplayString =
5789
		"  void foo(){\n" + 
4964
		"package p;\n" + 
5790
		"    #\n" +
4965
		"public class X {\n" + 
5791
		"    X o = new X[]{zzz;\n" + 
4966
		"  public X() {\n" + 
4967
		"  }\n" + 
4968
		"  void foo() {\n" + 
4969
		"    X o;\n" +
4970
		"    {\n" +
4971
		"      <CompleteOnName:zzz>;\n" +
4972
		"    }\n" + 
4973
		"  }\n" + 
5792
		"  }\n" + 
4974
		"}\n";
5793
		"}\n";
5794
5795
	String completeBehind = "zzz";
5796
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5797
	
5798
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5799
	String expectedParentNodeToString = "<NONE>";
5800
	String completionIdentifier = "zzz";
5801
	String expectedReplacedSource = "zzz";
5802
	String expectedUnitDisplayString =
5803
			"package p;\n" + 
5804
			"public class X {\n" + 
5805
			"  public X() {\n" + 
5806
			"  }\n" + 
5807
			"  void foo() {\n" + 
5808
			"    X o;\n" +
5809
			"    {\n" +
5810
			"      <CompleteOnName:zzz>;\n" +
5811
			"    }\n" + 
5812
			"  }\n" + 
5813
			"}\n";
4975
	
5814
	
4976
	checkMethodParse(
5815
	checkMethodParse(
4977
		str.toCharArray(), 
5816
		str.toCharArray(), 
Lines 5019-5025 Link Here
5019
}
5858
}
5020
5859
5021
5860
5022
public void test0092(){
5861
public void test0092_Diet(){
5023
	String str = 
5862
	String str = 
5024
		"package p;\n" +  
5863
		"package p;\n" +  
5025
		"public class X {\n" +
5864
		"public class X {\n" +
Lines 5053-5074 Link Here
5053
		expectedUnitDisplayString,
5892
		expectedUnitDisplayString,
5054
		completionIdentifier,
5893
		completionIdentifier,
5055
		expectedReplacedSource,
5894
		expectedReplacedSource,
5056
		"diet ast");
5895
		"diet ast"); 
5057
	
5896
}
5058
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5897
public void test0092_Method(){
5059
	expectedParentNodeToString = "<NONE>";
5898
	String str = 
5060
	completionIdentifier = "zzz";
5899
		"package p;\n" +  
5061
	expectedReplacedSource = "zzz";
5900
		"public class X {\n" +
5062
	expectedUnitDisplayString =
5063
		"package p;\n" + 
5064
		"public class X {\n" + 
5065
		"  {\n" + 
5901
		"  {\n" + 
5066
		"    Object o;\n" +
5902
		"    Object o = \"yyy;\n" + 
5067
		"    <CompleteOnName:zzz>;\n" + 
5903
		"    zzz\n" + 
5068
		"  }\n" + 
5069
		"  public X() {\n" + 
5070
		"  }\n" + 
5904
		"  }\n" + 
5071
		"}\n";
5905
		"}\n";
5906
5907
	String completeBehind = "zzz";
5908
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5909
	
5910
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5911
	String expectedParentNodeToString = "<NONE>";
5912
	String completionIdentifier = "zzz";
5913
	String expectedReplacedSource = "zzz";
5914
	String expectedUnitDisplayString =
5915
			"package p;\n" + 
5916
			"public class X {\n" + 
5917
			"  {\n" + 
5918
			"    Object o;\n" +
5919
			"    <CompleteOnName:zzz>;\n" + 
5920
			"  }\n" + 
5921
			"  public X() {\n" + 
5922
			"  }\n" + 
5923
			"}\n";
5072
	
5924
	
5073
	checkMethodParse(
5925
	checkMethodParse(
5074
		str.toCharArray(), 
5926
		str.toCharArray(), 
Lines 5082-5088 Link Here
5082
}
5934
}
5083
5935
5084
5936
5085
public void test0093(){
5937
public void test0093_Diet(){
5086
	String str = 
5938
	String str = 
5087
		"package p;\n" +  
5939
		"package p;\n" +  
5088
		"public class X {\n" +
5940
		"public class X {\n" +
Lines 5116-5137 Link Here
5116
		expectedUnitDisplayString,
5968
		expectedUnitDisplayString,
5117
		completionIdentifier,
5969
		completionIdentifier,
5118
		expectedReplacedSource,
5970
		expectedReplacedSource,
5119
		"diet ast");
5971
		"diet ast"); 
5120
	
5972
}
5121
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5973
public void test0093_Method(){
5122
	expectedParentNodeToString = "<NONE>";
5974
	String str = 
5123
	completionIdentifier = "zzz";
5975
		"package p;\n" +  
5124
	expectedReplacedSource = "zzz";
5976
		"public class X {\n" +
5125
	expectedUnitDisplayString =
5977
		"  void foo(){\n" + 
5126
		"package p;\n" + 
5978
		"    Object o = \"yyy;\n" + 
5127
		"public class X {\n" + 
5979
		"    zzz\n" + 
5128
		"  public X() {\n" + 
5129
		"  }\n" + 
5130
		"  void foo() {\n" + 
5131
		"    Object o;\n" +
5132
		"    <CompleteOnName:zzz>;\n" + 
5133
		"  }\n" + 
5980
		"  }\n" + 
5134
		"}\n";
5981
		"}\n";
5982
5983
	String completeBehind = "zzz";
5984
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
5985
	
5986
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
5987
	String expectedParentNodeToString = "<NONE>";
5988
	String completionIdentifier = "zzz";
5989
	String expectedReplacedSource = "zzz";
5990
	String expectedUnitDisplayString =
5991
			"package p;\n" + 
5992
			"public class X {\n" + 
5993
			"  public X() {\n" + 
5994
			"  }\n" + 
5995
			"  void foo() {\n" + 
5996
			"    Object o;\n" +
5997
			"    <CompleteOnName:zzz>;\n" + 
5998
			"  }\n" + 
5999
			"}\n";
5135
	
6000
	
5136
	checkMethodParse(
6001
	checkMethodParse(
5137
		str.toCharArray(), 
6002
		str.toCharArray(), 
Lines 5182-5188 Link Here
5182
}
6047
}
5183
6048
5184
6049
5185
public void test0095(){
6050
public void test0095_Diet(){
5186
	String str = 
6051
	String str = 
5187
		"package p;\n" +  
6052
		"package p;\n" +  
5188
		"public class X {\n" +
6053
		"public class X {\n" +
Lines 5217-5240 Link Here
5217
		expectedUnitDisplayString,
6082
		expectedUnitDisplayString,
5218
		completionIdentifier,
6083
		completionIdentifier,
5219
		expectedReplacedSource,
6084
		expectedReplacedSource,
5220
		"diet ast");
6085
		"diet ast"); 
5221
	
6086
}
5222
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6087
public void test0095_Method(){
5223
	expectedParentNodeToString = "<NONE>";
6088
	String str = 
5224
	completionIdentifier = "zzz";
6089
		"package p;\n" +  
5225
	expectedReplacedSource = "zzz";
6090
		"public class X {\n" +
5226
	expectedUnitDisplayString =
5227
		"package p;\n" + 
5228
		"public class X {\n" + 
5229
		"  {\n" + 
6091
		"  {\n" + 
5230
		"    {\n" + 
6092
		"    #\n" +
5231
		"      Object o;\n" +
6093
		"    Object o = \"yyy;\n" + 
5232
		"      <CompleteOnName:zzz>;\n" + 
6094
		"    zzz\n" + 
5233
		"    }\n" + 
5234
		"  }\n" + 
5235
		"  public X() {\n" + 
5236
		"  }\n" + 
6095
		"  }\n" + 
5237
		"}\n";
6096
		"}\n";
6097
6098
	String completeBehind = "zzz";
6099
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6100
	
6101
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6102
	String expectedParentNodeToString = "<NONE>";
6103
	String completionIdentifier = "zzz";
6104
	String expectedReplacedSource = "zzz";
6105
	String expectedUnitDisplayString =
6106
			"package p;\n" + 
6107
			"public class X {\n" + 
6108
			"  {\n" + 
6109
			"    {\n" + 
6110
			"      Object o;\n" +
6111
			"      <CompleteOnName:zzz>;\n" + 
6112
			"    }\n" + 
6113
			"  }\n" + 
6114
			"  public X() {\n" + 
6115
			"  }\n" + 
6116
			"}\n";
5238
	
6117
	
5239
	checkMethodParse(
6118
	checkMethodParse(
5240
		str.toCharArray(), 
6119
		str.toCharArray(), 
Lines 5248-5254 Link Here
5248
}
6127
}
5249
6128
5250
6129
5251
public void test0096(){
6130
public void test0096_Diet(){
5252
	String str = 
6131
	String str = 
5253
		"package p;\n" +  
6132
		"package p;\n" +  
5254
		"public class X {\n" +
6133
		"public class X {\n" +
Lines 5283-5306 Link Here
5283
		expectedUnitDisplayString,
6162
		expectedUnitDisplayString,
5284
		completionIdentifier,
6163
		completionIdentifier,
5285
		expectedReplacedSource,
6164
		expectedReplacedSource,
5286
		"diet ast");
6165
		"diet ast"); 
5287
	
6166
}
5288
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6167
public void test0096_Method(){
5289
	expectedParentNodeToString = "<NONE>";
6168
	String str = 
5290
	completionIdentifier = "zzz";
6169
		"package p;\n" +  
5291
	expectedReplacedSource = "zzz";
6170
		"public class X {\n" +
5292
	expectedUnitDisplayString =
5293
		"package p;\n" + 
5294
		"public class X {\n" + 
5295
		"  {\n" + 
6171
		"  {\n" + 
5296
		"    {\n" +
6172
		"    #\n" +
5297
		"      Object o;\n" +
6173
		"    Object o = \"yyy;\n" + 
5298
		"      <CompleteOnName:zzz>;\n" + 
6174
		"    zzz\n" + 
5299
		"    }\n" +
5300
		"  }\n" + 
5301
		"  public X() {\n" + 
5302
		"  }\n" + 
6175
		"  }\n" + 
5303
		"}\n";
6176
		"}\n";
6177
6178
	String completeBehind = "zzz";
6179
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6180
	
6181
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6182
	String expectedParentNodeToString = "<NONE>";
6183
	String completionIdentifier = "zzz";
6184
	String expectedReplacedSource = "zzz";
6185
	String expectedUnitDisplayString =
6186
			"package p;\n" + 
6187
			"public class X {\n" + 
6188
			"  {\n" + 
6189
			"    {\n" +
6190
			"      Object o;\n" +
6191
			"      <CompleteOnName:zzz>;\n" + 
6192
			"    }\n" +
6193
			"  }\n" + 
6194
			"  public X() {\n" + 
6195
			"  }\n" + 
6196
			"}\n";
5304
	
6197
	
5305
	checkMethodParse(
6198
	checkMethodParse(
5306
		str.toCharArray(), 
6199
		str.toCharArray(), 
Lines 5312-5318 Link Here
5312
		expectedReplacedSource,
6205
		expectedReplacedSource,
5313
		"full ast"); 
6206
		"full ast"); 
5314
}
6207
}
5315
public void test0097(){
6208
public void test0097_Diet(){
5316
	String str = 
6209
	String str = 
5317
		"package p;\n" +  
6210
		"package p;\n" +  
5318
		"public class X {\n" +
6211
		"public class X {\n" +
Lines 5347-5367 Link Here
5347
		completionIdentifier,
6240
		completionIdentifier,
5348
		expectedReplacedSource,
6241
		expectedReplacedSource,
5349
		"diet ast");
6242
		"diet ast");
5350
	
6243
}
5351
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6244
public void test0097_Method(){
5352
	expectedParentNodeToString = "o = <CompleteOnName:zzz>";
6245
	String str = 
5353
	completionIdentifier = "zzz";
6246
		"package p;\n" +  
5354
	expectedReplacedSource = "zzz";
6247
		"public class X {\n" +
5355
	expectedUnitDisplayString =
6248
		"  void foo(){\n" + 
5356
		"package p;\n" + 
5357
		"public class X {\n" + 
5358
		"  public X() {\n" + 
5359
		"  }\n" + 
5360
		"  void foo() {\n" + 
5361
		"    Object o;\n" +
6249
		"    Object o;\n" +
5362
		"    o = <CompleteOnName:zzz>;\n" +
6250
		"    o = zzz;\n" + 
5363
		"  }\n" + 
6251
		"  }\n" + 
5364
		"}\n";
6252
		"}\n";
6253
6254
	String completeBehind = "zzz";
6255
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6256
	
6257
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6258
	String expectedParentNodeToString = "o = <CompleteOnName:zzz>";
6259
	String completionIdentifier = "zzz";
6260
	String expectedReplacedSource = "zzz";
6261
	String expectedUnitDisplayString =
6262
			"package p;\n" + 
6263
			"public class X {\n" + 
6264
			"  public X() {\n" + 
6265
			"  }\n" + 
6266
			"  void foo() {\n" + 
6267
			"    Object o;\n" +
6268
			"    o = <CompleteOnName:zzz>;\n" +
6269
			"  }\n" + 
6270
			"}\n";
5365
	
6271
	
5366
	checkMethodParse(
6272
	checkMethodParse(
5367
		str.toCharArray(), 
6273
		str.toCharArray(), 
Lines 5374-5380 Link Here
5374
		"full ast");
6280
		"full ast");
5375
}
6281
}
5376
6282
5377
public void test0098(){
6283
public void test0098_Diet(){
5378
	String str = 
6284
	String str = 
5379
		"package p;\n" +  
6285
		"package p;\n" +  
5380
		"public class X {\n" +
6286
		"public class X {\n" +
Lines 5409-5429 Link Here
5409
		completionIdentifier,
6315
		completionIdentifier,
5410
		expectedReplacedSource,
6316
		expectedReplacedSource,
5411
		"diet ast");
6317
		"diet ast");
5412
	
6318
}
5413
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6319
public void test0098_Method(){
5414
	expectedParentNodeToString = "o = <CompleteOnName:zzz>";
6320
	String str = 
5415
	completionIdentifier = "zzz";
6321
		"package p;\n" +  
5416
	expectedReplacedSource = "zzz";
6322
		"public class X {\n" +
5417
	expectedUnitDisplayString =
6323
		"  void foo(){\n" + 
5418
		"package p;\n" + 
5419
		"public class X {\n" + 
5420
		"  public X() {\n" + 
5421
		"  }\n" + 
5422
		"  void foo() {\n" + 
5423
		"    Object o;\n" +
6324
		"    Object o;\n" +
5424
		"    o = <CompleteOnName:zzz>;\n" +
6325
		"    o = zzz;\n" + 
5425
		"  }\n" + 
6326
		"  }\n" + 
5426
		"}\n";
6327
		"}\n";
6328
6329
	String completeBehind = "zzz";
6330
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6331
	
6332
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6333
	String expectedParentNodeToString = "o = <CompleteOnName:zzz>";
6334
	String completionIdentifier = "zzz";
6335
	String expectedReplacedSource = "zzz";
6336
	String expectedUnitDisplayString =
6337
			"package p;\n" + 
6338
			"public class X {\n" + 
6339
			"  public X() {\n" + 
6340
			"  }\n" + 
6341
			"  void foo() {\n" + 
6342
			"    Object o;\n" +
6343
			"    o = <CompleteOnName:zzz>;\n" +
6344
			"  }\n" + 
6345
			"}\n";
5427
	
6346
	
5428
	checkMethodParse(
6347
	checkMethodParse(
5429
		str.toCharArray(), 
6348
		str.toCharArray(), 
Lines 5435-5441 Link Here
5435
		expectedReplacedSource,
6354
		expectedReplacedSource,
5436
		"full ast");
6355
		"full ast");
5437
}
6356
}
5438
public void test0099(){
6357
public void test0099_Diet(){
5439
	String str = 
6358
	String str = 
5440
		"package p;\n" +  
6359
		"package p;\n" +  
5441
		"public class X {\n" +
6360
		"public class X {\n" +
Lines 5470-5490 Link Here
5470
		completionIdentifier,
6389
		completionIdentifier,
5471
		expectedReplacedSource,
6390
		expectedReplacedSource,
5472
		"diet ast");
6391
		"diet ast");
5473
	
6392
}
5474
	expectedCompletionNodeToString = "<CompleteOnType:zzz>";
6393
public void test0099_Method(){
5475
	expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
6394
	String str = 
5476
	completionIdentifier = "zzz";
6395
		"package p;\n" +  
5477
	expectedReplacedSource = "zzz";
6396
		"public class X {\n" +
5478
	expectedUnitDisplayString =
6397
		"  void foo(){\n" + 
5479
		"package p;\n" + 
5480
		"public class X {\n" + 
5481
		"  public X() {\n" + 
5482
		"  }\n" + 
5483
		"  void foo() {\n" + 
5484
		"    Object o;\n" +
6398
		"    Object o;\n" +
5485
		"    o = new <CompleteOnType:zzz>();\n" +
6399
		"    o = new zzz;\n" + 
5486
		"  }\n" + 
6400
		"  }\n" + 
5487
		"}\n";
6401
		"}\n";
6402
6403
	String completeBehind = "zzz";
6404
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6405
	
6406
	String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
6407
	String expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
6408
	String completionIdentifier = "zzz";
6409
	String expectedReplacedSource = "zzz";
6410
	String expectedUnitDisplayString =
6411
			"package p;\n" + 
6412
			"public class X {\n" + 
6413
			"  public X() {\n" + 
6414
			"  }\n" + 
6415
			"  void foo() {\n" + 
6416
			"    Object o;\n" +
6417
			"    o = new <CompleteOnType:zzz>();\n" +
6418
			"  }\n" + 
6419
			"}\n";
5488
	
6420
	
5489
	checkMethodParse(
6421
	checkMethodParse(
5490
		str.toCharArray(), 
6422
		str.toCharArray(), 
Lines 5497-5503 Link Here
5497
		"full ast");
6429
		"full ast");
5498
}
6430
}
5499
6431
5500
public void test0100(){
6432
public void test0100_Diet(){
5501
	String str = 
6433
	String str = 
5502
		"package p;\n" +  
6434
		"package p;\n" +  
5503
		"public class X {\n" +
6435
		"public class X {\n" +
Lines 5532-5552 Link Here
5532
		completionIdentifier,
6464
		completionIdentifier,
5533
		expectedReplacedSource,
6465
		expectedReplacedSource,
5534
		"diet ast");
6466
		"diet ast");
5535
	
6467
}
5536
	expectedCompletionNodeToString = "<CompleteOnType:zzz>";
6468
public void test0100_Method(){
5537
	expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
6469
	String str = 
5538
	completionIdentifier = "zzz";
6470
		"package p;\n" +  
5539
	expectedReplacedSource = "zzz";
6471
		"public class X {\n" +
5540
	expectedUnitDisplayString =
6472
		"  void foo(){\n" + 
5541
		"package p;\n" + 
5542
		"public class X {\n" + 
5543
		"  public X() {\n" + 
5544
		"  }\n" + 
5545
		"  void foo() {\n" + 
5546
		"    Object o;\n" +
6473
		"    Object o;\n" +
5547
		"    o = new <CompleteOnType:zzz>();\n" +
6474
		"    o = new zzz;\n" + 
5548
		"  }\n" + 
6475
		"  }\n" + 
5549
		"}\n";
6476
		"}\n";
6477
6478
	String completeBehind = "zzz";
6479
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6480
	
6481
	String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
6482
	String expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
6483
	String completionIdentifier = "zzz";
6484
	String expectedReplacedSource = "zzz";
6485
	String expectedUnitDisplayString =
6486
			"package p;\n" + 
6487
			"public class X {\n" + 
6488
			"  public X() {\n" + 
6489
			"  }\n" + 
6490
			"  void foo() {\n" + 
6491
			"    Object o;\n" +
6492
			"    o = new <CompleteOnType:zzz>();\n" +
6493
			"  }\n" + 
6494
			"}\n";
5550
	
6495
	
5551
	checkMethodParse(
6496
	checkMethodParse(
5552
		str.toCharArray(), 
6497
		str.toCharArray(), 
Lines 5558-5564 Link Here
5558
		expectedReplacedSource,
6503
		expectedReplacedSource,
5559
		"full ast");
6504
		"full ast");
5560
}
6505
}
5561
public void test0101(){
6506
public void test0101_Diet(){
5562
	String str = 
6507
	String str = 
5563
		"package p;\n" +  
6508
		"package p;\n" +  
5564
		"public class X {\n" +
6509
		"public class X {\n" +
Lines 5594-5614 Link Here
5594
		completionIdentifier,
6539
		completionIdentifier,
5595
		expectedReplacedSource,
6540
		expectedReplacedSource,
5596
		"diet ast");
6541
		"diet ast");
5597
	
6542
}
5598
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6543
public void test0101_Method(){
5599
	expectedParentNodeToString = "<NONE>";
6544
	String str = 
5600
	completionIdentifier = "zzz";
6545
		"package p;\n" +  
5601
	expectedReplacedSource = "zzz";
6546
		"public class X {\n" +
5602
	expectedUnitDisplayString =
6547
		"  void foo(){\n" + 
5603
		"package p;\n" + 
5604
		"public class X {\n" + 
5605
		"  public X() {\n" + 
5606
		"  }\n" + 
5607
		"  void foo() {\n" + 
5608
		"    Object o;\n" +
6548
		"    Object o;\n" +
5609
		"    <CompleteOnName:zzz>;\n" +
6549
		"    o = yyy;\n" +
6550
		"    zzz\n" + 
5610
		"  }\n" + 
6551
		"  }\n" + 
5611
		"}\n";
6552
		"}\n";
6553
6554
	String completeBehind = "zzz";
6555
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6556
	
6557
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6558
	String expectedParentNodeToString = "<NONE>";
6559
	String completionIdentifier = "zzz";
6560
	String expectedReplacedSource = "zzz";
6561
	String expectedUnitDisplayString =
6562
			"package p;\n" + 
6563
			"public class X {\n" + 
6564
			"  public X() {\n" + 
6565
			"  }\n" + 
6566
			"  void foo() {\n" + 
6567
			"    Object o;\n" +
6568
			"    <CompleteOnName:zzz>;\n" +
6569
			"  }\n" + 
6570
			"}\n";
5612
	
6571
	
5613
	checkMethodParse(
6572
	checkMethodParse(
5614
		str.toCharArray(), 
6573
		str.toCharArray(), 
Lines 5621-5627 Link Here
5621
		"full ast");
6580
		"full ast");
5622
}
6581
}
5623
6582
5624
public void test0102(){
6583
public void test0102_Diet(){
5625
	String str = 
6584
	String str = 
5626
		"package p;\n" +  
6585
		"package p;\n" +  
5627
		"public class X {\n" +
6586
		"public class X {\n" +
Lines 5657-5677 Link Here
5657
		completionIdentifier,
6616
		completionIdentifier,
5658
		expectedReplacedSource,
6617
		expectedReplacedSource,
5659
		"diet ast");
6618
		"diet ast");
5660
	
6619
}
5661
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6620
public void test0102_Method(){
5662
	expectedParentNodeToString = "<NONE>";
6621
	String str = 
5663
	completionIdentifier = "zzz";
6622
		"package p;\n" +  
5664
	expectedReplacedSource = "zzz";
6623
		"public class X {\n" +
5665
	expectedUnitDisplayString =
6624
		"  void foo(){\n" + 
5666
		"package p;\n" + 
5667
		"public class X {\n" + 
5668
		"  public X() {\n" + 
5669
		"  }\n" + 
5670
		"  void foo() {\n" + 
5671
		"    Object o;\n" +
6625
		"    Object o;\n" +
5672
		"    <CompleteOnName:zzz>;\n" +
6626
		"    o = yyy;\n" +
6627
		"    zzz\n" + 
5673
		"  }\n" + 
6628
		"  }\n" + 
5674
		"}\n";
6629
		"}\n";
6630
6631
	String completeBehind = "zzz";
6632
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6633
	
6634
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6635
	String expectedParentNodeToString = "<NONE>";
6636
	String completionIdentifier = "zzz";
6637
	String expectedReplacedSource = "zzz";
6638
	String expectedUnitDisplayString =
6639
			"package p;\n" + 
6640
			"public class X {\n" + 
6641
			"  public X() {\n" + 
6642
			"  }\n" + 
6643
			"  void foo() {\n" + 
6644
			"    Object o;\n" +
6645
			"    <CompleteOnName:zzz>;\n" +
6646
			"  }\n" + 
6647
			"}\n";
5675
	
6648
	
5676
	checkMethodParse(
6649
	checkMethodParse(
5677
		str.toCharArray(), 
6650
		str.toCharArray(), 
Lines 5683-5689 Link Here
5683
		expectedReplacedSource,
6656
		expectedReplacedSource,
5684
		"full ast");
6657
		"full ast");
5685
}
6658
}
5686
public void test0103(){
6659
public void test0103_Diet(){
5687
	String str = 
6660
	String str = 
5688
		"package p;\n" +  
6661
		"package p;\n" +  
5689
		"public class X {\n" +
6662
		"public class X {\n" +
Lines 5719-5739 Link Here
5719
		completionIdentifier,
6692
		completionIdentifier,
5720
		expectedReplacedSource,
6693
		expectedReplacedSource,
5721
		"diet ast");
6694
		"diet ast");
5722
	
6695
}
5723
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6696
public void test0103_Method(){
5724
	expectedParentNodeToString = "<NONE>";
6697
	String str = 
5725
	completionIdentifier = "zzz";
6698
		"package p;\n" +  
5726
	expectedReplacedSource = "zzz";
6699
		"public class X {\n" +
5727
	expectedUnitDisplayString =
6700
		"  void foo(){\n" + 
5728
		"package p;\n" + 
5729
		"public class X {\n" + 
5730
		"  public X() {\n" + 
5731
		"  }\n" + 
5732
		"  void foo() {\n" + 
5733
		"    Object o;\n" +
6701
		"    Object o;\n" +
5734
		"    <CompleteOnName:zzz>;\n" +
6702
		"    o = \"yyy;\n" +
6703
		"    zzz\n" + 
5735
		"  }\n" + 
6704
		"  }\n" + 
5736
		"}\n";
6705
		"}\n";
6706
6707
	String completeBehind = "zzz";
6708
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6709
	
6710
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6711
	String expectedParentNodeToString = "<NONE>";
6712
	String completionIdentifier = "zzz";
6713
	String expectedReplacedSource = "zzz";
6714
	String expectedUnitDisplayString =
6715
			"package p;\n" + 
6716
			"public class X {\n" + 
6717
			"  public X() {\n" + 
6718
			"  }\n" + 
6719
			"  void foo() {\n" + 
6720
			"    Object o;\n" +
6721
			"    <CompleteOnName:zzz>;\n" +
6722
			"  }\n" + 
6723
			"}\n";
5737
	
6724
	
5738
	checkMethodParse(
6725
	checkMethodParse(
5739
		str.toCharArray(), 
6726
		str.toCharArray(), 
Lines 5746-5752 Link Here
5746
		"full ast");
6733
		"full ast");
5747
}
6734
}
5748
6735
5749
public void test0104(){
6736
public void test0104_Diet(){
5750
	String str = 
6737
	String str = 
5751
		"package p;\n" +  
6738
		"package p;\n" +  
5752
		"public class X {\n" +
6739
		"public class X {\n" +
Lines 5782-5802 Link Here
5782
		completionIdentifier,
6769
		completionIdentifier,
5783
		expectedReplacedSource,
6770
		expectedReplacedSource,
5784
		"diet ast");
6771
		"diet ast");
5785
	
6772
}
5786
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6773
public void test0104_Method(){
5787
	expectedParentNodeToString = "<NONE>";
6774
	String str = 
5788
	completionIdentifier = "zzz";
6775
		"package p;\n" +  
5789
	expectedReplacedSource = "zzz";
6776
		"public class X {\n" +
5790
	expectedUnitDisplayString =
6777
		"  void foo(){\n" + 
5791
		"package p;\n" + 
5792
		"public class X {\n" + 
5793
		"  public X() {\n" + 
5794
		"  }\n" + 
5795
		"  void foo() {\n" + 
5796
		"    Object o;\n" +
6778
		"    Object o;\n" +
5797
		"    <CompleteOnName:zzz>;\n" +
6779
		"    o = \"yyy;\n" +
6780
		"    zzz\n" + 
5798
		"  }\n" + 
6781
		"  }\n" + 
5799
		"}\n";
6782
		"}\n";
6783
6784
	String completeBehind = "zzz";
6785
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6786
	
6787
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6788
	String expectedParentNodeToString = "<NONE>";
6789
	String completionIdentifier = "zzz";
6790
	String expectedReplacedSource = "zzz";
6791
	String expectedUnitDisplayString =
6792
			"package p;\n" + 
6793
			"public class X {\n" + 
6794
			"  public X() {\n" + 
6795
			"  }\n" + 
6796
			"  void foo() {\n" + 
6797
			"    Object o;\n" +
6798
			"    <CompleteOnName:zzz>;\n" +
6799
			"  }\n" + 
6800
			"}\n";
5800
	
6801
	
5801
	checkMethodParse(
6802
	checkMethodParse(
5802
		str.toCharArray(), 
6803
		str.toCharArray(), 
Lines 5809-5815 Link Here
5809
		"full ast");
6810
		"full ast");
5810
}
6811
}
5811
6812
5812
public void test0105(){
6813
public void test0105_Diet(){
5813
	String str = 
6814
	String str = 
5814
		"package p;\n" +  
6815
		"package p;\n" +  
5815
		"public class X {\n" +
6816
		"public class X {\n" +
Lines 5843-5862 Link Here
5843
		completionIdentifier,
6844
		completionIdentifier,
5844
		expectedReplacedSource,
6845
		expectedReplacedSource,
5845
		"diet ast");
6846
		"diet ast");
5846
	
6847
}
5847
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6848
public void test0105_Method(){
5848
	expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
6849
	String str = 
5849
	completionIdentifier = "zzz";
6850
		"package p;\n" +  
5850
	expectedReplacedSource = "zzz";
6851
		"public class X {\n" +
5851
	expectedUnitDisplayString =
6852
		"  void foo(){\n" + 
5852
		"package p;\n" + 
6853
		"    int x = 1 + zzz\n" +
5853
		"public class X {\n" + 
5854
		"  public X() {\n" + 
5855
		"  }\n" + 
5856
		"  void foo() {\n" + 
5857
		"    int x = (1 + <CompleteOnName:zzz>);\n" +
5858
		"  }\n" + 
6854
		"  }\n" + 
5859
		"}\n";
6855
		"}\n";
6856
6857
	String completeBehind = "zzz";
6858
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6859
	
6860
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6861
	String expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
6862
	String completionIdentifier = "zzz";
6863
	String expectedReplacedSource = "zzz";
6864
	String expectedUnitDisplayString =
6865
			"package p;\n" + 
6866
			"public class X {\n" + 
6867
			"  public X() {\n" + 
6868
			"  }\n" + 
6869
			"  void foo() {\n" + 
6870
			"    int x = (1 + <CompleteOnName:zzz>);\n" +
6871
			"  }\n" + 
6872
			"}\n";
5860
	
6873
	
5861
	checkMethodParse(
6874
	checkMethodParse(
5862
		str.toCharArray(), 
6875
		str.toCharArray(), 
Lines 5868-5874 Link Here
5868
		expectedReplacedSource,
6881
		expectedReplacedSource,
5869
		"full ast");
6882
		"full ast");
5870
}
6883
}
5871
public void test0106(){
6884
public void test0106_Diet(){
5872
	String str = 
6885
	String str = 
5873
		"package p;\n" +  
6886
		"package p;\n" +  
5874
		"public class X {\n" +
6887
		"public class X {\n" +
Lines 5902-5921 Link Here
5902
		completionIdentifier,
6915
		completionIdentifier,
5903
		expectedReplacedSource,
6916
		expectedReplacedSource,
5904
		"diet ast");
6917
		"diet ast");
5905
	
6918
}
5906
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6919
public void test0106_Method(){
5907
	expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
6920
	String str = 
5908
	completionIdentifier = "zzz";
6921
		"package p;\n" +  
5909
	expectedReplacedSource = "zzz";
6922
		"public class X {\n" +
5910
	expectedUnitDisplayString =
6923
		"  void foo(){\n" + 
5911
		"package p;\n" + 
6924
		"    int x = 1 + (zzz\n" +
5912
		"public class X {\n" + 
5913
		"  public X() {\n" + 
5914
		"  }\n" + 
5915
		"  void foo() {\n" + 
5916
		"    int x = (1 + <CompleteOnName:zzz>);\n" +
5917
		"  }\n" + 
6925
		"  }\n" + 
5918
		"}\n";
6926
		"}\n";
6927
6928
	String completeBehind = "zzz";
6929
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
6930
	
6931
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6932
	String expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
6933
	String completionIdentifier = "zzz";
6934
	String expectedReplacedSource = "zzz";
6935
	String expectedUnitDisplayString =
6936
			"package p;\n" + 
6937
			"public class X {\n" + 
6938
			"  public X() {\n" + 
6939
			"  }\n" + 
6940
			"  void foo() {\n" + 
6941
			"    int x = (1 + <CompleteOnName:zzz>);\n" +
6942
			"  }\n" + 
6943
			"}\n";
5919
	
6944
	
5920
	checkMethodParse(
6945
	checkMethodParse(
5921
		str.toCharArray(), 
6946
		str.toCharArray(), 
Lines 5927-5933 Link Here
5927
		expectedReplacedSource,
6952
		expectedReplacedSource,
5928
		"full ast");
6953
		"full ast");
5929
}
6954
}
5930
public void test0107(){
6955
public void test0107_Diet(){
5931
	String str = 
6956
	String str = 
5932
		"package p;\n" +  
6957
		"package p;\n" +  
5933
		"public class X {\n" +
6958
		"public class X {\n" +
Lines 5963-5984 Link Here
5963
		completionIdentifier,
6988
		completionIdentifier,
5964
		expectedReplacedSource,
6989
		expectedReplacedSource,
5965
		"diet ast");
6990
		"diet ast");
5966
	
6991
}
5967
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
6992
public void test0107_Method(){
5968
	expectedParentNodeToString = "<NONE>";
6993
	String str = 
5969
	completionIdentifier = "zzz";
6994
		"package p;\n" +  
5970
	expectedReplacedSource = "zzz";
6995
		"public class X {\n" +
5971
	expectedUnitDisplayString =
6996
		"  void foo(){\n" + 
5972
		"package p;\n" + 
6997
		"    int x = 0;\n" +
5973
		"public class X {\n" + 
6998
		"    int y = 1 + x;\n" +
5974
		"  public X() {\n" + 
6999
		"    zzz;\n" +
5975
		"  }\n" + 
5976
		"  void foo() {\n" + 
5977
		"    int x;\n" +
5978
		"    int y;\n" +
5979
		"    <CompleteOnName:zzz>;\n" +
5980
		"  }\n" + 
7000
		"  }\n" + 
5981
		"}\n";
7001
		"}\n";
7002
7003
	String completeBehind = "zzz";
7004
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7005
	
7006
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7007
	String expectedParentNodeToString = "<NONE>";
7008
	String completionIdentifier = "zzz";
7009
	String expectedReplacedSource = "zzz";
7010
	String expectedUnitDisplayString =
7011
			"package p;\n" + 
7012
			"public class X {\n" + 
7013
			"  public X() {\n" + 
7014
			"  }\n" + 
7015
			"  void foo() {\n" + 
7016
			"    int x;\n" +
7017
			"    int y;\n" +
7018
			"    <CompleteOnName:zzz>;\n" +
7019
			"  }\n" + 
7020
			"}\n";
5982
	
7021
	
5983
	checkMethodParse(
7022
	checkMethodParse(
5984
		str.toCharArray(), 
7023
		str.toCharArray(), 
Lines 5990-5996 Link Here
5990
		expectedReplacedSource,
7029
		expectedReplacedSource,
5991
		"full ast");
7030
		"full ast");
5992
}
7031
}
5993
public void test0108(){
7032
public void test0108_Diet(){
5994
	String str = 
7033
	String str = 
5995
		"package p;\n" +  
7034
		"package p;\n" +  
5996
		"public class X {\n" +
7035
		"public class X {\n" +
Lines 6024-6043 Link Here
6024
		completionIdentifier,
7063
		completionIdentifier,
6025
		expectedReplacedSource,
7064
		expectedReplacedSource,
6026
		"diet ast");
7065
		"diet ast");
6027
	
7066
}
6028
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7067
public void test0108_Method(){
6029
	expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
7068
	String str = 
6030
	completionIdentifier = "zzz";
7069
		"package p;\n" +  
6031
	expectedReplacedSource = "zzz";
7070
		"public class X {\n" +
6032
	expectedUnitDisplayString =
7071
		"  void foo(){\n" + 
6033
		"package p;\n" + 
7072
		"    int x = -zzz;\n" +
6034
		"public class X {\n" + 
6035
		"  public X() {\n" + 
6036
		"  }\n" + 
6037
		"  void foo() {\n" + 
6038
		"    int x = (- <CompleteOnName:zzz>);\n" +
6039
		"  }\n" + 
7073
		"  }\n" + 
6040
		"}\n";
7074
		"}\n";
7075
7076
	String completeBehind = "zzz";
7077
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7078
	
7079
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7080
	String expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
7081
	String completionIdentifier = "zzz";
7082
	String expectedReplacedSource = "zzz";
7083
	String expectedUnitDisplayString =
7084
			"package p;\n" + 
7085
			"public class X {\n" + 
7086
			"  public X() {\n" + 
7087
			"  }\n" + 
7088
			"  void foo() {\n" + 
7089
			"    int x = (- <CompleteOnName:zzz>);\n" +
7090
			"  }\n" + 
7091
			"}\n";
6041
	
7092
	
6042
	checkMethodParse(
7093
	checkMethodParse(
6043
		str.toCharArray(), 
7094
		str.toCharArray(), 
Lines 6049-6055 Link Here
6049
		expectedReplacedSource,
7100
		expectedReplacedSource,
6050
		"full ast");
7101
		"full ast");
6051
}
7102
}
6052
public void test0109(){
7103
public void test0109_Diet(){
6053
	String str = 
7104
	String str = 
6054
		"package p;\n" +  
7105
		"package p;\n" +  
6055
		"public class X {\n" +
7106
		"public class X {\n" +
Lines 6083-6102 Link Here
6083
		completionIdentifier,
7134
		completionIdentifier,
6084
		expectedReplacedSource,
7135
		expectedReplacedSource,
6085
		"diet ast");
7136
		"diet ast");
6086
	
7137
}
6087
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7138
public void test0109_Method(){
6088
	expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
7139
	String str = 
6089
	completionIdentifier = "zzz";
7140
		"package p;\n" +  
6090
	expectedReplacedSource = "zzz";
7141
		"public class X {\n" +
6091
	expectedUnitDisplayString =
7142
		"  void foo(){\n" + 
6092
		"package p;\n" + 
7143
		"    int x = -(zzz;\n" +
6093
		"public class X {\n" + 
6094
		"  public X() {\n" + 
6095
		"  }\n" + 
6096
		"  void foo() {\n" + 
6097
		"    int x = (- <CompleteOnName:zzz>);\n" +
6098
		"  }\n" + 
7144
		"  }\n" + 
6099
		"}\n";
7145
		"}\n";
7146
7147
	String completeBehind = "zzz";
7148
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7149
	
7150
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7151
	String expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
7152
	String completionIdentifier = "zzz";
7153
	String expectedReplacedSource = "zzz";
7154
	String expectedUnitDisplayString =
7155
			"package p;\n" + 
7156
			"public class X {\n" + 
7157
			"  public X() {\n" + 
7158
			"  }\n" + 
7159
			"  void foo() {\n" + 
7160
			"    int x = (- <CompleteOnName:zzz>);\n" +
7161
			"  }\n" + 
7162
			"}\n";
6100
	
7163
	
6101
	checkMethodParse(
7164
	checkMethodParse(
6102
		str.toCharArray(), 
7165
		str.toCharArray(), 
Lines 6108-6114 Link Here
6108
		expectedReplacedSource,
7171
		expectedReplacedSource,
6109
		"full ast");
7172
		"full ast");
6110
}
7173
}
6111
public void test0110(){
7174
public void test0110_Diet(){
6112
	String str = 
7175
	String str = 
6113
		"package p;\n" +  
7176
		"package p;\n" +  
6114
		"public class X {\n" +
7177
		"public class X {\n" +
Lines 6144-6165 Link Here
6144
		completionIdentifier,
7207
		completionIdentifier,
6145
		expectedReplacedSource,
7208
		expectedReplacedSource,
6146
		"diet ast");
7209
		"diet ast");
6147
	
7210
}
6148
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7211
public void test0110_Method(){
6149
	expectedParentNodeToString = "<NONE>";
7212
	String str = 
6150
	completionIdentifier = "zzz";
7213
		"package p;\n" +  
6151
	expectedReplacedSource = "zzz";
7214
		"public class X {\n" +
6152
	expectedUnitDisplayString =
7215
		"  void foo(){\n" + 
6153
		"package p;\n" + 
7216
		"    int x = 0;\n" +
6154
		"public class X {\n" + 
7217
		"    int y = -x;\n" +
6155
		"  public X() {\n" + 
7218
		"    zzz;\n" +
6156
		"  }\n" + 
6157
		"  void foo() {\n" + 
6158
		"    int x;\n" +
6159
		"    int y;\n" +
6160
		"    <CompleteOnName:zzz>;\n" +
6161
		"  }\n" + 
7219
		"  }\n" + 
6162
		"}\n";
7220
		"}\n";
7221
7222
	String completeBehind = "zzz";
7223
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7224
	
7225
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7226
	String expectedParentNodeToString = "<NONE>";
7227
	String completionIdentifier = "zzz";
7228
	String expectedReplacedSource = "zzz";
7229
	String expectedUnitDisplayString =
7230
			"package p;\n" + 
7231
			"public class X {\n" + 
7232
			"  public X() {\n" + 
7233
			"  }\n" + 
7234
			"  void foo() {\n" + 
7235
			"    int x;\n" +
7236
			"    int y;\n" +
7237
			"    <CompleteOnName:zzz>;\n" +
7238
			"  }\n" + 
7239
			"}\n";
6163
	
7240
	
6164
	checkMethodParse(
7241
	checkMethodParse(
6165
		str.toCharArray(), 
7242
		str.toCharArray(), 
Lines 6171-6177 Link Here
6171
		expectedReplacedSource,
7248
		expectedReplacedSource,
6172
		"full ast");
7249
		"full ast");
6173
}
7250
}
6174
public void test0111(){
7251
public void test0111_Diet(){
6175
	String str = 
7252
	String str = 
6176
		"package p;\n" +  
7253
		"package p;\n" +  
6177
		"public class X {\n" +
7254
		"public class X {\n" +
Lines 6205-6224 Link Here
6205
		completionIdentifier,
7282
		completionIdentifier,
6206
		expectedReplacedSource,
7283
		expectedReplacedSource,
6207
		"diet ast");
7284
		"diet ast");
6208
	
7285
}
6209
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7286
public void test0111_Method(){
6210
	expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
7287
	String str = 
6211
	completionIdentifier = "zzz";
7288
		"package p;\n" +  
6212
	expectedReplacedSource = "zzz";
7289
		"public class X {\n" +
6213
	expectedUnitDisplayString =
7290
		"  void foo(){\n" + 
6214
		"package p;\n" + 
7291
		"    if(1 == zzz) {}\n" +
6215
		"public class X {\n" + 
6216
		"  public X() {\n" + 
6217
		"  }\n" + 
6218
		"  void foo() {\n" + 
6219
		"    (1 == <CompleteOnName:zzz>);\n" +
6220
		"  }\n" + 
7292
		"  }\n" + 
6221
		"}\n";
7293
		"}\n";
7294
7295
	String completeBehind = "zzz";
7296
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7297
	
7298
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7299
	String expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
7300
	String completionIdentifier = "zzz";
7301
	String expectedReplacedSource = "zzz";
7302
	String expectedUnitDisplayString =
7303
			"package p;\n" + 
7304
			"public class X {\n" + 
7305
			"  public X() {\n" + 
7306
			"  }\n" + 
7307
			"  void foo() {\n" + 
7308
			"    (1 == <CompleteOnName:zzz>);\n" +
7309
			"  }\n" + 
7310
			"}\n";
6222
	
7311
	
6223
	checkMethodParse(
7312
	checkMethodParse(
6224
		str.toCharArray(), 
7313
		str.toCharArray(), 
Lines 6230-6236 Link Here
6230
		expectedReplacedSource,
7319
		expectedReplacedSource,
6231
		"full ast");
7320
		"full ast");
6232
}
7321
}
6233
public void test0112(){
7322
public void test0112_Diet(){
6234
	String str = 
7323
	String str = 
6235
		"package p;\n" +  
7324
		"package p;\n" +  
6236
		"public class X {\n" +
7325
		"public class X {\n" +
Lines 6264-6283 Link Here
6264
		completionIdentifier,
7353
		completionIdentifier,
6265
		expectedReplacedSource,
7354
		expectedReplacedSource,
6266
		"diet ast");
7355
		"diet ast");
6267
	
7356
}
6268
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7357
public void test0112_Method(){
6269
	expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
7358
	String str = 
6270
	completionIdentifier = "zzz";
7359
		"package p;\n" +  
6271
	expectedReplacedSource = "zzz";
7360
		"public class X {\n" +
6272
	expectedUnitDisplayString =
7361
		"  void foo(){\n" + 
6273
		"package p;\n" + 
7362
		"    if(1 == (zzz)) {}\n" +
6274
		"public class X {\n" + 
6275
		"  public X() {\n" + 
6276
		"  }\n" + 
6277
		"  void foo() {\n" + 
6278
		"    (1 == <CompleteOnName:zzz>);\n" +
6279
		"  }\n" + 
7363
		"  }\n" + 
6280
		"}\n";
7364
		"}\n";
7365
7366
	String completeBehind = "zzz";
7367
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7368
	
7369
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7370
	String expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
7371
	String completionIdentifier = "zzz";
7372
	String expectedReplacedSource = "zzz";
7373
	String expectedUnitDisplayString =
7374
			"package p;\n" + 
7375
			"public class X {\n" + 
7376
			"  public X() {\n" + 
7377
			"  }\n" + 
7378
			"  void foo() {\n" + 
7379
			"    (1 == <CompleteOnName:zzz>);\n" +
7380
			"  }\n" + 
7381
			"}\n";
6281
	
7382
	
6282
	checkMethodParse(
7383
	checkMethodParse(
6283
		str.toCharArray(), 
7384
		str.toCharArray(), 
Lines 6289-6295 Link Here
6289
		expectedReplacedSource,
7390
		expectedReplacedSource,
6290
		"full ast");
7391
		"full ast");
6291
}
7392
}
6292
public void test0113(){
7393
public void test0113_Diet(){
6293
	String str = 
7394
	String str = 
6294
		"package p;\n" +  
7395
		"package p;\n" +  
6295
		"public class X {\n" +
7396
		"public class X {\n" +
Lines 6323-6342 Link Here
6323
		completionIdentifier,
7424
		completionIdentifier,
6324
		expectedReplacedSource,
7425
		expectedReplacedSource,
6325
		"diet ast");
7426
		"diet ast");
6326
	
7427
}
6327
	expectedCompletionNodeToString = "<CompleteOnType:ZZZ>";
7428
public void test0113_Method(){
6328
	expectedParentNodeToString = "(x instanceof <CompleteOnType:ZZZ>)";
7429
	String str = 
6329
	completionIdentifier = "ZZZ";
7430
		"package p;\n" +  
6330
	expectedReplacedSource = "ZZZ";
7431
		"public class X {\n" +
6331
	expectedUnitDisplayString =
7432
		"  void foo(Object x){\n" + 
6332
		"package p;\n" + 
7433
		"    if(x instanceof ZZZ) {}\n" +
6333
		"public class X {\n" + 
6334
		"  public X() {\n" + 
6335
		"  }\n" + 
6336
		"  void foo(Object x) {\n" + 
6337
		"    (x instanceof <CompleteOnType:ZZZ>);\n" +
6338
		"  }\n" + 
7434
		"  }\n" + 
6339
		"}\n";
7435
		"}\n";
7436
7437
	String completeBehind = "ZZZ";
7438
	int cursorLocation = str.indexOf("ZZZ") + completeBehind.length() - 1;
7439
	
7440
	String expectedCompletionNodeToString = "<CompleteOnType:ZZZ>";
7441
	String expectedParentNodeToString = "(x instanceof <CompleteOnType:ZZZ>)";
7442
	String completionIdentifier = "ZZZ";
7443
	String expectedReplacedSource = "ZZZ";
7444
	String expectedUnitDisplayString =
7445
			"package p;\n" + 
7446
			"public class X {\n" + 
7447
			"  public X() {\n" + 
7448
			"  }\n" + 
7449
			"  void foo(Object x) {\n" + 
7450
			"    (x instanceof <CompleteOnType:ZZZ>);\n" +
7451
			"  }\n" + 
7452
			"}\n";
6340
	
7453
	
6341
	checkMethodParse(
7454
	checkMethodParse(
6342
		str.toCharArray(), 
7455
		str.toCharArray(), 
Lines 6348-6354 Link Here
6348
		expectedReplacedSource,
7461
		expectedReplacedSource,
6349
		"full ast");
7462
		"full ast");
6350
}
7463
}
6351
public void test0114(){
7464
public void test0114_Diet(){
6352
	String str =
7465
	String str =
6353
		"package p;\n" +
7466
		"package p;\n" +
6354
		"public class X {\n" +
7467
		"public class X {\n" +
Lines 6383-6406 Link Here
6383
		completionIdentifier,
7496
		completionIdentifier,
6384
		expectedReplacedSource,
7497
		expectedReplacedSource,
6385
		"diet ast");
7498
		"diet ast");
6386
7499
}
6387
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7500
public void test0114_Method(){
6388
	expectedParentNodeToString = "c = <CompleteOnName:zzz>";
7501
	String str =
6389
	completionIdentifier = "zzz";
6390
	expectedReplacedSource = "zzz";
6391
	expectedUnitDisplayString =
6392
		"package p;\n" +
7502
		"package p;\n" +
6393
		"public class X {\n" +
7503
		"public class X {\n" +
6394
		"  public X() {\n" +
7504
		"  void foo(){\n" +
6395
		"  }\n" +
7505
		"    boolean a, b, c;\n" +
6396
		"  void foo() {\n" +
7506
		"    c = a == b ? zzz\n" +
6397
		"    boolean a;\n" +
6398
		"    boolean b;\n" +
6399
		"    boolean c;\n" +
6400
		"    c = <CompleteOnName:zzz>;\n" +
6401
		"  }\n" +
7507
		"  }\n" +
6402
		"}\n";
7508
		"}\n";
6403
7509
7510
	String completeBehind = "zzz";
7511
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7512
7513
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7514
	String expectedParentNodeToString = "c = <CompleteOnName:zzz>";
7515
	String completionIdentifier = "zzz";
7516
	String expectedReplacedSource = "zzz";
7517
	String expectedUnitDisplayString =
7518
			"package p;\n" +
7519
			"public class X {\n" +
7520
			"  public X() {\n" +
7521
			"  }\n" +
7522
			"  void foo() {\n" +
7523
			"    boolean a;\n" +
7524
			"    boolean b;\n" +
7525
			"    boolean c;\n" +
7526
			"    c = <CompleteOnName:zzz>;\n" +
7527
			"  }\n" +
7528
			"}\n";
7529
6404
	checkMethodParse(
7530
	checkMethodParse(
6405
		str.toCharArray(),
7531
		str.toCharArray(),
6406
		cursorLocation,
7532
		cursorLocation,
Lines 6411-6417 Link Here
6411
		expectedReplacedSource,
7537
		expectedReplacedSource,
6412
		"full ast");
7538
		"full ast");
6413
}
7539
}
6414
public void test0115(){
7540
public void test0115_Diet(){
6415
	String str =
7541
	String str =
6416
		"package p;\n" +
7542
		"package p;\n" +
6417
		"public class X {\n" +
7543
		"public class X {\n" +
Lines 6446-6468 Link Here
6446
		completionIdentifier,
7572
		completionIdentifier,
6447
		expectedReplacedSource,
7573
		expectedReplacedSource,
6448
		"diet ast");
7574
		"diet ast");
6449
7575
}
6450
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7576
public void test0115_Method(){
6451
	expectedParentNodeToString = "<NONE>";
7577
	String str =
6452
	completionIdentifier = "zzz";
6453
	expectedReplacedSource = "zzz";
6454
	expectedUnitDisplayString =
6455
		"package p;\n" +
7578
		"package p;\n" +
6456
		"public class X {\n" +
7579
		"public class X {\n" +
6457
		"  public X() {\n" +
7580
		"  void foo(){\n" +
6458
		"  }\n" +
7581
		"    boolean a, b;\n" +
6459
		"  void foo() {\n" +
7582
		"    a == b ? zzz\n" +
6460
		"    boolean a;\n" +
6461
		"    boolean b;\n" +
6462
		"    <CompleteOnName:zzz>;\n" +
6463
		"  }\n" +
7583
		"  }\n" +
6464
		"}\n";
7584
		"}\n";
6465
7585
7586
	String completeBehind = "zzz";
7587
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7588
7589
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7590
	String expectedParentNodeToString = "<NONE>";
7591
	String completionIdentifier = "zzz";
7592
	String expectedReplacedSource = "zzz";
7593
	String expectedUnitDisplayString =
7594
			"package p;\n" +
7595
			"public class X {\n" +
7596
			"  public X() {\n" +
7597
			"  }\n" +
7598
			"  void foo() {\n" +
7599
			"    boolean a;\n" +
7600
			"    boolean b;\n" +
7601
			"    <CompleteOnName:zzz>;\n" +
7602
			"  }\n" +
7603
			"}\n";
7604
6466
	checkMethodParse(
7605
	checkMethodParse(
6467
		str.toCharArray(),
7606
		str.toCharArray(),
6468
		cursorLocation,
7607
		cursorLocation,
Lines 6473-6479 Link Here
6473
		expectedReplacedSource,
7612
		expectedReplacedSource,
6474
		"full ast");
7613
		"full ast");
6475
}
7614
}
6476
public void test0116(){
7615
public void test0116_Diet(){
6477
	String str =
7616
	String str =
6478
		"package p;\n" +
7617
		"package p;\n" +
6479
		"public class X {\n" +
7618
		"public class X {\n" +
Lines 6508-6531 Link Here
6508
		completionIdentifier,
7647
		completionIdentifier,
6509
		expectedReplacedSource,
7648
		expectedReplacedSource,
6510
		"diet ast");
7649
		"diet ast");
6511
7650
}
6512
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7651
public void test0116_Method(){
6513
	expectedParentNodeToString = "c = ((a == b) ? a : <CompleteOnName:zzz>)";
7652
	String str =
6514
	completionIdentifier = "zzz";
6515
	expectedReplacedSource = "zzz";
6516
	expectedUnitDisplayString =
6517
		"package p;\n" +
7653
		"package p;\n" +
6518
		"public class X {\n" +
7654
		"public class X {\n" +
6519
		"  public X() {\n" +
7655
		"  void foo(){\n" +
6520
		"  }\n" +
7656
		"    boolean a, b, c;\n" +
6521
		"  void foo() {\n" +
7657
		"    c = a == b ? a : zzz\n" +
6522
		"    boolean a;\n" +
6523
		"    boolean b;\n" +
6524
		"    boolean c;\n" +
6525
		"    c = ((a == b) ? a : <CompleteOnName:zzz>);\n" +
6526
		"  }\n" +
7658
		"  }\n" +
6527
		"}\n";
7659
		"}\n";
6528
7660
7661
	String completeBehind = "zzz";
7662
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7663
7664
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7665
	String expectedParentNodeToString = "c = ((a == b) ? a : <CompleteOnName:zzz>)";
7666
	String completionIdentifier = "zzz";
7667
	String expectedReplacedSource = "zzz";
7668
	String expectedUnitDisplayString =
7669
			"package p;\n" +
7670
			"public class X {\n" +
7671
			"  public X() {\n" +
7672
			"  }\n" +
7673
			"  void foo() {\n" +
7674
			"    boolean a;\n" +
7675
			"    boolean b;\n" +
7676
			"    boolean c;\n" +
7677
			"    c = ((a == b) ? a : <CompleteOnName:zzz>);\n" +
7678
			"  }\n" +
7679
			"}\n";
7680
6529
	checkMethodParse(
7681
	checkMethodParse(
6530
		str.toCharArray(),
7682
		str.toCharArray(),
6531
		cursorLocation,
7683
		cursorLocation,
Lines 6536-6542 Link Here
6536
		expectedReplacedSource,
7688
		expectedReplacedSource,
6537
		"full ast");
7689
		"full ast");
6538
}
7690
}
6539
public void test0117(){
7691
public void test0117_Diet(){
6540
	String str =
7692
	String str =
6541
		"package p;\n" +
7693
		"package p;\n" +
6542
		"public class X {\n" +
7694
		"public class X {\n" +
Lines 6571-6594 Link Here
6571
		completionIdentifier,
7723
		completionIdentifier,
6572
		expectedReplacedSource,
7724
		expectedReplacedSource,
6573
		"diet ast");
7725
		"diet ast");
6574
7726
}
6575
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7727
public void test0117_Method(){
6576
	expectedParentNodeToString = "c = <CompleteOnName:zzz>";
7728
	String str =
6577
	completionIdentifier = "zzz";
6578
	expectedReplacedSource = "zzz";
6579
	expectedUnitDisplayString =
6580
		"package p;\n" +
7729
		"package p;\n" +
6581
		"public class X {\n" +
7730
		"public class X {\n" +
6582
		"  public X() {\n" +
7731
		"  void foo(){\n" +
6583
		"  }\n" +
7732
		"    boolean a, b, c;\n" +
6584
		"  void foo() {\n" +
7733
		"    c = a == b ? a : (zzz\n" +
6585
		"    boolean a;\n" +
6586
		"    boolean b;\n" +
6587
		"    boolean c;\n" +
6588
		"    c = <CompleteOnName:zzz>;\n" +
6589
		"  }\n" +
7734
		"  }\n" +
6590
		"}\n";
7735
		"}\n";
6591
7736
7737
	String completeBehind = "zzz";
7738
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7739
7740
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7741
	String expectedParentNodeToString = "c = <CompleteOnName:zzz>";
7742
	String completionIdentifier = "zzz";
7743
	String expectedReplacedSource = "zzz";
7744
	String expectedUnitDisplayString =
7745
			"package p;\n" +
7746
			"public class X {\n" +
7747
			"  public X() {\n" +
7748
			"  }\n" +
7749
			"  void foo() {\n" +
7750
			"    boolean a;\n" +
7751
			"    boolean b;\n" +
7752
			"    boolean c;\n" +
7753
			"    c = <CompleteOnName:zzz>;\n" +
7754
			"  }\n" +
7755
			"}\n";
7756
6592
	checkMethodParse(
7757
	checkMethodParse(
6593
		str.toCharArray(),
7758
		str.toCharArray(),
6594
		cursorLocation,
7759
		cursorLocation,
Lines 6599-6605 Link Here
6599
		expectedReplacedSource,
7764
		expectedReplacedSource,
6600
		"full ast");
7765
		"full ast");
6601
}
7766
}
6602
public void test0118(){
7767
public void test0118_Diet(){
6603
	String str =
7768
	String str =
6604
		"package p;\n" +
7769
		"package p;\n" +
6605
		"public class X {\n" +
7770
		"public class X {\n" +
Lines 6634-6657 Link Here
6634
		completionIdentifier,
7799
		completionIdentifier,
6635
		expectedReplacedSource,
7800
		expectedReplacedSource,
6636
		"diet ast");
7801
		"diet ast");
6637
7802
}
6638
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7803
public void test0118_Method(){
6639
	expectedParentNodeToString = "<NONE>";
7804
	String str =
6640
	completionIdentifier = "zzz";
6641
	expectedReplacedSource = "zzz";
6642
	expectedUnitDisplayString =
6643
		"package p;\n" +
7805
		"package p;\n" +
6644
		"public class X {\n" +
7806
		"public class X {\n" +
6645
		"  public X() {\n" +
7807
		"  void foo(){\n" +
6646
		"  }\n" +
7808
		"    boolean a, b, c;\n" +
6647
		"  void foo() {\n" +
7809
		"    c = a# == b ? a : zzz\n" +
6648
		"    boolean a;\n" +
6649
		"    boolean b;\n" +
6650
		"    boolean c;\n" +
6651
		"    <CompleteOnName:zzz>;\n" +
6652
		"  }\n" +
7810
		"  }\n" +
6653
		"}\n";
7811
		"}\n";
6654
7812
7813
	String completeBehind = "zzz";
7814
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7815
7816
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7817
	String expectedParentNodeToString = "<NONE>";
7818
	String completionIdentifier = "zzz";
7819
	String expectedReplacedSource = "zzz";
7820
	String expectedUnitDisplayString =
7821
			"package p;\n" +
7822
			"public class X {\n" +
7823
			"  public X() {\n" +
7824
			"  }\n" +
7825
			"  void foo() {\n" +
7826
			"    boolean a;\n" +
7827
			"    boolean b;\n" +
7828
			"    boolean c;\n" +
7829
			"    <CompleteOnName:zzz>;\n" +
7830
			"  }\n" +
7831
			"}\n";
7832
6655
	checkMethodParse(
7833
	checkMethodParse(
6656
		str.toCharArray(),
7834
		str.toCharArray(),
6657
		cursorLocation,
7835
		cursorLocation,
Lines 6662-6668 Link Here
6662
		expectedReplacedSource,
7840
		expectedReplacedSource,
6663
		"full ast");
7841
		"full ast");
6664
}
7842
}
6665
public void test0119(){
7843
public void test0119_Diet(){
6666
	String str =
7844
	String str =
6667
		"public class X {\n" +
7845
		"public class X {\n" +
6668
		"  void foo(){\n" +
7846
		"  void foo(){\n" +
Lines 6696-6722 Link Here
6696
		completionIdentifier,
7874
		completionIdentifier,
6697
		expectedReplacedSource,
7875
		expectedReplacedSource,
6698
		"diet ast");
7876
		"diet ast");
6699
7877
}
6700
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7878
public void test0119_Method(){
6701
	expectedParentNodeToString =
7879
	String str =
6702
		"switch (1) {\n" + 
7880
		"public class X {\n" +
6703
		"case <CompleteOnName:zzz> : ;\n" + 
7881
		"  void foo(){\n" +
6704
		"}";
7882
		"    switch(1) {\n" +
6705
	completionIdentifier = "zzz";
7883
		"      case zzz\n" +
6706
	expectedReplacedSource = "zzz";
7884
		"    }\n" +
6707
	expectedUnitDisplayString =
7885
		"  }\n" +
6708
		"public class X {\n" + 
6709
		"  public X() {\n" + 
6710
		"  }\n" + 
6711
		"  void foo() {\n" + 
6712
		"    {\n" + 
6713
		"      switch (1) {\n" + 
6714
		"      case <CompleteOnName:zzz> : ;\n" + 
6715
		"      }\n" + 
6716
		"    }\n" + 
6717
		"  }\n" + 
6718
		"}\n";
7886
		"}\n";
6719
7887
7888
	String completeBehind = "zzz";
7889
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7890
7891
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7892
	String expectedParentNodeToString =
7893
			"switch (1) {\n" + 
7894
			"case <CompleteOnName:zzz> : ;\n" + 
7895
			"}";
7896
	String completionIdentifier = "zzz";
7897
	String expectedReplacedSource = "zzz";
7898
	String expectedUnitDisplayString =
7899
			"public class X {\n" + 
7900
			"  public X() {\n" + 
7901
			"  }\n" + 
7902
			"  void foo() {\n" + 
7903
			"    {\n" + 
7904
			"      switch (1) {\n" + 
7905
			"      case <CompleteOnName:zzz> : ;\n" + 
7906
			"      }\n" + 
7907
			"    }\n" + 
7908
			"  }\n" + 
7909
			"}\n";
7910
6720
	checkMethodParse(
7911
	checkMethodParse(
6721
		str.toCharArray(),
7912
		str.toCharArray(),
6722
		cursorLocation,
7913
		cursorLocation,
Lines 6727-6733 Link Here
6727
		expectedReplacedSource,
7918
		expectedReplacedSource,
6728
		"full ast");
7919
		"full ast");
6729
}
7920
}
6730
public void test0120(){
7921
public void test0120_Diet(){
6731
	String str =
7922
	String str =
6732
		"public class X {\n" +
7923
		"public class X {\n" +
6733
		"  void foo(){\n" +
7924
		"  void foo(){\n" +
Lines 6762-6790 Link Here
6762
		completionIdentifier,
7953
		completionIdentifier,
6763
		expectedReplacedSource,
7954
		expectedReplacedSource,
6764
		"diet ast");
7955
		"diet ast");
6765
7956
}
6766
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7957
public void test0120_Method(){
6767
	expectedParentNodeToString =
7958
	String str =
6768
		"switch (1) {\n" + 
7959
		"public class X {\n" +
6769
		"case Something : ;\n" + 
7960
		"  void foo(){\n" +
6770
		"case <CompleteOnName:zzz> : ;\n" + 
7961
		"    switch(1) {\n" +
6771
		"}";
7962
		"      case Something :\n" +
6772
	completionIdentifier = "zzz";
7963
		"      case zzz\n" +
6773
	expectedReplacedSource = "zzz";
7964
		"    }\n" +
6774
	expectedUnitDisplayString =
7965
		"  }\n" +
6775
		"public class X {\n" + 
6776
		"  public X() {\n" + 
6777
		"  }\n" + 
6778
		"  void foo() {\n" + 
6779
		"    {\n" + 
6780
		"      switch (1) {\n" + 
6781
		"      case Something : ;\n" + 
6782
		"      case <CompleteOnName:zzz> : ;\n" + 
6783
		"      }\n" + 
6784
		"    }\n" + 
6785
		"  }\n" + 
6786
		"}\n";
7966
		"}\n";
6787
7967
7968
	String completeBehind = "zzz";
7969
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
7970
7971
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
7972
	String expectedParentNodeToString =
7973
			"switch (1) {\n" + 
7974
			"case Something : ;\n" + 
7975
			"case <CompleteOnName:zzz> : ;\n" + 
7976
			"}";
7977
	String completionIdentifier = "zzz";
7978
	String expectedReplacedSource = "zzz";
7979
	String expectedUnitDisplayString =
7980
			"public class X {\n" + 
7981
			"  public X() {\n" + 
7982
			"  }\n" + 
7983
			"  void foo() {\n" + 
7984
			"    {\n" + 
7985
			"      switch (1) {\n" + 
7986
			"      case Something : ;\n" + 
7987
			"      case <CompleteOnName:zzz> : ;\n" + 
7988
			"      }\n" + 
7989
			"    }\n" + 
7990
			"  }\n" + 
7991
			"}\n";
7992
6788
	checkMethodParse(
7993
	checkMethodParse(
6789
		str.toCharArray(),
7994
		str.toCharArray(),
6790
		cursorLocation,
7995
		cursorLocation,
Lines 6795-6801 Link Here
6795
		expectedReplacedSource,
8000
		expectedReplacedSource,
6796
		"full ast");
8001
		"full ast");
6797
}
8002
}
6798
public void test0121(){
8003
public void test0121_Diet(){
6799
	String str =
8004
	String str =
6800
		"public class X {\n" +
8005
		"public class X {\n" +
6801
		"  void foo(){\n" +
8006
		"  void foo(){\n" +
Lines 6827-6846 Link Here
6827
		completionIdentifier,
8032
		completionIdentifier,
6828
		expectedReplacedSource,
8033
		expectedReplacedSource,
6829
		"diet ast");
8034
		"diet ast");
6830
8035
}
6831
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8036
public void test0121_Method(){
6832
	expectedParentNodeToString = "tab[<CompleteOnName:zzz>]";
8037
	String str =
6833
	completionIdentifier = "zzz";
6834
	expectedReplacedSource = "zzz";
6835
	expectedUnitDisplayString =
6836
		"public class X {\n" +
8038
		"public class X {\n" +
6837
		"  public X() {\n" +
8039
		"  void foo(){\n" +
6838
		"  }\n" +
8040
		"    tab[zzz]\n" +
6839
		"  void foo() {\n" +
6840
		"    tab[<CompleteOnName:zzz>];\n" +
6841
		"  }\n" +
8041
		"  }\n" +
6842
		"}\n";
8042
		"}\n";
6843
8043
8044
	String completeBehind = "zzz";
8045
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8046
8047
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8048
	String expectedParentNodeToString = "tab[<CompleteOnName:zzz>]";
8049
	String completionIdentifier = "zzz";
8050
	String expectedReplacedSource = "zzz";
8051
	String expectedUnitDisplayString =
8052
			"public class X {\n" +
8053
			"  public X() {\n" +
8054
			"  }\n" +
8055
			"  void foo() {\n" +
8056
			"    tab[<CompleteOnName:zzz>];\n" +
8057
			"  }\n" +
8058
			"}\n";
8059
6844
	checkMethodParse(
8060
	checkMethodParse(
6845
		str.toCharArray(),
8061
		str.toCharArray(),
6846
		cursorLocation,
8062
		cursorLocation,
Lines 6851-6857 Link Here
6851
		expectedReplacedSource,
8067
		expectedReplacedSource,
6852
		"full ast");
8068
		"full ast");
6853
}
8069
}
6854
public void test0122(){
8070
public void test0122_Diet(){
6855
	String str =
8071
	String str =
6856
		"public class X {\n" +
8072
		"public class X {\n" +
6857
		"  void foo(){\n" +
8073
		"  void foo(){\n" +
Lines 6883-6902 Link Here
6883
		completionIdentifier,
8099
		completionIdentifier,
6884
		expectedReplacedSource,
8100
		expectedReplacedSource,
6885
		"diet ast");
8101
		"diet ast");
6886
8102
}
6887
	expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:tab[].zzz>";
8103
public void test0122_Method(){
6888
	expectedParentNodeToString = "<NONE>";
8104
	String str =
6889
	completionIdentifier = "zzz";
6890
	expectedReplacedSource = "tab[].zzz";
6891
	expectedUnitDisplayString =
6892
		"public class X {\n" +
8105
		"public class X {\n" +
6893
		"  public X() {\n" +
8106
		"  void foo(){\n" +
6894
		"  }\n" +
8107
		"    tab[].zzz\n" +
6895
		"  void foo() {\n" +
6896
		"    <CompleteOnClassLiteralAccess:tab[].zzz>;\n" +
6897
		"  }\n" +
8108
		"  }\n" +
6898
		"}\n";
8109
		"}\n";
6899
8110
8111
	String completeBehind = "zzz";
8112
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8113
8114
	String expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:tab[].zzz>";
8115
	String expectedParentNodeToString = "<NONE>";
8116
	String completionIdentifier = "zzz";
8117
	String expectedReplacedSource = "tab[].zzz";
8118
	String expectedUnitDisplayString =
8119
			"public class X {\n" +
8120
			"  public X() {\n" +
8121
			"  }\n" +
8122
			"  void foo() {\n" +
8123
			"    <CompleteOnClassLiteralAccess:tab[].zzz>;\n" +
8124
			"  }\n" +
8125
			"}\n";
8126
6900
	checkMethodParse(
8127
	checkMethodParse(
6901
		str.toCharArray(),
8128
		str.toCharArray(),
6902
		cursorLocation,
8129
		cursorLocation,
Lines 6907-6913 Link Here
6907
		expectedReplacedSource,
8134
		expectedReplacedSource,
6908
		"full ast");
8135
		"full ast");
6909
}
8136
}
6910
public void test0123(){
8137
public void test0123_Diet(){
6911
	String str =
8138
	String str =
6912
		"public class X {\n" +
8139
		"public class X {\n" +
6913
		"  void foo(){\n" +
8140
		"  void foo(){\n" +
Lines 6939-6958 Link Here
6939
		completionIdentifier,
8166
		completionIdentifier,
6940
		expectedReplacedSource,
8167
		expectedReplacedSource,
6941
		"diet ast");
8168
		"diet ast");
6942
8169
}
6943
	expectedCompletionNodeToString = "<CompleteOnMemberAccess:tab[0].zzz>";
8170
public void test0123_Method(){
6944
	expectedParentNodeToString = "<NONE>";
8171
	String str =
6945
	completionIdentifier = "zzz";
6946
	expectedReplacedSource = "zzz";
6947
	expectedUnitDisplayString =
6948
		"public class X {\n" +
8172
		"public class X {\n" +
6949
		"  public X() {\n" +
8173
		"  void foo(){\n" +
6950
		"  }\n" +
8174
		"    tab[0].zzz\n" +
6951
		"  void foo() {\n" +
6952
		"    <CompleteOnMemberAccess:tab[0].zzz>;\n" +
6953
		"  }\n" +
8175
		"  }\n" +
6954
		"}\n";
8176
		"}\n";
6955
8177
8178
	String completeBehind = "zzz";
8179
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8180
8181
	String expectedCompletionNodeToString = "<CompleteOnMemberAccess:tab[0].zzz>";
8182
	String expectedParentNodeToString = "<NONE>";
8183
	String completionIdentifier = "zzz";
8184
	String expectedReplacedSource = "zzz";
8185
	String expectedUnitDisplayString =
8186
			"public class X {\n" +
8187
			"  public X() {\n" +
8188
			"  }\n" +
8189
			"  void foo() {\n" +
8190
			"    <CompleteOnMemberAccess:tab[0].zzz>;\n" +
8191
			"  }\n" +
8192
			"}\n";
8193
6956
	checkMethodParse(
8194
	checkMethodParse(
6957
		str.toCharArray(),
8195
		str.toCharArray(),
6958
		cursorLocation,
8196
		cursorLocation,
Lines 6963-6969 Link Here
6963
		expectedReplacedSource,
8201
		expectedReplacedSource,
6964
		"full ast");
8202
		"full ast");
6965
}
8203
}
6966
public void test0124(){
8204
public void test0124_Diet(){
6967
	String str =
8205
	String str =
6968
		"public class X {\n" +
8206
		"public class X {\n" +
6969
		"  void foo(){\n" +
8207
		"  void foo(){\n" +
Lines 6995-7014 Link Here
6995
		completionIdentifier,
8233
		completionIdentifier,
6996
		expectedReplacedSource,
8234
		expectedReplacedSource,
6997
		"diet ast");
8235
		"diet ast");
6998
8236
}
6999
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8237
public void test0124_Method(){
7000
	expectedParentNodeToString = "foo()[<CompleteOnName:zzz>]";
8238
	String str =
7001
	completionIdentifier = "zzz";
7002
	expectedReplacedSource = "zzz";
7003
	expectedUnitDisplayString =
7004
		"public class X {\n" +
8239
		"public class X {\n" +
7005
		"  public X() {\n" +
8240
		"  void foo(){\n" +
7006
		"  }\n" +
8241
		"    foo()[zzz]\n" +
7007
		"  void foo() {\n" +
7008
		"    foo()[<CompleteOnName:zzz>];\n" +
7009
		"  }\n" +
8242
		"  }\n" +
7010
		"}\n";
8243
		"}\n";
7011
8244
8245
	String completeBehind = "zzz";
8246
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8247
8248
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8249
	String expectedParentNodeToString = "foo()[<CompleteOnName:zzz>]";
8250
	String completionIdentifier = "zzz";
8251
	String expectedReplacedSource = "zzz";
8252
	String expectedUnitDisplayString =
8253
			"public class X {\n" +
8254
			"  public X() {\n" +
8255
			"  }\n" +
8256
			"  void foo() {\n" +
8257
			"    foo()[<CompleteOnName:zzz>];\n" +
8258
			"  }\n" +
8259
			"}\n";
8260
7012
	checkMethodParse(
8261
	checkMethodParse(
7013
		str.toCharArray(),
8262
		str.toCharArray(),
7014
		cursorLocation,
8263
		cursorLocation,
Lines 7019-7025 Link Here
7019
		expectedReplacedSource,
8268
		expectedReplacedSource,
7020
		"full ast");
8269
		"full ast");
7021
}
8270
}
7022
public void test0125(){
8271
public void test0125_Diet(){
7023
	String str =
8272
	String str =
7024
		"public class X {\n" +
8273
		"public class X {\n" +
7025
		"  void foo(){\n" +
8274
		"  void foo(){\n" +
Lines 7051-7070 Link Here
7051
		completionIdentifier,
8300
		completionIdentifier,
7052
		expectedReplacedSource,
8301
		expectedReplacedSource,
7053
		"diet ast");
8302
		"diet ast");
7054
8303
}
7055
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8304
public void test0125_Method(){
7056
	expectedParentNodeToString = "<NONE>";
8305
	String str =
7057
	completionIdentifier = "zzz";
7058
	expectedReplacedSource = "zzz";
7059
	expectedUnitDisplayString =
7060
		"public class X {\n" +
8306
		"public class X {\n" +
7061
		"  public X() {\n" +
8307
		"  void foo(){\n" +
7062
		"  }\n" +
8308
		"    foo()[].zzz\n" +
7063
		"  void foo() {\n" +
7064
		"    <CompleteOnName:zzz>;\n" +
7065
		"  }\n" +
8309
		"  }\n" +
7066
		"}\n";
8310
		"}\n";
7067
8311
8312
	String completeBehind = "zzz";
8313
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8314
8315
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8316
	String expectedParentNodeToString = "<NONE>";
8317
	String completionIdentifier = "zzz";
8318
	String expectedReplacedSource = "zzz";
8319
	String expectedUnitDisplayString =
8320
			"public class X {\n" +
8321
			"  public X() {\n" +
8322
			"  }\n" +
8323
			"  void foo() {\n" +
8324
			"    <CompleteOnName:zzz>;\n" +
8325
			"  }\n" +
8326
			"}\n";
8327
7068
	checkMethodParse(
8328
	checkMethodParse(
7069
		str.toCharArray(),
8329
		str.toCharArray(),
7070
		cursorLocation,
8330
		cursorLocation,
Lines 7075-7081 Link Here
7075
		expectedReplacedSource,
8335
		expectedReplacedSource,
7076
		"full ast");
8336
		"full ast");
7077
}
8337
}
7078
public void test0126(){
8338
public void test0126_Diet(){
7079
	String str =
8339
	String str =
7080
		"public class X {\n" +
8340
		"public class X {\n" +
7081
		"  void foo(){\n" +
8341
		"  void foo(){\n" +
Lines 7107-7126 Link Here
7107
		completionIdentifier,
8367
		completionIdentifier,
7108
		expectedReplacedSource,
8368
		expectedReplacedSource,
7109
		"diet ast");
8369
		"diet ast");
7110
8370
}
7111
	expectedCompletionNodeToString = "<CompleteOnMemberAccess:foo()[1].zzz>";
8371
public void test0126_Method(){
7112
	expectedParentNodeToString = "<NONE>";
8372
	String str =
7113
	completionIdentifier = "zzz";
7114
	expectedReplacedSource = "zzz";
7115
	expectedUnitDisplayString =
7116
		"public class X {\n" +
8373
		"public class X {\n" +
7117
		"  public X() {\n" +
8374
		"  void foo(){\n" +
7118
		"  }\n" +
8375
		"    foo()[1].zzz\n" +
7119
		"  void foo() {\n" +
7120
		"    <CompleteOnMemberAccess:foo()[1].zzz>;\n" +
7121
		"  }\n" +
8376
		"  }\n" +
7122
		"}\n";
8377
		"}\n";
7123
8378
8379
	String completeBehind = "zzz";
8380
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8381
8382
	String expectedCompletionNodeToString = "<CompleteOnMemberAccess:foo()[1].zzz>";
8383
	String expectedParentNodeToString = "<NONE>";
8384
	String completionIdentifier = "zzz";
8385
	String expectedReplacedSource = "zzz";
8386
	String expectedUnitDisplayString =
8387
			"public class X {\n" +
8388
			"  public X() {\n" +
8389
			"  }\n" +
8390
			"  void foo() {\n" +
8391
			"    <CompleteOnMemberAccess:foo()[1].zzz>;\n" +
8392
			"  }\n" +
8393
			"}\n";
8394
7124
	checkMethodParse(
8395
	checkMethodParse(
7125
		str.toCharArray(),
8396
		str.toCharArray(),
7126
		cursorLocation,
8397
		cursorLocation,
Lines 7166-7172 Link Here
7166
		expectedReplacedSource,
8437
		expectedReplacedSource,
7167
		"diet ast");
8438
		"diet ast");
7168
}
8439
}
7169
public void test0128(){
8440
public void test0128_Diet(){
7170
	String str =
8441
	String str =
7171
		"public class X {\n" +
8442
		"public class X {\n" +
7172
		"  void foo(){\n" +
8443
		"  void foo(){\n" +
Lines 7202-7225 Link Here
7202
		completionIdentifier,
8473
		completionIdentifier,
7203
		expectedReplacedSource,
8474
		expectedReplacedSource,
7204
		"diet ast");
8475
		"diet ast");
7205
8476
}
7206
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8477
public void test0128_Method(){
7207
	expectedParentNodeToString = "a[<CompleteOnName:zzz>]";
8478
	String str =
7208
	completionIdentifier = "zzz";
7209
	expectedReplacedSource = "zzz";
7210
	expectedUnitDisplayString =
7211
		"public class X {\n" +
8479
		"public class X {\n" +
7212
		"  public X() {\n" +
8480
		"  void foo(){\n" +
7213
		"  }\n" +
7214
		"  void foo() {\n" +
7215
		"    new Object() {\n" +
8481
		"    new Object() {\n" +
7216
		"      void bar() {\n" +
8482
		"      void bar() {\n" +
7217
		"        a[<CompleteOnName:zzz>];\n" +
8483
		"        a[zzz\n" +
7218
		"      }\n" +
8484
		"      }\n" +
7219
		"    };\n" +
8485
		"    }\n" +
7220
		"  }\n" +
8486
		"  }\n" +
7221
		"}\n";
8487
		"}\n";
7222
8488
8489
	String completeBehind = "zzz";
8490
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8491
8492
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8493
	String expectedParentNodeToString = "a[<CompleteOnName:zzz>]";
8494
	String completionIdentifier = "zzz";
8495
	String expectedReplacedSource = "zzz";
8496
	String expectedUnitDisplayString =
8497
			"public class X {\n" +
8498
			"  public X() {\n" +
8499
			"  }\n" +
8500
			"  void foo() {\n" +
8501
			"    new Object() {\n" +
8502
			"      void bar() {\n" +
8503
			"        a[<CompleteOnName:zzz>];\n" +
8504
			"      }\n" +
8505
			"    };\n" +
8506
			"  }\n" +
8507
			"}\n";
8508
7223
	checkMethodParse(
8509
	checkMethodParse(
7224
		str.toCharArray(),
8510
		str.toCharArray(),
7225
		cursorLocation,
8511
		cursorLocation,
Lines 7230-7236 Link Here
7230
		expectedReplacedSource,
8516
		expectedReplacedSource,
7231
		"full ast");
8517
		"full ast");
7232
}
8518
}
7233
public void test0129(){
8519
public void test0129_Diet(){
7234
	String str =
8520
	String str =
7235
		"public class X {\n" +
8521
		"public class X {\n" +
7236
		"  void foo(){\n" +
8522
		"  void foo(){\n" +
Lines 7267-7288 Link Here
7267
		completionIdentifier,
8553
		completionIdentifier,
7268
		expectedReplacedSource,
8554
		expectedReplacedSource,
7269
		"diet ast");
8555
		"diet ast");
7270
8556
}
7271
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8557
public void test0129_Method(){
7272
	expectedParentNodeToString = "<NONE>";
8558
	String str =
7273
	completionIdentifier = "zzz";
7274
	expectedReplacedSource = "zzz";
7275
	expectedUnitDisplayString =
7276
		"public class X {\n" +
8559
		"public class X {\n" +
7277
		"  public X() {\n" +
8560
		"  void foo(){\n" +
7278
		"  }\n" +
7279
		"  void foo() {\n" +
7280
		"    Object local;\n" +
8561
		"    Object local;\n" +
7281
		"    double bar;\n" +
8562
		"    double bar;\n" +
7282
		"    <CompleteOnName:zzz>;\n" +
8563
		"    for(;;) {\n" +
8564
		"      bar = (double)0;\n" +
8565
		"    }\n" +
8566
		"    zzz\n" +
7283
		"  }\n" +
8567
		"  }\n" +
7284
		"}\n";
8568
		"}\n";
7285
8569
8570
	String completeBehind = "zzz";
8571
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
8572
8573
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
8574
	String expectedParentNodeToString = "<NONE>";
8575
	String completionIdentifier = "zzz";
8576
	String expectedReplacedSource = "zzz";
8577
	String expectedUnitDisplayString =
8578
			"public class X {\n" +
8579
			"  public X() {\n" +
8580
			"  }\n" +
8581
			"  void foo() {\n" +
8582
			"    Object local;\n" +
8583
			"    double bar;\n" +
8584
			"    <CompleteOnName:zzz>;\n" +
8585
			"  }\n" +
8586
			"}\n";
8587
7286
	checkMethodParse(
8588
	checkMethodParse(
7287
		str.toCharArray(),
8589
		str.toCharArray(),
7288
		cursorLocation,
8590
		cursorLocation,
Lines 7296-7302 Link Here
7296
/*
8598
/*
7297
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
8599
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
7298
 */
8600
 */
7299
public void test0130(){
8601
public void test0130_Diet(){
7300
	String str =
8602
	String str =
7301
		"public class X {\n" +
8603
		"public class X {\n" +
7302
		"  void foo(){\n" +
8604
		"  void foo(){\n" +
Lines 7329-7349 Link Here
7329
		completionIdentifier,
8631
		completionIdentifier,
7330
		expectedReplacedSource,
8632
		expectedReplacedSource,
7331
		"diet ast");
8633
		"diet ast");
7332
8634
}
7333
	expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz()>";
8635
/*
7334
	expectedParentNodeToString = "<NONE>";
8636
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
7335
	completionIdentifier = "";
8637
 */
7336
	expectedReplacedSource = "zzz(";
8638
public void test0130_Method(){
7337
	expectedUnitDisplayString =
8639
	String str =
7338
		"public class X {\n" + 
8640
		"public class X {\n" +
7339
		"  public X() {\n" + 
8641
		"  void foo(){\n" +
7340
		"  }\n" + 
8642
		"    A.B c = null;\n" +
7341
		"  void foo() {\n" + 
8643
		"    zzz();\n" +
7342
		"    A.B c;\n" + 
8644
		"  }\n" +
7343
		"    <CompleteOnMessageSend:zzz()>;\n" + 
7344
		"  }\n" + 
7345
		"}\n";
8645
		"}\n";
7346
8646
8647
	String completeBehind = "zzz(";
8648
	int cursorLocation = str.indexOf("zzz(") + completeBehind.length() - 1;
8649
8650
	String expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz()>";
8651
	String expectedParentNodeToString = "<NONE>";
8652
	String completionIdentifier = "";
8653
	String expectedReplacedSource = "zzz(";
8654
	String expectedUnitDisplayString =
8655
			"public class X {\n" + 
8656
			"  public X() {\n" + 
8657
			"  }\n" + 
8658
			"  void foo() {\n" + 
8659
			"    A.B c;\n" + 
8660
			"    <CompleteOnMessageSend:zzz()>;\n" + 
8661
			"  }\n" + 
8662
			"}\n";
8663
7347
	checkMethodParse(
8664
	checkMethodParse(
7348
		str.toCharArray(),
8665
		str.toCharArray(),
7349
		cursorLocation,
8666
		cursorLocation,
Lines 7357-7363 Link Here
7357
/*
8674
/*
7358
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
8675
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
7359
 */
8676
 */
7360
public void test0131(){
8677
public void test0131_Diet(){
7361
	String str =
8678
	String str =
7362
		"public class X {\n" +
8679
		"public class X {\n" +
7363
		"  void foo(){\n" +
8680
		"  void foo(){\n" +
Lines 7392-7414 Link Here
7392
		completionIdentifier,
8709
		completionIdentifier,
7393
		expectedReplacedSource,
8710
		expectedReplacedSource,
7394
		"diet ast");
8711
		"diet ast");
7395
8712
}
7396
	expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz()>";
8713
/*
7397
	expectedParentNodeToString = "<NONE>";
8714
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=42856
7398
	completionIdentifier = "";
8715
 */
7399
	expectedReplacedSource = "zzz(";
8716
public void test0131_Method(){
7400
	expectedUnitDisplayString =
8717
	String str =
7401
		"public class X {\n" + 
8718
		"public class X {\n" +
7402
		"  public X() {\n" + 
8719
		"  void foo(){\n" +
7403
		"  }\n" + 
8720
		"    try {\n" +
7404
		"  void foo() {\n" + 
8721
		"    } catch(A.B e) {\n" +
7405
		"    {\n" + 
8722
		"      zzz();\n" +
7406
		"      A.B e;\n" + 
8723
		"    }\n" +
7407
		"      <CompleteOnMessageSend:zzz()>;\n" + 
8724
		"  }\n" +
7408
		"    }\n" + 
7409
		"  }\n" + 
7410
		"}\n";
8725
		"}\n";
7411
8726
8727
	String completeBehind = "zzz(";
8728
	int cursorLocation = str.indexOf("zzz(") + completeBehind.length() - 1;
8729
8730
	String expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz()>";
8731
	String expectedParentNodeToString = "<NONE>";
8732
	String completionIdentifier = "";
8733
	String expectedReplacedSource = "zzz(";
8734
	String expectedUnitDisplayString =
8735
			"public class X {\n" + 
8736
			"  public X() {\n" + 
8737
			"  }\n" + 
8738
			"  void foo() {\n" + 
8739
			"    {\n" + 
8740
			"      A.B e;\n" + 
8741
			"      <CompleteOnMessageSend:zzz()>;\n" + 
8742
			"    }\n" + 
8743
			"  }\n" + 
8744
			"}\n";
8745
7412
	checkMethodParse(
8746
	checkMethodParse(
7413
		str.toCharArray(),
8747
		str.toCharArray(),
7414
		cursorLocation,
8748
		cursorLocation,
Lines 7422-7428 Link Here
7422
/*
8756
/*
7423
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44647
8757
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44647
7424
 */
8758
 */
7425
public void test0132(){
8759
public void test0132_Diet(){
7426
	String str =
8760
	String str =
7427
		"public class A\n" +
8761
		"public class A\n" +
7428
		"{\n" +
8762
		"{\n" +
Lines 7472-7495 Link Here
7472
		completionIdentifier,
8806
		completionIdentifier,
7473
		expectedReplacedSource,
8807
		expectedReplacedSource,
7474
		"diet ast");
8808
		"diet ast");
7475
8809
}
7476
	expectedCompletionNodeToString = "<CompleteOnName:>";
8810
/*
7477
	expectedParentNodeToString = "<NONE>";
8811
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44647
7478
	completionIdentifier = "";
8812
 */
7479
	expectedReplacedSource = "";
8813
public void test0132_Method(){
7480
	expectedUnitDisplayString =
8814
	String str =
7481
		"public class A {\n" + 
8815
		"public class A\n" +
7482
		"  public A(final String str1, final String str2) {\n" + 
8816
		"{\n" +
7483
		"  }\n" + 
8817
		"   public A(final String str1, final String str2)\n" +
7484
		"  private A[] methodA(final String str1, final String str2) {\n" + 
8818
		"   {\n" +
7485
		"    new A(str1, str2) {\n" + 
8819
		"      \n" +	
7486
		"      {\n" + 
8820
		"   }\n" +
7487
		"        <CompleteOnName:>;\n" + 
8821
		"   \n" +
7488
		"      }\n" + 
8822
		"   private A[] methodA(final String str1, final String str2)\n" +
7489
		"    };\n" + 
8823
		"      {\n" +
7490
		"  }\n" + 
8824
		"         return new A[]\n" +
8825
		"         {\n" +
8826
		"            new A(str1, str2)\n" +
8827
		"            {\n" +
8828
		"               //initialiser!\n" +
8829
		"               {\n" +
8830
		"                  methodA(\"1\", \"2\");\n" +
8831
		"               }\n" +
8832
		"            },\n" +
8833
		"            new A(\"hello\".c) //<--------code complete to \"hello\".concat()\n" +
8834
		"         };\n" +
8835
		"      \n" +
8836
		"      }\n" +
7491
		"}\n";
8837
		"}\n";
7492
8838
8839
8840
	String completeBehind = "\"2\");";
8841
	int cursorLocation = str.indexOf("\"2\");") + completeBehind.length() - 1;
8842
	String expectedCompletionNodeToString = "<CompleteOnName:>";
8843
	String expectedParentNodeToString = "<NONE>";
8844
	String completionIdentifier = "";
8845
	String expectedReplacedSource = "";
8846
	String expectedUnitDisplayString =
8847
			"public class A {\n" + 
8848
			"  public A(final String str1, final String str2) {\n" + 
8849
			"  }\n" + 
8850
			"  private A[] methodA(final String str1, final String str2) {\n" + 
8851
			"    new A(str1, str2) {\n" + 
8852
			"      {\n" + 
8853
			"        <CompleteOnName:>;\n" + 
8854
			"      }\n" + 
8855
			"    };\n" + 
8856
			"  }\n" + 
8857
			"}\n";
8858
7493
	checkMethodParse(
8859
	checkMethodParse(
7494
		str.toCharArray(),
8860
		str.toCharArray(),
7495
		cursorLocation,
8861
		cursorLocation,
Lines 7503-7509 Link Here
7503
/*
8869
/*
7504
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46470
8870
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46470
7505
 */
8871
 */
7506
public void test0133(){
8872
public void test0133_Diet(){
7507
	String str =
8873
	String str =
7508
	"public class X {\n" +
8874
	"public class X {\n" +
7509
	"   int x;\n" +
8875
	"   int x;\n" +
Lines 7541-7560 Link Here
7541
			completionIdentifier,
8907
			completionIdentifier,
7542
			expectedReplacedSource,
8908
			expectedReplacedSource,
7543
			"diet ast");
8909
			"diet ast");
8910
}
8911
/*
8912
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=46470
8913
 */
8914
public void test0133_Method(){
8915
	String str =
8916
	"public class X {\n" +
8917
	"   int x;\n" +
8918
	"   void foo() {\n" +
8919
	"      switch(x){\n" +
8920
	"         case 0:\n" +
8921
	"            break;\n" +
8922
	"      }\n" +
8923
	"      bar\n" +
8924
	"   }\n" +
8925
	"}\n";
7544
8926
7545
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8927
7546
	expectedParentNodeToString = "<NONE>";
8928
	String completeBehind = "bar";
7547
	completionIdentifier = "bar";
8929
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
7548
	expectedReplacedSource = "bar";
8930
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
7549
	expectedUnitDisplayString =
8931
	String expectedParentNodeToString = "<NONE>";
7550
		"public class X {\n" + 
8932
	String completionIdentifier = "bar";
7551
		"  int x;\n" + 
8933
	String expectedReplacedSource = "bar";
7552
		"  public X() {\n" + 
8934
	String expectedUnitDisplayString =
7553
		"  }\n" + 
8935
			"public class X {\n" + 
7554
		"  void foo() {\n" + 
8936
			"  int x;\n" + 
7555
		"    <CompleteOnName:bar>;\n" + 
8937
			"  public X() {\n" + 
7556
		"  }\n" + 
8938
			"  }\n" + 
7557
		"}\n";
8939
			"  void foo() {\n" + 
8940
			"    <CompleteOnName:bar>;\n" + 
8941
			"  }\n" + 
8942
			"}\n";
7558
8943
7559
	checkMethodParse(
8944
	checkMethodParse(
7560
			str.toCharArray(),
8945
			str.toCharArray(),
Lines 7616-7622 Link Here
7616
/*
9001
/*
7617
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43212
9002
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43212
7618
 */
9003
 */
7619
public void test0135(){
9004
public void test0135_Diet(){
7620
	String str =
9005
	String str =
7621
	"public class X {\n" +
9006
	"public class X {\n" +
7622
	"	void bar(){\n" +
9007
	"	void bar(){\n" +
Lines 7656-7683 Link Here
7656
			completionIdentifier,
9041
			completionIdentifier,
7657
			expectedReplacedSource,
9042
			expectedReplacedSource,
7658
			"diet ast");
9043
			"diet ast");
9044
}
9045
/*
9046
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=43212
9047
 */
9048
public void test0135_Method(){
9049
	String str =
9050
	"public class X {\n" +
9051
	"	void bar(){\n" +
9052
	"		#\n" +
9053
	"		class Inner {\n" +
9054
	"			void foo() {\n" +
9055
	"				try {\n" +
9056
	"				} catch(Exception e) {\n" +
9057
	"					e.\n" +
9058
	"				}\n" +
9059
	"			}\n" +
9060
	"		}\n" +
9061
	"	}\n" +
9062
	"}\n";
7659
9063
7660
	expectedCompletionNodeToString = "<CompleteOnName:e.>";
9064
7661
	expectedParentNodeToString = "<NONE>";
9065
	String completeBehind = "e.";
7662
	completionIdentifier = "";
9066
	int cursorLocation = str.indexOf("e.") + completeBehind.length() - 1;
7663
	expectedReplacedSource = "e.";
9067
	String expectedCompletionNodeToString = "<CompleteOnName:e.>";
7664
	expectedUnitDisplayString =
9068
	String expectedParentNodeToString = "<NONE>";
7665
		"public class X {\n" + 
9069
	String completionIdentifier = "";
7666
		"  public X() {\n" + 
9070
	String expectedReplacedSource = "e.";
7667
		"  }\n" + 
9071
	String expectedUnitDisplayString =
7668
		"  void bar() {\n" + 
9072
			"public class X {\n" + 
7669
		"    class Inner {\n" + 
9073
			"  public X() {\n" + 
7670
		"      Inner() {\n" + 
9074
			"  }\n" + 
7671
		"      }\n" + 
9075
			"  void bar() {\n" + 
7672
		"      void foo() {\n" + 
9076
			"    class Inner {\n" + 
7673
		"        {\n" + 
9077
			"      Inner() {\n" + 
7674
		"          Exception e;\n" + 
9078
			"      }\n" + 
7675
		"          <CompleteOnName:e.>;\n" + 
9079
			"      void foo() {\n" + 
7676
		"        }\n" + 
9080
			"        {\n" + 
7677
		"      }\n" + 
9081
			"          Exception e;\n" + 
7678
		"    }\n" + 
9082
			"          <CompleteOnName:e.>;\n" + 
7679
		"  }\n" + 
9083
			"        }\n" + 
7680
		"}\n";
9084
			"      }\n" + 
9085
			"    }\n" + 
9086
			"  }\n" + 
9087
			"}\n";
7681
9088
7682
	checkMethodParse(
9089
	checkMethodParse(
7683
			str.toCharArray(),
9090
			str.toCharArray(),
Lines 7726-7732 Link Here
7726
/*
9133
/*
7727
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=53624
9134
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=53624
7728
 */
9135
 */
7729
public void test0137(){
9136
public void test0137_Diet(){
7730
	String str =
9137
	String str =
7731
		"public class X {\n" +
9138
		"public class X {\n" +
7732
		"	void foo(){\n" +
9139
		"	void foo(){\n" +
Lines 7762-7785 Link Here
7762
			completionIdentifier,
9169
			completionIdentifier,
7763
			expectedReplacedSource,
9170
			expectedReplacedSource,
7764
	"diet ast");
9171
	"diet ast");
7765
	
9172
}
7766
	expectedCompletionNodeToString = "<CompleteOnMessageSend:super.zzz()>";
9173
/*
7767
	expectedParentNodeToString = "<NONE>";
9174
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=53624
7768
	completionIdentifier = "";
9175
 */
7769
	expectedReplacedSource = "zzz(";
9176
public void test0137_Method(){
7770
	expectedUnitDisplayString =
9177
	String str =
7771
		"public class X {\n" + 
9178
		"public class X {\n" +
7772
		"  public X() {\n" + 
9179
		"	void foo(){\n" +
7773
		"  }\n" + 
9180
		"		new Object(){\n" +
7774
		"  void foo() {\n" + 
9181
		"			void bar(){\n" +
7775
		"    new Object() {\n" + 
9182
		"				super.zzz();\n" +
7776
		"      void bar() {\n" + 
9183
		"			}\n" +
7777
		"        <CompleteOnMessageSend:super.zzz()>;\n" + 
9184
		"		};\n" +
7778
		"      }\n" + 
9185
		"	}\n" +
7779
		"    };\n" + 
7780
		"  }\n" + 
7781
		"}\n";
9186
		"}\n";
7782
9187
9188
9189
	String completeBehind = "zzz(";
9190
	int cursorLocation = str.indexOf("zzz(") + completeBehind.length() - 1;
9191
	String expectedCompletionNodeToString = "<CompleteOnMessageSend:super.zzz()>";
9192
	String expectedParentNodeToString = "<NONE>";
9193
	String completionIdentifier = "";
9194
	String expectedReplacedSource = "zzz(";
9195
	String expectedUnitDisplayString =
9196
			"public class X {\n" + 
9197
			"  public X() {\n" + 
9198
			"  }\n" + 
9199
			"  void foo() {\n" + 
9200
			"    new Object() {\n" + 
9201
			"      void bar() {\n" + 
9202
			"        <CompleteOnMessageSend:super.zzz()>;\n" + 
9203
			"      }\n" + 
9204
			"    };\n" + 
9205
			"  }\n" + 
9206
			"}\n";
9207
7783
	checkMethodParse(
9208
	checkMethodParse(
7784
			str.toCharArray(),
9209
			str.toCharArray(),
7785
			cursorLocation,
9210
			cursorLocation,
Lines 7793-7799 Link Here
7793
/*
9218
/*
7794
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=41395
9219
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=41395
7795
 */
9220
 */
7796
public void test0138(){
9221
public void test0138_Diet(){
7797
	String str =
9222
	String str =
7798
		"public class X{\n" + 
9223
		"public class X{\n" + 
7799
		"  public void foo() {\n" + 
9224
		"  public void foo() {\n" + 
Lines 7836-7862 Link Here
7836
			completionIdentifier,
9261
			completionIdentifier,
7837
			expectedReplacedSource,
9262
			expectedReplacedSource,
7838
	"diet ast");
9263
	"diet ast");
7839
	
9264
}
7840
	expectedCompletionNodeToString = "<CompleteOnFieldName:void to>;";
9265
/*
7841
	expectedParentNodeToString = "<NONE>";
9266
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=41395
7842
	completionIdentifier = "to";
9267
 */
7843
	expectedReplacedSource = "toto";
9268
public void test0138_Method(){
7844
	expectedUnitDisplayString =
9269
	String str =
7845
		"public class X {\n" + 
9270
		"public class X{\n" + 
7846
		"  public X() {\n" + 
7847
		"  }\n" + 
7848
		"  public void foo() {\n" + 
9271
		"  public void foo() {\n" + 
7849
		"    new Y() {\n" + 
9272
		"    new Y() {\n" + 
7850
		"      public void bar() {\n" + 
9273
		"      public void bar() {\n" + 
9274
		"        switch (zzz){\n" + 
9275
		"          case 1 :\n" + 
9276
    	"          };\n" + 
9277
		"        }\n" + 
7851
		"        new Z() {\n" + 
9278
		"        new Z() {\n" + 
7852
		"          <CompleteOnFieldName:void to>;\n" + 
9279
		"          public void toto() {		\n" + 	
7853
		"          {\n" + 
9280
		"        }\n" + 
7854
		"          }\n" + 
9281
		"      });\n" + 
7855
		"        };\n" + 
9282
		"    });\n" + 
7856
		"      }\n" + 
7857
		"    };\n" + 
7858
		"  }\n" + 
9283
		"  }\n" + 
7859
		"}\n";
9284
		"}\n" + 
9285
		"\n";
9286
9287
9288
	String completeBehind = "to";
9289
	int cursorLocation = str.indexOf("to") + completeBehind.length() - 1;
9290
	String expectedCompletionNodeToString = "<CompleteOnFieldName:void to>;";
9291
	String expectedParentNodeToString = "<NONE>";
9292
	String completionIdentifier = "to";
9293
	String expectedReplacedSource = "toto";
9294
	String expectedUnitDisplayString =
9295
			"public class X {\n" + 
9296
			"  public X() {\n" + 
9297
			"  }\n" + 
9298
			"  public void foo() {\n" + 
9299
			"    new Y() {\n" + 
9300
			"      public void bar() {\n" + 
9301
			"        new Z() {\n" + 
9302
			"          <CompleteOnFieldName:void to>;\n" + 
9303
			"          {\n" + 
9304
			"          }\n" + 
9305
			"        };\n" + 
9306
			"      }\n" + 
9307
			"    };\n" + 
9308
			"  }\n" + 
9309
			"}\n";
7860
9310
7861
	checkMethodParse(
9311
	checkMethodParse(
7862
			str.toCharArray(),
9312
			str.toCharArray(),
Lines 7992-7998 Link Here
7992
/*
9442
/*
7993
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=39499
9443
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=39499
7994
 */
9444
 */
7995
public void test0142(){
9445
public void test0142_Diet(){
7996
	String str =
9446
	String str =
7997
		"public class X{\n" + 
9447
		"public class X{\n" + 
7998
		"  public void foo() {\n" + 
9448
		"  public void foo() {\n" + 
Lines 8029-8051 Link Here
8029
			completionIdentifier,
9479
			completionIdentifier,
8030
			expectedReplacedSource,
9480
			expectedReplacedSource,
8031
	"diet ast");
9481
	"diet ast");
8032
	
9482
}
8033
	expectedCompletionNodeToString = "<CompleteOnKeyword:instanceof>";
9483
/*
8034
	expectedParentNodeToString = "<NONE>";
9484
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=39499
8035
	completionIdentifier = "instanceof";
9485
 */
8036
	expectedReplacedSource = "instanceof";
9486
public void test0142_Method(){
8037
	expectedUnitDisplayString =
9487
	String str =
8038
		"public class X {\n" + 
9488
		"public class X{\n" + 
8039
		"  public X() {\n" + 
8040
		"  }\n" + 
8041
		"  public void foo() {\n" + 
9489
		"  public void foo() {\n" + 
8042
		"    new Object() {\n" + 
9490
		"    bar(new Object(){\n" + 
8043
		"      public void toto() {\n" + 
9491
		"      public void toto() {\n" + 
8044
		"        <CompleteOnKeyword:instanceof>;\n" + 
9492
		"        if(a instanceof Object) {}\n" + 
8045
		"      }\n" + 
9493
		"      }\n" + 
8046
		"    };\n" + 
9494
    	"    });\n" + 
8047
		"  }\n" + 
9495
		"  }\n" + 
8048
		"}\n";
9496
		"}\n" + 
9497
		"\n";
9498
9499
9500
	String completeBehind = "instanceof";
9501
	int cursorLocation = str.indexOf("instanceof") + completeBehind.length() - 1;
9502
	String expectedCompletionNodeToString = "<CompleteOnKeyword:instanceof>";
9503
	String expectedParentNodeToString = "<NONE>";
9504
	String completionIdentifier = "instanceof";
9505
	String expectedReplacedSource = "instanceof";
9506
	String expectedUnitDisplayString =
9507
			"public class X {\n" + 
9508
			"  public X() {\n" + 
9509
			"  }\n" + 
9510
			"  public void foo() {\n" + 
9511
			"    new Object() {\n" + 
9512
			"      public void toto() {\n" + 
9513
			"        <CompleteOnKeyword:instanceof>;\n" + 
9514
			"      }\n" + 
9515
			"    };\n" + 
9516
			"  }\n" + 
9517
			"}\n";
8049
9518
8050
	checkMethodParse(
9519
	checkMethodParse(
8051
			str.toCharArray(),
9520
			str.toCharArray(),
Lines 8060-8066 Link Here
8060
/*
9529
/*
8061
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
9530
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8062
 */
9531
 */
8063
public void test0143(){
9532
public void test0143_Diet(){
8064
	String str =
9533
	String str =
8065
		"public class X{\n" + 
9534
		"public class X{\n" + 
8066
		"  public void foo() {\n" + 
9535
		"  public void foo() {\n" + 
Lines 8094-8113 Link Here
8094
			completionIdentifier,
9563
			completionIdentifier,
8095
			expectedReplacedSource,
9564
			expectedReplacedSource,
8096
	"diet ast");
9565
	"diet ast");
8097
	
9566
}
8098
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
9567
/*
8099
	expectedParentNodeToString = "<NONE>";
9568
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8100
	completionIdentifier = "bar";
9569
 */
8101
	expectedReplacedSource = "bar";
9570
public void test0143_Method(){
8102
	expectedUnitDisplayString =
9571
	String str =
8103
		"public class X {\n" + 
9572
		"public class X{\n" + 
8104
		"  public X() {\n" + 
8105
		"  }\n" + 
8106
		"  public void foo() {\n" + 
9573
		"  public void foo() {\n" + 
8107
		"    Object o;\n" + 
9574
		"    Object o =(int) tmp;\n" + 
8108
		"    <CompleteOnName:bar>;\n" + 
9575
		"    bar\n" + 
8109
		"  }\n" + 
9576
		"  }\n" + 
8110
		"}\n";
9577
		"}\n" + 
9578
		"\n";
9579
9580
9581
	String completeBehind = "bar";
9582
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
9583
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
9584
	String expectedParentNodeToString = "<NONE>";
9585
	String completionIdentifier = "bar";
9586
	String expectedReplacedSource = "bar";
9587
	String expectedUnitDisplayString =
9588
			"public class X {\n" + 
9589
			"  public X() {\n" + 
9590
			"  }\n" + 
9591
			"  public void foo() {\n" + 
9592
			"    Object o;\n" + 
9593
			"    <CompleteOnName:bar>;\n" + 
9594
			"  }\n" + 
9595
			"}\n";
8111
9596
8112
	checkMethodParse(
9597
	checkMethodParse(
8113
			str.toCharArray(),
9598
			str.toCharArray(),
Lines 8122-8128 Link Here
8122
/*
9607
/*
8123
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
9608
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8124
 */
9609
 */
8125
public void test0144(){
9610
public void test0144_Diet(){
8126
	String str =
9611
	String str =
8127
		"public class X{\n" + 
9612
		"public class X{\n" + 
8128
		"  public void foo() {\n" + 
9613
		"  public void foo() {\n" + 
Lines 8156-8175 Link Here
8156
			completionIdentifier,
9641
			completionIdentifier,
8157
			expectedReplacedSource,
9642
			expectedReplacedSource,
8158
	"diet ast");
9643
	"diet ast");
8159
	
9644
}
8160
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
9645
/*
8161
	expectedParentNodeToString = "<NONE>";
9646
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8162
	completionIdentifier = "bar";
9647
 */
8163
	expectedReplacedSource = "bar";
9648
public void test0144_Method(){
8164
	expectedUnitDisplayString =
9649
	String str =
8165
		"public class X {\n" + 
9650
		"public class X{\n" + 
8166
		"  public X() {\n" + 
8167
		"  }\n" + 
8168
		"  public void foo() {\n" + 
9651
		"  public void foo() {\n" + 
8169
		"    Object o;\n" + 
9652
		"    Object o =(int[]) tmp;\n" + 
8170
		"    <CompleteOnName:bar>;\n" + 
9653
		"    bar\n" + 
8171
		"  }\n" + 
9654
		"  }\n" + 
8172
		"}\n";
9655
		"}\n" + 
9656
		"\n";
9657
9658
9659
	String completeBehind = "bar";
9660
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
9661
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
9662
	String expectedParentNodeToString = "<NONE>";
9663
	String completionIdentifier = "bar";
9664
	String expectedReplacedSource = "bar";
9665
	String expectedUnitDisplayString =
9666
			"public class X {\n" + 
9667
			"  public X() {\n" + 
9668
			"  }\n" + 
9669
			"  public void foo() {\n" + 
9670
			"    Object o;\n" + 
9671
			"    <CompleteOnName:bar>;\n" + 
9672
			"  }\n" + 
9673
			"}\n";
8173
9674
8174
	checkMethodParse(
9675
	checkMethodParse(
8175
			str.toCharArray(),
9676
			str.toCharArray(),
Lines 8184-8190 Link Here
8184
/*
9685
/*
8185
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
9686
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8186
 */
9687
 */
8187
public void test0145(){
9688
public void test0145_Diet(){
8188
	String str =
9689
	String str =
8189
		"public class X{\n" + 
9690
		"public class X{\n" + 
8190
		"  public void foo() {\n" + 
9691
		"  public void foo() {\n" + 
Lines 8218-8237 Link Here
8218
			completionIdentifier,
9719
			completionIdentifier,
8219
			expectedReplacedSource,
9720
			expectedReplacedSource,
8220
	"diet ast");
9721
	"diet ast");
8221
	
9722
}
8222
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
9723
/*
8223
	expectedParentNodeToString = "<NONE>";
9724
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8224
	completionIdentifier = "bar";
9725
 */
8225
	expectedReplacedSource = "bar";
9726
public void test0145_Method(){
8226
	expectedUnitDisplayString =
9727
	String str =
8227
		"public class X {\n" + 
9728
		"public class X{\n" + 
8228
		"  public X() {\n" + 
8229
		"  }\n" + 
8230
		"  public void foo() {\n" + 
9729
		"  public void foo() {\n" + 
8231
		"    Object o;\n" + 
9730
		"    Object o =(X) tmp;\n" + 
8232
		"    <CompleteOnName:bar>;\n" + 
9731
		"    bar\n" + 
8233
		"  }\n" + 
9732
		"  }\n" + 
8234
		"}\n";
9733
		"}\n" + 
9734
		"\n";
9735
9736
9737
	String completeBehind = "bar";
9738
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
9739
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
9740
	String expectedParentNodeToString = "<NONE>";
9741
	String completionIdentifier = "bar";
9742
	String expectedReplacedSource = "bar";
9743
	String expectedUnitDisplayString =
9744
			"public class X {\n" + 
9745
			"  public X() {\n" + 
9746
			"  }\n" + 
9747
			"  public void foo() {\n" + 
9748
			"    Object o;\n" + 
9749
			"    <CompleteOnName:bar>;\n" + 
9750
			"  }\n" + 
9751
			"}\n";
8235
9752
8236
	checkMethodParse(
9753
	checkMethodParse(
8237
			str.toCharArray(),
9754
			str.toCharArray(),
Lines 8246-8252 Link Here
8246
/*
9763
/*
8247
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
9764
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8248
 */
9765
 */
8249
public void test0146(){
9766
public void test0146_Diet(){
8250
	String str =
9767
	String str =
8251
		"public class X{\n" + 
9768
		"public class X{\n" + 
8252
		"  public void foo() {\n" + 
9769
		"  public void foo() {\n" + 
Lines 8280-8299 Link Here
8280
			completionIdentifier,
9797
			completionIdentifier,
8281
			expectedReplacedSource,
9798
			expectedReplacedSource,
8282
	"diet ast");
9799
	"diet ast");
8283
	
9800
}
8284
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
9801
/*
8285
	expectedParentNodeToString = "<NONE>";
9802
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8286
	completionIdentifier = "bar";
9803
 */
8287
	expectedReplacedSource = "bar";
9804
public void test0146_Method(){
8288
	expectedUnitDisplayString =
9805
	String str =
8289
		"public class X {\n" + 
9806
		"public class X{\n" + 
8290
		"  public X() {\n" + 
8291
		"  }\n" + 
8292
		"  public void foo() {\n" + 
9807
		"  public void foo() {\n" + 
8293
		"    Object o;\n" + 
9808
		"    Object o =(X[]) tmp;\n" + 
8294
		"    <CompleteOnName:bar>;\n" + 
9809
		"    bar\n" + 
8295
		"  }\n" + 
9810
		"  }\n" + 
8296
		"}\n";
9811
		"}\n" + 
9812
		"\n";
9813
9814
9815
	String completeBehind = "bar";
9816
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
9817
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
9818
	String expectedParentNodeToString = "<NONE>";
9819
	String completionIdentifier = "bar";
9820
	String expectedReplacedSource = "bar";
9821
	String expectedUnitDisplayString =
9822
			"public class X {\n" + 
9823
			"  public X() {\n" + 
9824
			"  }\n" + 
9825
			"  public void foo() {\n" + 
9826
			"    Object o;\n" + 
9827
			"    <CompleteOnName:bar>;\n" + 
9828
			"  }\n" + 
9829
			"}\n";
8297
9830
8298
	checkMethodParse(
9831
	checkMethodParse(
8299
			str.toCharArray(),
9832
			str.toCharArray(),
Lines 8384-8390 Link Here
8384
/*
9917
/*
8385
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
9918
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
8386
 */
9919
 */
8387
public void test0149(){
9920
public void test0149_Diet(){
8388
	String str =
9921
	String str =
8389
		"public class X{\n" + 
9922
		"public class X{\n" + 
8390
		"  public void foo() {\n" + 
9923
		"  public void foo() {\n" + 
Lines 8418-8440 Link Here
8418
			completionIdentifier,
9951
			completionIdentifier,
8419
			expectedReplacedSource,
9952
			expectedReplacedSource,
8420
	"diet ast");
9953
	"diet ast");
8421
	
9954
}
8422
	expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
9955
/*
8423
	expectedParentNodeToString = "(titi & <CompleteOnName:ZZ>)";
9956
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
8424
	completionIdentifier = "ZZ";
9957
 */
8425
	expectedReplacedSource = "ZZ";
9958
public void test0149_Method(){
8426
	expectedUnitDisplayString =
9959
	String str =
8427
		"public class X {\n" + 
9960
		"public class X{\n" + 
8428
		"  public X() {\n" + 
8429
		"  }\n" + 
8430
		"  public void foo() {\n" + 
9961
		"  public void foo() {\n" + 
8431
		"    new Object() {\n" + 
9962
		"    new Object(){\n" + 
8432
		"      void bar() {\n" + 
9963
		"      void bar(){\n" + 
8433
		"        (titi & <CompleteOnName:ZZ>);\n" + 
9964
		"        if((titi & (ZZ\n" + 
8434
		"      }\n" + 
9965
		"}\n" + 
8435
		"    };\n" + 
9966
		"\n";
8436
		"  }\n" + 
9967
8437
		"}\n";
9968
9969
	String completeBehind = "ZZ";
9970
	int cursorLocation = str.indexOf("ZZ") + completeBehind.length() - 1;
9971
	String expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
9972
	String expectedParentNodeToString = "(titi & <CompleteOnName:ZZ>)";
9973
	String completionIdentifier = "ZZ";
9974
	String expectedReplacedSource = "ZZ";
9975
	String expectedUnitDisplayString =
9976
			"public class X {\n" + 
9977
			"  public X() {\n" + 
9978
			"  }\n" + 
9979
			"  public void foo() {\n" + 
9980
			"    new Object() {\n" + 
9981
			"      void bar() {\n" + 
9982
			"        (titi & <CompleteOnName:ZZ>);\n" + 
9983
			"      }\n" + 
9984
			"    };\n" + 
9985
			"  }\n" + 
9986
			"}\n";
8438
9987
8439
	checkMethodParse(
9988
	checkMethodParse(
8440
			str.toCharArray(),
9989
			str.toCharArray(),
Lines 8449-8455 Link Here
8449
/*
9998
/*
8450
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
9999
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
8451
 */
10000
 */
8452
public void test0150(){
10001
public void test0150_Diet(){
8453
	String str =
10002
	String str =
8454
		"public class X{\n" + 
10003
		"public class X{\n" + 
8455
		"  public void foo() {\n" + 
10004
		"  public void foo() {\n" + 
Lines 8481-8499 Link Here
8481
			completionIdentifier,
10030
			completionIdentifier,
8482
			expectedReplacedSource,
10031
			expectedReplacedSource,
8483
	"diet ast");
10032
	"diet ast");
8484
	
10033
}
8485
	expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
10034
/*
8486
	expectedParentNodeToString = "(titi & <CompleteOnName:ZZ>)";
10035
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=91371
8487
	completionIdentifier = "ZZ";
10036
 */
8488
	expectedReplacedSource = "ZZ";
10037
public void test0150_Method(){
8489
	expectedUnitDisplayString =
10038
	String str =
8490
		"public class X {\n" + 
10039
		"public class X{\n" + 
8491
		"  public X() {\n" + 
8492
		"  }\n" + 
8493
		"  public void foo() {\n" + 
10040
		"  public void foo() {\n" + 
8494
		"    (titi & <CompleteOnName:ZZ>);\n" + 
10041
		"    if((titi & (ZZ\n" + 
8495
		"  }\n" + 
10042
		"}\n" + 
8496
		"}\n";
10043
		"\n";
10044
10045
10046
	String completeBehind = "ZZ";
10047
	int cursorLocation = str.indexOf("ZZ") + completeBehind.length() - 1;
10048
	String expectedCompletionNodeToString = "<CompleteOnName:ZZ>";
10049
	String expectedParentNodeToString = "(titi & <CompleteOnName:ZZ>)";
10050
	String completionIdentifier = "ZZ";
10051
	String expectedReplacedSource = "ZZ";
10052
	String expectedUnitDisplayString =
10053
			"public class X {\n" + 
10054
			"  public X() {\n" + 
10055
			"  }\n" + 
10056
			"  public void foo() {\n" + 
10057
			"    (titi & <CompleteOnName:ZZ>);\n" + 
10058
			"  }\n" + 
10059
			"}\n";
8497
10060
8498
	checkMethodParse(
10061
	checkMethodParse(
8499
			str.toCharArray(),
10062
			str.toCharArray(),
Lines 8508-8514 Link Here
8508
/*
10071
/*
8509
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=92451
10072
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=92451
8510
 */
10073
 */
8511
public void test0151(){
10074
public void test0151_Diet(){
8512
	String str =
10075
	String str =
8513
		"public class X {\n" + 
10076
		"public class X {\n" + 
8514
		"  public static void main(String[] args) {\n" + 
10077
		"  public static void main(String[] args) {\n" + 
Lines 8542-8562 Link Here
8542
			completionIdentifier,
10105
			completionIdentifier,
8543
			expectedReplacedSource,
10106
			expectedReplacedSource,
8544
	"diet ast");
10107
	"diet ast");
8545
	
10108
}
8546
	expectedCompletionNodeToString = "<CompleteOnName:>";
10109
/*
8547
	expectedParentNodeToString = "<NONE>";
10110
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=92451
8548
	completionIdentifier = "";
10111
 */
8549
	expectedReplacedSource = "";
10112
public void test0151_Method(){
8550
	expectedUnitDisplayString =
10113
	String str =
8551
		"public class X {\n" + 
10114
		"public class X {\n" + 
8552
		"  public X() {\n" + 
8553
		"  }\n" + 
8554
		"  public static void main(String[] args) {\n" + 
10115
		"  public static void main(String[] args) {\n" + 
8555
		"    java.util.List elements;\n" + 
10116
 		"    java.util.List elements = null;\n" + 
8556
		"    <CompleteOnName:>;\n" + 
10117
 		"    new Test(Test.toStrings((Test[])elements.toArray(new Test[0])));\n" + 
10118
		"     //code assist fails on this line\n" + 
8557
		"  }\n" + 
10119
		"  }\n" + 
8558
		"}\n";
10120
		"}\n";
8559
10121
10122
10123
	String completeBehind = "";
10124
	int cursorLocation = str.indexOf(" //code assis") + completeBehind.length() - 1;
10125
	String expectedCompletionNodeToString = "<CompleteOnName:>";
10126
	String expectedParentNodeToString = "<NONE>";
10127
	String completionIdentifier = "";
10128
	String expectedReplacedSource = "";
10129
	String expectedUnitDisplayString =
10130
			"public class X {\n" + 
10131
			"  public X() {\n" + 
10132
			"  }\n" + 
10133
			"  public static void main(String[] args) {\n" + 
10134
			"    java.util.List elements;\n" + 
10135
			"    <CompleteOnName:>;\n" + 
10136
			"  }\n" + 
10137
			"}\n";
10138
8560
	checkMethodParse(
10139
	checkMethodParse(
8561
			str.toCharArray(),
10140
			str.toCharArray(),
8562
			cursorLocation,
10141
			cursorLocation,
Lines 8616-8622 Link Here
8616
/*
10195
/*
8617
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
10196
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8618
 */
10197
 */
8619
public void test0153(){
10198
public void test0153_Diet(){
8620
	String str =
10199
	String str =
8621
		"public class X {\n" + 
10200
		"public class X {\n" + 
8622
		"  void foo() {\n" + 
10201
		"  void foo() {\n" + 
Lines 8650-8669 Link Here
8650
			completionIdentifier,
10229
			completionIdentifier,
8651
			expectedReplacedSource,
10230
			expectedReplacedSource,
8652
	"diet ast");
10231
	"diet ast");
8653
	
10232
}
8654
	expectedCompletionNodeToString = "break <CompleteOnLabel:lab>;";
10233
/*
8655
	expectedParentNodeToString = "<NONE>";
10234
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8656
	completionIdentifier = "lab";
10235
 */
8657
	expectedReplacedSource = "lab";
10236
public void test0153_Method(){
8658
	expectedUnitDisplayString =
10237
	String str =
8659
		"public class X {\n" + 
10238
		"public class X {\n" + 
8660
		"  public X() {\n" + 
8661
		"  }\n" + 
8662
		"  void foo() {\n" + 
10239
		"  void foo() {\n" + 
8663
		"    break <CompleteOnLabel:lab>;\n" + 
10240
 		"    label1 : for(;;) {\n" + 
10241
 		"      break lab\n" + 
10242
 		"    }\n" + 
8664
		"  }\n" + 
10243
		"  }\n" + 
8665
		"}\n";
10244
		"}\n";
8666
10245
10246
10247
	String completeBehind = "lab";
10248
	int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
10249
	String expectedCompletionNodeToString = "break <CompleteOnLabel:lab>;";
10250
	String expectedParentNodeToString = "<NONE>";
10251
	String completionIdentifier = "lab";
10252
	String expectedReplacedSource = "lab";
10253
	String expectedUnitDisplayString =
10254
			"public class X {\n" + 
10255
			"  public X() {\n" + 
10256
			"  }\n" + 
10257
			"  void foo() {\n" + 
10258
			"    break <CompleteOnLabel:lab>;\n" + 
10259
			"  }\n" + 
10260
			"}\n";
10261
8667
	checkMethodParse(
10262
	checkMethodParse(
8668
			str.toCharArray(),
10263
			str.toCharArray(),
8669
			cursorLocation,
10264
			cursorLocation,
Lines 8677-8683 Link Here
8677
/*
10272
/*
8678
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
10273
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8679
 */
10274
 */
8680
public void test0154(){
10275
public void test0154_Diet(){
8681
	String str =
10276
	String str =
8682
		"public class X {\n" + 
10277
		"public class X {\n" + 
8683
		"  void foo() {\n" + 
10278
		"  void foo() {\n" + 
Lines 8712-8733 Link Here
8712
			completionIdentifier,
10307
			completionIdentifier,
8713
			expectedReplacedSource,
10308
			expectedReplacedSource,
8714
	"diet ast");
10309
	"diet ast");
8715
	
10310
}
8716
	expectedCompletionNodeToString = "break <CompleteOnLabel:lab>;";
10311
/*
8717
	expectedParentNodeToString = "<NONE>";
10312
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8718
	completionIdentifier = "lab";
10313
 */
8719
	expectedReplacedSource = "lab";
10314
public void test0154_Method(){
8720
	expectedUnitDisplayString =
10315
	String str =
8721
		"public class X {\n" + 
10316
		"public class X {\n" + 
8722
		"  public X() {\n" + 
8723
		"  }\n" + 
8724
		"  void foo() {\n" + 
10317
		"  void foo() {\n" + 
8725
		"    {\n" + 
10318
		"    #\n" + 
8726
		"      break <CompleteOnLabel:lab>;\n" + 
10319
 		"    label1 : for(;;) {\n" + 
8727
		"    }\n" + 
10320
 		"      break lab\n" + 
10321
 		"    }\n" + 
8728
		"  }\n" + 
10322
		"  }\n" + 
8729
		"}\n";
10323
		"}\n";
8730
10324
10325
10326
	String completeBehind = "lab";
10327
	int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
10328
	String expectedCompletionNodeToString = "break <CompleteOnLabel:lab>;";
10329
	String expectedParentNodeToString = "<NONE>";
10330
	String completionIdentifier = "lab";
10331
	String expectedReplacedSource = "lab";
10332
	String expectedUnitDisplayString =
10333
			"public class X {\n" + 
10334
			"  public X() {\n" + 
10335
			"  }\n" + 
10336
			"  void foo() {\n" + 
10337
			"    {\n" + 
10338
			"      break <CompleteOnLabel:lab>;\n" + 
10339
			"    }\n" + 
10340
			"  }\n" + 
10341
			"}\n";
10342
8731
	checkMethodParse(
10343
	checkMethodParse(
8732
			str.toCharArray(),
10344
			str.toCharArray(),
8733
			cursorLocation,
10345
			cursorLocation,
Lines 8741-8747 Link Here
8741
/*
10353
/*
8742
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
10354
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8743
 */
10355
 */
8744
public void test0155(){
10356
public void test0155_Diet(){
8745
	String str =
10357
	String str =
8746
		"public class X {\n" + 
10358
		"public class X {\n" + 
8747
		"  void foo() {\n" + 
10359
		"  void foo() {\n" + 
Lines 8775-8794 Link Here
8775
			completionIdentifier,
10387
			completionIdentifier,
8776
			expectedReplacedSource,
10388
			expectedReplacedSource,
8777
	"diet ast");
10389
	"diet ast");
8778
	
10390
}
8779
	expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10391
/*
8780
	expectedParentNodeToString = "<NONE>";
10392
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8781
	completionIdentifier = "lab";
10393
 */
8782
	expectedReplacedSource = "lab";
10394
public void test0155_Method(){
8783
	expectedUnitDisplayString =
10395
	String str =
8784
		"public class X {\n" + 
10396
		"public class X {\n" + 
8785
		"  public X() {\n" + 
8786
		"  }\n" + 
8787
		"  void foo() {\n" + 
10397
		"  void foo() {\n" + 
8788
		"    continue <CompleteOnLabel:lab>;\n" + 
10398
 		"    label1 : for(;;) {\n" + 
10399
 		"      continue lab\n" + 
10400
 		"    }\n" + 
8789
		"  }\n" + 
10401
		"  }\n" + 
8790
		"}\n";
10402
		"}\n";
8791
10403
10404
10405
	String completeBehind = "lab";
10406
	int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
10407
	String expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10408
	String expectedParentNodeToString = "<NONE>";
10409
	String completionIdentifier = "lab";
10410
	String expectedReplacedSource = "lab";
10411
	String expectedUnitDisplayString =
10412
			"public class X {\n" + 
10413
			"  public X() {\n" + 
10414
			"  }\n" + 
10415
			"  void foo() {\n" + 
10416
			"    continue <CompleteOnLabel:lab>;\n" + 
10417
			"  }\n" + 
10418
			"}\n";
10419
8792
	checkMethodParse(
10420
	checkMethodParse(
8793
			str.toCharArray(),
10421
			str.toCharArray(),
8794
			cursorLocation,
10422
			cursorLocation,
Lines 8802-8808 Link Here
8802
/*
10430
/*
8803
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
10431
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8804
 */
10432
 */
8805
public void test0156(){
10433
public void test0156_Diet(){
8806
	String str =
10434
	String str =
8807
		"public class X {\n" + 
10435
		"public class X {\n" + 
8808
		"  void foo() {\n" + 
10436
		"  void foo() {\n" + 
Lines 8837-8858 Link Here
8837
			completionIdentifier,
10465
			completionIdentifier,
8838
			expectedReplacedSource,
10466
			expectedReplacedSource,
8839
	"diet ast");
10467
	"diet ast");
8840
	
10468
}
8841
	expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10469
/*
8842
	expectedParentNodeToString = "<NONE>";
10470
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8843
	completionIdentifier = "lab";
10471
 */
8844
	expectedReplacedSource = "lab";
10472
public void test0156_Method(){
8845
	expectedUnitDisplayString =
10473
	String str =
8846
		"public class X {\n" + 
10474
		"public class X {\n" + 
8847
		"  public X() {\n" + 
8848
		"  }\n" + 
8849
		"  void foo() {\n" + 
10475
		"  void foo() {\n" + 
8850
		"    {\n" + 
10476
		"    #\n" + 
8851
		"      continue <CompleteOnLabel:lab>;\n" + 
10477
 		"    label1 : for(;;) {\n" + 
8852
		"    }\n" + 
10478
 		"      continue lab\n" + 
10479
 		"    }\n" + 
8853
		"  }\n" + 
10480
		"  }\n" + 
8854
		"}\n";
10481
		"}\n";
8855
10482
10483
10484
	String completeBehind = "lab";
10485
	int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
10486
	String expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10487
	String expectedParentNodeToString = "<NONE>";
10488
	String completionIdentifier = "lab";
10489
	String expectedReplacedSource = "lab";
10490
	String expectedUnitDisplayString =
10491
			"public class X {\n" + 
10492
			"  public X() {\n" + 
10493
			"  }\n" + 
10494
			"  void foo() {\n" + 
10495
			"    {\n" + 
10496
			"      continue <CompleteOnLabel:lab>;\n" + 
10497
			"    }\n" + 
10498
			"  }\n" + 
10499
			"}\n";
10500
8856
	checkMethodParse(
10501
	checkMethodParse(
8857
			str.toCharArray(),
10502
			str.toCharArray(),
8858
			cursorLocation,
10503
			cursorLocation,
Lines 8866-8872 Link Here
8866
/*
10511
/*
8867
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
10512
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8868
 */
10513
 */
8869
public void test0157(){
10514
public void test0157_Diet(){
8870
	String str =
10515
	String str =
8871
		"public class X {\n" + 
10516
		"public class X {\n" + 
8872
		"  void foo() {\n" + 
10517
		"  void foo() {\n" + 
Lines 8906-8934 Link Here
8906
			completionIdentifier,
10551
			completionIdentifier,
8907
			expectedReplacedSource,
10552
			expectedReplacedSource,
8908
	"diet ast");
10553
	"diet ast");
8909
	
10554
}
8910
	expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10555
/*
8911
	expectedParentNodeToString = "<NONE>";
10556
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8912
	completionIdentifier = "lab";
10557
 */
8913
	expectedReplacedSource = "lab";
10558
public void test0157_Method(){
8914
	expectedUnitDisplayString =
10559
	String str =
8915
		"public class X {\n" + 
10560
		"public class X {\n" + 
8916
		"  public X() {\n" + 
8917
		"  }\n" + 
8918
		"  void foo() {\n" + 
10561
		"  void foo() {\n" + 
8919
		"    {\n" + 
10562
		"    #\n" + 
8920
		"      class X {\n" + 
10563
 		"    label1 : for(;;) {\n" + 
8921
		"        X() {\n" + 
10564
 		"      class X {\n" + 
8922
		"          super();\n" + 
10565
 		"        void foo() {\n" + 
8923
		"        }\n" + 
10566
 		"          label2 : for(;;) foo();\n" + 
8924
		"        void foo() {\n" + 
10567
 		"        }\n" + 
8925
		"        }\n" + 
10568
 		"      }\n" + 
8926
		"      }\n" + 
10569
 		"      continue lab\n" + 
8927
		"      continue <CompleteOnLabel:lab>;\n" + 
10570
 		"    }\n" + 
8928
		"    }\n" + 
8929
		"  }\n" + 
10571
		"  }\n" + 
8930
		"}\n";
10572
		"}\n";
8931
10573
10574
10575
	String completeBehind = "lab";
10576
	int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
10577
	String expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10578
	String expectedParentNodeToString = "<NONE>";
10579
	String completionIdentifier = "lab";
10580
	String expectedReplacedSource = "lab";
10581
	String expectedUnitDisplayString =
10582
			"public class X {\n" + 
10583
			"  public X() {\n" + 
10584
			"  }\n" + 
10585
			"  void foo() {\n" + 
10586
			"    {\n" + 
10587
			"      class X {\n" + 
10588
			"        X() {\n" + 
10589
			"          super();\n" + 
10590
			"        }\n" + 
10591
			"        void foo() {\n" + 
10592
			"        }\n" + 
10593
			"      }\n" + 
10594
			"      continue <CompleteOnLabel:lab>;\n" + 
10595
			"    }\n" + 
10596
			"  }\n" + 
10597
			"}\n";
10598
8932
	checkMethodParse(
10599
	checkMethodParse(
8933
			str.toCharArray(),
10600
			str.toCharArray(),
8934
			cursorLocation,
10601
			cursorLocation,
Lines 8942-8948 Link Here
8942
/*
10609
/*
8943
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
10610
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8944
 */
10611
 */
8945
public void test0158(){
10612
public void test0158_Diet(){
8946
	String str =
10613
	String str =
8947
		"public class X {\n" + 
10614
		"public class X {\n" + 
8948
		"  void foo() {\n" + 
10615
		"  void foo() {\n" + 
Lines 8983-9012 Link Here
8983
			completionIdentifier,
10650
			completionIdentifier,
8984
			expectedReplacedSource,
10651
			expectedReplacedSource,
8985
	"diet ast");
10652
	"diet ast");
8986
	
10653
}
8987
	expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10654
/*
8988
	expectedParentNodeToString = "<NONE>";
10655
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=22072
8989
	completionIdentifier = "lab";
10656
 */
8990
	expectedReplacedSource = "lab";
10657
public void test0158_Method(){
8991
	expectedUnitDisplayString =
10658
	String str =
8992
		"public class X {\n" + 
10659
		"public class X {\n" + 
8993
		"  public X() {\n" + 
8994
		"  }\n" + 
8995
		"  void foo() {\n" + 
10660
		"  void foo() {\n" + 
8996
		"    {\n" + 
10661
		"    #\n" + 
8997
		"      class X {\n" + 
10662
 		"    label1 : for(;;) {\n" + 
8998
		"        X() {\n" + 
10663
 		"      class X {\n" + 
8999
		"        }\n" + 
10664
 		"        void foo() {\n" + 
9000
		"        void foo() {\n" + 
10665
 		"          label2 : for(;;) {\n" + 
9001
		"          {\n" + 
10666
 		"            continue lab\n" + 
9002
		"            continue <CompleteOnLabel:lab>;\n" + 
10667
 		"          }\n" + 
9003
		"          }\n" + 
10668
 		"        }\n" + 
9004
		"        }\n" + 
10669
 		"      }\n" + 
9005
		"      }\n" + 
10670
 		"    }\n" + 
9006
		"    }\n" + 
9007
		"  }\n" + 
10671
		"  }\n" + 
9008
		"}\n";
10672
		"}\n";
9009
10673
10674
10675
	String completeBehind = "lab";
10676
	int cursorLocation = str.lastIndexOf("lab") + completeBehind.length() - 1;
10677
	String expectedCompletionNodeToString = "continue <CompleteOnLabel:lab>;";
10678
	String expectedParentNodeToString = "<NONE>";
10679
	String completionIdentifier = "lab";
10680
	String expectedReplacedSource = "lab";
10681
	String expectedUnitDisplayString =
10682
			"public class X {\n" + 
10683
			"  public X() {\n" + 
10684
			"  }\n" + 
10685
			"  void foo() {\n" + 
10686
			"    {\n" + 
10687
			"      class X {\n" + 
10688
			"        X() {\n" + 
10689
			"        }\n" + 
10690
			"        void foo() {\n" + 
10691
			"          {\n" + 
10692
			"            continue <CompleteOnLabel:lab>;\n" + 
10693
			"          }\n" + 
10694
			"        }\n" + 
10695
			"      }\n" + 
10696
			"    }\n" + 
10697
			"  }\n" + 
10698
			"}\n";
10699
9010
	checkMethodParse(
10700
	checkMethodParse(
9011
			str.toCharArray(),
10701
			str.toCharArray(),
9012
			cursorLocation,
10702
			cursorLocation,
Lines 9191-9197 Link Here
9191
		testName);
10881
		testName);
9192
}
10882
}
9193
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122755
10883
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122755
9194
public void test0165() {
10884
public void test0165_Diet() {
9195
10885
9196
	String str = 
10886
	String str = 
9197
		"public class X {\n" +
10887
		"public class X {\n" +
Lines 9225-9243 Link Here
9225
			completionIdentifier,
10915
			completionIdentifier,
9226
			expectedReplacedSource,
10916
			expectedReplacedSource,
9227
	"diet ast");
10917
	"diet ast");
9228
	
10918
}
9229
	expectedCompletionNodeToString = "<CompleteOnName:>";
10919
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122755
9230
	expectedParentNodeToString = "<NONE>";
10920
public void test0165_Method() {
9231
	completionIdentifier = "";
10921
9232
	expectedReplacedSource = "";
10922
	String str = 
9233
	expectedUnitDisplayString =
10923
		"public class X {\n" +
9234
		"public class X {\n" + 
10924
		"	void foo() {" +
9235
		"  public X() {\n" + 
10925
		"	/**" +
9236
		"  }\n" + 
10926
		"	 *" +
9237
		"  void foo() {\n" + 
10927
		"	 */." +
9238
		"    <CompleteOnName:>;\n" + 
10928
		"	}" +
9239
		"  }\n" + 
10929
		"}\n"; 
9240
		"}\n";
10930
10931
	String completeBehind = "/.";
10932
	int cursorLocation = str.lastIndexOf("/.") + completeBehind.length() - 1;
10933
	String expectedCompletionNodeToString = "<CompleteOnName:>";
10934
	String expectedParentNodeToString = "<NONE>";
10935
	String completionIdentifier = "";
10936
	String expectedReplacedSource = "";
10937
	String expectedUnitDisplayString =
10938
			"public class X {\n" + 
10939
			"  public X() {\n" + 
10940
			"  }\n" + 
10941
			"  void foo() {\n" + 
10942
			"    <CompleteOnName:>;\n" + 
10943
			"  }\n" + 
10944
			"}\n";
9241
10945
9242
	checkMethodParse(
10946
	checkMethodParse(
9243
			str.toCharArray(),
10947
			str.toCharArray(),
Lines 9250-9256 Link Here
9250
			"full ast");
10954
			"full ast");
9251
}
10955
}
9252
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137623
10956
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137623
9253
public void test0166() {
10957
public void test0166_Diet() {
9254
10958
9255
	String str = 
10959
	String str = 
9256
		"public class X {\n" +
10960
		"public class X {\n" +
Lines 9285-9303 Link Here
9285
			completionIdentifier,
10989
			completionIdentifier,
9286
			expectedReplacedSource,
10990
			expectedReplacedSource,
9287
	"diet ast");
10991
	"diet ast");
9288
	
10992
}
9289
	expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:int.>";
10993
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=137623
9290
	expectedParentNodeToString = "<NONE>";
10994
public void test0166_Method() {
9291
	completionIdentifier = "";
10995
9292
	expectedReplacedSource = "int.";
10996
	String str = 
9293
	expectedUnitDisplayString =
10997
		"public class X {\n" +
9294
		"public class X {\n" + 
10998
		"	public boolean foo() {\n" +
9295
		"  public X() {\n" + 
10999
		"      if(this.equals(null))\n" +
9296
		"  }\n" + 
11000
		"      {\n" +
9297
		"  public boolean foo() {\n" + 
11001
		"         (zzz==int.\n" +
9298
		"    <CompleteOnClassLiteralAccess:int.>;\n" + 
11002
		"      }\n" +
9299
		"  }\n" + 
11003
		"   }" +
9300
		"}\n";
11004
		"}\n"; 
11005
11006
	String completeBehind = "int.";
11007
	int cursorLocation = str.lastIndexOf("int.") + completeBehind.length() - 1;
11008
	String expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:int.>";
11009
	String expectedParentNodeToString = "<NONE>";
11010
	String completionIdentifier = "";
11011
	String expectedReplacedSource = "int.";
11012
	String expectedUnitDisplayString =
11013
			"public class X {\n" + 
11014
			"  public X() {\n" + 
11015
			"  }\n" + 
11016
			"  public boolean foo() {\n" + 
11017
			"    <CompleteOnClassLiteralAccess:int.>;\n" + 
11018
			"  }\n" + 
11019
			"}\n";
9301
11020
9302
	checkMethodParse(
11021
	checkMethodParse(
9303
			str.toCharArray(),
11022
			str.toCharArray(),
Lines 9310-9316 Link Here
9310
			"full ast");
11029
			"full ast");
9311
}
11030
}
9312
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
11031
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9313
public void test0167() {
11032
public void test0167_Diet() {
9314
11033
9315
	String str = 
11034
	String str = 
9316
		"public class X {\n" +
11035
		"public class X {\n" +
Lines 9349-9382 Link Here
9349
			completionIdentifier,
11068
			completionIdentifier,
9350
			expectedReplacedSource,
11069
			expectedReplacedSource,
9351
	"diet ast");
11070
	"diet ast");
9352
	
11071
}
9353
	expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11072
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9354
	expectedParentNodeToString =
11073
public void test0167_Method() {
9355
		"try \n" + 
11074
9356
		"  {\n" + 
11075
	String str = 
9357
		"    throwing();\n" + 
11076
		"public class X {\n" +
9358
		"  }\n" + 
11077
		"	public boolean foo() {\n" +
9359
		"catch (IllegalAccessException e)   {\n" + 
11078
		"      try {\n" +
9360
		"  }\n" + 
11079
		"         throwing();\n" +
9361
		"catch (<CompleteOnException:IZZ>  )   {\n" + 
11080
		"      }\n" +
9362
		"  }";
11081
		"      catch (IllegalAccessException e) {\n" +
9363
	completionIdentifier = "IZZ";
11082
		"         bar();\n" +
9364
	expectedReplacedSource = "IZZ";
11083
		"      }\n" +
9365
	expectedUnitDisplayString =
11084
		"      catch (IZZ) {\n" +
9366
		"public class X {\n" + 
11085
		"      }\n" +
9367
		"  public X() {\n" + 
11086
		"   }" +
9368
		"  }\n" + 
11087
		"}\n"; 
9369
		"  public boolean foo() {\n" + 
11088
9370
		"    try \n" + 
11089
	String completeBehind = "IZZ";
9371
		"      {\n" + 
11090
	int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
9372
		"        throwing();\n" + 
11091
	String expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
9373
		"      }\n" + 
11092
	String expectedParentNodeToString =
9374
		"    catch (IllegalAccessException e)       {\n" + 
11093
			"try \n" + 
9375
		"      }\n" + 
11094
			"  {\n" + 
9376
		"    catch (<CompleteOnException:IZZ>  )       {\n" + 
11095
			"    throwing();\n" + 
9377
		"      }\n" + 
11096
			"  }\n" + 
9378
		"  }\n" + 
11097
			"catch (IllegalAccessException e)   {\n" + 
9379
		"}\n";
11098
			"  }\n" + 
11099
			"catch (<CompleteOnException:IZZ>  )   {\n" + 
11100
			"  }";
11101
	String completionIdentifier = "IZZ";
11102
	String expectedReplacedSource = "IZZ";
11103
	String expectedUnitDisplayString =
11104
			"public class X {\n" + 
11105
			"  public X() {\n" + 
11106
			"  }\n" + 
11107
			"  public boolean foo() {\n" + 
11108
			"    try \n" + 
11109
			"      {\n" + 
11110
			"        throwing();\n" + 
11111
			"      }\n" + 
11112
			"    catch (IllegalAccessException e)       {\n" + 
11113
			"      }\n" + 
11114
			"    catch (<CompleteOnException:IZZ>  )       {\n" + 
11115
			"      }\n" + 
11116
			"  }\n" + 
11117
			"}\n";
9380
11118
9381
	checkMethodParse(
11119
	checkMethodParse(
9382
			str.toCharArray(),
11120
			str.toCharArray(),
Lines 9389-9395 Link Here
9389
			"full ast");
11127
			"full ast");
9390
}
11128
}
9391
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
11129
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9392
public void test0168() {
11130
public void test0168_Diet() {
9393
11131
9394
	String str = 
11132
	String str = 
9395
		"public class X {\n" +
11133
		"public class X {\n" +
Lines 9427-9460 Link Here
9427
			completionIdentifier,
11165
			completionIdentifier,
9428
			expectedReplacedSource,
11166
			expectedReplacedSource,
9429
	"diet ast");
11167
	"diet ast");
9430
	
11168
}
9431
	expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11169
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9432
	expectedParentNodeToString =
11170
public void test0168_Method() {
9433
		"try \n" + 
11171
9434
		"  {\n" + 
11172
	String str = 
9435
		"    throwing();\n" + 
11173
		"public class X {\n" +
9436
		"  }\n" + 
11174
		"	public boolean foo() {\n" +
9437
		"catch (IllegalAccessException e)   {\n" + 
11175
		"      try {\n" +
9438
		"  }\n" + 
11176
		"         throwing();\n" +
9439
		"catch (<CompleteOnException:IZZ>  )   {\n" + 
11177
		"      }\n" +
9440
		"  }";
11178
		"      catch (IllegalAccessException e) {\n" +
9441
	completionIdentifier = "IZZ";
11179
		"         bar();\n" +
9442
	expectedReplacedSource = "IZZ";
11180
		"      }\n" +
9443
	expectedUnitDisplayString =
11181
		"      catch (IZZ\n" +
9444
		"public class X {\n" + 
11182
		"   }" +
9445
		"  public X() {\n" + 
11183
		"}\n"; 
9446
		"  }\n" + 
11184
9447
		"  public boolean foo() {\n" + 
11185
	String completeBehind = "IZZ";
9448
		"    try \n" + 
11186
	int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
9449
		"      {\n" + 
11187
	String expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
9450
		"        throwing();\n" + 
11188
	String expectedParentNodeToString =
9451
		"      }\n" + 
11189
			"try \n" + 
9452
		"    catch (IllegalAccessException e)       {\n" + 
11190
			"  {\n" + 
9453
		"      }\n" + 
11191
			"    throwing();\n" + 
9454
		"    catch (<CompleteOnException:IZZ>  )       {\n" + 
11192
			"  }\n" + 
9455
		"      }\n" + 
11193
			"catch (IllegalAccessException e)   {\n" + 
9456
		"  }\n" + 
11194
			"  }\n" + 
9457
		"}\n";
11195
			"catch (<CompleteOnException:IZZ>  )   {\n" + 
11196
			"  }";
11197
	String completionIdentifier = "IZZ";
11198
	String expectedReplacedSource = "IZZ";
11199
	String expectedUnitDisplayString =
11200
			"public class X {\n" + 
11201
			"  public X() {\n" + 
11202
			"  }\n" + 
11203
			"  public boolean foo() {\n" + 
11204
			"    try \n" + 
11205
			"      {\n" + 
11206
			"        throwing();\n" + 
11207
			"      }\n" + 
11208
			"    catch (IllegalAccessException e)       {\n" + 
11209
			"      }\n" + 
11210
			"    catch (<CompleteOnException:IZZ>  )       {\n" + 
11211
			"      }\n" + 
11212
			"  }\n" + 
11213
			"}\n";
9458
11214
9459
	checkMethodParse(
11215
	checkMethodParse(
9460
			str.toCharArray(),
11216
			str.toCharArray(),
Lines 9467-9473 Link Here
9467
			"full ast");
11223
			"full ast");
9468
}
11224
}
9469
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
11225
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9470
public void test0169() {
11226
public void test0169_Diet() {
9471
11227
9472
	String str = 
11228
	String str = 
9473
		"public class X {\n" +
11229
		"public class X {\n" +
Lines 9506-9524 Link Here
9506
			completionIdentifier,
11262
			completionIdentifier,
9507
			expectedReplacedSource,
11263
			expectedReplacedSource,
9508
	"diet ast");
11264
	"diet ast");
9509
	
11265
}
9510
	expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11266
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9511
	expectedParentNodeToString = "<NONE>";
11267
public void test0169_Method() {
9512
	completionIdentifier = "IZZ";
11268
9513
	expectedReplacedSource = "IZZ";
11269
	String str = 
9514
	expectedUnitDisplayString =
11270
		"public class X {\n" +
9515
		"public class X {\n" + 
11271
		"	public boolean foo() {\n" +
9516
		"  public X() {\n" + 
11272
		"      try {\n" +
9517
		"  }\n" + 
11273
		"         throwing();\n" +
9518
		"  public boolean foo() {\n" + 
11274
		"      }\n" +
9519
		"    <CompleteOnException:IZZ>;\n" + 
11275
		"      catch (IllegalAccessException e) {\n" +
9520
		"  }\n" + 
11276
		"         bar()\n" +
9521
		"}\n";
11277
		"      }\n" +
11278
		"      catch (IZZ) {\n" +
11279
		"      }\n" +
11280
		"   }" +
11281
		"}\n"; 
11282
11283
	String completeBehind = "IZZ";
11284
	int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
11285
	String expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11286
	String expectedParentNodeToString = "<NONE>";
11287
	String completionIdentifier = "IZZ";
11288
	String expectedReplacedSource = "IZZ";
11289
	String expectedUnitDisplayString =
11290
			"public class X {\n" + 
11291
			"  public X() {\n" + 
11292
			"  }\n" + 
11293
			"  public boolean foo() {\n" + 
11294
			"    <CompleteOnException:IZZ>;\n" + 
11295
			"  }\n" + 
11296
			"}\n";
9522
11297
9523
	checkMethodParse(
11298
	checkMethodParse(
9524
			str.toCharArray(),
11299
			str.toCharArray(),
Lines 9531-9537 Link Here
9531
			"full ast");
11306
			"full ast");
9532
}
11307
}
9533
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
11308
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9534
public void test0170() {
11309
public void test0170_Diet() {
9535
11310
9536
	String str = 
11311
	String str = 
9537
		"public class X {\n" +
11312
		"public class X {\n" +
Lines 9571-9589 Link Here
9571
			completionIdentifier,
11346
			completionIdentifier,
9572
			expectedReplacedSource,
11347
			expectedReplacedSource,
9573
	"diet ast");
11348
	"diet ast");
9574
	
11349
}
9575
	expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11350
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9576
	expectedParentNodeToString = "<NONE>";
11351
public void test0170_Method() {
9577
	completionIdentifier = "IZZ";
11352
9578
	expectedReplacedSource = "IZZ";
11353
	String str = 
9579
	expectedUnitDisplayString =
11354
		"public class X {\n" +
9580
		"public class X {\n" + 
11355
		"	public boolean foo() {\n" +
9581
		"  public X() {\n" + 
11356
		"      #\n" +
9582
		"  }\n" + 
11357
		"      try {\n" +
9583
		"  public boolean foo() {\n" + 
11358
		"         throwing();\n" +
9584
		"    <CompleteOnException:IZZ>;\n" + 
11359
		"      }\n" +
9585
		"  }\n" + 
11360
		"      catch (IllegalAccessException e) {\n" +
9586
		"}\n";
11361
		"         bar();\n" +
11362
		"      }\n" +
11363
		"      catch (IZZ) {\n" +
11364
		"      }\n" +
11365
		"   }" +
11366
		"}\n"; 
11367
11368
	String completeBehind = "IZZ";
11369
	int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
11370
	String expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11371
	String expectedParentNodeToString = "<NONE>";
11372
	String completionIdentifier = "IZZ";
11373
	String expectedReplacedSource = "IZZ";
11374
	String expectedUnitDisplayString =
11375
			"public class X {\n" + 
11376
			"  public X() {\n" + 
11377
			"  }\n" + 
11378
			"  public boolean foo() {\n" + 
11379
			"    <CompleteOnException:IZZ>;\n" + 
11380
			"  }\n" + 
11381
			"}\n";
9587
11382
9588
	checkMethodParse(
11383
	checkMethodParse(
9589
			str.toCharArray(),
11384
			str.toCharArray(),
Lines 9596-9602 Link Here
9596
			"full ast");
11391
			"full ast");
9597
}
11392
}
9598
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
11393
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9599
public void test0171() {
11394
public void test0171_Diet() {
9600
11395
9601
	String str = 
11396
	String str = 
9602
		"public class X {\n" +
11397
		"public class X {\n" +
Lines 9632-9662 Link Here
9632
			completionIdentifier,
11427
			completionIdentifier,
9633
			expectedReplacedSource,
11428
			expectedReplacedSource,
9634
	"diet ast");
11429
	"diet ast");
9635
	
11430
}
9636
	expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
11431
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9637
	expectedParentNodeToString =
11432
public void test0171_Method() {
9638
		"try \n" + 
11433
9639
		"  {\n" + 
11434
	String str = 
9640
		"    throwing();\n" + 
11435
		"public class X {\n" +
9641
		"  }\n" + 
11436
		"	public boolean foo() {\n" +
9642
		"catch (<CompleteOnException:IZZ>  )   {\n" + 
11437
		"      try {\n" +
9643
		"  }"
11438
		"         throwing();\n" +
9644
;
11439
		"      }\n" +
9645
	completionIdentifier = "IZZ";
11440
		"      catch (IZZ) {\n" +
9646
	expectedReplacedSource = "IZZ";
11441
		"      }\n" +
9647
	expectedUnitDisplayString =
11442
		"   }" +
9648
		"public class X {\n" + 
11443
		"}\n"; 
9649
		"  public X() {\n" + 
11444
9650
		"  }\n" + 
11445
	String completeBehind = "IZZ";
9651
		"  public boolean foo() {\n" + 
11446
	int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
9652
		"    try \n" + 
11447
	String expectedCompletionNodeToString = "<CompleteOnException:IZZ>";
9653
		"      {\n" + 
11448
	String expectedParentNodeToString =
9654
		"        throwing();\n" + 
11449
			"try \n" + 
9655
		"      }\n" + 
11450
			"  {\n" + 
9656
		"    catch (<CompleteOnException:IZZ>  )       {\n" + 
11451
			"    throwing();\n" + 
9657
		"      }\n" + 
11452
			"  }\n" + 
9658
		"  }\n" + 
11453
			"catch (<CompleteOnException:IZZ>  )   {\n" + 
9659
		"}\n";
11454
			"  }"
11455
	;
11456
	String completionIdentifier = "IZZ";
11457
	String expectedReplacedSource = "IZZ";
11458
	String expectedUnitDisplayString =
11459
			"public class X {\n" + 
11460
			"  public X() {\n" + 
11461
			"  }\n" + 
11462
			"  public boolean foo() {\n" + 
11463
			"    try \n" + 
11464
			"      {\n" + 
11465
			"        throwing();\n" + 
11466
			"      }\n" + 
11467
			"    catch (<CompleteOnException:IZZ>  )       {\n" + 
11468
			"      }\n" + 
11469
			"  }\n" + 
11470
			"}\n";
9660
11471
9661
	checkMethodParse(
11472
	checkMethodParse(
9662
			str.toCharArray(),
11473
			str.toCharArray(),
(-)src/org/eclipse/jdt/core/tests/compiler/parser/GenericsCompletionParserTest.java (-1325 / +2606 lines)
Lines 922-928 Link Here
922
			expectedReplacedSource,
922
			expectedReplacedSource,
923
	"diet ast");
923
	"diet ast");
924
}
924
}
925
public void test0030(){
925
public void test0030_Diet(){
926
	String str =
926
	String str =
927
		"public class X {\n" +
927
		"public class X {\n" +
928
		"  void foo() {\n" + 
928
		"  void foo() {\n" + 
Lines 954-972 Link Here
954
			completionIdentifier,
954
			completionIdentifier,
955
			expectedReplacedSource,
955
			expectedReplacedSource,
956
	"diet ast");
956
	"diet ast");
957
	
957
}
958
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
958
public void test0030_Method(){
959
	expectedParentNodeToString = "<NONE>";
959
	String str =
960
	completionIdentifier = "";
960
		"public class X {\n" +
961
	expectedReplacedSource = "Y<Z>.";
962
	expectedUnitDisplayString =
963
		"public class X {\n" + 
964
		"  public X() {\n" + 
965
		"  }\n" + 
966
		"  void foo() {\n" + 
961
		"  void foo() {\n" + 
967
		"    <CompleteOnType:Y<Z>.>;\n" + 
962
		"    Y<Z>.\n" + 
968
		"  }\n" + 
963
		"  }\n" + 
969
		"}\n";
964
		"}";
965
966
967
	String completeBehind = "Y<Z>.";
968
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
969
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
970
	String expectedParentNodeToString = "<NONE>";
971
	String completionIdentifier = "";
972
	String expectedReplacedSource = "Y<Z>.";
973
	String expectedUnitDisplayString =
974
			"public class X {\n" + 
975
			"  public X() {\n" + 
976
			"  }\n" + 
977
			"  void foo() {\n" + 
978
			"    <CompleteOnType:Y<Z>.>;\n" + 
979
			"  }\n" + 
980
			"}\n";
970
981
971
	checkMethodParse(
982
	checkMethodParse(
972
			str.toCharArray(),
983
			str.toCharArray(),
Lines 978-984 Link Here
978
			expectedReplacedSource,
989
			expectedReplacedSource,
979
			"full ast");
990
			"full ast");
980
}
991
}
981
public void test0031(){
992
public void test0031_Diet(){
982
	String str =
993
	String str =
983
		"public class X {\n" +
994
		"public class X {\n" +
984
		"  void foo() {\n" + 
995
		"  void foo() {\n" + 
Lines 1010-1028 Link Here
1010
			completionIdentifier,
1021
			completionIdentifier,
1011
			expectedReplacedSource,
1022
			expectedReplacedSource,
1012
	"diet ast");
1023
	"diet ast");
1013
	
1024
}
1014
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1025
public void test0031_Method(){
1015
	expectedParentNodeToString = "<NONE>";
1026
	String str =
1016
	completionIdentifier = "";
1027
		"public class X {\n" +
1017
	expectedReplacedSource = "Y<Z>.";
1018
	expectedUnitDisplayString =
1019
		"public class X {\n" + 
1020
		"  public X() {\n" + 
1021
		"  }\n" + 
1022
		"  void foo() {\n" + 
1028
		"  void foo() {\n" + 
1023
		"    <CompleteOnType:Y<Z>.>;\n" + 
1029
		"    Y<Z>. var\n" + 
1024
		"  }\n" + 
1030
		"  }\n" + 
1025
		"}\n";
1031
		"}";
1032
1033
1034
	String completeBehind = "Y<Z>.";
1035
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1036
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1037
	String expectedParentNodeToString = "<NONE>";
1038
	String completionIdentifier = "";
1039
	String expectedReplacedSource = "Y<Z>.";
1040
	String expectedUnitDisplayString =
1041
			"public class X {\n" + 
1042
			"  public X() {\n" + 
1043
			"  }\n" + 
1044
			"  void foo() {\n" + 
1045
			"    <CompleteOnType:Y<Z>.>;\n" + 
1046
			"  }\n" + 
1047
			"}\n";
1026
1048
1027
	checkMethodParse(
1049
	checkMethodParse(
1028
			str.toCharArray(),
1050
			str.toCharArray(),
Lines 1034-1040 Link Here
1034
			expectedReplacedSource,
1056
			expectedReplacedSource,
1035
			"full ast");
1057
			"full ast");
1036
}
1058
}
1037
public void test0032(){
1059
public void test0032_Diet(){
1038
	String str =
1060
	String str =
1039
		"public class X {\n" +
1061
		"public class X {\n" +
1040
		"  void foo() {\n" + 
1062
		"  void foo() {\n" + 
Lines 1066-1084 Link Here
1066
			completionIdentifier,
1088
			completionIdentifier,
1067
			expectedReplacedSource,
1089
			expectedReplacedSource,
1068
	"diet ast");
1090
	"diet ast");
1069
	
1091
}
1070
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.W>";
1092
public void test0032_Method(){
1071
	expectedParentNodeToString = "<NONE>";
1093
	String str =
1072
	completionIdentifier = "W";
1094
		"public class X {\n" +
1073
	expectedReplacedSource = "Y<Z>.W";
1074
	expectedUnitDisplayString =
1075
		"public class X {\n" + 
1076
		"  public X() {\n" + 
1077
		"  }\n" + 
1078
		"  void foo() {\n" + 
1095
		"  void foo() {\n" + 
1079
		"    <CompleteOnType:Y<Z>.W>;\n" + 
1096
		"    Y<Z>.W\n" + 
1080
		"  }\n" + 
1097
		"  }\n" + 
1081
		"}\n";
1098
		"}";
1099
1100
1101
	String completeBehind = "Y<Z>.W";
1102
	int cursorLocation = str.indexOf("Y<Z>.W") + completeBehind.length() - 1;
1103
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.W>";
1104
	String expectedParentNodeToString = "<NONE>";
1105
	String completionIdentifier = "W";
1106
	String expectedReplacedSource = "Y<Z>.W";
1107
	String expectedUnitDisplayString =
1108
			"public class X {\n" + 
1109
			"  public X() {\n" + 
1110
			"  }\n" + 
1111
			"  void foo() {\n" + 
1112
			"    <CompleteOnType:Y<Z>.W>;\n" + 
1113
			"  }\n" + 
1114
			"}\n";
1082
1115
1083
	checkMethodParse(
1116
	checkMethodParse(
1084
			str.toCharArray(),
1117
			str.toCharArray(),
Lines 1090-1096 Link Here
1090
			expectedReplacedSource,
1123
			expectedReplacedSource,
1091
			"full ast");
1124
			"full ast");
1092
}
1125
}
1093
public void test0033(){
1126
public void test0033_Diet(){
1094
	String str =
1127
	String str =
1095
		"public class X {\n" +
1128
		"public class X {\n" +
1096
		"  void foo() {\n" + 
1129
		"  void foo() {\n" + 
Lines 1122-1140 Link Here
1122
			completionIdentifier,
1155
			completionIdentifier,
1123
			expectedReplacedSource,
1156
			expectedReplacedSource,
1124
	"diet ast");
1157
	"diet ast");
1125
	
1158
}
1126
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.W>";
1159
public void test0033_Method(){
1127
	expectedParentNodeToString = "<NONE>";
1160
	String str =
1128
	completionIdentifier = "W";
1161
		"public class X {\n" +
1129
	expectedReplacedSource = "Y<Z>.W";
1130
	expectedUnitDisplayString =
1131
		"public class X {\n" + 
1132
		"  public X() {\n" + 
1133
		"  }\n" + 
1134
		"  void foo() {\n" + 
1162
		"  void foo() {\n" + 
1135
		"    <CompleteOnType:Y<Z>.W>;\n" + 
1163
		"    Y<Z>.W var\n" + 
1136
		"  }\n" + 
1164
		"  }\n" + 
1137
		"}\n";
1165
		"}";
1166
1167
1168
	String completeBehind = "Y<Z>.W";
1169
	int cursorLocation = str.indexOf("Y<Z>.W") + completeBehind.length() - 1;
1170
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.W>";
1171
	String expectedParentNodeToString = "<NONE>";
1172
	String completionIdentifier = "W";
1173
	String expectedReplacedSource = "Y<Z>.W";
1174
	String expectedUnitDisplayString =
1175
			"public class X {\n" + 
1176
			"  public X() {\n" + 
1177
			"  }\n" + 
1178
			"  void foo() {\n" + 
1179
			"    <CompleteOnType:Y<Z>.W>;\n" + 
1180
			"  }\n" + 
1181
			"}\n";
1138
1182
1139
	checkMethodParse(
1183
	checkMethodParse(
1140
			str.toCharArray(),
1184
			str.toCharArray(),
Lines 1146-1152 Link Here
1146
			expectedReplacedSource,
1190
			expectedReplacedSource,
1147
			"full ast");
1191
			"full ast");
1148
}
1192
}
1149
public void test0034(){
1193
public void test0034_Diet(){
1150
	String str =
1194
	String str =
1151
		"public class X {\n" +
1195
		"public class X {\n" +
1152
		"  void foo() {\n" + 
1196
		"  void foo() {\n" + 
Lines 1178-1196 Link Here
1178
			completionIdentifier,
1222
			completionIdentifier,
1179
			expectedReplacedSource,
1223
			expectedReplacedSource,
1180
	"diet ast");
1224
	"diet ast");
1181
	
1225
}
1182
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1226
public void test0034_Method(){
1183
	expectedParentNodeToString = "<NONE>";
1227
	String str =
1184
	completionIdentifier = "";
1228
		"public class X {\n" +
1185
	expectedReplacedSource = "Y<Z>.";
1186
	expectedUnitDisplayString =
1187
		"public class X {\n" + 
1188
		"  public X() {\n" + 
1189
		"  }\n" + 
1190
		"  void foo() {\n" + 
1229
		"  void foo() {\n" + 
1191
		"    <CompleteOnType:Y<Z>.>;\n" + 
1230
		"    this.<Y, Y<Z>.>bar();\n" + 
1192
		"  }\n" + 
1231
		"  }\n" + 
1193
		"}\n";
1232
		"}";
1233
1234
1235
	String completeBehind = "Y<Z>.";
1236
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1237
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1238
	String expectedParentNodeToString = "<NONE>";
1239
	String completionIdentifier = "";
1240
	String expectedReplacedSource = "Y<Z>.";
1241
	String expectedUnitDisplayString =
1242
			"public class X {\n" + 
1243
			"  public X() {\n" + 
1244
			"  }\n" + 
1245
			"  void foo() {\n" + 
1246
			"    <CompleteOnType:Y<Z>.>;\n" + 
1247
			"  }\n" + 
1248
			"}\n";
1194
1249
1195
	checkMethodParse(
1250
	checkMethodParse(
1196
			str.toCharArray(),
1251
			str.toCharArray(),
Lines 1202-1208 Link Here
1202
			expectedReplacedSource,
1257
			expectedReplacedSource,
1203
			"full ast");
1258
			"full ast");
1204
}
1259
}
1205
public void test0035(){
1260
public void test0035_Diet(){
1206
	String str =
1261
	String str =
1207
		"public class X {\n" +
1262
		"public class X {\n" +
1208
		"  void foo() {\n" + 
1263
		"  void foo() {\n" + 
Lines 1234-1252 Link Here
1234
			completionIdentifier,
1289
			completionIdentifier,
1235
			expectedReplacedSource,
1290
			expectedReplacedSource,
1236
	"diet ast");
1291
	"diet ast");
1237
	
1292
}
1238
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1293
public void test0035_Method(){
1239
	expectedParentNodeToString = "<NONE>";
1294
	String str =
1240
	completionIdentifier = "";
1295
		"public class X {\n" +
1241
	expectedReplacedSource = "Y<Z>.";
1242
	expectedUnitDisplayString =
1243
		"public class X {\n" + 
1244
		"  public X() {\n" + 
1245
		"  }\n" + 
1246
		"  void foo() {\n" + 
1296
		"  void foo() {\n" + 
1247
		"    <CompleteOnType:Y<Z>.>;\n" + 
1297
		"    this.<Y, Y<Z>.>bar(\n" + 
1248
		"  }\n" + 
1298
		"  }\n" + 
1249
		"}\n";
1299
		"}";
1300
1301
1302
	String completeBehind = "Y<Z>.";
1303
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1304
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1305
	String expectedParentNodeToString = "<NONE>";
1306
	String completionIdentifier = "";
1307
	String expectedReplacedSource = "Y<Z>.";
1308
	String expectedUnitDisplayString =
1309
			"public class X {\n" + 
1310
			"  public X() {\n" + 
1311
			"  }\n" + 
1312
			"  void foo() {\n" + 
1313
			"    <CompleteOnType:Y<Z>.>;\n" + 
1314
			"  }\n" + 
1315
			"}\n";
1250
1316
1251
	checkMethodParse(
1317
	checkMethodParse(
1252
			str.toCharArray(),
1318
			str.toCharArray(),
Lines 1258-1264 Link Here
1258
			expectedReplacedSource,
1324
			expectedReplacedSource,
1259
			"full ast");
1325
			"full ast");
1260
}
1326
}
1261
public void test0036(){
1327
public void test0036_Diet(){
1262
	String str =
1328
	String str =
1263
		"public class X {\n" +
1329
		"public class X {\n" +
1264
		"  void foo() {\n" + 
1330
		"  void foo() {\n" + 
Lines 1290-1308 Link Here
1290
			completionIdentifier,
1356
			completionIdentifier,
1291
			expectedReplacedSource,
1357
			expectedReplacedSource,
1292
	"diet ast");
1358
	"diet ast");
1293
	
1359
}
1294
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1360
public void test0036_Method(){
1295
	expectedParentNodeToString = "<NONE>";
1361
	String str =
1296
	completionIdentifier = "";
1362
		"public class X {\n" +
1297
	expectedReplacedSource = "Y<Z>.";
1298
	expectedUnitDisplayString =
1299
		"public class X {\n" + 
1300
		"  public X() {\n" + 
1301
		"  }\n" + 
1302
		"  void foo() {\n" + 
1363
		"  void foo() {\n" + 
1303
		"    <CompleteOnType:Y<Z>.>;\n" + 
1364
		"    this.<Y, Y<Z>.>bar\n" + 
1304
		"  }\n" + 
1365
		"  }\n" + 
1305
		"}\n";
1366
		"}";
1367
1368
1369
	String completeBehind = "Y<Z>.";
1370
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1371
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1372
	String expectedParentNodeToString = "<NONE>";
1373
	String completionIdentifier = "";
1374
	String expectedReplacedSource = "Y<Z>.";
1375
	String expectedUnitDisplayString =
1376
			"public class X {\n" + 
1377
			"  public X() {\n" + 
1378
			"  }\n" + 
1379
			"  void foo() {\n" + 
1380
			"    <CompleteOnType:Y<Z>.>;\n" + 
1381
			"  }\n" + 
1382
			"}\n";
1306
1383
1307
	checkMethodParse(
1384
	checkMethodParse(
1308
			str.toCharArray(),
1385
			str.toCharArray(),
Lines 1314-1320 Link Here
1314
			expectedReplacedSource,
1391
			expectedReplacedSource,
1315
			"full ast");
1392
			"full ast");
1316
}
1393
}
1317
public void test0037(){
1394
public void test0037_Diet(){
1318
	String str =
1395
	String str =
1319
		"public class X {\n" +
1396
		"public class X {\n" +
1320
		"  void foo() {\n" + 
1397
		"  void foo() {\n" + 
Lines 1346-1364 Link Here
1346
			completionIdentifier,
1423
			completionIdentifier,
1347
			expectedReplacedSource,
1424
			expectedReplacedSource,
1348
	"diet ast");
1425
	"diet ast");
1349
	
1426
}
1350
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1427
public void test0037_Method(){
1351
	expectedParentNodeToString = "<NONE>";
1428
	String str =
1352
	completionIdentifier = "";
1429
		"public class X {\n" +
1353
	expectedReplacedSource = "Y<Z>.";
1354
	expectedUnitDisplayString =
1355
		"public class X {\n" + 
1356
		"  public X() {\n" + 
1357
		"  }\n" + 
1358
		"  void foo() {\n" + 
1430
		"  void foo() {\n" + 
1359
		"    <CompleteOnType:Y<Z>.>;\n" + 
1431
		"    this.<Y, Y<Z>.>\n" + 
1360
		"  }\n" + 
1432
		"  }\n" + 
1361
		"}\n";
1433
		"}";
1434
1435
1436
	String completeBehind = "Y<Z>.";
1437
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1438
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1439
	String expectedParentNodeToString = "<NONE>";
1440
	String completionIdentifier = "";
1441
	String expectedReplacedSource = "Y<Z>.";
1442
	String expectedUnitDisplayString =
1443
			"public class X {\n" + 
1444
			"  public X() {\n" + 
1445
			"  }\n" + 
1446
			"  void foo() {\n" + 
1447
			"    <CompleteOnType:Y<Z>.>;\n" + 
1448
			"  }\n" + 
1449
			"}\n";
1362
1450
1363
	checkMethodParse(
1451
	checkMethodParse(
1364
			str.toCharArray(),
1452
			str.toCharArray(),
Lines 1370-1376 Link Here
1370
			expectedReplacedSource,
1458
			expectedReplacedSource,
1371
			"full ast");
1459
			"full ast");
1372
}
1460
}
1373
public void test0038(){
1461
public void test0038_Diet(){
1374
	String str =
1462
	String str =
1375
		"public class X {\n" +
1463
		"public class X {\n" +
1376
		"  void foo() {\n" + 
1464
		"  void foo() {\n" + 
Lines 1402-1420 Link Here
1402
			completionIdentifier,
1490
			completionIdentifier,
1403
			expectedReplacedSource,
1491
			expectedReplacedSource,
1404
	"diet ast");
1492
	"diet ast");
1405
	
1493
}
1406
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1494
public void test0038_Method(){
1407
	expectedParentNodeToString = "<NONE>";
1495
	String str =
1408
	completionIdentifier = "";
1496
		"public class X {\n" +
1409
	expectedReplacedSource = "Y<Z>.";
1410
	expectedUnitDisplayString =
1411
		"public class X {\n" + 
1412
		"  public X() {\n" + 
1413
		"  }\n" + 
1414
		"  void foo() {\n" + 
1497
		"  void foo() {\n" + 
1415
		"    <CompleteOnType:Y<Z>.>;\n" + 
1498
		"    this.<Y, Y<Z>.\n" + 
1416
		"  }\n" + 
1499
		"  }\n" + 
1417
		"}\n";
1500
		"}";
1501
1502
1503
	String completeBehind = "Y<Z>.";
1504
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1505
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1506
	String expectedParentNodeToString = "<NONE>";
1507
	String completionIdentifier = "";
1508
	String expectedReplacedSource = "Y<Z>.";
1509
	String expectedUnitDisplayString =
1510
			"public class X {\n" + 
1511
			"  public X() {\n" + 
1512
			"  }\n" + 
1513
			"  void foo() {\n" + 
1514
			"    <CompleteOnType:Y<Z>.>;\n" + 
1515
			"  }\n" + 
1516
			"}\n";
1418
1517
1419
	checkMethodParse(
1518
	checkMethodParse(
1420
			str.toCharArray(),
1519
			str.toCharArray(),
Lines 1426-1432 Link Here
1426
			expectedReplacedSource,
1525
			expectedReplacedSource,
1427
			"full ast");
1526
			"full ast");
1428
}
1527
}
1429
public void test0039(){
1528
public void test0039_Diet(){
1430
	String str =
1529
	String str =
1431
		"public class X {\n" +
1530
		"public class X {\n" +
1432
		"  void foo() {\n" + 
1531
		"  void foo() {\n" + 
Lines 1458-1476 Link Here
1458
			completionIdentifier,
1557
			completionIdentifier,
1459
			expectedReplacedSource,
1558
			expectedReplacedSource,
1460
	"diet ast");
1559
	"diet ast");
1461
	
1560
}
1462
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1561
public void test0039_Method(){
1463
	expectedParentNodeToString = "<NONE>";
1562
	String str =
1464
	completionIdentifier = "";
1563
		"public class X {\n" +
1465
	expectedReplacedSource = "Y<Z>.";
1466
	expectedUnitDisplayString =
1467
		"public class X {\n" + 
1468
		"  public X() {\n" + 
1469
		"  }\n" + 
1470
		"  void foo() {\n" + 
1564
		"  void foo() {\n" + 
1471
		"    <CompleteOnType:Y<Z>.>;\n" + 
1565
		"    new <Y, Y<Z>.>X();\n" + 
1472
		"  }\n" + 
1566
		"  }\n" + 
1473
		"}\n";
1567
		"}";
1568
1569
1570
	String completeBehind = "Y<Z>.";
1571
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1572
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1573
	String expectedParentNodeToString = "<NONE>";
1574
	String completionIdentifier = "";
1575
	String expectedReplacedSource = "Y<Z>.";
1576
	String expectedUnitDisplayString =
1577
			"public class X {\n" + 
1578
			"  public X() {\n" + 
1579
			"  }\n" + 
1580
			"  void foo() {\n" + 
1581
			"    <CompleteOnType:Y<Z>.>;\n" + 
1582
			"  }\n" + 
1583
			"}\n";
1474
1584
1475
	checkMethodParse(
1585
	checkMethodParse(
1476
			str.toCharArray(),
1586
			str.toCharArray(),
Lines 1482-1488 Link Here
1482
			expectedReplacedSource,
1592
			expectedReplacedSource,
1483
			"full ast");
1593
			"full ast");
1484
}
1594
}
1485
public void test0040(){
1595
public void test0040_Diet(){
1486
	String str =
1596
	String str =
1487
		"public class X {\n" +
1597
		"public class X {\n" +
1488
		"  void foo() {\n" + 
1598
		"  void foo() {\n" + 
Lines 1514-1532 Link Here
1514
			completionIdentifier,
1624
			completionIdentifier,
1515
			expectedReplacedSource,
1625
			expectedReplacedSource,
1516
	"diet ast");
1626
	"diet ast");
1517
	
1627
}
1518
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1628
public void test0040_Method(){
1519
	expectedParentNodeToString = "<NONE>";
1629
	String str =
1520
	completionIdentifier = "";
1630
		"public class X {\n" +
1521
	expectedReplacedSource = "Y<Z>.";
1522
	expectedUnitDisplayString =
1523
		"public class X {\n" + 
1524
		"  public X() {\n" + 
1525
		"  }\n" + 
1526
		"  void foo() {\n" + 
1631
		"  void foo() {\n" + 
1527
		"    <CompleteOnType:Y<Z>.>;\n" + 
1632
		"    aaa.new <Y, Y<Z>.>X();\n" + 
1528
		"  }\n" + 
1633
		"  }\n" + 
1529
		"}\n";
1634
		"}";
1635
1636
1637
	String completeBehind = "Y<Z>.";
1638
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1639
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1640
	String expectedParentNodeToString = "<NONE>";
1641
	String completionIdentifier = "";
1642
	String expectedReplacedSource = "Y<Z>.";
1643
	String expectedUnitDisplayString =
1644
			"public class X {\n" + 
1645
			"  public X() {\n" + 
1646
			"  }\n" + 
1647
			"  void foo() {\n" + 
1648
			"    <CompleteOnType:Y<Z>.>;\n" + 
1649
			"  }\n" + 
1650
			"}\n";
1530
1651
1531
	checkMethodParse(
1652
	checkMethodParse(
1532
			str.toCharArray(),
1653
			str.toCharArray(),
Lines 1538-1544 Link Here
1538
			expectedReplacedSource,
1659
			expectedReplacedSource,
1539
			"full ast");
1660
			"full ast");
1540
}
1661
}
1541
public void test0041(){
1662
public void test0041_Diet(){
1542
	String str =
1663
	String str =
1543
		"public class X {\n" +
1664
		"public class X {\n" +
1544
		"  void foo() {\n" + 
1665
		"  void foo() {\n" + 
Lines 1570-1588 Link Here
1570
			completionIdentifier,
1691
			completionIdentifier,
1571
			expectedReplacedSource,
1692
			expectedReplacedSource,
1572
	"diet ast");
1693
	"diet ast");
1573
	
1694
}
1574
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1695
public void test0041_Method(){
1575
	expectedParentNodeToString = "<NONE>";
1696
	String str =
1576
	completionIdentifier = "";
1697
		"public class X {\n" +
1577
	expectedReplacedSource = "Y<Z>.";
1578
	expectedUnitDisplayString =
1579
		"public class X {\n" + 
1580
		"  public X() {\n" + 
1581
		"  }\n" + 
1582
		"  void foo() {\n" + 
1698
		"  void foo() {\n" + 
1583
		"    <CompleteOnType:Y<Z>.>;\n" + 
1699
		"    new V().new <Y, Y<Z>.>X();\n" + 
1584
		"  }\n" + 
1700
		"  }\n" + 
1585
		"}\n";
1701
		"}";
1702
1703
1704
	String completeBehind = "Y<Z>.";
1705
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1706
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1707
	String expectedParentNodeToString = "<NONE>";
1708
	String completionIdentifier = "";
1709
	String expectedReplacedSource = "Y<Z>.";
1710
	String expectedUnitDisplayString =
1711
			"public class X {\n" + 
1712
			"  public X() {\n" + 
1713
			"  }\n" + 
1714
			"  void foo() {\n" + 
1715
			"    <CompleteOnType:Y<Z>.>;\n" + 
1716
			"  }\n" + 
1717
			"}\n";
1586
1718
1587
	checkMethodParse(
1719
	checkMethodParse(
1588
			str.toCharArray(),
1720
			str.toCharArray(),
Lines 1594-1600 Link Here
1594
			expectedReplacedSource,
1726
			expectedReplacedSource,
1595
			"full ast");
1727
			"full ast");
1596
}
1728
}
1597
public void test0042(){
1729
public void test0042_Diet(){
1598
	String str =
1730
	String str =
1599
		"public class X {\n" +
1731
		"public class X {\n" +
1600
		"  void foo() {\n" + 
1732
		"  void foo() {\n" + 
Lines 1626-1644 Link Here
1626
			completionIdentifier,
1758
			completionIdentifier,
1627
			expectedReplacedSource,
1759
			expectedReplacedSource,
1628
	"diet ast");
1760
	"diet ast");
1629
	
1761
}
1630
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1762
public void test0042_Method(){
1631
	expectedParentNodeToString = "<NONE>";
1763
	String str =
1632
	completionIdentifier = "";
1764
		"public class X {\n" +
1633
	expectedReplacedSource = "Y<Z>.";
1634
	expectedUnitDisplayString =
1635
		"public class X {\n" + 
1636
		"  public X() {\n" + 
1637
		"  }\n" + 
1638
		"  void foo() {\n" + 
1765
		"  void foo() {\n" + 
1639
		"    <CompleteOnType:Y<Z>.>;\n" + 
1766
		"    for(Y<Z>. var;;){}\n" + 
1640
		"  }\n" + 
1767
		"  }\n" + 
1641
		"}\n";
1768
		"}";
1769
1770
1771
	String completeBehind = "Y<Z>.";
1772
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1773
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1774
	String expectedParentNodeToString = "<NONE>";
1775
	String completionIdentifier = "";
1776
	String expectedReplacedSource = "Y<Z>.";
1777
	String expectedUnitDisplayString =
1778
			"public class X {\n" + 
1779
			"  public X() {\n" + 
1780
			"  }\n" + 
1781
			"  void foo() {\n" + 
1782
			"    <CompleteOnType:Y<Z>.>;\n" + 
1783
			"  }\n" + 
1784
			"}\n";
1642
1785
1643
	checkMethodParse(
1786
	checkMethodParse(
1644
			str.toCharArray(),
1787
			str.toCharArray(),
Lines 1650-1656 Link Here
1650
			expectedReplacedSource,
1793
			expectedReplacedSource,
1651
			"full ast");
1794
			"full ast");
1652
}
1795
}
1653
public void test0043(){
1796
public void test0043_Diet(){
1654
	String str =
1797
	String str =
1655
		"public class X {\n" +
1798
		"public class X {\n" +
1656
		"  void foo() {\n" + 
1799
		"  void foo() {\n" + 
Lines 1682-1700 Link Here
1682
			completionIdentifier,
1825
			completionIdentifier,
1683
			expectedReplacedSource,
1826
			expectedReplacedSource,
1684
	"diet ast");
1827
	"diet ast");
1685
	
1828
}
1686
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1829
public void test0043_Method(){
1687
	expectedParentNodeToString = "<NONE>";
1830
	String str =
1688
	completionIdentifier = "";
1831
		"public class X {\n" +
1689
	expectedReplacedSource = "Y<Z>.";
1690
	expectedUnitDisplayString =
1691
		"public class X {\n" + 
1692
		"  public X() {\n" + 
1693
		"  }\n" + 
1694
		"  void foo() {\n" + 
1832
		"  void foo() {\n" + 
1695
		"    <CompleteOnType:Y<Z>.>;\n" + 
1833
		"    for(Y<Z>.\n" + 
1696
		"  }\n" + 
1834
		"  }\n" + 
1697
		"}\n";
1835
		"}";
1836
1837
1838
	String completeBehind = "Y<Z>.";
1839
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1840
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
1841
	String expectedParentNodeToString = "<NONE>";
1842
	String completionIdentifier = "";
1843
	String expectedReplacedSource = "Y<Z>.";
1844
	String expectedUnitDisplayString =
1845
			"public class X {\n" + 
1846
			"  public X() {\n" + 
1847
			"  }\n" + 
1848
			"  void foo() {\n" + 
1849
			"    <CompleteOnType:Y<Z>.>;\n" + 
1850
			"  }\n" + 
1851
			"}\n";
1698
1852
1699
	checkMethodParse(
1853
	checkMethodParse(
1700
			str.toCharArray(),
1854
			str.toCharArray(),
Lines 1706-1712 Link Here
1706
			expectedReplacedSource,
1860
			expectedReplacedSource,
1707
			"full ast");
1861
			"full ast");
1708
}
1862
}
1709
public void test0044(){
1863
public void test0044_Diet(){
1710
	String str =
1864
	String str =
1711
		"public class X {\n" +
1865
		"public class X {\n" +
1712
		"  void foo() {\n" + 
1866
		"  void foo() {\n" + 
Lines 1740-1767 Link Here
1740
			completionIdentifier,
1894
			completionIdentifier,
1741
			expectedReplacedSource,
1895
			expectedReplacedSource,
1742
	"diet ast");
1896
	"diet ast");
1743
	
1897
}
1744
	expectedCompletionNodeToString = "<CompleteOnException:Y<Z>.>";
1898
public void test0044_Method(){
1745
	expectedParentNodeToString =
1899
	String str =
1746
		"try \n" + 
1900
		"public class X {\n" +
1747
		"  {\n" + 
1748
		"  }\n" + 
1749
		"catch (<CompleteOnException:Y<Z>.>  )   {\n" + 
1750
		"  }";
1751
	completionIdentifier = "";
1752
	expectedReplacedSource = "Y<Z>.";
1753
	expectedUnitDisplayString =
1754
		"public class X {\n" + 
1755
		"  public X() {\n" + 
1756
		"  }\n" + 
1757
		"  void foo() {\n" + 
1901
		"  void foo() {\n" + 
1758
		"    try \n" + 
1902
		"    try {\n" + 
1759
		"      {\n" + 
1903
		"    } catch(Y<Z>. e) {\n" +
1760
		"      }\n" + 
1904
		"   }\n" + 
1761
		"    catch (<CompleteOnException:Y<Z>.>  )       {\n" + 
1762
		"      }\n" + 
1763
		"  }\n" + 
1905
		"  }\n" + 
1764
		"}\n";
1906
		"}";
1907
1908
1909
	String completeBehind = "Y<Z>.";
1910
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1911
	String expectedCompletionNodeToString = "<CompleteOnException:Y<Z>.>";
1912
	String expectedParentNodeToString =
1913
			"try \n" + 
1914
			"  {\n" + 
1915
			"  }\n" + 
1916
			"catch (<CompleteOnException:Y<Z>.>  )   {\n" + 
1917
			"  }";
1918
	String completionIdentifier = "";
1919
	String expectedReplacedSource = "Y<Z>.";
1920
	String expectedUnitDisplayString =
1921
			"public class X {\n" + 
1922
			"  public X() {\n" + 
1923
			"  }\n" + 
1924
			"  void foo() {\n" + 
1925
			"    try \n" + 
1926
			"      {\n" + 
1927
			"      }\n" + 
1928
			"    catch (<CompleteOnException:Y<Z>.>  )       {\n" + 
1929
			"      }\n" + 
1930
			"  }\n" + 
1931
			"}\n";
1765
1932
1766
	checkMethodParse(
1933
	checkMethodParse(
1767
			str.toCharArray(),
1934
			str.toCharArray(),
Lines 1773-1779 Link Here
1773
			expectedReplacedSource,
1940
			expectedReplacedSource,
1774
			"full ast");
1941
			"full ast");
1775
}
1942
}
1776
public void test0045(){
1943
public void test0045_Diet(){
1777
	String str =
1944
	String str =
1778
		"public class X {\n" +
1945
		"public class X {\n" +
1779
		"  void foo() {\n" + 
1946
		"  void foo() {\n" + 
Lines 1806-1835 Link Here
1806
			completionIdentifier,
1973
			completionIdentifier,
1807
			expectedReplacedSource,
1974
			expectedReplacedSource,
1808
	"diet ast");
1975
	"diet ast");
1809
	
1976
}
1810
	expectedCompletionNodeToString = "<CompleteOnException:Y<Z>.>";
1977
public void test0045_Method(){
1811
	expectedParentNodeToString = 
1978
	String str =
1812
		"try \n" + 
1979
		"public class X {\n" +
1813
		"  {\n" + 
1814
		"  }\n" + 
1815
		"catch (<CompleteOnException:Y<Z>.>  )   {\n" + 
1816
		"  }";
1817
	completionIdentifier = "";
1818
	expectedReplacedSource = "Y<Z>.";
1819
	expectedUnitDisplayString =
1820
		"public class X {\n" + 
1821
		"  public X() {\n" + 
1822
		"  }\n" + 
1823
		"  void foo() {\n" + 
1980
		"  void foo() {\n" + 
1824
		"    try \n" + 
1981
		"    try {\n" + 
1825
		"      {\n" + 
1982
		"    } catch(Y<Z>. e\n" + 
1826
		"      }\n" + 
1827
		"    catch (<CompleteOnException:Y<Z>.>  )       {\n" + 
1828
		"      }\n" + 
1829
		"  }\n" + 
1983
		"  }\n" + 
1830
		"}\n";
1984
		"}";
1831
1985
1832
	checkMethodParse(
1986
1987
	String completeBehind = "Y<Z>.";
1988
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
1989
	String expectedCompletionNodeToString = "<CompleteOnException:Y<Z>.>";
1990
	String expectedParentNodeToString = 
1991
			"try \n" + 
1992
			"  {\n" + 
1993
			"  }\n" + 
1994
			"catch (<CompleteOnException:Y<Z>.>  )   {\n" + 
1995
			"  }";
1996
	String completionIdentifier = "";
1997
	String expectedReplacedSource = "Y<Z>.";
1998
	String expectedUnitDisplayString =
1999
			"public class X {\n" + 
2000
			"  public X() {\n" + 
2001
			"  }\n" + 
2002
			"  void foo() {\n" + 
2003
			"    try \n" + 
2004
			"      {\n" + 
2005
			"      }\n" + 
2006
			"    catch (<CompleteOnException:Y<Z>.>  )       {\n" + 
2007
			"      }\n" + 
2008
			"  }\n" + 
2009
			"}\n";
2010
2011
	checkMethodParse(
1833
			str.toCharArray(),
2012
			str.toCharArray(),
1834
			cursorLocation,
2013
			cursorLocation,
1835
			expectedCompletionNodeToString,
2014
			expectedCompletionNodeToString,
Lines 1839-1845 Link Here
1839
			expectedReplacedSource,
2018
			expectedReplacedSource,
1840
			"full ast");
2019
			"full ast");
1841
}
2020
}
1842
public void test0046(){
2021
public void test0046_Diet(){
1843
	String str =
2022
	String str =
1844
		"public class X {\n" +
2023
		"public class X {\n" +
1845
		"  void foo() {\n" + 
2024
		"  void foo() {\n" + 
Lines 1871-1889 Link Here
1871
			completionIdentifier,
2050
			completionIdentifier,
1872
			expectedReplacedSource,
2051
			expectedReplacedSource,
1873
	"diet ast");
2052
	"diet ast");
1874
	
2053
}
1875
	expectedCompletionNodeToString = "<CompleteOnException:Y<Z>.>";
2054
public void test0046_Method(){
1876
	expectedParentNodeToString = "<NONE>";
2055
	String str =
1877
	completionIdentifier = "";
2056
		"public class X {\n" +
1878
	expectedReplacedSource = "Y<Z>.";
1879
	expectedUnitDisplayString =
1880
		"public class X {\n" + 
1881
		"  public X() {\n" + 
1882
		"  }\n" + 
1883
		"  void foo() {\n" + 
2057
		"  void foo() {\n" + 
1884
		"    <CompleteOnException:Y<Z>.>;\n" + 
2058
		"    catch(Y<Z>. e\n" + 
1885
		"  }\n" + 
2059
		"  }\n" + 
1886
		"}\n";
2060
		"}";
2061
2062
2063
	String completeBehind = "Y<Z>.";
2064
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2065
	String expectedCompletionNodeToString = "<CompleteOnException:Y<Z>.>";
2066
	String expectedParentNodeToString = "<NONE>";
2067
	String completionIdentifier = "";
2068
	String expectedReplacedSource = "Y<Z>.";
2069
	String expectedUnitDisplayString =
2070
			"public class X {\n" + 
2071
			"  public X() {\n" + 
2072
			"  }\n" + 
2073
			"  void foo() {\n" + 
2074
			"    <CompleteOnException:Y<Z>.>;\n" + 
2075
			"  }\n" + 
2076
			"}\n";
1887
2077
1888
	checkMethodParse(
2078
	checkMethodParse(
1889
			str.toCharArray(),
2079
			str.toCharArray(),
Lines 1895-1901 Link Here
1895
			expectedReplacedSource,
2085
			expectedReplacedSource,
1896
			"full ast");
2086
			"full ast");
1897
}
2087
}
1898
public void test0047(){
2088
public void test0047_Diet(){
1899
	String str =
2089
	String str =
1900
		"public class X {\n" +
2090
		"public class X {\n" +
1901
		"  void foo() {\n" + 
2091
		"  void foo() {\n" + 
Lines 1927-1945 Link Here
1927
			completionIdentifier,
2117
			completionIdentifier,
1928
			expectedReplacedSource,
2118
			expectedReplacedSource,
1929
	"diet ast");
2119
	"diet ast");
1930
	
2120
}
1931
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2121
public void test0047_Method(){
1932
	expectedParentNodeToString = "<NONE>";
2122
	String str =
1933
	completionIdentifier = "";
2123
		"public class X {\n" +
1934
	expectedReplacedSource = "Y<Z>.";
1935
	expectedUnitDisplayString =
1936
		"public class X {\n" + 
1937
		"  public X() {\n" + 
1938
		"  }\n" + 
1939
		"  void foo() {\n" + 
2124
		"  void foo() {\n" + 
1940
		"    Object a = <CompleteOnType:Y<Z>.>;\n" + 
2125
		"    Object a = (Y<Z>.) e;\n" + 
1941
		"  }\n" + 
2126
		"  }\n" + 
1942
		"}\n";
2127
		"}";
2128
2129
2130
	String completeBehind = "Y<Z>.";
2131
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2132
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2133
	String expectedParentNodeToString = "<NONE>";
2134
	String completionIdentifier = "";
2135
	String expectedReplacedSource = "Y<Z>.";
2136
	String expectedUnitDisplayString =
2137
			"public class X {\n" + 
2138
			"  public X() {\n" + 
2139
			"  }\n" + 
2140
			"  void foo() {\n" + 
2141
			"    Object a = <CompleteOnType:Y<Z>.>;\n" + 
2142
			"  }\n" + 
2143
			"}\n";
1943
2144
1944
	checkMethodParse(
2145
	checkMethodParse(
1945
			str.toCharArray(),
2146
			str.toCharArray(),
Lines 1951-1957 Link Here
1951
			expectedReplacedSource,
2152
			expectedReplacedSource,
1952
			"full ast");
2153
			"full ast");
1953
}
2154
}
1954
public void test0048(){
2155
public void test0048_Diet(){
1955
	String str =
2156
	String str =
1956
		"public class X {\n" +
2157
		"public class X {\n" +
1957
		"  void foo() {\n" + 
2158
		"  void foo() {\n" + 
Lines 1983-2001 Link Here
1983
			completionIdentifier,
2184
			completionIdentifier,
1984
			expectedReplacedSource,
2185
			expectedReplacedSource,
1985
	"diet ast");
2186
	"diet ast");
1986
	
2187
}
1987
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2188
public void test0048_Method(){
1988
	expectedParentNodeToString = "<NONE>";
2189
	String str =
1989
	completionIdentifier = "";
2190
		"public class X {\n" +
1990
	expectedReplacedSource = "Y<Z>.";
1991
	expectedUnitDisplayString =
1992
		"public class X {\n" + 
1993
		"  public X() {\n" + 
1994
		"  }\n" + 
1995
		"  void foo() {\n" + 
2191
		"  void foo() {\n" + 
1996
		"    Object a = <CompleteOnType:Y<Z>.>;\n" + 
2192
		"    Object a = (Y<Z>.) e;\n" + 
1997
		"  }\n" + 
2193
		"  }\n" + 
1998
		"}\n";
2194
		"}";
2195
2196
2197
	String completeBehind = "Y<Z>.";
2198
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2199
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2200
	String expectedParentNodeToString = "<NONE>";
2201
	String completionIdentifier = "";
2202
	String expectedReplacedSource = "Y<Z>.";
2203
	String expectedUnitDisplayString =
2204
			"public class X {\n" + 
2205
			"  public X() {\n" + 
2206
			"  }\n" + 
2207
			"  void foo() {\n" + 
2208
			"    Object a = <CompleteOnType:Y<Z>.>;\n" + 
2209
			"  }\n" + 
2210
			"}\n";
1999
2211
2000
	checkMethodParse(
2212
	checkMethodParse(
2001
			str.toCharArray(),
2213
			str.toCharArray(),
Lines 2007-2013 Link Here
2007
			expectedReplacedSource,
2219
			expectedReplacedSource,
2008
			"full ast");
2220
			"full ast");
2009
}
2221
}
2010
public void test0049(){
2222
public void test0049_Diet(){
2011
	String str =
2223
	String str =
2012
		"public class X {\n" +
2224
		"public class X {\n" +
2013
		"  void foo() {\n" + 
2225
		"  void foo() {\n" + 
Lines 2039-2057 Link Here
2039
			completionIdentifier,
2251
			completionIdentifier,
2040
			expectedReplacedSource,
2252
			expectedReplacedSource,
2041
	"diet ast");
2253
	"diet ast");
2042
	
2254
}
2043
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2255
public void test0049_Method(){
2044
	expectedParentNodeToString = "<NONE>";
2256
	String str =
2045
	completionIdentifier = "";
2257
		"public class X {\n" +
2046
	expectedReplacedSource = "Y<Z>.";
2047
	expectedUnitDisplayString =
2048
		"public class X {\n" + 
2049
		"  public X() {\n" + 
2050
		"  }\n" + 
2051
		"  void foo() {\n" + 
2258
		"  void foo() {\n" + 
2052
		"    <CompleteOnType:Y<Z>.>;\n" + 
2259
		"    (Y<Z>.) e;\n" + 
2053
		"  }\n" + 
2260
		"  }\n" + 
2054
		"}\n";
2261
		"}";
2262
2263
2264
	String completeBehind = "Y<Z>.";
2265
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2266
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2267
	String expectedParentNodeToString = "<NONE>";
2268
	String completionIdentifier = "";
2269
	String expectedReplacedSource = "Y<Z>.";
2270
	String expectedUnitDisplayString =
2271
			"public class X {\n" + 
2272
			"  public X() {\n" + 
2273
			"  }\n" + 
2274
			"  void foo() {\n" + 
2275
			"    <CompleteOnType:Y<Z>.>;\n" + 
2276
			"  }\n" + 
2277
			"}\n";
2055
2278
2056
	checkMethodParse(
2279
	checkMethodParse(
2057
			str.toCharArray(),
2280
			str.toCharArray(),
Lines 2063-2069 Link Here
2063
			expectedReplacedSource,
2286
			expectedReplacedSource,
2064
			"full ast");
2287
			"full ast");
2065
}
2288
}
2066
public void test0050(){
2289
public void test0050_Diet(){
2067
	String str =
2290
	String str =
2068
		"public class X {\n" +
2291
		"public class X {\n" +
2069
		"  void foo() {\n" + 
2292
		"  void foo() {\n" + 
Lines 2095-2112 Link Here
2095
			completionIdentifier,
2318
			completionIdentifier,
2096
			expectedReplacedSource,
2319
			expectedReplacedSource,
2097
	"diet ast");
2320
	"diet ast");
2098
	
2321
}
2099
	expectedCompletionNodeToString = "<NONE>";
2322
public void test0050_Method(){
2100
	expectedParentNodeToString = "<NONE>";
2323
	String str =
2101
	completionIdentifier = "";
2324
		"public class X {\n" +
2102
	expectedReplacedSource = "<NONE>";
2103
	expectedUnitDisplayString =
2104
		"public class X {\n" + 
2105
		"  public X() {\n" + 
2106
		"  }\n" + 
2107
		"  void foo() {\n" + 
2325
		"  void foo() {\n" + 
2326
		"    Object[] o = new Y<Z>.[0];\n" + 
2108
		"  }\n" + 
2327
		"  }\n" + 
2109
		"}\n";
2328
		"}";
2329
2330
2331
	String completeBehind = "Y<Z>.";
2332
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2333
	String expectedCompletionNodeToString = "<NONE>";
2334
	String expectedParentNodeToString = "<NONE>";
2335
	String completionIdentifier = "";
2336
	String expectedReplacedSource = "<NONE>";
2337
	String expectedUnitDisplayString =
2338
			"public class X {\n" + 
2339
			"  public X() {\n" + 
2340
			"  }\n" + 
2341
			"  void foo() {\n" + 
2342
			"  }\n" + 
2343
			"}\n";
2110
2344
2111
	checkMethodParse(
2345
	checkMethodParse(
2112
			str.toCharArray(),
2346
			str.toCharArray(),
Lines 2118-2124 Link Here
2118
			expectedReplacedSource,
2352
			expectedReplacedSource,
2119
			"full ast");
2353
			"full ast");
2120
}
2354
}
2121
public void test0051(){
2355
public void test0051_Diet(){
2122
	String str =
2356
	String str =
2123
		"public class X {\n" +
2357
		"public class X {\n" +
2124
		"  void foo() {\n" + 
2358
		"  void foo() {\n" + 
Lines 2150-2167 Link Here
2150
			completionIdentifier,
2384
			completionIdentifier,
2151
			expectedReplacedSource,
2385
			expectedReplacedSource,
2152
	"diet ast");
2386
	"diet ast");
2153
	
2387
}
2154
	expectedCompletionNodeToString = "<NONE>";
2388
public void test0051_Method(){
2155
	expectedParentNodeToString = "<NONE>";
2389
	String str =
2156
	completionIdentifier = "";
2390
		"public class X {\n" +
2157
	expectedReplacedSource = "<NONE>";
2158
	expectedUnitDisplayString =
2159
		"public class X {\n" + 
2160
		"  public X() {\n" + 
2161
		"  }\n" + 
2162
		"  void foo() {\n" + 
2391
		"  void foo() {\n" + 
2392
		"    Object[] o = new Y<Z>.\n" + 
2163
		"  }\n" + 
2393
		"  }\n" + 
2164
		"}\n";
2394
		"}";
2395
2396
2397
	String completeBehind = "Y<Z>.";
2398
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2399
	String expectedCompletionNodeToString = "<NONE>";
2400
	String expectedParentNodeToString = "<NONE>";
2401
	String completionIdentifier = "";
2402
	String expectedReplacedSource = "<NONE>";
2403
	String expectedUnitDisplayString =
2404
			"public class X {\n" + 
2405
			"  public X() {\n" + 
2406
			"  }\n" + 
2407
			"  void foo() {\n" + 
2408
			"  }\n" + 
2409
			"}\n";
2165
2410
2166
	checkMethodParse(
2411
	checkMethodParse(
2167
			str.toCharArray(),
2412
			str.toCharArray(),
Lines 2173-2179 Link Here
2173
			expectedReplacedSource,
2418
			expectedReplacedSource,
2174
			"full ast");
2419
			"full ast");
2175
}
2420
}
2176
public void test0052(){
2421
public void test0052_Diet(){
2177
	String str =
2422
	String str =
2178
		"public class X {\n" +
2423
		"public class X {\n" +
2179
		"  void foo() {\n" + 
2424
		"  void foo() {\n" + 
Lines 2205-2222 Link Here
2205
			completionIdentifier,
2450
			completionIdentifier,
2206
			expectedReplacedSource,
2451
			expectedReplacedSource,
2207
	"diet ast");
2452
	"diet ast");
2208
	
2453
}
2209
	expectedCompletionNodeToString = "<NONE>";
2454
public void test0052_Method(){
2210
	expectedParentNodeToString = "<NONE>";
2455
	String str =
2211
	completionIdentifier = "";
2456
		"public class X {\n" +
2212
	expectedReplacedSource = "<NONE>";
2213
	expectedUnitDisplayString =
2214
		"public class X {\n" + 
2215
		"  public X() {\n" + 
2216
		"  }\n" + 
2217
		"  void foo() {\n" + 
2457
		"  void foo() {\n" + 
2458
		"    new Y<Z>.\n" + 
2218
		"  }\n" + 
2459
		"  }\n" + 
2219
		"}\n";
2460
		"}";
2461
2462
2463
	String completeBehind = "Y<Z>.";
2464
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2465
	String expectedCompletionNodeToString = "<NONE>";
2466
	String expectedParentNodeToString = "<NONE>";
2467
	String completionIdentifier = "";
2468
	String expectedReplacedSource = "<NONE>";
2469
	String expectedUnitDisplayString =
2470
			"public class X {\n" + 
2471
			"  public X() {\n" + 
2472
			"  }\n" + 
2473
			"  void foo() {\n" + 
2474
			"  }\n" + 
2475
			"}\n";
2220
2476
2221
	checkMethodParse(
2477
	checkMethodParse(
2222
			str.toCharArray(),
2478
			str.toCharArray(),
Lines 2228-2234 Link Here
2228
			expectedReplacedSource,
2484
			expectedReplacedSource,
2229
			"full ast");
2485
			"full ast");
2230
}
2486
}
2231
public void test0053(){
2487
public void test0053_Diet(){
2232
	String str =
2488
	String str =
2233
		"public class X {\n" +
2489
		"public class X {\n" +
2234
		"  public X() {\n" + 
2490
		"  public X() {\n" + 
Lines 2258-2275 Link Here
2258
			completionIdentifier,
2514
			completionIdentifier,
2259
			expectedReplacedSource,
2515
			expectedReplacedSource,
2260
	"diet ast");
2516
	"diet ast");
2261
	
2517
}
2262
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2518
public void test0053_Method(){
2263
	expectedParentNodeToString = "<NONE>";
2519
	String str =
2264
	completionIdentifier = "";
2520
		"public class X {\n" +
2265
	expectedReplacedSource = "Y<Z>.";
2266
	expectedUnitDisplayString =
2267
		"public class X {\n" + 
2268
		"  public X() {\n" + 
2521
		"  public X() {\n" + 
2269
		"    super();\n" + 
2522
		"    <Y<Z>.>super();\n" + 
2270
		"    <CompleteOnType:Y<Z>.>;\n" + 
2271
		"  }\n" + 
2523
		"  }\n" + 
2272
		"}\n";
2524
		"}";
2525
2526
2527
	String completeBehind = "Y<Z>.";
2528
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2529
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2530
	String expectedParentNodeToString = "<NONE>";
2531
	String completionIdentifier = "";
2532
	String expectedReplacedSource = "Y<Z>.";
2533
	String expectedUnitDisplayString =
2534
			"public class X {\n" + 
2535
			"  public X() {\n" + 
2536
			"    super();\n" + 
2537
			"    <CompleteOnType:Y<Z>.>;\n" + 
2538
			"  }\n" + 
2539
			"}\n";
2273
2540
2274
	checkMethodParse(
2541
	checkMethodParse(
2275
			str.toCharArray(),
2542
			str.toCharArray(),
Lines 2281-2287 Link Here
2281
			expectedReplacedSource,
2548
			expectedReplacedSource,
2282
			"full ast");
2549
			"full ast");
2283
}
2550
}
2284
public void test0054(){
2551
public void test0054_Diet(){
2285
	String str =
2552
	String str =
2286
		"public class X {\n" +
2553
		"public class X {\n" +
2287
		"  public X() {\n" + 
2554
		"  public X() {\n" + 
Lines 2311-2328 Link Here
2311
			completionIdentifier,
2578
			completionIdentifier,
2312
			expectedReplacedSource,
2579
			expectedReplacedSource,
2313
	"diet ast");
2580
	"diet ast");
2314
	
2581
}
2315
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2582
public void test0054_Method(){
2316
	expectedParentNodeToString = "<NONE>";
2583
	String str =
2317
	completionIdentifier = "";
2584
		"public class X {\n" +
2318
	expectedReplacedSource = "Y<Z>.";
2319
	expectedUnitDisplayString =
2320
		"public class X {\n" + 
2321
		"  public X() {\n" + 
2585
		"  public X() {\n" + 
2322
		"    super();\n" + 
2586
		"    aaa.<Y<Z>.>super();\n" + 
2323
		"    <CompleteOnType:Y<Z>.>;\n" + 
2324
		"  }\n" + 
2587
		"  }\n" + 
2325
		"}\n";
2588
		"}";
2589
2590
2591
	String completeBehind = "Y<Z>.";
2592
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2593
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2594
	String expectedParentNodeToString = "<NONE>";
2595
	String completionIdentifier = "";
2596
	String expectedReplacedSource = "Y<Z>.";
2597
	String expectedUnitDisplayString =
2598
			"public class X {\n" + 
2599
			"  public X() {\n" + 
2600
			"    super();\n" + 
2601
			"    <CompleteOnType:Y<Z>.>;\n" + 
2602
			"  }\n" + 
2603
			"}\n";
2326
2604
2327
	checkMethodParse(
2605
	checkMethodParse(
2328
			str.toCharArray(),
2606
			str.toCharArray(),
Lines 2334-2340 Link Here
2334
			expectedReplacedSource,
2612
			expectedReplacedSource,
2335
			"full ast");
2613
			"full ast");
2336
}
2614
}
2337
public void test0055(){
2615
public void test0055_Diet(){
2338
	String str =
2616
	String str =
2339
		"public class X {\n" +
2617
		"public class X {\n" +
2340
		"  public X() {\n" + 
2618
		"  public X() {\n" + 
Lines 2364-2381 Link Here
2364
			completionIdentifier,
2642
			completionIdentifier,
2365
			expectedReplacedSource,
2643
			expectedReplacedSource,
2366
	"diet ast");
2644
	"diet ast");
2367
	
2645
}
2368
	expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2646
public void test0055_Method(){
2369
	expectedParentNodeToString = "<NONE>";
2647
	String str =
2370
	completionIdentifier = "";
2648
		"public class X {\n" +
2371
	expectedReplacedSource = "Y<Z>.";
2372
	expectedUnitDisplayString =
2373
		"public class X {\n" + 
2374
		"  public X() {\n" + 
2649
		"  public X() {\n" + 
2375
		"    super();\n" + 
2650
		"    A.this.<Y<Z>.>super();\n" + 
2376
		"    <CompleteOnType:Y<Z>.>;\n" + 
2377
		"  }\n" + 
2651
		"  }\n" + 
2378
		"}\n";
2652
		"}";
2653
2654
2655
	String completeBehind = "Y<Z>.";
2656
	int cursorLocation = str.indexOf("Y<Z>.") + completeBehind.length() - 1;
2657
	String expectedCompletionNodeToString = "<CompleteOnType:Y<Z>.>";
2658
	String expectedParentNodeToString = "<NONE>";
2659
	String completionIdentifier = "";
2660
	String expectedReplacedSource = "Y<Z>.";
2661
	String expectedUnitDisplayString =
2662
			"public class X {\n" + 
2663
			"  public X() {\n" + 
2664
			"    super();\n" + 
2665
			"    <CompleteOnType:Y<Z>.>;\n" + 
2666
			"  }\n" + 
2667
			"}\n";
2379
2668
2380
	checkMethodParse(
2669
	checkMethodParse(
2381
			str.toCharArray(),
2670
			str.toCharArray(),
Lines 2388-2394 Link Here
2388
			"full ast");
2677
			"full ast");
2389
}
2678
}
2390
2679
2391
public void test0056(){
2680
public void test0056_Diet(){
2392
	String str =
2681
	String str =
2393
		"public class X {\n" +
2682
		"public class X {\n" +
2394
		"  void foo() {\n" + 
2683
		"  void foo() {\n" + 
Lines 2420-2438 Link Here
2420
			completionIdentifier,
2709
			completionIdentifier,
2421
			expectedReplacedSource,
2710
			expectedReplacedSource,
2422
	"diet ast");
2711
	"diet ast");
2423
	
2712
}
2424
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
2713
public void test0056_Method(){
2425
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
2714
	String str =
2426
	completionIdentifier = "Z";
2715
		"public class X {\n" +
2427
	expectedReplacedSource = "Z";
2428
	expectedUnitDisplayString =
2429
		"public class X {\n" + 
2430
		"  public X() {\n" + 
2431
		"  }\n" + 
2432
		"  void foo() {\n" + 
2716
		"  void foo() {\n" + 
2433
		"    Y<<CompleteOnType:Z>>;\n" + 
2717
		"    Y<Z\n" + 
2434
		"  }\n" + 
2718
		"  }\n" + 
2435
		"}\n";
2719
		"}";
2720
2721
2722
	String completeBehind = "Y<Z";
2723
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
2724
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
2725
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
2726
	String completionIdentifier = "Z";
2727
	String expectedReplacedSource = "Z";
2728
	String expectedUnitDisplayString =
2729
			"public class X {\n" + 
2730
			"  public X() {\n" + 
2731
			"  }\n" + 
2732
			"  void foo() {\n" + 
2733
			"    Y<<CompleteOnType:Z>>;\n" + 
2734
			"  }\n" + 
2735
			"}\n";
2436
2736
2437
	checkMethodParse(
2737
	checkMethodParse(
2438
			str.toCharArray(),
2738
			str.toCharArray(),
Lines 2444-2450 Link Here
2444
			expectedReplacedSource,
2744
			expectedReplacedSource,
2445
			"full ast");
2745
			"full ast");
2446
}
2746
}
2447
public void test0057(){
2747
public void test0057_Diet(){
2448
	String str =
2748
	String str =
2449
		"public class X {\n" +
2749
		"public class X {\n" +
2450
		"  void foo() {\n" + 
2750
		"  void foo() {\n" + 
Lines 2476-2494 Link Here
2476
			completionIdentifier,
2776
			completionIdentifier,
2477
			expectedReplacedSource,
2777
			expectedReplacedSource,
2478
	"diet ast");
2778
	"diet ast");
2479
	
2779
}
2480
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
2780
public void test0057_Method(){
2481
	expectedParentNodeToString = "Y<V, <CompleteOnType:Z>>";
2781
	String str =
2482
	completionIdentifier = "Z";
2782
		"public class X {\n" +
2483
	expectedReplacedSource = "Z";
2484
	expectedUnitDisplayString =
2485
		"public class X {\n" + 
2486
		"  public X() {\n" + 
2487
		"  }\n" + 
2488
		"  void foo() {\n" + 
2783
		"  void foo() {\n" + 
2489
		"    Y<V, <CompleteOnType:Z>>;\n" + 
2784
		"    Y<V,Z\n" + 
2490
		"  }\n" + 
2785
		"  }\n" + 
2491
		"}\n";
2786
		"}";
2787
2788
2789
	String completeBehind = "Y<V,Z";
2790
	int cursorLocation = str.indexOf("Y<V,Z") + completeBehind.length() - 1;
2791
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
2792
	String expectedParentNodeToString = "Y<V, <CompleteOnType:Z>>";
2793
	String completionIdentifier = "Z";
2794
	String expectedReplacedSource = "Z";
2795
	String expectedUnitDisplayString =
2796
			"public class X {\n" + 
2797
			"  public X() {\n" + 
2798
			"  }\n" + 
2799
			"  void foo() {\n" + 
2800
			"    Y<V, <CompleteOnType:Z>>;\n" + 
2801
			"  }\n" + 
2802
			"}\n";
2492
2803
2493
	checkMethodParse(
2804
	checkMethodParse(
2494
			str.toCharArray(),
2805
			str.toCharArray(),
Lines 2500-2506 Link Here
2500
			expectedReplacedSource,
2811
			expectedReplacedSource,
2501
			"full ast");
2812
			"full ast");
2502
}
2813
}
2503
public void test0058(){
2814
public void test0058_Diet(){
2504
	String str =
2815
	String str =
2505
		"public class X {\n" +
2816
		"public class X {\n" +
2506
		"  void foo() {\n" + 
2817
		"  void foo() {\n" + 
Lines 2532-2550 Link Here
2532
			completionIdentifier,
2843
			completionIdentifier,
2533
			expectedReplacedSource,
2844
			expectedReplacedSource,
2534
	"diet ast");
2845
	"diet ast");
2535
	
2846
}
2536
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
2847
public void test0058_Method(){
2537
	expectedParentNodeToString = "W<U>.Y<V, <CompleteOnType:Z>>";
2848
	String str =
2538
	completionIdentifier = "Z";
2849
		"public class X {\n" +
2539
	expectedReplacedSource = "Z";
2540
	expectedUnitDisplayString =
2541
		"public class X {\n" + 
2542
		"  public X() {\n" + 
2543
		"  }\n" + 
2544
		"  void foo() {\n" + 
2850
		"  void foo() {\n" + 
2545
		"    W<U>.Y<V, <CompleteOnType:Z>>;\n" + 
2851
		"    W<U>.Y<V,Z\n" + 
2546
		"  }\n" + 
2852
		"  }\n" + 
2547
		"}\n";
2853
		"}";
2854
2855
2856
	String completeBehind = "Y<V,Z";
2857
	int cursorLocation = str.indexOf("Y<V,Z") + completeBehind.length() - 1;
2858
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
2859
	String expectedParentNodeToString = "W<U>.Y<V, <CompleteOnType:Z>>";
2860
	String completionIdentifier = "Z";
2861
	String expectedReplacedSource = "Z";
2862
	String expectedUnitDisplayString =
2863
			"public class X {\n" + 
2864
			"  public X() {\n" + 
2865
			"  }\n" + 
2866
			"  void foo() {\n" + 
2867
			"    W<U>.Y<V, <CompleteOnType:Z>>;\n" + 
2868
			"  }\n" + 
2869
			"}\n";
2548
2870
2549
	checkMethodParse(
2871
	checkMethodParse(
2550
			str.toCharArray(),
2872
			str.toCharArray(),
Lines 3803-3809 Link Here
3803
			expectedReplacedSource,
4125
			expectedReplacedSource,
3804
	"diet ast");
4126
	"diet ast");
3805
}
4127
}
3806
public void test0099(){
4128
public void test0099_Diet(){
3807
	String str =
4129
	String str =
3808
		"public class X {\n" +
4130
		"public class X {\n" +
3809
		"  void foo() {\n" + 
4131
		"  void foo() {\n" + 
Lines 3835-3853 Link Here
3835
			completionIdentifier,
4157
			completionIdentifier,
3836
			expectedReplacedSource,
4158
			expectedReplacedSource,
3837
	"diet ast");
4159
	"diet ast");
3838
	
4160
}
3839
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4161
public void test0099_Method(){
3840
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4162
	String str =
3841
	completionIdentifier = "Z";
4163
		"public class X {\n" +
3842
	expectedReplacedSource = "Z";
3843
	expectedUnitDisplayString =
3844
		"public class X {\n" + 
3845
		"  public X() {\n" + 
3846
		"  }\n" + 
3847
		"  void foo() {\n" + 
4164
		"  void foo() {\n" + 
3848
		"    Y<<CompleteOnType:Z>>;\n" + 
4165
		"    this.<Y, Y<Z bar();\n" + 
3849
		"  }\n" + 
4166
		"  }\n" + 
3850
		"}\n";
4167
		"}";
4168
4169
4170
	String completeBehind = "Y<Z";
4171
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4172
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4173
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4174
	String completionIdentifier = "Z";
4175
	String expectedReplacedSource = "Z";
4176
	String expectedUnitDisplayString =
4177
			"public class X {\n" + 
4178
			"  public X() {\n" + 
4179
			"  }\n" + 
4180
			"  void foo() {\n" + 
4181
			"    Y<<CompleteOnType:Z>>;\n" + 
4182
			"  }\n" + 
4183
			"}\n";
3851
4184
3852
	checkMethodParse(
4185
	checkMethodParse(
3853
			str.toCharArray(),
4186
			str.toCharArray(),
Lines 3859-3865 Link Here
3859
			expectedReplacedSource,
4192
			expectedReplacedSource,
3860
			"full ast");
4193
			"full ast");
3861
}
4194
}
3862
public void test0100(){
4195
public void test0100_Diet(){
3863
	String str =
4196
	String str =
3864
		"public class X {\n" +
4197
		"public class X {\n" +
3865
		"  void foo() {\n" + 
4198
		"  void foo() {\n" + 
Lines 3891-3921 Link Here
3891
			completionIdentifier,
4224
			completionIdentifier,
3892
			expectedReplacedSource,
4225
			expectedReplacedSource,
3893
	"diet ast");
4226
	"diet ast");
3894
	
3895
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
3896
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
3897
	completionIdentifier = "Z";
3898
	expectedReplacedSource = "Z";
3899
	expectedUnitDisplayString =
3900
		"public class X {\n" + 
3901
		"  public X() {\n" + 
3902
		"  }\n" + 
3903
		"  void foo() {\n" + 
3904
		"    Y<<CompleteOnType:Z>>;\n" + 
3905
		"  }\n" + 
3906
		"}\n";
3907
3908
	checkMethodParse(
3909
			str.toCharArray(),
3910
			cursorLocation,
3911
			expectedCompletionNodeToString,
3912
			expectedParentNodeToString,
3913
			expectedUnitDisplayString,
3914
			completionIdentifier,
3915
			expectedReplacedSource,
3916
			"full ast");
3917
}
4227
}
3918
public void test0101(){
4228
public void test0100_Method(){
4229
	String str =
4230
		"public class X {\n" +
4231
		"  void foo() {\n" + 
4232
		"    this.<Y, Y<Z> bar();\n" + 
4233
		"  }\n" + 
4234
		"}";
4235
4236
4237
	String completeBehind = "Y<Z";
4238
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4239
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4240
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4241
	String completionIdentifier = "Z";
4242
	String expectedReplacedSource = "Z";
4243
	String expectedUnitDisplayString =
4244
			"public class X {\n" + 
4245
			"  public X() {\n" + 
4246
			"  }\n" + 
4247
			"  void foo() {\n" + 
4248
			"    Y<<CompleteOnType:Z>>;\n" + 
4249
			"  }\n" + 
4250
			"}\n";
4251
4252
	checkMethodParse(
4253
			str.toCharArray(),
4254
			cursorLocation,
4255
			expectedCompletionNodeToString,
4256
			expectedParentNodeToString,
4257
			expectedUnitDisplayString,
4258
			completionIdentifier,
4259
			expectedReplacedSource,
4260
			"full ast");
4261
}
4262
public void test0101_Diet(){
3919
	String str =
4263
	String str =
3920
		"public class X {\n" +
4264
		"public class X {\n" +
3921
		"  void foo() {\n" + 
4265
		"  void foo() {\n" + 
Lines 3947-3965 Link Here
3947
			completionIdentifier,
4291
			completionIdentifier,
3948
			expectedReplacedSource,
4292
			expectedReplacedSource,
3949
	"diet ast");
4293
	"diet ast");
3950
	
4294
}
3951
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4295
public void test0101_Method(){
3952
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4296
	String str =
3953
	completionIdentifier = "Z";
4297
		"public class X {\n" +
3954
	expectedReplacedSource = "Z";
3955
	expectedUnitDisplayString =
3956
		"public class X {\n" + 
3957
		"  public X() {\n" + 
3958
		"  }\n" + 
3959
		"  void foo() {\n" + 
4298
		"  void foo() {\n" + 
3960
		"    Y<<CompleteOnType:Z>>;\n" + 
4299
		"    this.<Y, Y<Z>> bar();\n" + 
3961
		"  }\n" + 
4300
		"  }\n" + 
3962
		"}\n";
4301
		"}";
4302
4303
4304
	String completeBehind = "Y<Z";
4305
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4306
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4307
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4308
	String completionIdentifier = "Z";
4309
	String expectedReplacedSource = "Z";
4310
	String expectedUnitDisplayString =
4311
			"public class X {\n" + 
4312
			"  public X() {\n" + 
4313
			"  }\n" + 
4314
			"  void foo() {\n" + 
4315
			"    Y<<CompleteOnType:Z>>;\n" + 
4316
			"  }\n" + 
4317
			"}\n";
3963
4318
3964
	checkMethodParse(
4319
	checkMethodParse(
3965
			str.toCharArray(),
4320
			str.toCharArray(),
Lines 3971-3977 Link Here
3971
			expectedReplacedSource,
4326
			expectedReplacedSource,
3972
			"full ast");
4327
			"full ast");
3973
}
4328
}
3974
public void test0102(){
4329
public void test0102_Diet(){
3975
	String str =
4330
	String str =
3976
		"public class X {\n" +
4331
		"public class X {\n" +
3977
		"  void foo() {\n" + 
4332
		"  void foo() {\n" + 
Lines 4003-4021 Link Here
4003
			completionIdentifier,
4358
			completionIdentifier,
4004
			expectedReplacedSource,
4359
			expectedReplacedSource,
4005
	"diet ast");
4360
	"diet ast");
4006
	
4361
}
4007
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4362
public void test0102_Method(){
4008
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4363
	String str =
4009
	completionIdentifier = "Z";
4364
		"public class X {\n" +
4010
	expectedReplacedSource = "Z";
4011
	expectedUnitDisplayString =
4012
		"public class X {\n" + 
4013
		"  public X() {\n" + 
4014
		"  }\n" + 
4015
		"  void foo() {\n" + 
4365
		"  void foo() {\n" + 
4016
		"    Y<<CompleteOnType:Z>>;\n" + 
4366
		"    this.<Y, Y<Z bar\n" + 
4017
		"  }\n" + 
4367
		"  }\n" + 
4018
		"}\n";
4368
		"}";
4369
4370
4371
	String completeBehind = "Y<Z";
4372
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4373
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4374
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4375
	String completionIdentifier = "Z";
4376
	String expectedReplacedSource = "Z";
4377
	String expectedUnitDisplayString =
4378
			"public class X {\n" + 
4379
			"  public X() {\n" + 
4380
			"  }\n" + 
4381
			"  void foo() {\n" + 
4382
			"    Y<<CompleteOnType:Z>>;\n" + 
4383
			"  }\n" + 
4384
			"}\n";
4019
4385
4020
	checkMethodParse(
4386
	checkMethodParse(
4021
			str.toCharArray(),
4387
			str.toCharArray(),
Lines 4027-4033 Link Here
4027
			expectedReplacedSource,
4393
			expectedReplacedSource,
4028
			"full ast");
4394
			"full ast");
4029
}
4395
}
4030
public void test0103(){
4396
public void test0103_Diet(){
4031
	String str =
4397
	String str =
4032
		"public class X {\n" +
4398
		"public class X {\n" +
4033
		"  void foo() {\n" + 
4399
		"  void foo() {\n" + 
Lines 4059-4077 Link Here
4059
			completionIdentifier,
4425
			completionIdentifier,
4060
			expectedReplacedSource,
4426
			expectedReplacedSource,
4061
	"diet ast");
4427
	"diet ast");
4062
	
4428
}
4063
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4429
public void test0103_Method(){
4064
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4430
	String str =
4065
	completionIdentifier = "Z";
4431
		"public class X {\n" +
4066
	expectedReplacedSource = "Z";
4067
	expectedUnitDisplayString =
4068
		"public class X {\n" + 
4069
		"  public X() {\n" + 
4070
		"  }\n" + 
4071
		"  void foo() {\n" + 
4432
		"  void foo() {\n" + 
4072
		"    Y<<CompleteOnType:Z>>;\n" + 
4433
		"    this.<Y, Y<Z> bar\n" + 
4073
		"  }\n" + 
4434
		"  }\n" + 
4074
		"}\n";
4435
		"}";
4436
4437
4438
	String completeBehind = "Y<Z";
4439
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4440
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4441
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4442
	String completionIdentifier = "Z";
4443
	String expectedReplacedSource = "Z";
4444
	String expectedUnitDisplayString =
4445
			"public class X {\n" + 
4446
			"  public X() {\n" + 
4447
			"  }\n" + 
4448
			"  void foo() {\n" + 
4449
			"    Y<<CompleteOnType:Z>>;\n" + 
4450
			"  }\n" + 
4451
			"}\n";
4075
4452
4076
	checkMethodParse(
4453
	checkMethodParse(
4077
			str.toCharArray(),
4454
			str.toCharArray(),
Lines 4083-4089 Link Here
4083
			expectedReplacedSource,
4460
			expectedReplacedSource,
4084
			"full ast");
4461
			"full ast");
4085
}
4462
}
4086
public void test0104(){
4463
public void test0104_Diet(){
4087
	String str =
4464
	String str =
4088
		"public class X {\n" +
4465
		"public class X {\n" +
4089
		"  void foo() {\n" + 
4466
		"  void foo() {\n" + 
Lines 4115-4133 Link Here
4115
			completionIdentifier,
4492
			completionIdentifier,
4116
			expectedReplacedSource,
4493
			expectedReplacedSource,
4117
	"diet ast");
4494
	"diet ast");
4118
	
4495
}
4119
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4496
public void test0104_Method(){
4120
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4497
	String str =
4121
	completionIdentifier = "Z";
4498
		"public class X {\n" +
4122
	expectedReplacedSource = "Z";
4123
	expectedUnitDisplayString =
4124
		"public class X {\n" + 
4125
		"  public X() {\n" + 
4126
		"  }\n" + 
4127
		"  void foo() {\n" + 
4499
		"  void foo() {\n" + 
4128
		"    Y<<CompleteOnType:Z>>;\n" + 
4500
		"    this.<Y, Y<Z>> bar\n" + 
4129
		"  }\n" + 
4501
		"  }\n" + 
4130
		"}\n";
4502
		"}";
4503
4504
4505
	String completeBehind = "Y<Z";
4506
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4507
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4508
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4509
	String completionIdentifier = "Z";
4510
	String expectedReplacedSource = "Z";
4511
	String expectedUnitDisplayString =
4512
			"public class X {\n" + 
4513
			"  public X() {\n" + 
4514
			"  }\n" + 
4515
			"  void foo() {\n" + 
4516
			"    Y<<CompleteOnType:Z>>;\n" + 
4517
			"  }\n" + 
4518
			"}\n";
4131
4519
4132
	checkMethodParse(
4520
	checkMethodParse(
4133
			str.toCharArray(),
4521
			str.toCharArray(),
Lines 4139-4145 Link Here
4139
			expectedReplacedSource,
4527
			expectedReplacedSource,
4140
			"full ast");
4528
			"full ast");
4141
}
4529
}
4142
public void test0105(){
4530
public void test0105_Diet(){
4143
	String str =
4531
	String str =
4144
		"public class X {\n" +
4532
		"public class X {\n" +
4145
		"  void foo() {\n" + 
4533
		"  void foo() {\n" + 
Lines 4171-4189 Link Here
4171
			completionIdentifier,
4559
			completionIdentifier,
4172
			expectedReplacedSource,
4560
			expectedReplacedSource,
4173
	"diet ast");
4561
	"diet ast");
4174
	
4562
}
4175
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4563
public void test0105_Method(){
4176
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4564
	String str =
4177
	completionIdentifier = "Z";
4565
		"public class X {\n" +
4178
	expectedReplacedSource = "Z";
4179
	expectedUnitDisplayString =
4180
		"public class X {\n" + 
4181
		"  public X() {\n" + 
4182
		"  }\n" + 
4183
		"  void foo() {\n" + 
4566
		"  void foo() {\n" + 
4184
		"    Y<<CompleteOnType:Z>>;\n" + 
4567
		"    this.<Y, Y<Z\n" + 
4185
		"  }\n" + 
4568
		"  }\n" + 
4186
		"}\n";
4569
		"}";
4570
4571
4572
	String completeBehind = "Y<Z";
4573
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4574
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4575
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4576
	String completionIdentifier = "Z";
4577
	String expectedReplacedSource = "Z";
4578
	String expectedUnitDisplayString =
4579
			"public class X {\n" + 
4580
			"  public X() {\n" + 
4581
			"  }\n" + 
4582
			"  void foo() {\n" + 
4583
			"    Y<<CompleteOnType:Z>>;\n" + 
4584
			"  }\n" + 
4585
			"}\n";
4187
4586
4188
	checkMethodParse(
4587
	checkMethodParse(
4189
			str.toCharArray(),
4588
			str.toCharArray(),
Lines 4195-4201 Link Here
4195
			expectedReplacedSource,
4594
			expectedReplacedSource,
4196
			"full ast");
4595
			"full ast");
4197
}
4596
}
4198
public void test0106(){
4597
public void test0106_Diet(){
4199
	String str =
4598
	String str =
4200
		"public class X {\n" +
4599
		"public class X {\n" +
4201
		"  void foo() {\n" + 
4600
		"  void foo() {\n" + 
Lines 4227-4245 Link Here
4227
			completionIdentifier,
4626
			completionIdentifier,
4228
			expectedReplacedSource,
4627
			expectedReplacedSource,
4229
	"diet ast");
4628
	"diet ast");
4230
	
4629
}
4231
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4630
public void test0106_Method(){
4232
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4631
	String str =
4233
	completionIdentifier = "Z";
4632
		"public class X {\n" +
4234
	expectedReplacedSource = "Z";
4235
	expectedUnitDisplayString =
4236
		"public class X {\n" + 
4237
		"  public X() {\n" + 
4238
		"  }\n" + 
4239
		"  void foo() {\n" + 
4633
		"  void foo() {\n" + 
4240
		"    Y<<CompleteOnType:Z>>;\n" + 
4634
		"    this.<Y, Y<Z>\n" + 
4241
		"  }\n" + 
4635
		"  }\n" + 
4242
		"}\n";
4636
		"}";
4637
4638
4639
	String completeBehind = "Y<Z";
4640
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4641
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4642
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4643
	String completionIdentifier = "Z";
4644
	String expectedReplacedSource = "Z";
4645
	String expectedUnitDisplayString =
4646
			"public class X {\n" + 
4647
			"  public X() {\n" + 
4648
			"  }\n" + 
4649
			"  void foo() {\n" + 
4650
			"    Y<<CompleteOnType:Z>>;\n" + 
4651
			"  }\n" + 
4652
			"}\n";
4243
4653
4244
	checkMethodParse(
4654
	checkMethodParse(
4245
			str.toCharArray(),
4655
			str.toCharArray(),
Lines 4251-4257 Link Here
4251
			expectedReplacedSource,
4661
			expectedReplacedSource,
4252
			"full ast");
4662
			"full ast");
4253
}
4663
}
4254
public void test0107(){
4664
public void test0107_Diet(){
4255
	String str =
4665
	String str =
4256
		"public class X {\n" +
4666
		"public class X {\n" +
4257
		"  void foo() {\n" + 
4667
		"  void foo() {\n" + 
Lines 4283-4301 Link Here
4283
			completionIdentifier,
4693
			completionIdentifier,
4284
			expectedReplacedSource,
4694
			expectedReplacedSource,
4285
	"diet ast");
4695
	"diet ast");
4286
	
4696
}
4287
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4697
public void test0107_Method(){
4288
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4698
	String str =
4289
	completionIdentifier = "Z";
4699
		"public class X {\n" +
4290
	expectedReplacedSource = "Z";
4291
	expectedUnitDisplayString =
4292
		"public class X {\n" + 
4293
		"  public X() {\n" + 
4294
		"  }\n" + 
4295
		"  void foo() {\n" + 
4700
		"  void foo() {\n" + 
4296
		"    Y<<CompleteOnType:Z>>;\n" + 
4701
		"    this.<Y, Y<Z>>\n" + 
4297
		"  }\n" + 
4702
		"  }\n" + 
4298
		"}\n";
4703
		"}";
4704
4705
4706
	String completeBehind = "Y<Z";
4707
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4708
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4709
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4710
	String completionIdentifier = "Z";
4711
	String expectedReplacedSource = "Z";
4712
	String expectedUnitDisplayString =
4713
			"public class X {\n" + 
4714
			"  public X() {\n" + 
4715
			"  }\n" + 
4716
			"  void foo() {\n" + 
4717
			"    Y<<CompleteOnType:Z>>;\n" + 
4718
			"  }\n" + 
4719
			"}\n";
4299
4720
4300
	checkMethodParse(
4721
	checkMethodParse(
4301
			str.toCharArray(),
4722
			str.toCharArray(),
Lines 4307-4313 Link Here
4307
			expectedReplacedSource,
4728
			expectedReplacedSource,
4308
			"full ast");
4729
			"full ast");
4309
}
4730
}
4310
public void test0108(){
4731
public void test0108_Diet(){
4311
	String str =
4732
	String str =
4312
		"public class X {\n" +
4733
		"public class X {\n" +
4313
		"  void foo() {\n" + 
4734
		"  void foo() {\n" + 
Lines 4339-4357 Link Here
4339
			completionIdentifier,
4760
			completionIdentifier,
4340
			expectedReplacedSource,
4761
			expectedReplacedSource,
4341
	"diet ast");
4762
	"diet ast");
4342
	
4763
}
4343
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4764
public void test0108_Method(){
4344
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4765
	String str =
4345
	completionIdentifier = "Z";
4766
		"public class X {\n" +
4346
	expectedReplacedSource = "Z";
4347
	expectedUnitDisplayString =
4348
		"public class X {\n" + 
4349
		"  public X() {\n" + 
4350
		"  }\n" + 
4351
		"  void foo() {\n" + 
4767
		"  void foo() {\n" + 
4352
		"    Y<<CompleteOnType:Z>>;\n" + 
4768
		"    new <Y, Y<Z X();\n" + 
4353
		"  }\n" + 
4769
		"  }\n" + 
4354
		"}\n";
4770
		"}";
4771
4772
4773
	String completeBehind = "Y<Z";
4774
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4775
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4776
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4777
	String completionIdentifier = "Z";
4778
	String expectedReplacedSource = "Z";
4779
	String expectedUnitDisplayString =
4780
			"public class X {\n" + 
4781
			"  public X() {\n" + 
4782
			"  }\n" + 
4783
			"  void foo() {\n" + 
4784
			"    Y<<CompleteOnType:Z>>;\n" + 
4785
			"  }\n" + 
4786
			"}\n";
4355
4787
4356
	checkMethodParse(
4788
	checkMethodParse(
4357
			str.toCharArray(),
4789
			str.toCharArray(),
Lines 4363-4369 Link Here
4363
			expectedReplacedSource,
4795
			expectedReplacedSource,
4364
			"full ast");
4796
			"full ast");
4365
}
4797
}
4366
public void test0109(){
4798
public void test0109_Diet(){
4367
	String str =
4799
	String str =
4368
		"public class X {\n" +
4800
		"public class X {\n" +
4369
		"  void foo() {\n" + 
4801
		"  void foo() {\n" + 
Lines 4395-4413 Link Here
4395
			completionIdentifier,
4827
			completionIdentifier,
4396
			expectedReplacedSource,
4828
			expectedReplacedSource,
4397
	"diet ast");
4829
	"diet ast");
4398
	
4830
}
4399
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4831
public void test0109_Method(){
4400
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4832
	String str =
4401
	completionIdentifier = "Z";
4833
		"public class X {\n" +
4402
	expectedReplacedSource = "Z";
4403
	expectedUnitDisplayString =
4404
		"public class X {\n" + 
4405
		"  public X() {\n" + 
4406
		"  }\n" + 
4407
		"  void foo() {\n" + 
4834
		"  void foo() {\n" + 
4408
		"    Y<<CompleteOnType:Z>>;\n" + 
4835
		"    new <Y, Y<Z> X();\n" + 
4409
		"  }\n" + 
4836
		"  }\n" + 
4410
		"}\n";
4837
		"}";
4838
4839
4840
	String completeBehind = "Y<Z";
4841
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4842
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4843
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4844
	String completionIdentifier = "Z";
4845
	String expectedReplacedSource = "Z";
4846
	String expectedUnitDisplayString =
4847
			"public class X {\n" + 
4848
			"  public X() {\n" + 
4849
			"  }\n" + 
4850
			"  void foo() {\n" + 
4851
			"    Y<<CompleteOnType:Z>>;\n" + 
4852
			"  }\n" + 
4853
			"}\n";
4411
4854
4412
	checkMethodParse(
4855
	checkMethodParse(
4413
			str.toCharArray(),
4856
			str.toCharArray(),
Lines 4419-4425 Link Here
4419
			expectedReplacedSource,
4862
			expectedReplacedSource,
4420
			"full ast");
4863
			"full ast");
4421
}
4864
}
4422
public void test0110(){
4865
public void test0110_Diet(){
4423
	String str =
4866
	String str =
4424
		"public class X {\n" +
4867
		"public class X {\n" +
4425
		"  void foo() {\n" + 
4868
		"  void foo() {\n" + 
Lines 4451-4469 Link Here
4451
			completionIdentifier,
4894
			completionIdentifier,
4452
			expectedReplacedSource,
4895
			expectedReplacedSource,
4453
	"diet ast");
4896
	"diet ast");
4454
	
4897
}
4455
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4898
public void test0110_Method(){
4456
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4899
	String str =
4457
	completionIdentifier = "Z";
4900
		"public class X {\n" +
4458
	expectedReplacedSource = "Z";
4459
	expectedUnitDisplayString =
4460
		"public class X {\n" + 
4461
		"  public X() {\n" + 
4462
		"  }\n" + 
4463
		"  void foo() {\n" + 
4901
		"  void foo() {\n" + 
4464
		"    Y<<CompleteOnType:Z>>;\n" + 
4902
		"    new <Y, Y<Z>> X();\n" + 
4465
		"  }\n" + 
4903
		"  }\n" + 
4466
		"}\n";
4904
		"}";
4905
4906
4907
	String completeBehind = "Y<Z";
4908
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4909
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4910
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4911
	String completionIdentifier = "Z";
4912
	String expectedReplacedSource = "Z";
4913
	String expectedUnitDisplayString =
4914
			"public class X {\n" + 
4915
			"  public X() {\n" + 
4916
			"  }\n" + 
4917
			"  void foo() {\n" + 
4918
			"    Y<<CompleteOnType:Z>>;\n" + 
4919
			"  }\n" + 
4920
			"}\n";
4467
4921
4468
	checkMethodParse(
4922
	checkMethodParse(
4469
			str.toCharArray(),
4923
			str.toCharArray(),
Lines 4475-4481 Link Here
4475
			expectedReplacedSource,
4929
			expectedReplacedSource,
4476
			"full ast");
4930
			"full ast");
4477
}
4931
}
4478
public void test0111(){
4932
public void test0111_Diet(){
4479
	String str =
4933
	String str =
4480
		"public class X {\n" +
4934
		"public class X {\n" +
4481
		"  void foo() {\n" + 
4935
		"  void foo() {\n" + 
Lines 4507-4525 Link Here
4507
			completionIdentifier,
4961
			completionIdentifier,
4508
			expectedReplacedSource,
4962
			expectedReplacedSource,
4509
	"diet ast");
4963
	"diet ast");
4510
	
4964
}
4511
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
4965
public void test0111_Method(){
4512
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4966
	String str =
4513
	completionIdentifier = "Z";
4967
		"public class X {\n" +
4514
	expectedReplacedSource = "Z";
4515
	expectedUnitDisplayString =
4516
		"public class X {\n" + 
4517
		"  public X() {\n" + 
4518
		"  }\n" + 
4519
		"  void foo() {\n" + 
4968
		"  void foo() {\n" + 
4520
		"    Y<<CompleteOnType:Z>>;\n" + 
4969
		"    aaa.new <Y, Y<Z X();\n" + 
4521
		"  }\n" + 
4970
		"  }\n" + 
4522
		"}\n";
4971
		"}";
4972
4973
4974
	String completeBehind = "Y<Z";
4975
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
4976
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
4977
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
4978
	String completionIdentifier = "Z";
4979
	String expectedReplacedSource = "Z";
4980
	String expectedUnitDisplayString =
4981
			"public class X {\n" + 
4982
			"  public X() {\n" + 
4983
			"  }\n" + 
4984
			"  void foo() {\n" + 
4985
			"    Y<<CompleteOnType:Z>>;\n" + 
4986
			"  }\n" + 
4987
			"}\n";
4523
4988
4524
	checkMethodParse(
4989
	checkMethodParse(
4525
			str.toCharArray(),
4990
			str.toCharArray(),
Lines 4531-4537 Link Here
4531
			expectedReplacedSource,
4996
			expectedReplacedSource,
4532
			"full ast");
4997
			"full ast");
4533
}
4998
}
4534
public void test0112(){
4999
public void test0112_Diet(){
4535
	String str =
5000
	String str =
4536
		"public class X {\n" +
5001
		"public class X {\n" +
4537
		"  void foo() {\n" + 
5002
		"  void foo() {\n" + 
Lines 4563-4581 Link Here
4563
			completionIdentifier,
5028
			completionIdentifier,
4564
			expectedReplacedSource,
5029
			expectedReplacedSource,
4565
	"diet ast");
5030
	"diet ast");
4566
	
5031
}
4567
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5032
public void test0112_Method(){
4568
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5033
	String str =
4569
	completionIdentifier = "Z";
5034
		"public class X {\n" +
4570
	expectedReplacedSource = "Z";
4571
	expectedUnitDisplayString =
4572
		"public class X {\n" + 
4573
		"  public X() {\n" + 
4574
		"  }\n" + 
4575
		"  void foo() {\n" + 
5035
		"  void foo() {\n" + 
4576
		"    Y<<CompleteOnType:Z>>;\n" + 
5036
		"    aaa.new <Y, Y<Z> X();\n" + 
4577
		"  }\n" + 
5037
		"  }\n" + 
4578
		"}\n";
5038
		"}";
5039
5040
5041
	String completeBehind = "Y<Z";
5042
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5043
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5044
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5045
	String completionIdentifier = "Z";
5046
	String expectedReplacedSource = "Z";
5047
	String expectedUnitDisplayString =
5048
			"public class X {\n" + 
5049
			"  public X() {\n" + 
5050
			"  }\n" + 
5051
			"  void foo() {\n" + 
5052
			"    Y<<CompleteOnType:Z>>;\n" + 
5053
			"  }\n" + 
5054
			"}\n";
4579
5055
4580
	checkMethodParse(
5056
	checkMethodParse(
4581
			str.toCharArray(),
5057
			str.toCharArray(),
Lines 4587-4593 Link Here
4587
			expectedReplacedSource,
5063
			expectedReplacedSource,
4588
			"full ast");
5064
			"full ast");
4589
}
5065
}
4590
public void test0113(){
5066
public void test0113_Diet(){
4591
	String str =
5067
	String str =
4592
		"public class X {\n" +
5068
		"public class X {\n" +
4593
		"  void foo() {\n" + 
5069
		"  void foo() {\n" + 
Lines 4619-4637 Link Here
4619
			completionIdentifier,
5095
			completionIdentifier,
4620
			expectedReplacedSource,
5096
			expectedReplacedSource,
4621
	"diet ast");
5097
	"diet ast");
4622
	
5098
}
4623
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5099
public void test0113_Method(){
4624
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5100
	String str =
4625
	completionIdentifier = "Z";
5101
		"public class X {\n" +
4626
	expectedReplacedSource = "Z";
4627
	expectedUnitDisplayString =
4628
		"public class X {\n" + 
4629
		"  public X() {\n" + 
4630
		"  }\n" + 
4631
		"  void foo() {\n" + 
5102
		"  void foo() {\n" + 
4632
		"    Y<<CompleteOnType:Z>>;\n" + 
5103
		"    aaa.new <Y, Y<Z>> X();\n" + 
4633
		"  }\n" + 
5104
		"  }\n" + 
4634
		"}\n";
5105
		"}";
5106
5107
5108
	String completeBehind = "Y<Z";
5109
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5110
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5111
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5112
	String completionIdentifier = "Z";
5113
	String expectedReplacedSource = "Z";
5114
	String expectedUnitDisplayString =
5115
			"public class X {\n" + 
5116
			"  public X() {\n" + 
5117
			"  }\n" + 
5118
			"  void foo() {\n" + 
5119
			"    Y<<CompleteOnType:Z>>;\n" + 
5120
			"  }\n" + 
5121
			"}\n";
4635
5122
4636
	checkMethodParse(
5123
	checkMethodParse(
4637
			str.toCharArray(),
5124
			str.toCharArray(),
Lines 4643-4649 Link Here
4643
			expectedReplacedSource,
5130
			expectedReplacedSource,
4644
			"full ast");
5131
			"full ast");
4645
}
5132
}
4646
public void test0114(){
5133
public void test0114_Diet(){
4647
	String str =
5134
	String str =
4648
		"public class X {\n" +
5135
		"public class X {\n" +
4649
		"  void foo() {\n" + 
5136
		"  void foo() {\n" + 
Lines 4675-4693 Link Here
4675
			completionIdentifier,
5162
			completionIdentifier,
4676
			expectedReplacedSource,
5163
			expectedReplacedSource,
4677
	"diet ast");
5164
	"diet ast");
4678
	
5165
}
4679
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5166
public void test0114_Method(){
4680
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5167
	String str =
4681
	completionIdentifier = "Z";
5168
		"public class X {\n" +
4682
	expectedReplacedSource = "Z";
4683
	expectedUnitDisplayString =
4684
		"public class X {\n" + 
4685
		"  public X() {\n" + 
4686
		"  }\n" + 
4687
		"  void foo() {\n" + 
5169
		"  void foo() {\n" + 
4688
		"    Y<<CompleteOnType:Z>>;\n" + 
5170
		"    new V().new <Y, Y<Z X();\n" + 
4689
		"  }\n" + 
5171
		"  }\n" + 
4690
		"}\n";
5172
		"}";
5173
5174
5175
	String completeBehind = "Y<Z";
5176
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5177
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5178
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5179
	String completionIdentifier = "Z";
5180
	String expectedReplacedSource = "Z";
5181
	String expectedUnitDisplayString =
5182
			"public class X {\n" + 
5183
			"  public X() {\n" + 
5184
			"  }\n" + 
5185
			"  void foo() {\n" + 
5186
			"    Y<<CompleteOnType:Z>>;\n" + 
5187
			"  }\n" + 
5188
			"}\n";
4691
5189
4692
	checkMethodParse(
5190
	checkMethodParse(
4693
			str.toCharArray(),
5191
			str.toCharArray(),
Lines 4699-4705 Link Here
4699
			expectedReplacedSource,
5197
			expectedReplacedSource,
4700
			"full ast");
5198
			"full ast");
4701
}
5199
}
4702
public void test0115(){
5200
public void test0115_Diet(){
4703
	String str =
5201
	String str =
4704
		"public class X {\n" +
5202
		"public class X {\n" +
4705
		"  void foo() {\n" + 
5203
		"  void foo() {\n" + 
Lines 4731-4749 Link Here
4731
			completionIdentifier,
5229
			completionIdentifier,
4732
			expectedReplacedSource,
5230
			expectedReplacedSource,
4733
	"diet ast");
5231
	"diet ast");
4734
	
5232
}
4735
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5233
public void test0115_Method(){
4736
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5234
	String str =
4737
	completionIdentifier = "Z";
5235
		"public class X {\n" +
4738
	expectedReplacedSource = "Z";
4739
	expectedUnitDisplayString =
4740
		"public class X {\n" + 
4741
		"  public X() {\n" + 
4742
		"  }\n" + 
4743
		"  void foo() {\n" + 
5236
		"  void foo() {\n" + 
4744
		"    Y<<CompleteOnType:Z>>;\n" + 
5237
		"    new V().new <Y, Y<Z> X();\n" + 
4745
		"  }\n" + 
5238
		"  }\n" + 
4746
		"}\n";
5239
		"}";
5240
5241
5242
	String completeBehind = "Y<Z";
5243
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5244
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5245
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5246
	String completionIdentifier = "Z";
5247
	String expectedReplacedSource = "Z";
5248
	String expectedUnitDisplayString =
5249
			"public class X {\n" + 
5250
			"  public X() {\n" + 
5251
			"  }\n" + 
5252
			"  void foo() {\n" + 
5253
			"    Y<<CompleteOnType:Z>>;\n" + 
5254
			"  }\n" + 
5255
			"}\n";
4747
5256
4748
	checkMethodParse(
5257
	checkMethodParse(
4749
			str.toCharArray(),
5258
			str.toCharArray(),
Lines 4755-4761 Link Here
4755
			expectedReplacedSource,
5264
			expectedReplacedSource,
4756
			"full ast");
5265
			"full ast");
4757
}
5266
}
4758
public void test0116(){
5267
public void test0116_Diet(){
4759
	String str =
5268
	String str =
4760
		"public class X {\n" +
5269
		"public class X {\n" +
4761
		"  void foo() {\n" + 
5270
		"  void foo() {\n" + 
Lines 4787-4805 Link Here
4787
			completionIdentifier,
5296
			completionIdentifier,
4788
			expectedReplacedSource,
5297
			expectedReplacedSource,
4789
	"diet ast");
5298
	"diet ast");
4790
	
5299
}
4791
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5300
public void test0116_Method(){
4792
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5301
	String str =
4793
	completionIdentifier = "Z";
5302
		"public class X {\n" +
4794
	expectedReplacedSource = "Z";
4795
	expectedUnitDisplayString =
4796
		"public class X {\n" + 
4797
		"  public X() {\n" + 
4798
		"  }\n" + 
4799
		"  void foo() {\n" + 
5303
		"  void foo() {\n" + 
4800
		"    Y<<CompleteOnType:Z>>;\n" + 
5304
		"    new V().new <Y, Y<Z>> X();\n" + 
4801
		"  }\n" + 
5305
		"  }\n" + 
4802
		"}\n";
5306
		"}";
5307
5308
5309
	String completeBehind = "Y<Z";
5310
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5311
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5312
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5313
	String completionIdentifier = "Z";
5314
	String expectedReplacedSource = "Z";
5315
	String expectedUnitDisplayString =
5316
			"public class X {\n" + 
5317
			"  public X() {\n" + 
5318
			"  }\n" + 
5319
			"  void foo() {\n" + 
5320
			"    Y<<CompleteOnType:Z>>;\n" + 
5321
			"  }\n" + 
5322
			"}\n";
4803
5323
4804
	checkMethodParse(
5324
	checkMethodParse(
4805
			str.toCharArray(),
5325
			str.toCharArray(),
Lines 4811-4817 Link Here
4811
			expectedReplacedSource,
5331
			expectedReplacedSource,
4812
			"full ast");
5332
			"full ast");
4813
}
5333
}
4814
public void test0117(){
5334
public void test0117_Diet(){
4815
	String str =
5335
	String str =
4816
		"public class X {\n" +
5336
		"public class X {\n" +
4817
		"  void foo() {\n" + 
5337
		"  void foo() {\n" + 
Lines 4843-4861 Link Here
4843
			completionIdentifier,
5363
			completionIdentifier,
4844
			expectedReplacedSource,
5364
			expectedReplacedSource,
4845
	"diet ast");
5365
	"diet ast");
4846
	
5366
}
4847
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5367
public void test0117_Method(){
4848
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5368
	String str =
4849
	completionIdentifier = "Z";
5369
		"public class X {\n" +
4850
	expectedReplacedSource = "Z";
4851
	expectedUnitDisplayString =
4852
		"public class X {\n" + 
4853
		"  public X() {\n" + 
4854
		"  }\n" + 
4855
		"  void foo() {\n" + 
5370
		"  void foo() {\n" + 
4856
		"    Y<<CompleteOnType:Z>>;\n" + 
5371
		"    for(Y<Z var;;){}\n" + 
4857
		"  }\n" + 
5372
		"  }\n" + 
4858
		"}\n";
5373
		"}";
5374
5375
5376
	String completeBehind = "Y<Z";
5377
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5378
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5379
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5380
	String completionIdentifier = "Z";
5381
	String expectedReplacedSource = "Z";
5382
	String expectedUnitDisplayString =
5383
			"public class X {\n" + 
5384
			"  public X() {\n" + 
5385
			"  }\n" + 
5386
			"  void foo() {\n" + 
5387
			"    Y<<CompleteOnType:Z>>;\n" + 
5388
			"  }\n" + 
5389
			"}\n";
4859
5390
4860
	checkMethodParse(
5391
	checkMethodParse(
4861
			str.toCharArray(),
5392
			str.toCharArray(),
Lines 4867-4873 Link Here
4867
			expectedReplacedSource,
5398
			expectedReplacedSource,
4868
			"full ast");
5399
			"full ast");
4869
}
5400
}
4870
public void test0118(){
5401
public void test0118_Diet(){
4871
	String str =
5402
	String str =
4872
		"public class X {\n" +
5403
		"public class X {\n" +
4873
		"  void foo() {\n" + 
5404
		"  void foo() {\n" + 
Lines 4899-4917 Link Here
4899
			completionIdentifier,
5430
			completionIdentifier,
4900
			expectedReplacedSource,
5431
			expectedReplacedSource,
4901
	"diet ast");
5432
	"diet ast");
4902
	
5433
}
4903
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5434
public void test0118_Method(){
4904
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5435
	String str =
4905
	completionIdentifier = "Z";
5436
		"public class X {\n" +
4906
	expectedReplacedSource = "Z";
4907
	expectedUnitDisplayString =
4908
		"public class X {\n" + 
4909
		"  public X() {\n" + 
4910
		"  }\n" + 
4911
		"  void foo() {\n" + 
5437
		"  void foo() {\n" + 
4912
		"    Y<<CompleteOnType:Z>>;\n" + 
5438
		"    for(Y<Z> var;;){}\n" + 
4913
		"  }\n" + 
5439
		"  }\n" + 
4914
		"}\n";
5440
		"}";
5441
5442
5443
	String completeBehind = "Y<Z";
5444
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5445
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5446
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5447
	String completionIdentifier = "Z";
5448
	String expectedReplacedSource = "Z";
5449
	String expectedUnitDisplayString =
5450
			"public class X {\n" + 
5451
			"  public X() {\n" + 
5452
			"  }\n" + 
5453
			"  void foo() {\n" + 
5454
			"    Y<<CompleteOnType:Z>>;\n" + 
5455
			"  }\n" + 
5456
			"}\n";
4915
5457
4916
	checkMethodParse(
5458
	checkMethodParse(
4917
			str.toCharArray(),
5459
			str.toCharArray(),
Lines 4923-4929 Link Here
4923
			expectedReplacedSource,
5465
			expectedReplacedSource,
4924
			"full ast");
5466
			"full ast");
4925
}
5467
}
4926
public void test0119(){
5468
public void test0119_Diet(){
4927
	String str =
5469
	String str =
4928
		"public class X {\n" +
5470
		"public class X {\n" +
4929
		"  void foo() {\n" + 
5471
		"  void foo() {\n" + 
Lines 4955-4973 Link Here
4955
			completionIdentifier,
5497
			completionIdentifier,
4956
			expectedReplacedSource,
5498
			expectedReplacedSource,
4957
	"diet ast");
5499
	"diet ast");
4958
	
5500
}
4959
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5501
public void test0119_Method(){
4960
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5502
	String str =
4961
	completionIdentifier = "Z";
5503
		"public class X {\n" +
4962
	expectedReplacedSource = "Z";
4963
	expectedUnitDisplayString =
4964
		"public class X {\n" + 
4965
		"  public X() {\n" + 
4966
		"  }\n" + 
4967
		"  void foo() {\n" + 
5504
		"  void foo() {\n" + 
4968
		"    Y<<CompleteOnType:Z>>;\n" + 
5505
		"    for(Y<Z\n" + 
4969
		"  }\n" + 
5506
		"  }\n" + 
4970
		"}\n";
5507
		"}";
5508
5509
5510
	String completeBehind = "Y<Z";
5511
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5512
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5513
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5514
	String completionIdentifier = "Z";
5515
	String expectedReplacedSource = "Z";
5516
	String expectedUnitDisplayString =
5517
			"public class X {\n" + 
5518
			"  public X() {\n" + 
5519
			"  }\n" + 
5520
			"  void foo() {\n" + 
5521
			"    Y<<CompleteOnType:Z>>;\n" + 
5522
			"  }\n" + 
5523
			"}\n";
4971
5524
4972
	checkMethodParse(
5525
	checkMethodParse(
4973
			str.toCharArray(),
5526
			str.toCharArray(),
Lines 4979-4985 Link Here
4979
			expectedReplacedSource,
5532
			expectedReplacedSource,
4980
			"full ast");
5533
			"full ast");
4981
}
5534
}
4982
public void test0120(){
5535
public void test0120_Diet(){
4983
	String str =
5536
	String str =
4984
		"public class X {\n" +
5537
		"public class X {\n" +
4985
		"  void foo() {\n" + 
5538
		"  void foo() {\n" + 
Lines 5011-5029 Link Here
5011
			completionIdentifier,
5564
			completionIdentifier,
5012
			expectedReplacedSource,
5565
			expectedReplacedSource,
5013
	"diet ast");
5566
	"diet ast");
5014
	
5567
}
5015
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5568
public void test0120_Method(){
5016
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5569
	String str =
5017
	completionIdentifier = "Z";
5570
		"public class X {\n" +
5018
	expectedReplacedSource = "Z";
5019
	expectedUnitDisplayString =
5020
		"public class X {\n" + 
5021
		"  public X() {\n" + 
5022
		"  }\n" + 
5023
		"  void foo() {\n" + 
5571
		"  void foo() {\n" + 
5024
		"    Y<<CompleteOnType:Z>>;\n" + 
5572
		"    for(Y<Z>\n" + 
5025
		"  }\n" + 
5573
		"  }\n" + 
5026
		"}\n";
5574
		"}";
5575
5576
5577
	String completeBehind = "Y<Z";
5578
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5579
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5580
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5581
	String completionIdentifier = "Z";
5582
	String expectedReplacedSource = "Z";
5583
	String expectedUnitDisplayString =
5584
			"public class X {\n" + 
5585
			"  public X() {\n" + 
5586
			"  }\n" + 
5587
			"  void foo() {\n" + 
5588
			"    Y<<CompleteOnType:Z>>;\n" + 
5589
			"  }\n" + 
5590
			"}\n";
5027
5591
5028
	checkMethodParse(
5592
	checkMethodParse(
5029
			str.toCharArray(),
5593
			str.toCharArray(),
Lines 5035-5041 Link Here
5035
			expectedReplacedSource,
5599
			expectedReplacedSource,
5036
			"full ast");
5600
			"full ast");
5037
}
5601
}
5038
public void test0121(){
5602
public void test0121_Diet(){
5039
	String str =
5603
	String str =
5040
		"public class X {\n" +
5604
		"public class X {\n" +
5041
		"  void foo() {\n" + 
5605
		"  void foo() {\n" + 
Lines 5069-5087 Link Here
5069
			completionIdentifier,
5633
			completionIdentifier,
5070
			expectedReplacedSource,
5634
			expectedReplacedSource,
5071
	"diet ast");
5635
	"diet ast");
5072
	
5636
}
5073
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5637
public void test0121_Method(){
5074
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5638
	String str =
5075
	completionIdentifier = "Z";
5639
		"public class X {\n" +
5076
	expectedReplacedSource = "Z";
5077
	expectedUnitDisplayString =
5078
		"public class X {\n" + 
5079
		"  public X() {\n" + 
5080
		"  }\n" + 
5081
		"  void foo() {\n" + 
5640
		"  void foo() {\n" + 
5082
		"    Y<<CompleteOnType:Z>>;\n" + 
5641
		"    try {\n" + 
5642
		"    } catch(Y<Z e) {\n" +
5643
		"   }\n" + 
5083
		"  }\n" + 
5644
		"  }\n" + 
5084
		"}\n";
5645
		"}";
5646
5647
5648
	String completeBehind = "Y<Z";
5649
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5650
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5651
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5652
	String completionIdentifier = "Z";
5653
	String expectedReplacedSource = "Z";
5654
	String expectedUnitDisplayString =
5655
			"public class X {\n" + 
5656
			"  public X() {\n" + 
5657
			"  }\n" + 
5658
			"  void foo() {\n" + 
5659
			"    Y<<CompleteOnType:Z>>;\n" + 
5660
			"  }\n" + 
5661
			"}\n";
5085
5662
5086
	checkMethodParse(
5663
	checkMethodParse(
5087
			str.toCharArray(),
5664
			str.toCharArray(),
Lines 5093-5099 Link Here
5093
			expectedReplacedSource,
5670
			expectedReplacedSource,
5094
			"full ast");
5671
			"full ast");
5095
}
5672
}
5096
public void test0122(){
5673
public void test0122_Diet(){
5097
	String str =
5674
	String str =
5098
		"public class X {\n" +
5675
		"public class X {\n" +
5099
		"  void foo() {\n" + 
5676
		"  void foo() {\n" + 
Lines 5127-5145 Link Here
5127
			completionIdentifier,
5704
			completionIdentifier,
5128
			expectedReplacedSource,
5705
			expectedReplacedSource,
5129
	"diet ast");
5706
	"diet ast");
5130
	
5707
}
5131
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5708
public void test0122_Method(){
5132
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5709
	String str =
5133
	completionIdentifier = "Z";
5710
		"public class X {\n" +
5134
	expectedReplacedSource = "Z";
5135
	expectedUnitDisplayString =
5136
		"public class X {\n" + 
5137
		"  public X() {\n" + 
5138
		"  }\n" + 
5139
		"  void foo() {\n" + 
5711
		"  void foo() {\n" + 
5140
		"    Y<<CompleteOnType:Z>>;\n" + 
5712
		"    try {\n" + 
5713
		"    } catch(Y<Z> e) {\n" +
5714
		"   }\n" + 
5141
		"  }\n" + 
5715
		"  }\n" + 
5142
		"}\n";
5716
		"}";
5717
5718
5719
	String completeBehind = "Y<Z";
5720
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5721
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5722
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5723
	String completionIdentifier = "Z";
5724
	String expectedReplacedSource = "Z";
5725
	String expectedUnitDisplayString =
5726
			"public class X {\n" + 
5727
			"  public X() {\n" + 
5728
			"  }\n" + 
5729
			"  void foo() {\n" + 
5730
			"    Y<<CompleteOnType:Z>>;\n" + 
5731
			"  }\n" + 
5732
			"}\n";
5143
5733
5144
	checkMethodParse(
5734
	checkMethodParse(
5145
			str.toCharArray(),
5735
			str.toCharArray(),
Lines 5151-5157 Link Here
5151
			expectedReplacedSource,
5741
			expectedReplacedSource,
5152
			"full ast");
5742
			"full ast");
5153
}
5743
}
5154
public void test0123(){
5744
public void test0123_Diet(){
5155
	String str =
5745
	String str =
5156
		"public class X {\n" +
5746
		"public class X {\n" +
5157
		"  void foo() {\n" + 
5747
		"  void foo() {\n" + 
Lines 5184-5202 Link Here
5184
			completionIdentifier,
5774
			completionIdentifier,
5185
			expectedReplacedSource,
5775
			expectedReplacedSource,
5186
	"diet ast");
5776
	"diet ast");
5187
	
5777
}
5188
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5778
public void test0123_Method(){
5189
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5779
	String str =
5190
	completionIdentifier = "Z";
5780
		"public class X {\n" +
5191
	expectedReplacedSource = "Z";
5192
	expectedUnitDisplayString =
5193
		"public class X {\n" + 
5194
		"  public X() {\n" + 
5195
		"  }\n" + 
5196
		"  void foo() {\n" + 
5781
		"  void foo() {\n" + 
5197
		"    Y<<CompleteOnType:Z>>;\n" + 
5782
		"    try {\n" + 
5783
		"    } catch(Y<Z e\n" + 
5198
		"  }\n" + 
5784
		"  }\n" + 
5199
		"}\n";
5785
		"}";
5786
5787
5788
	String completeBehind = "Y<Z";
5789
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5790
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5791
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5792
	String completionIdentifier = "Z";
5793
	String expectedReplacedSource = "Z";
5794
	String expectedUnitDisplayString =
5795
			"public class X {\n" + 
5796
			"  public X() {\n" + 
5797
			"  }\n" + 
5798
			"  void foo() {\n" + 
5799
			"    Y<<CompleteOnType:Z>>;\n" + 
5800
			"  }\n" + 
5801
			"}\n";
5200
5802
5201
	checkMethodParse(
5803
	checkMethodParse(
5202
			str.toCharArray(),
5804
			str.toCharArray(),
Lines 5208-5214 Link Here
5208
			expectedReplacedSource,
5810
			expectedReplacedSource,
5209
			"full ast");
5811
			"full ast");
5210
}
5812
}
5211
public void test0124(){
5813
public void test0124_Diet(){
5212
	String str =
5814
	String str =
5213
		"public class X {\n" +
5815
		"public class X {\n" +
5214
		"  void foo() {\n" + 
5816
		"  void foo() {\n" + 
Lines 5241-5259 Link Here
5241
			completionIdentifier,
5843
			completionIdentifier,
5242
			expectedReplacedSource,
5844
			expectedReplacedSource,
5243
	"diet ast");
5845
	"diet ast");
5244
	
5846
}
5245
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5847
public void test0124_Method(){
5246
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5848
	String str =
5247
	completionIdentifier = "Z";
5849
		"public class X {\n" +
5248
	expectedReplacedSource = "Z";
5249
	expectedUnitDisplayString =
5250
		"public class X {\n" + 
5251
		"  public X() {\n" + 
5252
		"  }\n" + 
5253
		"  void foo() {\n" + 
5850
		"  void foo() {\n" + 
5254
		"    Y<<CompleteOnType:Z>>;\n" + 
5851
		"    try {\n" + 
5852
		"    } catch(Y<Z> e\n" + 
5255
		"  }\n" + 
5853
		"  }\n" + 
5256
		"}\n";
5854
		"}";
5855
5856
5857
	String completeBehind = "Y<Z";
5858
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5859
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5860
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5861
	String completionIdentifier = "Z";
5862
	String expectedReplacedSource = "Z";
5863
	String expectedUnitDisplayString =
5864
			"public class X {\n" + 
5865
			"  public X() {\n" + 
5866
			"  }\n" + 
5867
			"  void foo() {\n" + 
5868
			"    Y<<CompleteOnType:Z>>;\n" + 
5869
			"  }\n" + 
5870
			"}\n";
5257
5871
5258
	checkMethodParse(
5872
	checkMethodParse(
5259
			str.toCharArray(),
5873
			str.toCharArray(),
Lines 5265-5271 Link Here
5265
			expectedReplacedSource,
5879
			expectedReplacedSource,
5266
			"full ast");
5880
			"full ast");
5267
}
5881
}
5268
public void test0125(){
5882
public void test0125_Diet(){
5269
	String str =
5883
	String str =
5270
		"public class X {\n" +
5884
		"public class X {\n" +
5271
		"  void foo() {\n" + 
5885
		"  void foo() {\n" + 
Lines 5297-5315 Link Here
5297
			completionIdentifier,
5911
			completionIdentifier,
5298
			expectedReplacedSource,
5912
			expectedReplacedSource,
5299
	"diet ast");
5913
	"diet ast");
5300
	
5914
}
5301
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5915
public void test0125_Method(){
5302
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5916
	String str =
5303
	completionIdentifier = "Z";
5917
		"public class X {\n" +
5304
	expectedReplacedSource = "Z";
5305
	expectedUnitDisplayString =
5306
		"public class X {\n" + 
5307
		"  public X() {\n" + 
5308
		"  }\n" + 
5309
		"  void foo() {\n" + 
5918
		"  void foo() {\n" + 
5310
		"    Y<<CompleteOnType:Z>>;\n" + 
5919
		"    catch(Y<Z e\n" + 
5311
		"  }\n" + 
5920
		"  }\n" + 
5312
		"}\n";
5921
		"}";
5922
5923
5924
	String completeBehind = "Y<Z";
5925
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5926
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5927
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5928
	String completionIdentifier = "Z";
5929
	String expectedReplacedSource = "Z";
5930
	String expectedUnitDisplayString =
5931
			"public class X {\n" + 
5932
			"  public X() {\n" + 
5933
			"  }\n" + 
5934
			"  void foo() {\n" + 
5935
			"    Y<<CompleteOnType:Z>>;\n" + 
5936
			"  }\n" + 
5937
			"}\n";
5313
5938
5314
	checkMethodParse(
5939
	checkMethodParse(
5315
			str.toCharArray(),
5940
			str.toCharArray(),
Lines 5321-5327 Link Here
5321
			expectedReplacedSource,
5946
			expectedReplacedSource,
5322
			"full ast");
5947
			"full ast");
5323
}
5948
}
5324
public void test0126(){
5949
public void test0126_Diet(){
5325
	String str =
5950
	String str =
5326
		"public class X {\n" +
5951
		"public class X {\n" +
5327
		"  void foo() {\n" + 
5952
		"  void foo() {\n" + 
Lines 5353-5371 Link Here
5353
			completionIdentifier,
5978
			completionIdentifier,
5354
			expectedReplacedSource,
5979
			expectedReplacedSource,
5355
	"diet ast");
5980
	"diet ast");
5356
	
5981
}
5357
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
5982
public void test0126_Method(){
5358
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5983
	String str =
5359
	completionIdentifier = "Z";
5984
		"public class X {\n" +
5360
	expectedReplacedSource = "Z";
5361
	expectedUnitDisplayString =
5362
		"public class X {\n" + 
5363
		"  public X() {\n" + 
5364
		"  }\n" + 
5365
		"  void foo() {\n" + 
5985
		"  void foo() {\n" + 
5366
		"    Y<<CompleteOnType:Z>>;\n" + 
5986
		"    catch(Y<Z> e\n" + 
5367
		"  }\n" + 
5987
		"  }\n" + 
5368
		"}\n";
5988
		"}";
5989
5990
5991
	String completeBehind = "Y<Z";
5992
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
5993
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
5994
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
5995
	String completionIdentifier = "Z";
5996
	String expectedReplacedSource = "Z";
5997
	String expectedUnitDisplayString =
5998
			"public class X {\n" + 
5999
			"  public X() {\n" + 
6000
			"  }\n" + 
6001
			"  void foo() {\n" + 
6002
			"    Y<<CompleteOnType:Z>>;\n" + 
6003
			"  }\n" + 
6004
			"}\n";
5369
6005
5370
	checkMethodParse(
6006
	checkMethodParse(
5371
			str.toCharArray(),
6007
			str.toCharArray(),
Lines 5377-5383 Link Here
5377
			expectedReplacedSource,
6013
			expectedReplacedSource,
5378
			"full ast");
6014
			"full ast");
5379
}
6015
}
5380
public void test0127(){
6016
public void test0127_Diet(){
5381
	String str =
6017
	String str =
5382
		"public class X {\n" +
6018
		"public class X {\n" +
5383
		"  void foo() {\n" + 
6019
		"  void foo() {\n" + 
Lines 5409-5427 Link Here
5409
			completionIdentifier,
6045
			completionIdentifier,
5410
			expectedReplacedSource,
6046
			expectedReplacedSource,
5411
	"diet ast");
6047
	"diet ast");
5412
	
6048
}
5413
	expectedCompletionNodeToString = "<CompleteOnName:Z>";
6049
public void test0127_Method(){
5414
	expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6050
	String str =
5415
	completionIdentifier = "Z";
6051
		"public class X {\n" +
5416
	expectedReplacedSource = "Z";
5417
	expectedUnitDisplayString =
5418
		"public class X {\n" + 
5419
		"  public X() {\n" + 
5420
		"  }\n" + 
5421
		"  void foo() {\n" + 
6052
		"  void foo() {\n" + 
5422
		"    Object a = (Y < <CompleteOnName:Z>);\n" + 
6053
		"    Object a = (Y<Z ) e;\n" + 
5423
		"  }\n" + 
6054
		"  }\n" + 
5424
		"}\n";
6055
		"}";
6056
6057
6058
	String completeBehind = "Y<Z";
6059
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6060
	String expectedCompletionNodeToString = "<CompleteOnName:Z>";
6061
	String expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6062
	String completionIdentifier = "Z";
6063
	String expectedReplacedSource = "Z";
6064
	String expectedUnitDisplayString =
6065
			"public class X {\n" + 
6066
			"  public X() {\n" + 
6067
			"  }\n" + 
6068
			"  void foo() {\n" + 
6069
			"    Object a = (Y < <CompleteOnName:Z>);\n" + 
6070
			"  }\n" + 
6071
			"}\n";
5425
6072
5426
	checkMethodParse(
6073
	checkMethodParse(
5427
			str.toCharArray(),
6074
			str.toCharArray(),
Lines 5433-5439 Link Here
5433
			expectedReplacedSource,
6080
			expectedReplacedSource,
5434
			"full ast");
6081
			"full ast");
5435
}
6082
}
5436
public void test0128(){
6083
public void test0128_Diet(){
5437
	String str =
6084
	String str =
5438
		"public class X {\n" +
6085
		"public class X {\n" +
5439
		"  void foo() {\n" + 
6086
		"  void foo() {\n" + 
Lines 5465-5483 Link Here
5465
			completionIdentifier,
6112
			completionIdentifier,
5466
			expectedReplacedSource,
6113
			expectedReplacedSource,
5467
	"diet ast");
6114
	"diet ast");
5468
	
6115
}
5469
	expectedCompletionNodeToString = "<CompleteOnName:Z>";
6116
public void test0128_Method(){
5470
	expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6117
	String str =
5471
	completionIdentifier = "Z";
6118
		"public class X {\n" +
5472
	expectedReplacedSource = "Z";
5473
	expectedUnitDisplayString =
5474
		"public class X {\n" + 
5475
		"  public X() {\n" + 
5476
		"  }\n" + 
5477
		"  void foo() {\n" + 
6119
		"  void foo() {\n" + 
5478
		"    Object a = (Y < <CompleteOnName:Z>);\n" + 
6120
		"    Object a = (Y<Z> ) e;\n" + 
5479
		"  }\n" + 
6121
		"  }\n" + 
5480
		"}\n";
6122
		"}";
6123
6124
6125
	String completeBehind = "Y<Z";
6126
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6127
	String expectedCompletionNodeToString = "<CompleteOnName:Z>";
6128
	String expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6129
	String completionIdentifier = "Z";
6130
	String expectedReplacedSource = "Z";
6131
	String expectedUnitDisplayString =
6132
			"public class X {\n" + 
6133
			"  public X() {\n" + 
6134
			"  }\n" + 
6135
			"  void foo() {\n" + 
6136
			"    Object a = (Y < <CompleteOnName:Z>);\n" + 
6137
			"  }\n" + 
6138
			"}\n";
5481
6139
5482
	checkMethodParse(
6140
	checkMethodParse(
5483
			str.toCharArray(),
6141
			str.toCharArray(),
Lines 5489-5495 Link Here
5489
			expectedReplacedSource,
6147
			expectedReplacedSource,
5490
			"full ast");
6148
			"full ast");
5491
}
6149
}
5492
public void test0129(){
6150
public void test0129_Diet(){
5493
	String str =
6151
	String str =
5494
		"public class X {\n" +
6152
		"public class X {\n" +
5495
		"  void foo() {\n" + 
6153
		"  void foo() {\n" + 
Lines 5521-5539 Link Here
5521
			completionIdentifier,
6179
			completionIdentifier,
5522
			expectedReplacedSource,
6180
			expectedReplacedSource,
5523
	"diet ast");
6181
	"diet ast");
5524
	
6182
}
5525
	expectedCompletionNodeToString = "<CompleteOnName:Z>";
6183
public void test0129_Method(){
5526
	expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6184
	String str =
5527
	completionIdentifier = "Z";
6185
		"public class X {\n" +
5528
	expectedReplacedSource = "Z";
5529
	expectedUnitDisplayString =
5530
		"public class X {\n" + 
5531
		"  public X() {\n" + 
5532
		"  }\n" + 
5533
		"  void foo() {\n" + 
6186
		"  void foo() {\n" + 
5534
		"    (Y < <CompleteOnName:Z>);\n" + 
6187
		"    (Y<Z) e;\n" + 
5535
		"  }\n" + 
6188
		"  }\n" + 
5536
		"}\n";
6189
		"}";
6190
6191
6192
	String completeBehind = "Y<Z";
6193
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6194
	String expectedCompletionNodeToString = "<CompleteOnName:Z>";
6195
	String expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6196
	String completionIdentifier = "Z";
6197
	String expectedReplacedSource = "Z";
6198
	String expectedUnitDisplayString =
6199
			"public class X {\n" + 
6200
			"  public X() {\n" + 
6201
			"  }\n" + 
6202
			"  void foo() {\n" + 
6203
			"    (Y < <CompleteOnName:Z>);\n" + 
6204
			"  }\n" + 
6205
			"}\n";
5537
6206
5538
	checkMethodParse(
6207
	checkMethodParse(
5539
			str.toCharArray(),
6208
			str.toCharArray(),
Lines 5545-5551 Link Here
5545
			expectedReplacedSource,
6214
			expectedReplacedSource,
5546
			"full ast");
6215
			"full ast");
5547
}
6216
}
5548
public void test0130(){
6217
public void test0130_Diet(){
5549
	String str =
6218
	String str =
5550
		"public class X {\n" +
6219
		"public class X {\n" +
5551
		"  void foo() {\n" + 
6220
		"  void foo() {\n" + 
Lines 5577-5595 Link Here
5577
			completionIdentifier,
6246
			completionIdentifier,
5578
			expectedReplacedSource,
6247
			expectedReplacedSource,
5579
	"diet ast");
6248
	"diet ast");
5580
	
6249
}
5581
	expectedCompletionNodeToString = "<CompleteOnName:Z>";
6250
public void test0130_Method(){
5582
	expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6251
	String str =
5583
	completionIdentifier = "Z";
6252
		"public class X {\n" +
5584
	expectedReplacedSource = "Z";
5585
	expectedUnitDisplayString =
5586
		"public class X {\n" + 
5587
		"  public X() {\n" + 
5588
		"  }\n" + 
5589
		"  void foo() {\n" + 
6253
		"  void foo() {\n" + 
5590
		"    (Y < <CompleteOnName:Z>);\n" + 
6254
		"    (Y<Z>) e;\n" + 
5591
		"  }\n" + 
6255
		"  }\n" + 
5592
		"}\n";
6256
		"}";
6257
6258
6259
	String completeBehind = "Y<Z";
6260
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6261
	String expectedCompletionNodeToString = "<CompleteOnName:Z>";
6262
	String expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
6263
	String completionIdentifier = "Z";
6264
	String expectedReplacedSource = "Z";
6265
	String expectedUnitDisplayString =
6266
			"public class X {\n" + 
6267
			"  public X() {\n" + 
6268
			"  }\n" + 
6269
			"  void foo() {\n" + 
6270
			"    (Y < <CompleteOnName:Z>);\n" + 
6271
			"  }\n" + 
6272
			"}\n";
5593
6273
5594
	checkMethodParse(
6274
	checkMethodParse(
5595
			str.toCharArray(),
6275
			str.toCharArray(),
Lines 5601-5607 Link Here
5601
			expectedReplacedSource,
6281
			expectedReplacedSource,
5602
			"full ast");
6282
			"full ast");
5603
}
6283
}
5604
public void test0131(){
6284
public void test0131_Diet(){
5605
	String str =
6285
	String str =
5606
		"public class X {\n" +
6286
		"public class X {\n" +
5607
		"  void foo() {\n" + 
6287
		"  void foo() {\n" + 
Lines 5633-5651 Link Here
5633
			completionIdentifier,
6313
			completionIdentifier,
5634
			expectedReplacedSource,
6314
			expectedReplacedSource,
5635
	"diet ast");
6315
	"diet ast");
5636
	
6316
}
5637
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6317
public void test0131_Method(){
5638
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6318
	String str =
5639
	completionIdentifier = "Z";
6319
		"public class X {\n" +
5640
	expectedReplacedSource = "Z";
5641
	expectedUnitDisplayString =
5642
		"public class X {\n" + 
5643
		"  public X() {\n" + 
5644
		"  }\n" + 
5645
		"  void foo() {\n" + 
6320
		"  void foo() {\n" + 
5646
		"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6321
		"    Object[] o = new Y<Z[0];\n" + 
5647
		"  }\n" + 
6322
		"  }\n" + 
5648
		"}\n";
6323
		"}";
6324
6325
6326
	String completeBehind = "Y<Z";
6327
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6328
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6329
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6330
	String completionIdentifier = "Z";
6331
	String expectedReplacedSource = "Z";
6332
	String expectedUnitDisplayString =
6333
			"public class X {\n" + 
6334
			"  public X() {\n" + 
6335
			"  }\n" + 
6336
			"  void foo() {\n" + 
6337
			"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6338
			"  }\n" + 
6339
			"}\n";
5649
6340
5650
	checkMethodParse(
6341
	checkMethodParse(
5651
			str.toCharArray(),
6342
			str.toCharArray(),
Lines 5657-5663 Link Here
5657
			expectedReplacedSource,
6348
			expectedReplacedSource,
5658
			"full ast");
6349
			"full ast");
5659
}
6350
}
5660
public void test0132(){
6351
public void test0132_Diet(){
5661
	String str =
6352
	String str =
5662
		"public class X {\n" +
6353
		"public class X {\n" +
5663
		"  void foo() {\n" + 
6354
		"  void foo() {\n" + 
Lines 5689-5707 Link Here
5689
			completionIdentifier,
6380
			completionIdentifier,
5690
			expectedReplacedSource,
6381
			expectedReplacedSource,
5691
	"diet ast");
6382
	"diet ast");
5692
	
6383
}
5693
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6384
public void test0132_Method(){
5694
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6385
	String str =
5695
	completionIdentifier = "Z";
6386
		"public class X {\n" +
5696
	expectedReplacedSource = "Z";
5697
	expectedUnitDisplayString =
5698
		"public class X {\n" + 
5699
		"  public X() {\n" + 
5700
		"  }\n" + 
5701
		"  void foo() {\n" + 
6387
		"  void foo() {\n" + 
5702
		"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6388
		"    Object[] o = new Y<Z>[0];\n" + 
5703
		"  }\n" + 
6389
		"  }\n" + 
5704
		"}\n";
6390
		"}";
6391
6392
6393
	String completeBehind = "Y<Z";
6394
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6395
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6396
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6397
	String completionIdentifier = "Z";
6398
	String expectedReplacedSource = "Z";
6399
	String expectedUnitDisplayString =
6400
			"public class X {\n" + 
6401
			"  public X() {\n" + 
6402
			"  }\n" + 
6403
			"  void foo() {\n" + 
6404
			"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6405
			"  }\n" + 
6406
			"}\n";
5705
6407
5706
	checkMethodParse(
6408
	checkMethodParse(
5707
			str.toCharArray(),
6409
			str.toCharArray(),
Lines 5713-5719 Link Here
5713
			expectedReplacedSource,
6415
			expectedReplacedSource,
5714
			"full ast");
6416
			"full ast");
5715
}
6417
}
5716
public void test0133(){
6418
public void test0133_Diet(){
5717
	String str =
6419
	String str =
5718
		"public class X {\n" +
6420
		"public class X {\n" +
5719
		"  void foo() {\n" + 
6421
		"  void foo() {\n" + 
Lines 5745-5763 Link Here
5745
			completionIdentifier,
6447
			completionIdentifier,
5746
			expectedReplacedSource,
6448
			expectedReplacedSource,
5747
	"diet ast");
6449
	"diet ast");
5748
	
6450
}
5749
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6451
public void test0133_Method(){
5750
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6452
	String str =
5751
	completionIdentifier = "Z";
6453
		"public class X {\n" +
5752
	expectedReplacedSource = "Z";
5753
	expectedUnitDisplayString =
5754
		"public class X {\n" + 
5755
		"  public X() {\n" + 
5756
		"  }\n" + 
5757
		"  void foo() {\n" + 
6454
		"  void foo() {\n" + 
5758
		"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6455
		"    Object[] o = new Y<Z\n" + 
5759
		"  }\n" + 
6456
		"  }\n" + 
5760
		"}\n";
6457
		"}";
6458
6459
6460
	String completeBehind = "Y<Z";
6461
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6462
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6463
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6464
	String completionIdentifier = "Z";
6465
	String expectedReplacedSource = "Z";
6466
	String expectedUnitDisplayString =
6467
			"public class X {\n" + 
6468
			"  public X() {\n" + 
6469
			"  }\n" + 
6470
			"  void foo() {\n" + 
6471
			"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6472
			"  }\n" + 
6473
			"}\n";
5761
6474
5762
	checkMethodParse(
6475
	checkMethodParse(
5763
			str.toCharArray(),
6476
			str.toCharArray(),
Lines 5769-5775 Link Here
5769
			expectedReplacedSource,
6482
			expectedReplacedSource,
5770
			"full ast");
6483
			"full ast");
5771
}
6484
}
5772
public void test0134(){
6485
public void test0134_Diet(){
5773
	String str =
6486
	String str =
5774
		"public class X {\n" +
6487
		"public class X {\n" +
5775
		"  void foo() {\n" + 
6488
		"  void foo() {\n" + 
Lines 5801-5819 Link Here
5801
			completionIdentifier,
6514
			completionIdentifier,
5802
			expectedReplacedSource,
6515
			expectedReplacedSource,
5803
	"diet ast");
6516
	"diet ast");
5804
	
6517
}
5805
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6518
public void test0134_Method(){
5806
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6519
	String str =
5807
	completionIdentifier = "Z";
6520
		"public class X {\n" +
5808
	expectedReplacedSource = "Z";
5809
	expectedUnitDisplayString =
5810
		"public class X {\n" + 
5811
		"  public X() {\n" + 
5812
		"  }\n" + 
5813
		"  void foo() {\n" + 
6521
		"  void foo() {\n" + 
5814
		"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6522
		"    Object[] o = new Y<Z>\n" + 
5815
		"  }\n" + 
6523
		"  }\n" + 
5816
		"}\n";
6524
		"}";
6525
6526
6527
	String completeBehind = "Y<Z";
6528
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6529
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6530
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6531
	String completionIdentifier = "Z";
6532
	String expectedReplacedSource = "Z";
6533
	String expectedUnitDisplayString =
6534
			"public class X {\n" + 
6535
			"  public X() {\n" + 
6536
			"  }\n" + 
6537
			"  void foo() {\n" + 
6538
			"    Object[] o = Y<<CompleteOnType:Z>>;\n" + 
6539
			"  }\n" + 
6540
			"}\n";
5817
6541
5818
	checkMethodParse(
6542
	checkMethodParse(
5819
			str.toCharArray(),
6543
			str.toCharArray(),
Lines 5825-5831 Link Here
5825
			expectedReplacedSource,
6549
			expectedReplacedSource,
5826
			"full ast");
6550
			"full ast");
5827
}
6551
}
5828
public void test0135(){
6552
public void test0135_Diet(){
5829
	String str =
6553
	String str =
5830
		"public class X {\n" +
6554
		"public class X {\n" +
5831
		"  void foo() {\n" + 
6555
		"  void foo() {\n" + 
Lines 5857-5875 Link Here
5857
			completionIdentifier,
6581
			completionIdentifier,
5858
			expectedReplacedSource,
6582
			expectedReplacedSource,
5859
	"diet ast");
6583
	"diet ast");
5860
	
6584
}
5861
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6585
public void test0135_Method(){
5862
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6586
	String str =
5863
	completionIdentifier = "Z";
6587
		"public class X {\n" +
5864
	expectedReplacedSource = "Z";
5865
	expectedUnitDisplayString =
5866
		"public class X {\n" + 
5867
		"  public X() {\n" + 
5868
		"  }\n" + 
5869
		"  void foo() {\n" + 
6588
		"  void foo() {\n" + 
5870
		"    Y<<CompleteOnType:Z>>;\n" + 
6589
		"    new Y<Z\n" + 
5871
		"  }\n" + 
6590
		"  }\n" + 
5872
		"}\n";
6591
		"}";
6592
6593
6594
	String completeBehind = "Y<Z";
6595
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6596
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6597
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6598
	String completionIdentifier = "Z";
6599
	String expectedReplacedSource = "Z";
6600
	String expectedUnitDisplayString =
6601
			"public class X {\n" + 
6602
			"  public X() {\n" + 
6603
			"  }\n" + 
6604
			"  void foo() {\n" + 
6605
			"    Y<<CompleteOnType:Z>>;\n" + 
6606
			"  }\n" + 
6607
			"}\n";
5873
6608
5874
	checkMethodParse(
6609
	checkMethodParse(
5875
			str.toCharArray(),
6610
			str.toCharArray(),
Lines 5881-5887 Link Here
5881
			expectedReplacedSource,
6616
			expectedReplacedSource,
5882
			"full ast");
6617
			"full ast");
5883
}
6618
}
5884
public void test0136(){
6619
public void test0136_Diet(){
5885
	String str =
6620
	String str =
5886
		"public class X {\n" +
6621
		"public class X {\n" +
5887
		"  void foo() {\n" + 
6622
		"  void foo() {\n" + 
Lines 5913-5931 Link Here
5913
			completionIdentifier,
6648
			completionIdentifier,
5914
			expectedReplacedSource,
6649
			expectedReplacedSource,
5915
	"diet ast");
6650
	"diet ast");
5916
	
6651
}
5917
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6652
public void test0136_Method(){
5918
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6653
	String str =
5919
	completionIdentifier = "Z";
6654
		"public class X {\n" +
5920
	expectedReplacedSource = "Z";
5921
	expectedUnitDisplayString =
5922
		"public class X {\n" + 
5923
		"  public X() {\n" + 
5924
		"  }\n" + 
5925
		"  void foo() {\n" + 
6655
		"  void foo() {\n" + 
5926
		"    Y<<CompleteOnType:Z>>;\n" + 
6656
		"    new Y<Z>\n" + 
5927
		"  }\n" + 
6657
		"  }\n" + 
5928
		"}\n";
6658
		"}";
6659
6660
6661
	String completeBehind = "Y<Z";
6662
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6663
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6664
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6665
	String completionIdentifier = "Z";
6666
	String expectedReplacedSource = "Z";
6667
	String expectedUnitDisplayString =
6668
			"public class X {\n" + 
6669
			"  public X() {\n" + 
6670
			"  }\n" + 
6671
			"  void foo() {\n" + 
6672
			"    Y<<CompleteOnType:Z>>;\n" + 
6673
			"  }\n" + 
6674
			"}\n";
5929
6675
5930
	checkMethodParse(
6676
	checkMethodParse(
5931
			str.toCharArray(),
6677
			str.toCharArray(),
Lines 5937-5943 Link Here
5937
			expectedReplacedSource,
6683
			expectedReplacedSource,
5938
			"full ast");
6684
			"full ast");
5939
}
6685
}
5940
public void test0137(){
6686
public void test0137_Diet(){
5941
	String str =
6687
	String str =
5942
		"public class X {\n" +
6688
		"public class X {\n" +
5943
		"  public X() {\n" + 
6689
		"  public X() {\n" + 
Lines 5967-5984 Link Here
5967
			completionIdentifier,
6713
			completionIdentifier,
5968
			expectedReplacedSource,
6714
			expectedReplacedSource,
5969
	"diet ast");
6715
	"diet ast");
5970
	
6716
}
5971
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6717
public void test0137_Method(){
5972
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6718
	String str =
5973
	completionIdentifier = "Z";
6719
		"public class X {\n" +
5974
	expectedReplacedSource = "Z";
5975
	expectedUnitDisplayString =
5976
		"public class X {\n" + 
5977
		"  public X() {\n" + 
6720
		"  public X() {\n" + 
5978
		"    super();\n" + 
6721
		"    <Y<Z super(0);\n" + 
5979
		"    Y<<CompleteOnType:Z>>;\n" + 
5980
		"  }\n" + 
6722
		"  }\n" + 
5981
		"}\n";
6723
		"}";
6724
6725
6726
	String completeBehind = "Y<Z";
6727
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6728
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6729
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6730
	String completionIdentifier = "Z";
6731
	String expectedReplacedSource = "Z";
6732
	String expectedUnitDisplayString =
6733
			"public class X {\n" + 
6734
			"  public X() {\n" + 
6735
			"    super();\n" + 
6736
			"    Y<<CompleteOnType:Z>>;\n" + 
6737
			"  }\n" + 
6738
			"}\n";
5982
6739
5983
	checkMethodParse(
6740
	checkMethodParse(
5984
			str.toCharArray(),
6741
			str.toCharArray(),
Lines 5990-5996 Link Here
5990
			expectedReplacedSource,
6747
			expectedReplacedSource,
5991
			"full ast");
6748
			"full ast");
5992
}
6749
}
5993
public void test0138(){
6750
public void test0138_Diet(){
5994
	String str =
6751
	String str =
5995
		"public class X {\n" +
6752
		"public class X {\n" +
5996
		"  public X() {\n" + 
6753
		"  public X() {\n" + 
Lines 6020-6037 Link Here
6020
			completionIdentifier,
6777
			completionIdentifier,
6021
			expectedReplacedSource,
6778
			expectedReplacedSource,
6022
	"diet ast");
6779
	"diet ast");
6023
	
6780
}
6024
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6781
public void test0138_Method(){
6025
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6782
	String str =
6026
	completionIdentifier = "Z";
6783
		"public class X {\n" +
6027
	expectedReplacedSource = "Z";
6028
	expectedUnitDisplayString =
6029
		"public class X {\n" + 
6030
		"  public X() {\n" + 
6784
		"  public X() {\n" + 
6031
		"    super();\n" + 
6785
		"    <Y<Z> super(0);\n" + 
6032
		"    Y<<CompleteOnType:Z>>;\n" + 
6033
		"  }\n" + 
6786
		"  }\n" + 
6034
		"}\n";
6787
		"}";
6788
6789
6790
	String completeBehind = "Y<Z";
6791
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6792
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6793
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6794
	String completionIdentifier = "Z";
6795
	String expectedReplacedSource = "Z";
6796
	String expectedUnitDisplayString =
6797
			"public class X {\n" + 
6798
			"  public X() {\n" + 
6799
			"    super();\n" + 
6800
			"    Y<<CompleteOnType:Z>>;\n" + 
6801
			"  }\n" + 
6802
			"}\n";
6035
6803
6036
	checkMethodParse(
6804
	checkMethodParse(
6037
			str.toCharArray(),
6805
			str.toCharArray(),
Lines 6043-6049 Link Here
6043
			expectedReplacedSource,
6811
			expectedReplacedSource,
6044
			"full ast");
6812
			"full ast");
6045
}
6813
}
6046
public void test0139(){
6814
public void test0139_Diet(){
6047
	String str =
6815
	String str =
6048
		"public class X {\n" +
6816
		"public class X {\n" +
6049
		"  public X() {\n" + 
6817
		"  public X() {\n" + 
Lines 6073-6090 Link Here
6073
			completionIdentifier,
6841
			completionIdentifier,
6074
			expectedReplacedSource,
6842
			expectedReplacedSource,
6075
	"diet ast");
6843
	"diet ast");
6076
	
6844
}
6077
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6845
public void test0139_Method(){
6078
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6846
	String str =
6079
	completionIdentifier = "Z";
6847
		"public class X {\n" +
6080
	expectedReplacedSource = "Z";
6081
	expectedUnitDisplayString =
6082
		"public class X {\n" + 
6083
		"  public X() {\n" + 
6848
		"  public X() {\n" + 
6084
		"    super();\n" + 
6849
		"    <Y<Z>> super(0);\n" + 
6085
		"    Y<<CompleteOnType:Z>>;\n" + 
6086
		"  }\n" + 
6850
		"  }\n" + 
6087
		"}\n";
6851
		"}";
6852
6853
6854
	String completeBehind = "Y<Z";
6855
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6856
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6857
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6858
	String completionIdentifier = "Z";
6859
	String expectedReplacedSource = "Z";
6860
	String expectedUnitDisplayString =
6861
			"public class X {\n" + 
6862
			"  public X() {\n" + 
6863
			"    super();\n" + 
6864
			"    Y<<CompleteOnType:Z>>;\n" + 
6865
			"  }\n" + 
6866
			"}\n";
6088
6867
6089
	checkMethodParse(
6868
	checkMethodParse(
6090
			str.toCharArray(),
6869
			str.toCharArray(),
Lines 6096-6102 Link Here
6096
			expectedReplacedSource,
6875
			expectedReplacedSource,
6097
			"full ast");
6876
			"full ast");
6098
}
6877
}
6099
public void test0140(){
6878
public void test0140_Diet(){
6100
	String str =
6879
	String str =
6101
		"public class X {\n" +
6880
		"public class X {\n" +
6102
		"  public X() {\n" + 
6881
		"  public X() {\n" + 
Lines 6126-6143 Link Here
6126
			completionIdentifier,
6905
			completionIdentifier,
6127
			expectedReplacedSource,
6906
			expectedReplacedSource,
6128
	"diet ast");
6907
	"diet ast");
6129
	
6908
}
6130
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6909
public void test0140_Method(){
6131
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6910
	String str =
6132
	completionIdentifier = "Z";
6911
		"public class X {\n" +
6133
	expectedReplacedSource = "Z";
6134
	expectedUnitDisplayString =
6135
		"public class X {\n" + 
6136
		"  public X() {\n" + 
6912
		"  public X() {\n" + 
6137
		"    super();\n" + 
6913
		"    aaa.<Y<Z super(0);\n" + 
6138
		"    Y<<CompleteOnType:Z>>;\n" + 
6139
		"  }\n" + 
6914
		"  }\n" + 
6140
		"}\n";
6915
		"}";
6916
6917
6918
	String completeBehind = "Y<Z";
6919
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6920
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6921
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6922
	String completionIdentifier = "Z";
6923
	String expectedReplacedSource = "Z";
6924
	String expectedUnitDisplayString =
6925
			"public class X {\n" + 
6926
			"  public X() {\n" + 
6927
			"    super();\n" + 
6928
			"    Y<<CompleteOnType:Z>>;\n" + 
6929
			"  }\n" + 
6930
			"}\n";
6141
6931
6142
	checkMethodParse(
6932
	checkMethodParse(
6143
			str.toCharArray(),
6933
			str.toCharArray(),
Lines 6149-6155 Link Here
6149
			expectedReplacedSource,
6939
			expectedReplacedSource,
6150
			"full ast");
6940
			"full ast");
6151
}
6941
}
6152
public void test0141(){
6942
public void test0141_Diet(){
6153
	String str =
6943
	String str =
6154
		"public class X {\n" +
6944
		"public class X {\n" +
6155
		"  public X() {\n" + 
6945
		"  public X() {\n" + 
Lines 6179-6196 Link Here
6179
			completionIdentifier,
6969
			completionIdentifier,
6180
			expectedReplacedSource,
6970
			expectedReplacedSource,
6181
	"diet ast");
6971
	"diet ast");
6182
	
6972
}
6183
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
6973
public void test0141_Method(){
6184
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6974
	String str =
6185
	completionIdentifier = "Z";
6975
		"public class X {\n" +
6186
	expectedReplacedSource = "Z";
6187
	expectedUnitDisplayString =
6188
		"public class X {\n" + 
6189
		"  public X() {\n" + 
6976
		"  public X() {\n" + 
6190
		"    super();\n" + 
6977
		"    aaa.<Y<Z> super(0);\n" + 
6191
		"    Y<<CompleteOnType:Z>>;\n" + 
6192
		"  }\n" + 
6978
		"  }\n" + 
6193
		"}\n";
6979
		"}";
6980
6981
6982
	String completeBehind = "Y<Z";
6983
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
6984
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
6985
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
6986
	String completionIdentifier = "Z";
6987
	String expectedReplacedSource = "Z";
6988
	String expectedUnitDisplayString =
6989
			"public class X {\n" + 
6990
			"  public X() {\n" + 
6991
			"    super();\n" + 
6992
			"    Y<<CompleteOnType:Z>>;\n" + 
6993
			"  }\n" + 
6994
			"}\n";
6194
6995
6195
	checkMethodParse(
6996
	checkMethodParse(
6196
			str.toCharArray(),
6997
			str.toCharArray(),
Lines 6202-6208 Link Here
6202
			expectedReplacedSource,
7003
			expectedReplacedSource,
6203
			"full ast");
7004
			"full ast");
6204
}
7005
}
6205
public void test0142(){
7006
public void test0142_Diet(){
6206
	String str =
7007
	String str =
6207
		"public class X {\n" +
7008
		"public class X {\n" +
6208
		"  public X() {\n" + 
7009
		"  public X() {\n" + 
Lines 6232-6249 Link Here
6232
			completionIdentifier,
7033
			completionIdentifier,
6233
			expectedReplacedSource,
7034
			expectedReplacedSource,
6234
	"diet ast");
7035
	"diet ast");
6235
	
7036
}
6236
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
7037
public void test0142_Method(){
6237
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7038
	String str =
6238
	completionIdentifier = "Z";
7039
		"public class X {\n" +
6239
	expectedReplacedSource = "Z";
6240
	expectedUnitDisplayString =
6241
		"public class X {\n" + 
6242
		"  public X() {\n" + 
7040
		"  public X() {\n" + 
6243
		"    super();\n" + 
7041
		"    aaa.<Y<Z>> super(0);\n" + 
6244
		"    Y<<CompleteOnType:Z>>;\n" + 
6245
		"  }\n" + 
7042
		"  }\n" + 
6246
		"}\n";
7043
		"}";
7044
7045
7046
	String completeBehind = "Y<Z";
7047
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7048
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
7049
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7050
	String completionIdentifier = "Z";
7051
	String expectedReplacedSource = "Z";
7052
	String expectedUnitDisplayString =
7053
			"public class X {\n" + 
7054
			"  public X() {\n" + 
7055
			"    super();\n" + 
7056
			"    Y<<CompleteOnType:Z>>;\n" + 
7057
			"  }\n" + 
7058
			"}\n";
6247
7059
6248
	checkMethodParse(
7060
	checkMethodParse(
6249
			str.toCharArray(),
7061
			str.toCharArray(),
Lines 6255-6261 Link Here
6255
			expectedReplacedSource,
7067
			expectedReplacedSource,
6256
			"full ast");
7068
			"full ast");
6257
}
7069
}
6258
public void test0143(){
7070
public void test0143_Diet(){
6259
	String str =
7071
	String str =
6260
		"public class X {\n" +
7072
		"public class X {\n" +
6261
		"  public X() {\n" + 
7073
		"  public X() {\n" + 
Lines 6285-6302 Link Here
6285
			completionIdentifier,
7097
			completionIdentifier,
6286
			expectedReplacedSource,
7098
			expectedReplacedSource,
6287
	"diet ast");
7099
	"diet ast");
6288
	
7100
}
6289
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
7101
public void test0143_Method(){
6290
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7102
	String str =
6291
	completionIdentifier = "Z";
7103
		"public class X {\n" +
6292
	expectedReplacedSource = "Z";
6293
	expectedUnitDisplayString =
6294
		"public class X {\n" + 
6295
		"  public X() {\n" + 
7104
		"  public X() {\n" + 
6296
		"    super();\n" + 
7105
		"    A.this.<Y<Z super(0);\n" + 
6297
		"    Y<<CompleteOnType:Z>>;\n" + 
6298
		"  }\n" + 
7106
		"  }\n" + 
6299
		"}\n";
7107
		"}";
7108
7109
7110
	String completeBehind = "Y<Z";
7111
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7112
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
7113
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7114
	String completionIdentifier = "Z";
7115
	String expectedReplacedSource = "Z";
7116
	String expectedUnitDisplayString =
7117
			"public class X {\n" + 
7118
			"  public X() {\n" + 
7119
			"    super();\n" + 
7120
			"    Y<<CompleteOnType:Z>>;\n" + 
7121
			"  }\n" + 
7122
			"}\n";
6300
7123
6301
	checkMethodParse(
7124
	checkMethodParse(
6302
			str.toCharArray(),
7125
			str.toCharArray(),
Lines 6308-6314 Link Here
6308
			expectedReplacedSource,
7131
			expectedReplacedSource,
6309
			"full ast");
7132
			"full ast");
6310
}
7133
}
6311
public void test0144(){
7134
public void test0144_Diet(){
6312
	String str =
7135
	String str =
6313
		"public class X {\n" +
7136
		"public class X {\n" +
6314
		"  public X() {\n" + 
7137
		"  public X() {\n" + 
Lines 6338-6355 Link Here
6338
			completionIdentifier,
7161
			completionIdentifier,
6339
			expectedReplacedSource,
7162
			expectedReplacedSource,
6340
	"diet ast");
7163
	"diet ast");
6341
	
7164
}
6342
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
7165
public void test0144_Method(){
6343
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7166
	String str =
6344
	completionIdentifier = "Z";
7167
		"public class X {\n" +
6345
	expectedReplacedSource = "Z";
6346
	expectedUnitDisplayString =
6347
		"public class X {\n" + 
6348
		"  public X() {\n" + 
7168
		"  public X() {\n" + 
6349
		"    super();\n" + 
7169
		"    A.this.<Y<Z> super(0);\n" + 
6350
		"    Y<<CompleteOnType:Z>>;\n" + 
6351
		"  }\n" + 
7170
		"  }\n" + 
6352
		"}\n";
7171
		"}";
7172
7173
7174
	String completeBehind = "Y<Z";
7175
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7176
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
7177
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7178
	String completionIdentifier = "Z";
7179
	String expectedReplacedSource = "Z";
7180
	String expectedUnitDisplayString =
7181
			"public class X {\n" + 
7182
			"  public X() {\n" + 
7183
			"    super();\n" + 
7184
			"    Y<<CompleteOnType:Z>>;\n" + 
7185
			"  }\n" + 
7186
			"}\n";
6353
7187
6354
	checkMethodParse(
7188
	checkMethodParse(
6355
			str.toCharArray(),
7189
			str.toCharArray(),
Lines 6361-6367 Link Here
6361
			expectedReplacedSource,
7195
			expectedReplacedSource,
6362
			"full ast");
7196
			"full ast");
6363
}
7197
}
6364
public void test0145(){
7198
public void test0145_Diet(){
6365
	String str =
7199
	String str =
6366
		"public class X {\n" +
7200
		"public class X {\n" +
6367
		"  public X() {\n" + 
7201
		"  public X() {\n" + 
Lines 6391-6408 Link Here
6391
			completionIdentifier,
7225
			completionIdentifier,
6392
			expectedReplacedSource,
7226
			expectedReplacedSource,
6393
	"diet ast");
7227
	"diet ast");
6394
	
7228
}
6395
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
7229
public void test0145_Method(){
6396
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7230
	String str =
6397
	completionIdentifier = "Z";
7231
		"public class X {\n" +
6398
	expectedReplacedSource = "Z";
6399
	expectedUnitDisplayString =
6400
		"public class X {\n" + 
6401
		"  public X() {\n" + 
7232
		"  public X() {\n" + 
6402
		"    super();\n" + 
7233
		"    A.this.<Y<Z>> super(0);\n" + 
6403
		"    Y<<CompleteOnType:Z>>;\n" + 
6404
		"  }\n" + 
7234
		"  }\n" + 
6405
		"}\n";
7235
		"}";
7236
7237
7238
	String completeBehind = "Y<Z";
7239
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7240
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
7241
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7242
	String completionIdentifier = "Z";
7243
	String expectedReplacedSource = "Z";
7244
	String expectedUnitDisplayString =
7245
			"public class X {\n" + 
7246
			"  public X() {\n" + 
7247
			"    super();\n" + 
7248
			"    Y<<CompleteOnType:Z>>;\n" + 
7249
			"  }\n" + 
7250
			"}\n";
6406
7251
6407
	checkMethodParse(
7252
	checkMethodParse(
6408
			str.toCharArray(),
7253
			str.toCharArray(),
Lines 6804-6810 Link Here
6804
			expectedReplacedSource,
7649
			expectedReplacedSource,
6805
	"diet ast");
7650
	"diet ast");
6806
}
7651
}
6807
public void test0159(){
7652
public void test0159_Diet(){
6808
	String str =
7653
	String str =
6809
		"public class X {\n" +
7654
		"public class X {\n" +
6810
		"  void foo() {\n" + 
7655
		"  void foo() {\n" + 
Lines 6836-6854 Link Here
6836
			completionIdentifier,
7681
			completionIdentifier,
6837
			expectedReplacedSource,
7682
			expectedReplacedSource,
6838
	"diet ast");
7683
	"diet ast");
6839
	
7684
}
6840
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
7685
public void test0159_Method(){
6841
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7686
	String str =
6842
	completionIdentifier = "Z";
7687
		"public class X {\n" +
6843
	expectedReplacedSource = "Z";
6844
	expectedUnitDisplayString =
6845
		"public class X {\n" + 
6846
		"  public X() {\n" + 
6847
		"  }\n" + 
6848
		"  void foo() {\n" + 
7688
		"  void foo() {\n" + 
6849
		"    Object a = Y<<CompleteOnType:Z>>;\n" + 
7689
		"    Object a = (W<Y<Z> ) e;\n" + 
6850
		"  }\n" + 
7690
		"  }\n" + 
6851
		"}\n";
7691
		"}";
7692
7693
7694
	String completeBehind = "Y<Z";
7695
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7696
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
7697
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
7698
	String completionIdentifier = "Z";
7699
	String expectedReplacedSource = "Z";
7700
	String expectedUnitDisplayString =
7701
			"public class X {\n" + 
7702
			"  public X() {\n" + 
7703
			"  }\n" + 
7704
			"  void foo() {\n" + 
7705
			"    Object a = Y<<CompleteOnType:Z>>;\n" + 
7706
			"  }\n" + 
7707
			"}\n";
6852
7708
6853
	checkMethodParse(
7709
	checkMethodParse(
6854
			str.toCharArray(),
7710
			str.toCharArray(),
Lines 6860-6866 Link Here
6860
			expectedReplacedSource,
7716
			expectedReplacedSource,
6861
			"full ast");
7717
			"full ast");
6862
}
7718
}
6863
public void test0160(){
7719
public void test0160_Diet(){
6864
	String str =
7720
	String str =
6865
		"public class X {\n" +
7721
		"public class X {\n" +
6866
		"  void foo() {\n" + 
7722
		"  void foo() {\n" + 
Lines 6892-6910 Link Here
6892
			completionIdentifier,
7748
			completionIdentifier,
6893
			expectedReplacedSource,
7749
			expectedReplacedSource,
6894
	"diet ast");
7750
	"diet ast");
6895
	
7751
}
6896
	expectedCompletionNodeToString = "<CompleteOnName:Z>";
7752
public void test0160_Method(){
6897
	expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
7753
	String str =
6898
	completionIdentifier = "Z";
7754
		"public class X {\n" +
6899
	expectedReplacedSource = "Z";
6900
	expectedUnitDisplayString =
6901
		"public class X {\n" + 
6902
		"  public X() {\n" + 
6903
		"  }\n" + 
6904
		"  void foo() {\n" + 
7755
		"  void foo() {\n" + 
6905
		"    (Y < <CompleteOnName:Z>);\n" + 
7756
		"    ((Y<Z>) e).foo();\n" + 
6906
		"  }\n" + 
7757
		"  }\n" + 
6907
		"}\n";
7758
		"}";
7759
7760
7761
	String completeBehind = "Y<Z";
7762
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7763
	String expectedCompletionNodeToString = "<CompleteOnName:Z>";
7764
	String expectedParentNodeToString = "(Y < <CompleteOnName:Z>)";
7765
	String completionIdentifier = "Z";
7766
	String expectedReplacedSource = "Z";
7767
	String expectedUnitDisplayString =
7768
			"public class X {\n" + 
7769
			"  public X() {\n" + 
7770
			"  }\n" + 
7771
			"  void foo() {\n" + 
7772
			"    (Y < <CompleteOnName:Z>);\n" + 
7773
			"  }\n" + 
7774
			"}\n";
6908
7775
6909
	checkMethodParse(
7776
	checkMethodParse(
6910
			str.toCharArray(),
7777
			str.toCharArray(),
Lines 7031-7037 Link Here
7031
			expectedReplacedSource,
7898
			expectedReplacedSource,
7032
	"diet ast");
7899
	"diet ast");
7033
}
7900
}
7034
public void test0165(){
7901
public void test0165_Diet(){
7035
	String str =
7902
	String str =
7036
		"public class X {\n" +
7903
		"public class X {\n" +
7037
		"  void foo() {\n" + 
7904
		"  void foo() {\n" + 
Lines 7063-7081 Link Here
7063
			completionIdentifier,
7930
			completionIdentifier,
7064
			expectedReplacedSource,
7931
			expectedReplacedSource,
7065
	"diet ast");
7932
	"diet ast");
7066
	
7933
}
7067
	expectedCompletionNodeToString = "<CompleteOnName:Z>";
7934
public void test0165_Method(){
7068
	expectedParentNodeToString = "(W.Y < <CompleteOnName:Z>)";
7935
	String str =
7069
	completionIdentifier = "Z";
7936
		"public class X {\n" +
7070
	expectedReplacedSource = "Z";
7071
	expectedUnitDisplayString =
7072
		"public class X {\n" + 
7073
		"  public X() {\n" + 
7074
		"  }\n" + 
7075
		"  void foo() {\n" + 
7937
		"  void foo() {\n" + 
7076
		"    Object a = (W.Y < <CompleteOnName:Z>);\n" + 
7938
		"    Object a = (W.Y<Z>) e;\n" + 
7077
		"  }\n" + 
7939
		"  }\n" + 
7078
		"}\n";
7940
		"}";
7941
7942
7943
	String completeBehind = "Y<Z";
7944
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
7945
	String expectedCompletionNodeToString = "<CompleteOnName:Z>";
7946
	String expectedParentNodeToString = "(W.Y < <CompleteOnName:Z>)";
7947
	String completionIdentifier = "Z";
7948
	String expectedReplacedSource = "Z";
7949
	String expectedUnitDisplayString =
7950
			"public class X {\n" + 
7951
			"  public X() {\n" + 
7952
			"  }\n" + 
7953
			"  void foo() {\n" + 
7954
			"    Object a = (W.Y < <CompleteOnName:Z>);\n" + 
7955
			"  }\n" + 
7956
			"}\n";
7079
7957
7080
	checkMethodParse(
7958
	checkMethodParse(
7081
			str.toCharArray(),
7959
			str.toCharArray(),
Lines 7087-7093 Link Here
7087
			expectedReplacedSource,
7965
			expectedReplacedSource,
7088
			"full ast");
7966
			"full ast");
7089
}
7967
}
7090
public void test0166(){
7968
public void test0166_Diet(){
7091
	String str =
7969
	String str =
7092
		"public class X {\n" +
7970
		"public class X {\n" +
7093
		"  void foo() {\n" + 
7971
		"  void foo() {\n" + 
Lines 7119-7137 Link Here
7119
			completionIdentifier,
7997
			completionIdentifier,
7120
			expectedReplacedSource,
7998
			expectedReplacedSource,
7121
	"diet ast");
7999
	"diet ast");
7122
	
8000
}
7123
	expectedCompletionNodeToString = "<CompleteOnType:Z>";
8001
public void test0166_Method(){
7124
	expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
8002
	String str =
7125
	completionIdentifier = "Z";
8003
		"public class X {\n" +
7126
	expectedReplacedSource = "Z";
7127
	expectedUnitDisplayString =
7128
		"public class X {\n" + 
7129
		"  public X() {\n" + 
7130
		"  }\n" + 
7131
		"  void foo() {\n" + 
8004
		"  void foo() {\n" + 
7132
		"    Object a = W<U>.Y<<CompleteOnType:Z>>;\n" + 
8005
		"    Object a = (W<U>.Y<Z>) e;\n" + 
7133
		"  }\n" + 
8006
		"  }\n" + 
7134
		"}\n";
8007
		"}";
8008
8009
8010
	String completeBehind = "Y<Z";
8011
	int cursorLocation = str.indexOf("Y<Z") + completeBehind.length() - 1;
8012
	String expectedCompletionNodeToString = "<CompleteOnType:Z>";
8013
	String expectedParentNodeToString = "Y<<CompleteOnType:Z>>";
8014
	String completionIdentifier = "Z";
8015
	String expectedReplacedSource = "Z";
8016
	String expectedUnitDisplayString =
8017
			"public class X {\n" + 
8018
			"  public X() {\n" + 
8019
			"  }\n" + 
8020
			"  void foo() {\n" + 
8021
			"    Object a = W<U>.Y<<CompleteOnType:Z>>;\n" + 
8022
			"  }\n" + 
8023
			"}\n";
7135
8024
7136
	checkMethodParse(
8025
	checkMethodParse(
7137
			str.toCharArray(),
8026
			str.toCharArray(),
Lines 7146-7152 Link Here
7146
/*
8035
/*
7147
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=69598
8036
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=69598
7148
*/
8037
*/
7149
public void test0167(){
8038
public void test0167_Diet(){
7150
	String str =
8039
	String str =
7151
		"public class X {\n" +
8040
		"public class X {\n" +
7152
		"  void foo(){\n" +
8041
		"  void foo(){\n" +
Lines 7181-7203 Link Here
7181
			completionIdentifier,
8070
			completionIdentifier,
7182
			expectedReplacedSource,
8071
			expectedReplacedSource,
7183
	"diet ast");
8072
	"diet ast");
7184
	
8073
}
7185
	expectedCompletionNodeToString = "<CompleteOnName:i.>";
8074
/*
7186
	expectedParentNodeToString = "<NONE>";
8075
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=69598
7187
	completionIdentifier = "";
8076
*/
7188
	expectedReplacedSource = "i.";
8077
public void test0167_Method(){
7189
	expectedUnitDisplayString =
8078
	String str =
7190
		"public class X {\n" + 
8079
		"public class X {\n" +
7191
		"  public X() {\n" + 
8080
		"  void foo(){\n" +
7192
		"  }\n" + 
8081
		"    List<Integer> cont=new ArrayList<Integer>();\n" +
7193
		"  void foo() {\n" + 
8082
		"    for (Integer i:cont){\n" +
7194
		"    List<Integer> cont;\n" + 
8083
		"      i.\n" +
7195
		"    Integer i;\n" + 
7196
		"    {\n" + 
7197
		"      <CompleteOnName:i.>;\n" + 
7198
		"    }\n" + 
8084
		"    }\n" + 
7199
		"  }\n" + 
8085
		"  }\n" + 
7200
		"}\n";
8086
		"}";
8087
8088
8089
	String completeBehind = "i.";
8090
	int cursorLocation = str.indexOf("i.") + completeBehind.length() - 1;
8091
	String expectedCompletionNodeToString = "<CompleteOnName:i.>";
8092
	String expectedParentNodeToString = "<NONE>";
8093
	String completionIdentifier = "";
8094
	String expectedReplacedSource = "i.";
8095
	String expectedUnitDisplayString =
8096
			"public class X {\n" + 
8097
			"  public X() {\n" + 
8098
			"  }\n" + 
8099
			"  void foo() {\n" + 
8100
			"    List<Integer> cont;\n" + 
8101
			"    Integer i;\n" + 
8102
			"    {\n" + 
8103
			"      <CompleteOnName:i.>;\n" + 
8104
			"    }\n" + 
8105
			"  }\n" + 
8106
			"}\n";
7201
8107
7202
	checkMethodParse(
8108
	checkMethodParse(
7203
			str.toCharArray(),
8109
			str.toCharArray(),
Lines 7212-7218 Link Here
7212
/*
8118
/*
7213
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=69598
8119
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=69598
7214
*/
8120
*/
7215
public void test0168(){
8121
public void test0168_Diet(){
7216
	String str =
8122
	String str =
7217
		"public class X {\n" +
8123
		"public class X {\n" +
7218
		"  void foo(){\n" +
8124
		"  void foo(){\n" +
Lines 7247-7266 Link Here
7247
			completionIdentifier,
8153
			completionIdentifier,
7248
			expectedReplacedSource,
8154
			expectedReplacedSource,
7249
	"diet ast");
8155
	"diet ast");
7250
	
8156
}
7251
	expectedCompletionNodeToString = "<CompleteOnName:i.>";
8157
/*
7252
	expectedParentNodeToString = "<NONE>";
8158
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=69598
7253
	completionIdentifier = "";
8159
*/
7254
	expectedReplacedSource = "i.";
8160
public void test0168_Method(){
7255
	expectedUnitDisplayString =
8161
	String str =
7256
		"public class X {\n" + 
8162
		"public class X {\n" +
7257
		"  public X() {\n" + 
8163
		"  void foo(){\n" +
7258
		"  }\n" + 
8164
		"    List<Integer> cont=new ArrayList<Integer>();\n" +
7259
		"  void foo() {\n" + 
8165
		"    for (Integer i:cont){\n" +
7260
		"    List<Integer> cont;\n" + 
8166
		"    }\n" + 
7261
		"    <CompleteOnName:i.>;\n" + 
8167
		"    i.\n" +
7262
		"  }\n" + 
8168
		"  }\n" + 
7263
		"}\n";
8169
		"}";
8170
8171
8172
	String completeBehind = "i.";
8173
	int cursorLocation = str.indexOf("i.") + completeBehind.length() - 1;
8174
	String expectedCompletionNodeToString = "<CompleteOnName:i.>";
8175
	String expectedParentNodeToString = "<NONE>";
8176
	String completionIdentifier = "";
8177
	String expectedReplacedSource = "i.";
8178
	String expectedUnitDisplayString =
8179
			"public class X {\n" + 
8180
			"  public X() {\n" + 
8181
			"  }\n" + 
8182
			"  void foo() {\n" + 
8183
			"    List<Integer> cont;\n" + 
8184
			"    <CompleteOnName:i.>;\n" + 
8185
			"  }\n" + 
8186
			"}\n";
7264
8187
7265
	checkMethodParse(
8188
	checkMethodParse(
7266
			str.toCharArray(),
8189
			str.toCharArray(),
Lines 7380-7386 Link Here
7380
/*
8303
/*
7381
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8304
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7382
 */
8305
 */
7383
public void test0171(){
8306
public void test0171_Diet(){
7384
	String str =
8307
	String str =
7385
		"public class X{\n" + 
8308
		"public class X{\n" + 
7386
		"  public void foo() {\n" + 
8309
		"  public void foo() {\n" + 
Lines 7414-7433 Link Here
7414
			completionIdentifier,
8337
			completionIdentifier,
7415
			expectedReplacedSource,
8338
			expectedReplacedSource,
7416
	"diet ast");
8339
	"diet ast");
7417
	
8340
}
7418
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8341
/*
7419
	expectedParentNodeToString = "<NONE>";
8342
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7420
	completionIdentifier = "bar";
8343
 */
7421
	expectedReplacedSource = "bar";
8344
public void test0171_Method(){
7422
	expectedUnitDisplayString =
8345
	String str =
7423
		"public class X {\n" + 
8346
		"public class X{\n" + 
7424
		"  public X() {\n" + 
7425
		"  }\n" + 
7426
		"  public void foo() {\n" + 
8347
		"  public void foo() {\n" + 
7427
		"    Object o;\n" + 
8348
		"    Object o =(A<B>) tmp;\n" + 
7428
		"    <CompleteOnName:bar>;\n" + 
8349
		"    bar\n" + 
7429
		"  }\n" + 
8350
		"  }\n" + 
7430
		"}\n";
8351
		"}\n" + 
8352
		"\n";
8353
8354
8355
	String completeBehind = "bar";
8356
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
8357
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
8358
	String expectedParentNodeToString = "<NONE>";
8359
	String completionIdentifier = "bar";
8360
	String expectedReplacedSource = "bar";
8361
	String expectedUnitDisplayString =
8362
			"public class X {\n" + 
8363
			"  public X() {\n" + 
8364
			"  }\n" + 
8365
			"  public void foo() {\n" + 
8366
			"    Object o;\n" + 
8367
			"    <CompleteOnName:bar>;\n" + 
8368
			"  }\n" + 
8369
			"}\n";
7431
8370
7432
	checkMethodParse(
8371
	checkMethodParse(
7433
			str.toCharArray(),
8372
			str.toCharArray(),
Lines 7442-7448 Link Here
7442
/*
8381
/*
7443
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8382
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7444
 */
8383
 */
7445
public void test0172(){
8384
public void test0172_Diet(){
7446
	String str =
8385
	String str =
7447
		"public class X{\n" + 
8386
		"public class X{\n" + 
7448
		"  public void foo() {\n" + 
8387
		"  public void foo() {\n" + 
Lines 7476-7495 Link Here
7476
			completionIdentifier,
8415
			completionIdentifier,
7477
			expectedReplacedSource,
8416
			expectedReplacedSource,
7478
	"diet ast");
8417
	"diet ast");
7479
	
8418
}
7480
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8419
/*
7481
	expectedParentNodeToString = "<NONE>";
8420
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7482
	completionIdentifier = "bar";
8421
 */
7483
	expectedReplacedSource = "bar";
8422
public void test0172_Method(){
7484
	expectedUnitDisplayString =
8423
	String str =
7485
		"public class X {\n" + 
8424
		"public class X{\n" + 
7486
		"  public X() {\n" + 
7487
		"  }\n" + 
7488
		"  public void foo() {\n" + 
8425
		"  public void foo() {\n" + 
7489
		"    Object o;\n" + 
8426
		"    Object o =(A<B>[]) tmp;\n" + 
7490
		"    <CompleteOnName:bar>;\n" + 
8427
		"    bar\n" + 
7491
		"  }\n" + 
8428
		"  }\n" + 
7492
		"}\n";
8429
		"}\n" + 
8430
		"\n";
8431
8432
8433
	String completeBehind = "bar";
8434
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
8435
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
8436
	String expectedParentNodeToString = "<NONE>";
8437
	String completionIdentifier = "bar";
8438
	String expectedReplacedSource = "bar";
8439
	String expectedUnitDisplayString =
8440
			"public class X {\n" + 
8441
			"  public X() {\n" + 
8442
			"  }\n" + 
8443
			"  public void foo() {\n" + 
8444
			"    Object o;\n" + 
8445
			"    <CompleteOnName:bar>;\n" + 
8446
			"  }\n" + 
8447
			"}\n";
7493
8448
7494
	checkMethodParse(
8449
	checkMethodParse(
7495
			str.toCharArray(),
8450
			str.toCharArray(),
Lines 7504-7510 Link Here
7504
/*
8459
/*
7505
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8460
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7506
 */
8461
 */
7507
public void test0173(){
8462
public void test0173_Diet(){
7508
	String str =
8463
	String str =
7509
		"public class X{\n" + 
8464
		"public class X{\n" + 
7510
		"  public void foo() {\n" + 
8465
		"  public void foo() {\n" + 
Lines 7538-7557 Link Here
7538
			completionIdentifier,
8493
			completionIdentifier,
7539
			expectedReplacedSource,
8494
			expectedReplacedSource,
7540
	"diet ast");
8495
	"diet ast");
7541
	
8496
}
7542
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8497
/*
7543
	expectedParentNodeToString = "<NONE>";
8498
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7544
	completionIdentifier = "bar";
8499
 */
7545
	expectedReplacedSource = "bar";
8500
public void test0173_Method(){
7546
	expectedUnitDisplayString =
8501
	String str =
7547
		"public class X {\n" + 
8502
		"public class X{\n" + 
7548
		"  public X() {\n" + 
7549
		"  }\n" + 
7550
		"  public void foo() {\n" + 
8503
		"  public void foo() {\n" + 
7551
		"    Object o;\n" + 
8504
		"    Object o =(A<B>.C) tmp;\n" + 
7552
		"    <CompleteOnName:bar>;\n" + 
8505
		"    bar\n" + 
7553
		"  }\n" + 
8506
		"  }\n" + 
7554
		"}\n";
8507
		"}\n" + 
8508
		"\n";
8509
8510
8511
	String completeBehind = "bar";
8512
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
8513
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
8514
	String expectedParentNodeToString = "<NONE>";
8515
	String completionIdentifier = "bar";
8516
	String expectedReplacedSource = "bar";
8517
	String expectedUnitDisplayString =
8518
			"public class X {\n" + 
8519
			"  public X() {\n" + 
8520
			"  }\n" + 
8521
			"  public void foo() {\n" + 
8522
			"    Object o;\n" + 
8523
			"    <CompleteOnName:bar>;\n" + 
8524
			"  }\n" + 
8525
			"}\n";
7555
8526
7556
	checkMethodParse(
8527
	checkMethodParse(
7557
			str.toCharArray(),
8528
			str.toCharArray(),
Lines 7566-7572 Link Here
7566
/*
8537
/*
7567
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8538
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7568
 */
8539
 */
7569
public void test0174(){
8540
public void test0174_Diet(){
7570
	String str =
8541
	String str =
7571
		"public class X{\n" + 
8542
		"public class X{\n" + 
7572
		"  public void foo() {\n" + 
8543
		"  public void foo() {\n" + 
Lines 7600-7619 Link Here
7600
			completionIdentifier,
8571
			completionIdentifier,
7601
			expectedReplacedSource,
8572
			expectedReplacedSource,
7602
	"diet ast");
8573
	"diet ast");
7603
	
8574
}
7604
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8575
/*
7605
	expectedParentNodeToString = "<NONE>";
8576
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7606
	completionIdentifier = "bar";
8577
 */
7607
	expectedReplacedSource = "bar";
8578
public void test0174_Method(){
7608
	expectedUnitDisplayString =
8579
	String str =
7609
		"public class X {\n" + 
8580
		"public class X{\n" + 
7610
		"  public X() {\n" + 
7611
		"  }\n" + 
7612
		"  public void foo() {\n" + 
8581
		"  public void foo() {\n" + 
7613
		"    Object o;\n" + 
8582
		"    Object o =(A<B>.C[]) tmp;\n" + 
7614
		"    <CompleteOnName:bar>;\n" + 
8583
		"    bar\n" + 
7615
		"  }\n" + 
8584
		"  }\n" + 
7616
		"}\n";
8585
		"}\n" + 
8586
		"\n";
8587
8588
8589
	String completeBehind = "bar";
8590
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
8591
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
8592
	String expectedParentNodeToString = "<NONE>";
8593
	String completionIdentifier = "bar";
8594
	String expectedReplacedSource = "bar";
8595
	String expectedUnitDisplayString =
8596
			"public class X {\n" + 
8597
			"  public X() {\n" + 
8598
			"  }\n" + 
8599
			"  public void foo() {\n" + 
8600
			"    Object o;\n" + 
8601
			"    <CompleteOnName:bar>;\n" + 
8602
			"  }\n" + 
8603
			"}\n";
7617
8604
7618
	checkMethodParse(
8605
	checkMethodParse(
7619
			str.toCharArray(),
8606
			str.toCharArray(),
Lines 7628-7634 Link Here
7628
/*
8615
/*
7629
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8616
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7630
 */
8617
 */
7631
public void test0175(){
8618
public void test0175_Diet(){
7632
	String str =
8619
	String str =
7633
		"public class X{\n" + 
8620
		"public class X{\n" + 
7634
		"  public void foo() {\n" + 
8621
		"  public void foo() {\n" + 
Lines 7662-7681 Link Here
7662
			completionIdentifier,
8649
			completionIdentifier,
7663
			expectedReplacedSource,
8650
			expectedReplacedSource,
7664
	"diet ast");
8651
	"diet ast");
7665
	
8652
}
7666
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8653
/*
7667
	expectedParentNodeToString = "<NONE>";
8654
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7668
	completionIdentifier = "bar";
8655
 */
7669
	expectedReplacedSource = "bar";
8656
public void test0175_Method(){
7670
	expectedUnitDisplayString =
8657
	String str =
7671
		"public class X {\n" + 
8658
		"public class X{\n" + 
7672
		"  public X() {\n" + 
7673
		"  }\n" + 
7674
		"  public void foo() {\n" + 
8659
		"  public void foo() {\n" + 
7675
		"    Object o;\n" + 
8660
		"    Object o =(A<B>.C<D>) tmp;\n" + 
7676
		"    <CompleteOnName:bar>;\n" + 
8661
		"    bar\n" + 
7677
		"  }\n" + 
8662
		"  }\n" + 
7678
		"}\n";
8663
		"}\n" + 
8664
		"\n";
8665
8666
8667
	String completeBehind = "bar";
8668
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
8669
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
8670
	String expectedParentNodeToString = "<NONE>";
8671
	String completionIdentifier = "bar";
8672
	String expectedReplacedSource = "bar";
8673
	String expectedUnitDisplayString =
8674
			"public class X {\n" + 
8675
			"  public X() {\n" + 
8676
			"  }\n" + 
8677
			"  public void foo() {\n" + 
8678
			"    Object o;\n" + 
8679
			"    <CompleteOnName:bar>;\n" + 
8680
			"  }\n" + 
8681
			"}\n";
7679
8682
7680
	checkMethodParse(
8683
	checkMethodParse(
7681
			str.toCharArray(),
8684
			str.toCharArray(),
Lines 7690-7696 Link Here
7690
/*
8693
/*
7691
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
8694
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7692
 */
8695
 */
7693
public void test0176(){
8696
public void test0176_Diet(){
7694
	String str =
8697
	String str =
7695
		"public class X{\n" + 
8698
		"public class X{\n" + 
7696
		"  public void foo() {\n" + 
8699
		"  public void foo() {\n" + 
Lines 7724-7743 Link Here
7724
			completionIdentifier,
8727
			completionIdentifier,
7725
			expectedReplacedSource,
8728
			expectedReplacedSource,
7726
	"diet ast");
8729
	"diet ast");
7727
	
8730
}
7728
	expectedCompletionNodeToString = "<CompleteOnName:bar>";
8731
/*
7729
	expectedParentNodeToString = "<NONE>";
8732
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=71702
7730
	completionIdentifier = "bar";
8733
 */
7731
	expectedReplacedSource = "bar";
8734
public void test0176_Method(){
7732
	expectedUnitDisplayString =
8735
	String str =
7733
		"public class X {\n" + 
8736
		"public class X{\n" + 
7734
		"  public X() {\n" + 
7735
		"  }\n" + 
7736
		"  public void foo() {\n" + 
8737
		"  public void foo() {\n" + 
7737
		"    Object o;\n" + 
8738
		"    Object o =(A<B>.C<D>[]) tmp;\n" + 
7738
		"    <CompleteOnName:bar>;\n" + 
8739
		"    bar\n" + 
7739
		"  }\n" + 
8740
		"  }\n" + 
7740
		"}\n";
8741
		"}\n" + 
8742
		"\n";
8743
8744
8745
	String completeBehind = "bar";
8746
	int cursorLocation = str.indexOf("bar") + completeBehind.length() - 1;
8747
	String expectedCompletionNodeToString = "<CompleteOnName:bar>";
8748
	String expectedParentNodeToString = "<NONE>";
8749
	String completionIdentifier = "bar";
8750
	String expectedReplacedSource = "bar";
8751
	String expectedUnitDisplayString =
8752
			"public class X {\n" + 
8753
			"  public X() {\n" + 
8754
			"  }\n" + 
8755
			"  public void foo() {\n" + 
8756
			"    Object o;\n" + 
8757
			"    <CompleteOnName:bar>;\n" + 
8758
			"  }\n" + 
8759
			"}\n";
7741
8760
7742
	checkMethodParse(
8761
	checkMethodParse(
7743
			str.toCharArray(),
8762
			str.toCharArray(),
Lines 7990-7996 Link Here
7990
/*
9009
/*
7991
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75649
9010
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75649
7992
 */
9011
 */
7993
public void test0184(){
9012
public void test0184_Diet(){
7994
	String str =
9013
	String str =
7995
		"public class X <T>{\n" + 
9014
		"public class X <T>{\n" + 
7996
		"  void foo() {\n" + 
9015
		"  void foo() {\n" + 
Lines 8022-8040 Link Here
8022
			completionIdentifier,
9041
			completionIdentifier,
8023
			expectedReplacedSource,
9042
			expectedReplacedSource,
8024
	"diet ast");
9043
	"diet ast");
8025
	
9044
}
8026
	expectedCompletionNodeToString = "<CompleteOnType:Strin>";
9045
/*
8027
	expectedParentNodeToString = "<NONE>";
9046
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=75649
8028
	completionIdentifier = "Strin";
9047
 */
8029
	expectedReplacedSource = "String";
9048
public void test0184_Method(){
8030
	expectedUnitDisplayString =
9049
	String str =
8031
		"public class X<T> {\n" + 
9050
		"public class X <T>{\n" + 
8032
		"  public X() {\n" + 
8033
		"  }\n" + 
8034
		"  void foo() {\n" + 
9051
		"  void foo() {\n" + 
8035
		"    X<? extends <CompleteOnType:Strin>>;\n" + 
9052
		"    X<? extends String> s;\n" + 
8036
		"  }\n" + 
9053
		"  }\n" + 
8037
		"}\n";
9054
		"}\n" + 
9055
		"\n";
9056
9057
	String completeBehind = "Strin";
9058
	int cursorLocation = str.indexOf("Strin") + completeBehind.length() - 1;
9059
	String expectedCompletionNodeToString = "<CompleteOnType:Strin>";
9060
	String expectedParentNodeToString = "<NONE>";
9061
	String completionIdentifier = "Strin";
9062
	String expectedReplacedSource = "String";
9063
	String expectedUnitDisplayString =
9064
			"public class X<T> {\n" + 
9065
			"  public X() {\n" + 
9066
			"  }\n" + 
9067
			"  void foo() {\n" + 
9068
			"    X<? extends <CompleteOnType:Strin>>;\n" + 
9069
			"  }\n" + 
9070
			"}\n";
8038
9071
8039
	checkMethodParse(
9072
	checkMethodParse(
8040
			str.toCharArray(),
9073
			str.toCharArray(),
Lines 8121-8127 Link Here
8121
/*
9154
/*
8122
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=93119
9155
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=93119
8123
 */
9156
 */
8124
public void test0187(){
9157
public void test0187_Diet(){
8125
	String str =
9158
	String str =
8126
		"public class Test {\n" + 
9159
		"public class Test {\n" + 
8127
		"  void foo() {\n" + 
9160
		"  void foo() {\n" + 
Lines 8152-8171 Link Here
8152
			completionIdentifier,
9185
			completionIdentifier,
8153
			expectedReplacedSource,
9186
			expectedReplacedSource,
8154
	"diet ast");
9187
	"diet ast");
8155
	
9188
}
8156
	expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
9189
/*
8157
	expectedParentNodeToString = "<NONE>";
9190
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=93119
8158
	completionIdentifier = "ext";
9191
 */
8159
	expectedReplacedSource = "ext";
9192
public void test0187_Method(){
8160
	expectedUnitDisplayString =
9193
	String str =
8161
		"public class Test {\n" + 
9194
		"public class Test {\n" + 
8162
		"  public Test() {\n" + 
8163
		"  }\n" + 
8164
		"  void foo() {\n" + 
9195
		"  void foo() {\n" + 
8165
		"    List<? extends <CompleteOnKeyword:ext>>;\n" + 
9196
		"    List<? ext\n" + 
8166
		"  }\n" + 
9197
		"  }\n" + 
8167
		"}\n";
9198
		"}\n";
8168
9199
9200
	String completeBehind = "ext";
9201
	int cursorLocation = str.indexOf("ext") + completeBehind.length() - 1;
9202
	String expectedCompletionNodeToString = "<CompleteOnKeyword:ext>";
9203
	String expectedParentNodeToString = "<NONE>";
9204
	String completionIdentifier = "ext";
9205
	String expectedReplacedSource = "ext";
9206
	String expectedUnitDisplayString =
9207
			"public class Test {\n" + 
9208
			"  public Test() {\n" + 
9209
			"  }\n" + 
9210
			"  void foo() {\n" + 
9211
			"    List<? extends <CompleteOnKeyword:ext>>;\n" + 
9212
			"  }\n" + 
9213
			"}\n";
9214
8169
	checkMethodParse(
9215
	checkMethodParse(
8170
			str.toCharArray(),
9216
			str.toCharArray(),
8171
			cursorLocation,
9217
			cursorLocation,
Lines 8179-8185 Link Here
8179
/*
9225
/*
8180
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=80432
9226
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=80432
8181
 */
9227
 */
8182
public void test0188(){
9228
public void test0188_Diet(){
8183
	String str =
9229
	String str =
8184
		"public class Test {\n" + 
9230
		"public class Test {\n" + 
8185
		"  void foo() {\n" + 
9231
		"  void foo() {\n" + 
Lines 8212-8233 Link Here
8212
			completionIdentifier,
9258
			completionIdentifier,
8213
			expectedReplacedSource,
9259
			expectedReplacedSource,
8214
	"diet ast");
9260
	"diet ast");
8215
	
9261
}
8216
	expectedCompletionNodeToString = "<CompleteOnName:toto.>";
9262
/*
8217
	expectedParentNodeToString = "bar(<CompleteOnName:toto.>)";
9263
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=80432
8218
	completionIdentifier = "";
9264
 */
8219
	expectedReplacedSource = "toto.";
9265
public void test0188_Method(){
8220
	expectedUnitDisplayString =
9266
	String str =
8221
		"public class Test {\n" + 
9267
		"public class Test {\n" + 
8222
		"  public Test() {\n" + 
8223
		"  }\n" + 
8224
		"  void foo() {\n" + 
9268
		"  void foo() {\n" + 
8225
		"    {\n" + 
9269
		"    for(;;) {\n" + 
8226
		"      bar(<CompleteOnName:toto.>);\n" + 
9270
		"      bar(toto.\n" + 
8227
		"    }\n" + 
9271
		"    }\n" + 
8228
		"  }\n" + 
9272
		"  }\n" + 
8229
		"}\n";
9273
		"}\n";
8230
9274
9275
	String completeBehind = "toto.";
9276
	int cursorLocation = str.indexOf("toto.") + completeBehind.length() - 1;
9277
	String expectedCompletionNodeToString = "<CompleteOnName:toto.>";
9278
	String expectedParentNodeToString = "bar(<CompleteOnName:toto.>)";
9279
	String completionIdentifier = "";
9280
	String expectedReplacedSource = "toto.";
9281
	String expectedUnitDisplayString =
9282
			"public class Test {\n" + 
9283
			"  public Test() {\n" + 
9284
			"  }\n" + 
9285
			"  void foo() {\n" + 
9286
			"    {\n" + 
9287
			"      bar(<CompleteOnName:toto.>);\n" + 
9288
			"    }\n" + 
9289
			"  }\n" + 
9290
			"}\n";
9291
8231
	checkMethodParse(
9292
	checkMethodParse(
8232
			str.toCharArray(),
9293
			str.toCharArray(),
8233
			cursorLocation,
9294
			cursorLocation,
Lines 8241-8247 Link Here
8241
/*
9302
/*
8242
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
9303
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8243
 */
9304
 */
8244
public void test0189(){
9305
public void test0189_Diet(){
8245
	String str =
9306
	String str =
8246
		"public class Test {\n" + 
9307
		"public class Test {\n" + 
8247
		"  void bar() {\n" + 
9308
		"  void bar() {\n" + 
Lines 8272-8291 Link Here
8272
			completionIdentifier,
9333
			completionIdentifier,
8273
			expectedReplacedSource,
9334
			expectedReplacedSource,
8274
	"diet ast");
9335
	"diet ast");
8275
	
9336
}
8276
	expectedCompletionNodeToString = "<CompleteOnType:Runtime>";
9337
/*
8277
	expectedParentNodeToString = "zzz.foo(new <CompleteOnType:Runtime>())";
9338
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8278
	completionIdentifier = "Runtime";
9339
 */
8279
	expectedReplacedSource = "Runtime";
9340
public void test0189_Method(){
8280
	expectedUnitDisplayString =
9341
	String str =
8281
		"public class Test {\n" + 
9342
		"public class Test {\n" + 
8282
		"  public Test() {\n" + 
8283
		"  }\n" + 
8284
		"  void bar() {\n" + 
9343
		"  void bar() {\n" + 
8285
		"    zzz.foo(new <CompleteOnType:Runtime>());\n" + 
9344
		"    zzz.<String>foo(new Runtime());\n" + 
8286
		"  }\n" + 
9345
		"  }\n" + 
8287
		"}\n";
9346
		"}\n";
8288
9347
9348
	String completeBehind = "Runtime";
9349
	int cursorLocation = str.indexOf("Runtime") + completeBehind.length() - 1;
9350
	String expectedCompletionNodeToString = "<CompleteOnType:Runtime>";
9351
	String expectedParentNodeToString = "zzz.foo(new <CompleteOnType:Runtime>())";
9352
	String completionIdentifier = "Runtime";
9353
	String expectedReplacedSource = "Runtime";
9354
	String expectedUnitDisplayString =
9355
			"public class Test {\n" + 
9356
			"  public Test() {\n" + 
9357
			"  }\n" + 
9358
			"  void bar() {\n" + 
9359
			"    zzz.foo(new <CompleteOnType:Runtime>());\n" + 
9360
			"  }\n" + 
9361
			"}\n";
9362
8289
	checkMethodParse(
9363
	checkMethodParse(
8290
			str.toCharArray(),
9364
			str.toCharArray(),
8291
			cursorLocation,
9365
			cursorLocation,
Lines 8299-8305 Link Here
8299
/*
9373
/*
8300
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
9374
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8301
 */
9375
 */
8302
public void test0190(){
9376
public void test0190_Diet(){
8303
	String str =
9377
	String str =
8304
		"public class Test {\n" + 
9378
		"public class Test {\n" + 
8305
		"  void bar() {\n" + 
9379
		"  void bar() {\n" + 
Lines 8330-8349 Link Here
8330
			completionIdentifier,
9404
			completionIdentifier,
8331
			expectedReplacedSource,
9405
			expectedReplacedSource,
8332
	"diet ast");
9406
	"diet ast");
8333
	
9407
}
8334
	expectedCompletionNodeToString = "<CompleteOnName:var>";
9408
/*
8335
	expectedParentNodeToString = "zzz.foo(<CompleteOnName:var>)";
9409
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8336
	completionIdentifier = "var";
9410
 */
8337
	expectedReplacedSource = "var";
9411
public void test0190_Method(){
8338
	expectedUnitDisplayString =
9412
	String str =
8339
		"public class Test {\n" + 
9413
		"public class Test {\n" + 
8340
		"  public Test() {\n" + 
8341
		"  }\n" + 
8342
		"  void bar() {\n" + 
9414
		"  void bar() {\n" + 
8343
		"    zzz.foo(<CompleteOnName:var>);\n" + 
9415
		"    zzz.<String>foo(var);\n" + 
8344
		"  }\n" + 
9416
		"  }\n" + 
8345
		"}\n";
9417
		"}\n";
8346
9418
9419
	String completeBehind = "var";
9420
	int cursorLocation = str.indexOf("var") + completeBehind.length() - 1;
9421
	String expectedCompletionNodeToString = "<CompleteOnName:var>";
9422
	String expectedParentNodeToString = "zzz.foo(<CompleteOnName:var>)";
9423
	String completionIdentifier = "var";
9424
	String expectedReplacedSource = "var";
9425
	String expectedUnitDisplayString =
9426
			"public class Test {\n" + 
9427
			"  public Test() {\n" + 
9428
			"  }\n" + 
9429
			"  void bar() {\n" + 
9430
			"    zzz.foo(<CompleteOnName:var>);\n" + 
9431
			"  }\n" + 
9432
			"}\n";
9433
8347
	checkMethodParse(
9434
	checkMethodParse(
8348
			str.toCharArray(),
9435
			str.toCharArray(),
8349
			cursorLocation,
9436
			cursorLocation,
Lines 8357-8363 Link Here
8357
/*
9444
/*
8358
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
9445
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8359
 */
9446
 */
8360
public void test0191(){
9447
public void test0191_Diet(){
8361
	String str =
9448
	String str =
8362
		"public class Test {\n" + 
9449
		"public class Test {\n" + 
8363
		"  void bar() {\n" + 
9450
		"  void bar() {\n" + 
Lines 8388-8407 Link Here
8388
			completionIdentifier,
9475
			completionIdentifier,
8389
			expectedReplacedSource,
9476
			expectedReplacedSource,
8390
	"diet ast");
9477
	"diet ast");
8391
	
9478
}
8392
	expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz.foo()>";
9479
/*
8393
	expectedParentNodeToString = "<NONE>";
9480
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8394
	completionIdentifier = "";
9481
 */
8395
	expectedReplacedSource = "foo(";
9482
public void test0191_Method(){
8396
	expectedUnitDisplayString =
9483
	String str =
8397
		"public class Test {\n" + 
9484
		"public class Test {\n" + 
8398
		"  public Test() {\n" + 
8399
		"  }\n" + 
8400
		"  void bar() {\n" + 
9485
		"  void bar() {\n" + 
8401
		"    <CompleteOnMessageSend:zzz.foo()>;\n" + 
9486
		"    zzz.<String>foo();\n" + 
8402
		"  }\n" + 
9487
		"  }\n" + 
8403
		"}\n";
9488
		"}\n";
8404
9489
9490
	String completeBehind = "foo(";
9491
	int cursorLocation = str.indexOf("foo(") + completeBehind.length() - 1;
9492
	String expectedCompletionNodeToString = "<CompleteOnMessageSend:zzz.foo()>";
9493
	String expectedParentNodeToString = "<NONE>";
9494
	String completionIdentifier = "";
9495
	String expectedReplacedSource = "foo(";
9496
	String expectedUnitDisplayString =
9497
			"public class Test {\n" + 
9498
			"  public Test() {\n" + 
9499
			"  }\n" + 
9500
			"  void bar() {\n" + 
9501
			"    <CompleteOnMessageSend:zzz.foo()>;\n" + 
9502
			"  }\n" + 
9503
			"}\n";
9504
8405
	checkMethodParse(
9505
	checkMethodParse(
8406
			str.toCharArray(),
9506
			str.toCharArray(),
8407
			cursorLocation,
9507
			cursorLocation,
Lines 8415-8421 Link Here
8415
/*
9515
/*
8416
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
9516
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8417
 */
9517
 */
8418
public void test0192(){
9518
public void test0192_Diet(){
8419
	String str =
9519
	String str =
8420
		"public class Test {\n" + 
9520
		"public class Test {\n" + 
8421
		"  void bar() {\n" + 
9521
		"  void bar() {\n" + 
Lines 8446-8465 Link Here
8446
			completionIdentifier,
9546
			completionIdentifier,
8447
			expectedReplacedSource,
9547
			expectedReplacedSource,
8448
	"diet ast");
9548
	"diet ast");
8449
	
9549
}
8450
	expectedCompletionNodeToString = "<CompleteOnMessageSendName:zzz.<String>fo()>";
9550
/*
8451
	expectedParentNodeToString = "<NONE>";
9551
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=82560
8452
	completionIdentifier = "fo";
9552
 */
8453
	expectedReplacedSource = "foo";
9553
public void test0192_Method(){
8454
	expectedUnitDisplayString =
9554
	String str =
8455
		"public class Test {\n" + 
9555
		"public class Test {\n" + 
8456
		"  public Test() {\n" + 
8457
		"  }\n" + 
8458
		"  void bar() {\n" + 
9556
		"  void bar() {\n" + 
8459
		"    <CompleteOnMessageSendName:zzz.<String>fo()>;\n" + 
9557
		"    zzz.<String>foo();\n" + 
8460
		"  }\n" + 
9558
		"  }\n" + 
8461
		"}\n";
9559
		"}\n";
8462
9560
9561
	String completeBehind = "fo";
9562
	int cursorLocation = str.indexOf("fo") + completeBehind.length() - 1;
9563
	String expectedCompletionNodeToString = "<CompleteOnMessageSendName:zzz.<String>fo()>";
9564
	String expectedParentNodeToString = "<NONE>";
9565
	String completionIdentifier = "fo";
9566
	String expectedReplacedSource = "foo";
9567
	String expectedUnitDisplayString =
9568
			"public class Test {\n" + 
9569
			"  public Test() {\n" + 
9570
			"  }\n" + 
9571
			"  void bar() {\n" + 
9572
			"    <CompleteOnMessageSendName:zzz.<String>fo()>;\n" + 
9573
			"  }\n" + 
9574
			"}\n";
9575
8463
	checkMethodParse(
9576
	checkMethodParse(
8464
			str.toCharArray(),
9577
			str.toCharArray(),
8465
			cursorLocation,
9578
			cursorLocation,
Lines 8473-8479 Link Here
8473
/*
9586
/*
8474
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
9587
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
8475
 */
9588
 */
8476
public void test0193(){
9589
public void test0193_Diet(){
8477
	String str =
9590
	String str =
8478
		"public class Test {\n" + 
9591
		"public class Test {\n" + 
8479
		"  void bar() {\n" + 
9592
		"  void bar() {\n" + 
Lines 8504-8523 Link Here
8504
			completionIdentifier,
9617
			completionIdentifier,
8505
			expectedReplacedSource,
9618
			expectedReplacedSource,
8506
	"diet ast");
9619
	"diet ast");
8507
	
9620
}
8508
	expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Foo<X>()>";
9621
/*
8509
	expectedParentNodeToString = "<NONE>";
9622
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
8510
	completionIdentifier = "";
9623
 */
8511
	expectedReplacedSource = "";
9624
public void test0193_Method(){
8512
	expectedUnitDisplayString =
9625
	String str =
8513
		"public class Test {\n" + 
9626
		"public class Test {\n" + 
8514
		"  public Test() {\n" + 
8515
		"  }\n" + 
8516
		"  void bar() {\n" + 
9627
		"  void bar() {\n" + 
8517
		"    <CompleteOnAllocationExpression:new Foo<X>()>;\n" + 
9628
		"    new Foo<X>();\n" + 
8518
		"  }\n" + 
9629
		"  }\n" + 
8519
		"}\n";
9630
		"}\n";
8520
9631
9632
	String completeBehind = ">(";
9633
	int cursorLocation = str.indexOf(">(") + completeBehind.length() - 1;
9634
	String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Foo<X>()>";
9635
	String expectedParentNodeToString = "<NONE>";
9636
	String completionIdentifier = "";
9637
	String expectedReplacedSource = "";
9638
	String expectedUnitDisplayString =
9639
			"public class Test {\n" + 
9640
			"  public Test() {\n" + 
9641
			"  }\n" + 
9642
			"  void bar() {\n" + 
9643
			"    <CompleteOnAllocationExpression:new Foo<X>()>;\n" + 
9644
			"  }\n" + 
9645
			"}\n";
9646
8521
	checkMethodParse(
9647
	checkMethodParse(
8522
			str.toCharArray(),
9648
			str.toCharArray(),
8523
			cursorLocation,
9649
			cursorLocation,
Lines 8531-8537 Link Here
8531
/*
9657
/*
8532
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
9658
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
8533
 */
9659
 */
8534
public void test0194(){
9660
public void test0194_Diet(){
8535
	String str =
9661
	String str =
8536
		"public class Test {\n" + 
9662
		"public class Test {\n" + 
8537
		"  void bar() {\n" + 
9663
		"  void bar() {\n" + 
Lines 8562-8581 Link Here
8562
			completionIdentifier,
9688
			completionIdentifier,
8563
			expectedReplacedSource,
9689
			expectedReplacedSource,
8564
	"diet ast");
9690
	"diet ast");
8565
	
9691
}
8566
	expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Foo<X<X>>()>";
9692
/*
8567
	expectedParentNodeToString = "<NONE>";
9693
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
8568
	completionIdentifier = "";
9694
 */
8569
	expectedReplacedSource = "";
9695
public void test0194_Method(){
8570
	expectedUnitDisplayString =
9696
	String str =
8571
		"public class Test {\n" + 
9697
		"public class Test {\n" + 
8572
		"  public Test() {\n" + 
8573
		"  }\n" + 
8574
		"  void bar() {\n" + 
9698
		"  void bar() {\n" + 
8575
		"    <CompleteOnAllocationExpression:new Foo<X<X>>()>;\n" + 
9699
		"    new Foo<X<X>>();\n" + 
8576
		"  }\n" + 
9700
		"  }\n" + 
8577
		"}\n";
9701
		"}\n";
8578
9702
9703
	String completeBehind = ">(";
9704
	int cursorLocation = str.indexOf(">(") + completeBehind.length() - 1;
9705
	String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Foo<X<X>>()>";
9706
	String expectedParentNodeToString = "<NONE>";
9707
	String completionIdentifier = "";
9708
	String expectedReplacedSource = "";
9709
	String expectedUnitDisplayString =
9710
			"public class Test {\n" + 
9711
			"  public Test() {\n" + 
9712
			"  }\n" + 
9713
			"  void bar() {\n" + 
9714
			"    <CompleteOnAllocationExpression:new Foo<X<X>>()>;\n" + 
9715
			"  }\n" + 
9716
			"}\n";
9717
8579
	checkMethodParse(
9718
	checkMethodParse(
8580
			str.toCharArray(),
9719
			str.toCharArray(),
8581
			cursorLocation,
9720
			cursorLocation,
Lines 8589-8595 Link Here
8589
/*
9728
/*
8590
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
9729
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
8591
 */
9730
 */
8592
public void test0195(){
9731
public void test0195_Diet(){
8593
	String str =
9732
	String str =
8594
		"public class Test {\n" + 
9733
		"public class Test {\n" + 
8595
		"  void bar() {\n" + 
9734
		"  void bar() {\n" + 
Lines 8620-8639 Link Here
8620
			completionIdentifier,
9759
			completionIdentifier,
8621
			expectedReplacedSource,
9760
			expectedReplacedSource,
8622
	"diet ast");
9761
	"diet ast");
8623
	
9762
}
8624
	expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Foo<X<X<X>>>()>";
9763
/*
8625
	expectedParentNodeToString = "<NONE>";
9764
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=94641
8626
	completionIdentifier = "";
9765
 */
8627
	expectedReplacedSource = "";
9766
public void test0195_Method(){
8628
	expectedUnitDisplayString =
9767
	String str =
8629
		"public class Test {\n" + 
9768
		"public class Test {\n" + 
8630
		"  public Test() {\n" + 
8631
		"  }\n" + 
8632
		"  void bar() {\n" + 
9769
		"  void bar() {\n" + 
8633
		"    <CompleteOnAllocationExpression:new Foo<X<X<X>>>()>;\n" + 
9770
		"    new Foo<X<X<X>>>();\n" + 
8634
		"  }\n" + 
9771
		"  }\n" + 
8635
		"}\n";
9772
		"}\n";
8636
9773
9774
	String completeBehind = ">(";
9775
	int cursorLocation = str.indexOf(">(") + completeBehind.length() - 1;
9776
	String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new Foo<X<X<X>>>()>";
9777
	String expectedParentNodeToString = "<NONE>";
9778
	String completionIdentifier = "";
9779
	String expectedReplacedSource = "";
9780
	String expectedUnitDisplayString =
9781
			"public class Test {\n" + 
9782
			"  public Test() {\n" + 
9783
			"  }\n" + 
9784
			"  void bar() {\n" + 
9785
			"    <CompleteOnAllocationExpression:new Foo<X<X<X>>>()>;\n" + 
9786
			"  }\n" + 
9787
			"}\n";
9788
8637
	checkMethodParse(
9789
	checkMethodParse(
8638
			str.toCharArray(),
9790
			str.toCharArray(),
8639
			cursorLocation,
9791
			cursorLocation,
Lines 8863-8869 Link Here
8863
/*
10015
/*
8864
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100302
10016
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100302
8865
 */
10017
 */
8866
public void test0202(){
10018
public void test0202_Diet(){
8867
	String str =
10019
	String str =
8868
		"public class Test {\n" + 
10020
		"public class Test {\n" + 
8869
		"  void bar() {\n" + 
10021
		"  void bar() {\n" + 
Lines 8896-8918 Link Here
8896
			completionIdentifier,
10048
			completionIdentifier,
8897
			expectedReplacedSource,
10049
			expectedReplacedSource,
8898
	"diet ast");
10050
	"diet ast");
8899
	
10051
}
8900
	expectedCompletionNodeToString = "<CompleteOnName:entry.>";
10052
/*
8901
	expectedParentNodeToString = "<NONE>";
10053
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100302
8902
	completionIdentifier = "";
10054
 */
8903
	expectedReplacedSource = "entry.";
10055
public void test0202_Method(){
8904
	expectedUnitDisplayString =
10056
	String str =
8905
		"public class Test {\n" + 
10057
		"public class Test {\n" + 
8906
		"  public Test() {\n" + 
8907
		"  }\n" + 
8908
		"  void bar() {\n" + 
10058
		"  void bar() {\n" + 
8909
		"    Entry entry;\n" + 
10059
		"    for (Entry entry : (Set<Entry>) var) {\n" + 
8910
		"    {\n" + 
10060
		"      entry.\n" + 
8911
		"      <CompleteOnName:entry.>;\n" + 
8912
		"    }\n" + 
10061
		"    }\n" + 
8913
		"  }\n" + 
10062
		"  }\n" + 
8914
		"}\n";
10063
		"}\n";
8915
10064
10065
	String completeBehind = "entry.";
10066
	int cursorLocation = str.indexOf("entry.") + completeBehind.length() - 1;
10067
	String expectedCompletionNodeToString = "<CompleteOnName:entry.>";
10068
	String expectedParentNodeToString = "<NONE>";
10069
	String completionIdentifier = "";
10070
	String expectedReplacedSource = "entry.";
10071
	String expectedUnitDisplayString =
10072
			"public class Test {\n" + 
10073
			"  public Test() {\n" + 
10074
			"  }\n" + 
10075
			"  void bar() {\n" + 
10076
			"    Entry entry;\n" + 
10077
			"    {\n" + 
10078
			"      <CompleteOnName:entry.>;\n" + 
10079
			"    }\n" + 
10080
			"  }\n" + 
10081
			"}\n";
10082
8916
	checkMethodParse(
10083
	checkMethodParse(
8917
			str.toCharArray(),
10084
			str.toCharArray(),
8918
			cursorLocation,
10085
			cursorLocation,
Lines 8926-8932 Link Here
8926
/*
10093
/*
8927
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100302
10094
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100302
8928
 */
10095
 */
8929
public void test0203(){
10096
public void test0203_Diet(){
8930
	String str =
10097
	String str =
8931
		"public class Test {\n" + 
10098
		"public class Test {\n" + 
8932
		"  void bar() {\n" + 
10099
		"  void bar() {\n" + 
Lines 8959-8981 Link Here
8959
			completionIdentifier,
10126
			completionIdentifier,
8960
			expectedReplacedSource,
10127
			expectedReplacedSource,
8961
	"diet ast");
10128
	"diet ast");
8962
	
10129
}
8963
	expectedCompletionNodeToString = "<CompleteOnName:entry.>";
10130
/*
8964
	expectedParentNodeToString = "<NONE>";
10131
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=100302
8965
	completionIdentifier = "";
10132
 */
8966
	expectedReplacedSource = "entry.";
10133
public void test0203_Method(){
8967
	expectedUnitDisplayString =
10134
	String str =
8968
		"public class Test {\n" + 
10135
		"public class Test {\n" + 
8969
		"  public Test() {\n" + 
8970
		"  }\n" + 
8971
		"  void bar() {\n" + 
10136
		"  void bar() {\n" + 
8972
		"    Entry entry;\n" + 
10137
		"    for (Entry entry : (ZZZ<YYY>.Set<Entry>) var) {\n" + 
8973
		"    {\n" + 
10138
		"      entry.\n" + 
8974
		"      <CompleteOnName:entry.>;\n" + 
8975
		"    }\n" + 
10139
		"    }\n" + 
8976
		"  }\n" + 
10140
		"  }\n" + 
8977
		"}\n";
10141
		"}\n";
8978
10142
10143
	String completeBehind = "entry.";
10144
	int cursorLocation = str.indexOf("entry.") + completeBehind.length() - 1;
10145
	String expectedCompletionNodeToString = "<CompleteOnName:entry.>";
10146
	String expectedParentNodeToString = "<NONE>";
10147
	String completionIdentifier = "";
10148
	String expectedReplacedSource = "entry.";
10149
	String expectedUnitDisplayString =
10150
			"public class Test {\n" + 
10151
			"  public Test() {\n" + 
10152
			"  }\n" + 
10153
			"  void bar() {\n" + 
10154
			"    Entry entry;\n" + 
10155
			"    {\n" + 
10156
			"      <CompleteOnName:entry.>;\n" + 
10157
			"    }\n" + 
10158
			"  }\n" + 
10159
			"}\n";
10160
8979
	checkMethodParse(
10161
	checkMethodParse(
8980
			str.toCharArray(),
10162
			str.toCharArray(),
8981
			cursorLocation,
10163
			cursorLocation,
Lines 8989-8995 Link Here
8989
/*
10171
/*
8990
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=103148
10172
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=103148
8991
 */
10173
 */
8992
public void test0204(){
10174
public void test0204_Diet(){
8993
	String str =
10175
	String str =
8994
		"public class Test {\n"+
10176
		"public class Test {\n"+
8995
		"	public enum MyEnum { A };\n"+
10177
		"	public enum MyEnum { A };\n"+
Lines 9029-9055 Link Here
9029
			completionIdentifier,
10211
			completionIdentifier,
9030
			expectedReplacedSource,
10212
			expectedReplacedSource,
9031
	"diet ast");
10213
	"diet ast");
9032
	
10214
}
9033
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
10215
/*
9034
	expectedParentNodeToString = "<NONE>";
10216
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=103148
9035
	completionIdentifier = "zzz";
10217
 */
9036
	expectedReplacedSource = "zzz";
10218
public void test0204_Method(){
9037
	expectedUnitDisplayString =
10219
	String str =
9038
		"public class Test {\n" + 
10220
		"public class Test {\n"+
9039
		"  public enum MyEnum {\n" + 
10221
		"	public enum MyEnum { A };\n"+
9040
		"    A(),\n" + 
10222
		"	public static void foo() {\n"+
9041
		"    <clinit>() {\n" + 
10223
		"		EnumSet.<MyEnum>of(MyEnum.A);\n"+
9042
		"    }\n" + 
10224
		"		zzz\n"+
9043
		"    public MyEnum() {\n" + 
10225
		"	}\n"+
9044
		"    }\n" + 
9045
		"  }\n" + 
9046
		"  public Test() {\n" + 
9047
		"  }\n" + 
9048
		"  public static void foo() {\n" + 
9049
		"    <CompleteOnName:zzz>;\n" + 
9050
		"  }\n" + 
9051
		"}\n";
10226
		"}\n";
9052
10227
10228
	String completeBehind = "zzz";
10229
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
10230
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
10231
	String expectedParentNodeToString = "<NONE>";
10232
	String completionIdentifier = "zzz";
10233
	String expectedReplacedSource = "zzz";
10234
	String expectedUnitDisplayString =
10235
			"public class Test {\n" + 
10236
			"  public enum MyEnum {\n" + 
10237
			"    A(),\n" + 
10238
			"    <clinit>() {\n" + 
10239
			"    }\n" + 
10240
			"    public MyEnum() {\n" + 
10241
			"    }\n" + 
10242
			"  }\n" + 
10243
			"  public Test() {\n" + 
10244
			"  }\n" + 
10245
			"  public static void foo() {\n" + 
10246
			"    <CompleteOnName:zzz>;\n" + 
10247
			"  }\n" + 
10248
			"}\n";
10249
9053
	checkMethodParse(
10250
	checkMethodParse(
9054
			str.toCharArray(),
10251
			str.toCharArray(),
9055
			cursorLocation,
10252
			cursorLocation,
Lines 9094-9100 Link Here
9094
/*
10291
/*
9095
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
10292
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9096
 */
10293
 */
9097
public void test0206(){
10294
public void test0206_Diet(){
9098
	String str =
10295
	String str =
9099
		"public class Test {\n"+
10296
		"public class Test {\n"+
9100
		"	void foo() {\n"+
10297
		"	void foo() {\n"+
Lines 9125-9144 Link Here
9125
			completionIdentifier,
10322
			completionIdentifier,
9126
			expectedReplacedSource,
10323
			expectedReplacedSource,
9127
	"diet ast");
10324
	"diet ast");
9128
	
10325
}
9129
	expectedCompletionNodeToString = "<CompleteOnMessageSendName:Collections.<B>zzz()>";
10326
/*
9130
	expectedParentNodeToString = "<NONE>";
10327
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9131
	completionIdentifier = "zzz";
10328
 */
9132
	expectedReplacedSource = "zzz";
10329
public void test0206_Method(){
9133
	expectedUnitDisplayString =
10330
	String str =
9134
		"public class Test {\n" + 
10331
		"public class Test {\n"+
9135
		"  public Test() {\n" + 
10332
		"	void foo() {\n"+
9136
		"  }\n" + 
10333
		"	  Collections.<B>zzz\n"+
9137
		"  void foo() {\n" + 
10334
		"	}\n"+
9138
		"    <CompleteOnMessageSendName:Collections.<B>zzz()>;\n" + 
9139
		"  }\n" + 
9140
		"}\n";
10335
		"}\n";
9141
10336
10337
	String completeBehind = "zzz";
10338
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
10339
	String expectedCompletionNodeToString = "<CompleteOnMessageSendName:Collections.<B>zzz()>";
10340
	String expectedParentNodeToString = "<NONE>";
10341
	String completionIdentifier = "zzz";
10342
	String expectedReplacedSource = "zzz";
10343
	String expectedUnitDisplayString =
10344
			"public class Test {\n" + 
10345
			"  public Test() {\n" + 
10346
			"  }\n" + 
10347
			"  void foo() {\n" + 
10348
			"    <CompleteOnMessageSendName:Collections.<B>zzz()>;\n" + 
10349
			"  }\n" + 
10350
			"}\n";
10351
9142
	checkMethodParse(
10352
	checkMethodParse(
9143
			str.toCharArray(),
10353
			str.toCharArray(),
9144
			cursorLocation,
10354
			cursorLocation,
Lines 9152-9158 Link Here
9152
/*
10362
/*
9153
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
10363
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9154
 */
10364
 */
9155
public void test0207(){
10365
public void test0207_Diet(){
9156
	String str =
10366
	String str =
9157
		"public class Test {\n"+
10367
		"public class Test {\n"+
9158
		"	void foo() {\n"+
10368
		"	void foo() {\n"+
Lines 9183-9202 Link Here
9183
			completionIdentifier,
10393
			completionIdentifier,
9184
			expectedReplacedSource,
10394
			expectedReplacedSource,
9185
	"diet ast");
10395
	"diet ast");
9186
	
10396
}
9187
	expectedCompletionNodeToString = "<CompleteOnMessageSendName:bar().<B>zzz()>";
10397
/*
9188
	expectedParentNodeToString = "<NONE>";
10398
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9189
	completionIdentifier = "zzz";
10399
 */
9190
	expectedReplacedSource = "zzz";
10400
public void test0207_Method(){
9191
	expectedUnitDisplayString =
10401
	String str =
9192
		"public class Test {\n" + 
10402
		"public class Test {\n"+
9193
		"  public Test() {\n" + 
10403
		"	void foo() {\n"+
9194
		"  }\n" + 
10404
		"	  bar().<B>zzz\n"+
9195
		"  void foo() {\n" + 
10405
		"	}\n"+
9196
		"    <CompleteOnMessageSendName:bar().<B>zzz()>;\n" + 
9197
		"  }\n" + 
9198
		"}\n";
10406
		"}\n";
9199
10407
10408
	String completeBehind = "zzz";
10409
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
10410
	String expectedCompletionNodeToString = "<CompleteOnMessageSendName:bar().<B>zzz()>";
10411
	String expectedParentNodeToString = "<NONE>";
10412
	String completionIdentifier = "zzz";
10413
	String expectedReplacedSource = "zzz";
10414
	String expectedUnitDisplayString =
10415
			"public class Test {\n" + 
10416
			"  public Test() {\n" + 
10417
			"  }\n" + 
10418
			"  void foo() {\n" + 
10419
			"    <CompleteOnMessageSendName:bar().<B>zzz()>;\n" + 
10420
			"  }\n" + 
10421
			"}\n";
10422
9200
	checkMethodParse(
10423
	checkMethodParse(
9201
			str.toCharArray(),
10424
			str.toCharArray(),
9202
			cursorLocation,
10425
			cursorLocation,
Lines 9210-9216 Link Here
9210
/*
10433
/*
9211
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
10434
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9212
 */
10435
 */
9213
public void test0208(){
10436
public void test0208_Diet(){
9214
	String str =
10437
	String str =
9215
		"public class Test {\n"+
10438
		"public class Test {\n"+
9216
		"	void foo() {\n"+
10439
		"	void foo() {\n"+
Lines 9241-9260 Link Here
9241
			completionIdentifier,
10464
			completionIdentifier,
9242
			expectedReplacedSource,
10465
			expectedReplacedSource,
9243
	"diet ast");
10466
	"diet ast");
9244
	
10467
}
9245
	expectedCompletionNodeToString = "<CompleteOnName:zzz>";
10468
/*
9246
	expectedParentNodeToString = "<NONE>";
10469
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9247
	completionIdentifier = "zzz";
10470
 */
9248
	expectedReplacedSource = "zzz";
10471
public void test0208_Method(){
9249
	expectedUnitDisplayString =
10472
	String str =
9250
		"public class Test {\n" + 
10473
		"public class Test {\n"+
9251
		"  public Test() {\n" + 
10474
		"	void foo() {\n"+
9252
		"  }\n" + 
10475
		"	  int.<B>zzz\n"+
9253
		"  void foo() {\n" + 
10476
		"	}\n"+
9254
		"    <CompleteOnName:zzz>;\n" + 
9255
		"  }\n" + 
9256
		"}\n";
10477
		"}\n";
9257
10478
10479
	String completeBehind = "zzz";
10480
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
10481
	String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
10482
	String expectedParentNodeToString = "<NONE>";
10483
	String completionIdentifier = "zzz";
10484
	String expectedReplacedSource = "zzz";
10485
	String expectedUnitDisplayString =
10486
			"public class Test {\n" + 
10487
			"  public Test() {\n" + 
10488
			"  }\n" + 
10489
			"  void foo() {\n" + 
10490
			"    <CompleteOnName:zzz>;\n" + 
10491
			"  }\n" + 
10492
			"}\n";
10493
9258
	checkMethodParse(
10494
	checkMethodParse(
9259
			str.toCharArray(),
10495
			str.toCharArray(),
9260
			cursorLocation,
10496
			cursorLocation,
Lines 9268-9274 Link Here
9268
/*
10504
/*
9269
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
10505
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9270
 */
10506
 */
9271
public void test0209(){
10507
public void test0209_Diet(){
9272
	String str =
10508
	String str =
9273
		"public class Test {\n"+
10509
		"public class Test {\n"+
9274
		"	void foo() {\n"+
10510
		"	void foo() {\n"+
Lines 9299-9318 Link Here
9299
			completionIdentifier,
10535
			completionIdentifier,
9300
			expectedReplacedSource,
10536
			expectedReplacedSource,
9301
	"diet ast");
10537
	"diet ast");
9302
	
10538
}
9303
	expectedCompletionNodeToString = "<CompleteOnMessageSendName:this.<B>zzz()>";
10539
/*
9304
	expectedParentNodeToString = "<NONE>";
10540
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9305
	completionIdentifier = "zzz";
10541
 */
9306
	expectedReplacedSource = "zzz";
10542
public void test0209_Method(){
9307
	expectedUnitDisplayString =
10543
	String str =
9308
		"public class Test {\n" + 
10544
		"public class Test {\n"+
9309
		"  public Test() {\n" + 
10545
		"	void foo() {\n"+
9310
		"  }\n" + 
10546
		"	  this.<B>zzz\n"+
9311
		"  void foo() {\n" + 
10547
		"	}\n"+
9312
		"    <CompleteOnMessageSendName:this.<B>zzz()>;\n" + 
9313
		"  }\n" + 
9314
		"}\n";
10548
		"}\n";
9315
10549
10550
	String completeBehind = "zzz";
10551
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
10552
	String expectedCompletionNodeToString = "<CompleteOnMessageSendName:this.<B>zzz()>";
10553
	String expectedParentNodeToString = "<NONE>";
10554
	String completionIdentifier = "zzz";
10555
	String expectedReplacedSource = "zzz";
10556
	String expectedUnitDisplayString =
10557
			"public class Test {\n" + 
10558
			"  public Test() {\n" + 
10559
			"  }\n" + 
10560
			"  void foo() {\n" + 
10561
			"    <CompleteOnMessageSendName:this.<B>zzz()>;\n" + 
10562
			"  }\n" + 
10563
			"}\n";
10564
9316
	checkMethodParse(
10565
	checkMethodParse(
9317
			str.toCharArray(),
10566
			str.toCharArray(),
9318
			cursorLocation,
10567
			cursorLocation,
Lines 9326-9332 Link Here
9326
/*
10575
/*
9327
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
10576
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9328
 */
10577
 */
9329
public void test0210(){
10578
public void test0210_Diet(){
9330
	String str =
10579
	String str =
9331
		"public class Test {\n"+
10580
		"public class Test {\n"+
9332
		"	void foo() {\n"+
10581
		"	void foo() {\n"+
Lines 9357-9376 Link Here
9357
			completionIdentifier,
10606
			completionIdentifier,
9358
			expectedReplacedSource,
10607
			expectedReplacedSource,
9359
	"diet ast");
10608
	"diet ast");
9360
	
10609
}
9361
	expectedCompletionNodeToString = "<CompleteOnMessageSendName:super.<B>zzz()>";
10610
/*
9362
	expectedParentNodeToString = "<NONE>";
10611
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=106450
9363
	completionIdentifier = "zzz";
10612
 */
9364
	expectedReplacedSource = "zzz";
10613
public void test0210_Method(){
9365
	expectedUnitDisplayString =
10614
	String str =
9366
		"public class Test {\n" + 
10615
		"public class Test {\n"+
9367
		"  public Test() {\n" + 
10616
		"	void foo() {\n"+
9368
		"  }\n" + 
10617
		"	  super.<B>zzz\n"+
9369
		"  void foo() {\n" + 
10618
		"	}\n"+
9370
		"    <CompleteOnMessageSendName:super.<B>zzz()>;\n" + 
9371
		"  }\n" + 
9372
		"}\n";
10619
		"}\n";
9373
10620
10621
	String completeBehind = "zzz";
10622
	int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
10623
	String expectedCompletionNodeToString = "<CompleteOnMessageSendName:super.<B>zzz()>";
10624
	String expectedParentNodeToString = "<NONE>";
10625
	String completionIdentifier = "zzz";
10626
	String expectedReplacedSource = "zzz";
10627
	String expectedUnitDisplayString =
10628
			"public class Test {\n" + 
10629
			"  public Test() {\n" + 
10630
			"  }\n" + 
10631
			"  void foo() {\n" + 
10632
			"    <CompleteOnMessageSendName:super.<B>zzz()>;\n" + 
10633
			"  }\n" + 
10634
			"}\n";
10635
9374
	checkMethodParse(
10636
	checkMethodParse(
9375
			str.toCharArray(),
10637
			str.toCharArray(),
9376
			cursorLocation,
10638
			cursorLocation,
Lines 9441-9447 Link Here
9441
	"diet ast");
10703
	"diet ast");
9442
}
10704
}
9443
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
10705
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9444
public void test0213() {
10706
public void test0213_Diet() {
9445
10707
9446
	String str = 
10708
	String str = 
9447
		"public class X {\n" +
10709
		"public class X {\n" +
Lines 9480-9513 Link Here
9480
			completionIdentifier,
10742
			completionIdentifier,
9481
			expectedReplacedSource,
10743
			expectedReplacedSource,
9482
	"diet ast");
10744
	"diet ast");
9483
	
10745
}
9484
	expectedCompletionNodeToString = "<CompleteOnException:Top<Object>.IZZ>";
10746
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157584
9485
	expectedParentNodeToString =
10747
public void test0213_Method() {
9486
		"try \n" + 
10748
9487
		"  {\n" + 
10749
	String str = 
9488
		"    throwing();\n" + 
10750
		"public class X {\n" +
9489
		"  }\n" + 
10751
		"	public boolean foo() {\n" +
9490
		"catch (IllegalAccessException e)   {\n" + 
10752
		"      try {\n" +
9491
		"  }\n" + 
10753
		"         throwing();\n" +
9492
		"catch (<CompleteOnException:Top<Object>.IZZ>  )   {\n" + 
10754
		"      }\n" +
9493
		"  }";
10755
		"      catch (IllegalAccessException e) {\n" +
9494
	completionIdentifier = "IZZ";
10756
		"         bar();\n" +
9495
	expectedReplacedSource = "Top<Object>.IZZ";
10757
		"      }\n" +
9496
	expectedUnitDisplayString =
10758
		"      catch (Top<Object>.IZZ) {\n" +
9497
		"public class X {\n" + 
10759
		"      }\n" +
9498
		"  public X() {\n" + 
10760
		"   }" +
9499
		"  }\n" + 
10761
		"}\n"; 
9500
		"  public boolean foo() {\n" + 
10762
9501
		"    try \n" + 
10763
	String completeBehind = "IZZ";
9502
		"      {\n" + 
10764
	int cursorLocation = str.lastIndexOf("IZZ") + completeBehind.length() - 1;
9503
		"        throwing();\n" + 
10765
	String expectedCompletionNodeToString = "<CompleteOnException:Top<Object>.IZZ>";
9504
		"      }\n" + 
10766
	String expectedParentNodeToString =
9505
		"    catch (IllegalAccessException e)       {\n" + 
10767
			"try \n" + 
9506
		"      }\n" + 
10768
			"  {\n" + 
9507
		"    catch (<CompleteOnException:Top<Object>.IZZ>  )       {\n" + 
10769
			"    throwing();\n" + 
9508
		"      }\n" + 
10770
			"  }\n" + 
9509
		"  }\n" + 
10771
			"catch (IllegalAccessException e)   {\n" + 
9510
		"}\n";
10772
			"  }\n" + 
10773
			"catch (<CompleteOnException:Top<Object>.IZZ>  )   {\n" + 
10774
			"  }";
10775
	String completionIdentifier = "IZZ";
10776
	String expectedReplacedSource = "Top<Object>.IZZ";
10777
	String expectedUnitDisplayString =
10778
			"public class X {\n" + 
10779
			"  public X() {\n" + 
10780
			"  }\n" + 
10781
			"  public boolean foo() {\n" + 
10782
			"    try \n" + 
10783
			"      {\n" + 
10784
			"        throwing();\n" + 
10785
			"      }\n" + 
10786
			"    catch (IllegalAccessException e)       {\n" + 
10787
			"      }\n" + 
10788
			"    catch (<CompleteOnException:Top<Object>.IZZ>  )       {\n" + 
10789
			"      }\n" + 
10790
			"  }\n" + 
10791
			"}\n";
9511
10792
9512
	checkMethodParse(
10793
	checkMethodParse(
9513
			str.toCharArray(),
10794
			str.toCharArray(),
(-)src/org/eclipse/jdt/core/tests/compiler/parser/AbstractCompletionTest.java (-165 / +129 lines)
Lines 34-39 Link Here
34
public abstract class AbstractCompletionTest extends AbstractCompilerTest {
34
public abstract class AbstractCompletionTest extends AbstractCompilerTest {
35
35
36
	public final static String NONE = "<NONE>";
36
	public final static String NONE = "<NONE>";
37
	public final static String NULL = "null";
37
public AbstractCompletionTest(String testName){
38
public AbstractCompletionTest(String testName){
38
	super(testName);
39
	super(testName);
39
}
40
}
Lines 84-159 Link Here
84
85
85
	CompilationUnitDeclaration unit = parser.dietParse(sourceUnit, compilationResult, cursorLocation);
86
	CompilationUnitDeclaration unit = parser.dietParse(sourceUnit, compilationResult, cursorLocation);
86
87
87
	String computedCompletion = parser.assistNode == null 
88
	checkParse(
88
									? NONE
89
			expectedCompletion,
89
									: parser.assistNode.toString();
90
			expectedParentCompletion,
90
	String computedParentCompletion = parser.assistNodeParent == null 
91
			expectedUnitToString,
91
								? NONE
92
								: parser.assistNodeParent.toString();
93
	String computedUnitToString = unit.toString();
94
	//System.out.println(computedUnitToString);
95
	//System.out.println(Util.displayString(computedUnitToString));
96
	//System.out.println(expectedUnitToString);
97
	
98
	if (!expectedCompletion.equals(computedCompletion)) {
99
		System.out.println(Util.displayString(computedCompletion));
100
	}
101
	assertEquals(
102
		"invalid completion node-" + testName,
103
		expectedCompletion,
104
		computedCompletion);
105
	
106
	if(expectedParentCompletion != null) {
107
		if (!expectedParentCompletion.equals(computedParentCompletion)) {
108
			System.out.println(Util.displayString(computedParentCompletion));
109
		}
110
		assertEquals(
111
		"invalid completion parent node-" + testName,
112
		expectedParentCompletion,
113
		computedParentCompletion);
114
	}
115
116
	if (!expectedUnitToString.equals(computedUnitToString)) {
117
		System.out.println(Util.displayString(computedUnitToString));
118
	}
119
	assertEquals(
120
		"invalid completion tree-" + testName,
121
		expectedUnitToString,
122
		computedUnitToString);
123
	
124
	if (expectedCompletionIdentifier != null){
125
		char[] chars = ((CompletionScanner)parser.scanner).completionIdentifier;
126
		String computedCompletionIdentifier = chars == null ? NONE : new String(chars);
127
		assertEquals(
128
			"invalid completion identifier-" + testName,
129
			expectedCompletionIdentifier,
92
			expectedCompletionIdentifier,
130
			computedCompletionIdentifier);
131
	}
132
	
133
	if (expectedReplacedSource != null){
134
		char[] chars = null;
135
		if (parser.assistNode != null){
136
			chars = CharOperation.subarray(
137
				parser.scanner.source, 
138
				parser.assistNode.sourceStart, 
139
				parser.assistNode.sourceEnd + 1);
140
		} else {
141
			if (parser.assistIdentifier() != null){
142
				if (((CompletionScanner)parser.scanner).completedIdentifierEnd 
143
					>= ((CompletionScanner)parser.scanner).completedIdentifierStart){
144
					chars = CharOperation.subarray(
145
						parser.scanner.source, 
146
						((CompletionScanner)parser.scanner).completedIdentifierStart, 
147
						((CompletionScanner)parser.scanner).completedIdentifierEnd + 1);
148
				}
149
			}
150
		}
151
		String computedReplacedSource  = chars == null ? NONE : new String(chars);
152
		assertEquals(
153
			"invalid replaced source-" + testName,
154
			expectedReplacedSource,
93
			expectedReplacedSource,
155
			computedReplacedSource);
94
			testName,
156
	}
95
			parser,
96
			unit);
157
}
97
}
158
/*
98
/*
159
 * Parse a method with completionNode check
99
 * Parse a method with completionNode check
Lines 193-303 Link Here
193
			}
133
			}
194
		}
134
		}
195
	}
135
	}
196
	assertTrue("no method found at cursor location", foundMethod != null);
136
	
197
	if (foundMethod instanceof AbstractMethodDeclaration) {
137
	if (foundMethod != null) {
198
		parser.parseBlockStatements((AbstractMethodDeclaration)foundMethod, unit);
138
		if (foundMethod instanceof AbstractMethodDeclaration) {
199
	} else {
139
			parser.parseBlockStatements((AbstractMethodDeclaration)foundMethod, unit);
200
		TypeDeclaration type = (TypeDeclaration)foundMethod;
140
		} else {
201
		if (type.fields != null) {
141
			TypeDeclaration type = (TypeDeclaration)foundMethod;
202
			for (int i = 0; i < type.fields.length; i++) {
142
			if (type.fields != null) {
203
				FieldDeclaration field = type.fields[i];
143
				done : for (int i = 0; i < type.fields.length; i++) {
204
				if (field.declarationSourceStart <= cursorLocation && (cursorLocation <= field.declarationSourceEnd || field.declarationSourceEnd == 0)) {
144
					FieldDeclaration field = type.fields[i];
205
					if (field instanceof Initializer) {
145
					if (field.declarationSourceStart <= cursorLocation && (cursorLocation <= field.declarationSourceEnd || field.declarationSourceEnd == 0)) {
206
						parser.parseBlockStatements((Initializer)field, type, unit);
146
						if (field instanceof Initializer) {
207
						break;
147
							parser.parseBlockStatements((Initializer)field, type, unit);
148
							break;
149
						}
150
						break done; // field initializer
208
					}
151
					}
209
					assertTrue("TBD", false); // field initializer
210
				}
152
				}
211
			}
153
			}
212
		}
154
		}
213
	}
155
	}
214
	
156
	
215
	String computedCompletion = parser.assistNode == null 
157
	checkParse(
216
								? NONE
158
			expectedCompletion,
217
								: parser.assistNode.toString();
159
			expectedParentCompletion,
218
	String computedParentCompletion = parser.assistNodeParent == null 
160
			expectedUnitToString,
219
								? NONE
220
								: parser.assistNodeParent.toString();
221
	String computedUnitToString = unit.toString();
222
223
	if (!expectedCompletion.equals(computedCompletion)) {
224
		System.out.println(Util.displayString(computedCompletion));
225
	}
226
	assertEquals(
227
		"invalid completion node-" + testName,
228
		expectedCompletion,
229
		computedCompletion);
230
		
231
	if(expectedParentCompletion != null) {
232
		if (!expectedParentCompletion.equals(computedParentCompletion)) {
233
			System.out.println(Util.displayString(computedParentCompletion));
234
		}
235
		assertEquals(
236
		"invalid completion parent node-" + testName,
237
		expectedParentCompletion,
238
		computedParentCompletion);
239
	}
240
241
	if (!expectedUnitToString.equals(computedUnitToString)) {
242
		System.out.println(Util.displayString(computedUnitToString));
243
	}
244
	assertEquals(
245
		"invalid completion location-"+testName,
246
		expectedUnitToString,
247
		computedUnitToString);
248
249
	if (expectedCompletionIdentifier != null){
250
		char[] chars = ((CompletionScanner)parser.scanner).completionIdentifier;
251
		String computedCompletionIdentifier = chars == null ? NONE : new String(chars);
252
		if (!expectedCompletionIdentifier.equals(computedCompletionIdentifier)) {
253
			System.out.println(Util.displayString(computedCompletionIdentifier));
254
		}
255
		assertEquals(
256
			"invalid completion identifier-" + testName,
257
			expectedCompletionIdentifier,
161
			expectedCompletionIdentifier,
258
			computedCompletionIdentifier);
259
	}
260
	if (expectedReplacedSource != null){
261
		char[] chars = null;
262
		if (parser.assistNode != null){
263
			chars = CharOperation.subarray(
264
				parser.scanner.source, 
265
				parser.assistNode.sourceStart, 
266
				parser.assistNode.sourceEnd + 1);
267
		} else {
268
			if (parser.assistIdentifier() != null){
269
				if (((CompletionScanner)parser.scanner).completedIdentifierEnd 
270
					>= ((CompletionScanner)parser.scanner).completedIdentifierStart){
271
					chars = CharOperation.subarray(
272
						parser.scanner.source, 
273
						((CompletionScanner)parser.scanner).completedIdentifierStart, 
274
						((CompletionScanner)parser.scanner).completedIdentifierEnd + 1);
275
				}
276
			}
277
		}
278
		String computedReplacedSource  = chars == null ? NONE : new String(chars);
279
		if (!expectedReplacedSource.equals(computedReplacedSource)) {
280
			System.out.println(Util.displayString(computedReplacedSource));
281
		}
282
		assertEquals(
283
			"invalid replaced source-" + testName,
284
			expectedReplacedSource,
162
			expectedReplacedSource,
285
			computedReplacedSource);
163
			testName,
286
		if (expectedReplacedSource.length() == 0) {
164
			parser,
287
			assertEquals(
165
			unit);
288
				"invalid insertion point-" + testName,
289
				cursorLocation + 1, 
290
				parser.assistNode.sourceStart);
291
		}
292
	}
293
	if (expectedLabels != null) {
294
//		int length = (parser.labels == null) ? 0 : parser.labels.length;
295
//		assertEquals("invalid number of labels-" + testName, expectedLabels.length, length);
296
//		for (int i = 0; i < length; i++) {
297
//			String label = new String(parser.labels[i]);
298
//			assertEquals("invalid label-" + testName, expectedLabels[i], label);
299
//		}
300
	}
301
}
166
}
302
/*
167
/*
303
 * Parse a method with completionNode check
168
 * Parse a method with completionNode check
Lines 370-375 Link Here
370
		expectedLabels,
235
		expectedLabels,
371
		testName);
236
		testName);
372
}
237
}
238
private void checkParse(
239
		String expectedCompletion,
240
		String expectedParentCompletion,
241
		String expectedUnitToString,
242
		String expectedCompletionIdentifier,
243
		String expectedReplacedSource,
244
		String testName,
245
		CompletionParser parser,
246
		CompilationUnitDeclaration unit) {
247
	String computedCompletion = parser.assistNode == null 
248
									? NONE
249
									: parser.assistNode.toString();
250
	
251
	String computedParentCompletion = NULL;
252
	if (expectedParentCompletion != null) {
253
		computedParentCompletion = parser.assistNodeParent == null 
254
								? NONE
255
								: parser.assistNodeParent.toString();
256
	}
257
	
258
	String computedUnitToString = unit.toString();
259
	//System.out.println(computedUnitToString);
260
	//System.out.println(Util.displayString(computedUnitToString));
261
	//System.out.println(expectedUnitToString);
262
	
263
	if (!expectedCompletion.equals(computedCompletion)) {
264
		System.out.println(Util.displayString(computedCompletion));
265
	}
266
	
267
	if(expectedParentCompletion != null) {
268
		if (!expectedParentCompletion.equals(computedParentCompletion)) {
269
			System.out.println(Util.displayString(computedParentCompletion));
270
		}
271
	}
272
273
	if (!expectedUnitToString.equals(computedUnitToString)) {
274
		System.out.println(Util.displayString(computedUnitToString));
275
	}
276
	
277
	String computedCompletionIdentifier = NULL;
278
	if (expectedCompletionIdentifier != null){
279
		char[] chars = ((CompletionScanner)parser.scanner).completionIdentifier;
280
		computedCompletionIdentifier = chars == null ? NONE : new String(chars);
281
	}
282
	
283
	String computedReplacedSource = NULL;
284
	if (expectedReplacedSource != null){
285
		char[] chars = null;
286
		if (parser.assistNode != null){
287
			chars = CharOperation.subarray(
288
				parser.scanner.source, 
289
				parser.assistNode.sourceStart, 
290
				parser.assistNode.sourceEnd + 1);
291
		} else {
292
			if (parser.assistIdentifier() != null){
293
				if (((CompletionScanner)parser.scanner).completedIdentifierEnd 
294
					>= ((CompletionScanner)parser.scanner).completedIdentifierStart){
295
					chars = CharOperation.subarray(
296
						parser.scanner.source, 
297
						((CompletionScanner)parser.scanner).completedIdentifierStart, 
298
						((CompletionScanner)parser.scanner).completedIdentifierEnd + 1);
299
				}
300
			}
301
		}
302
		computedReplacedSource  = chars == null ? NONE : new String(chars);
303
	}
304
	assertEquals(
305
			testName,
306
			concatResults(
307
					expectedCompletion,
308
					expectedParentCompletion,
309
					expectedUnitToString,
310
					expectedCompletionIdentifier,
311
					expectedReplacedSource),
312
			concatResults(computedCompletion,
313
					computedParentCompletion,
314
					computedUnitToString,
315
					computedCompletionIdentifier,
316
					computedReplacedSource));
317
}
318
private String concatResults(
319
		String completionNode, 
320
		String parentCompletionNode,
321
		String unitToString, 
322
		String completionIdentifier,
323
		String replacedSource) {
324
	StringBuffer buffer = new StringBuffer();
325
	buffer.append("### Completion node ###\n");
326
	buffer.append(completionNode);
327
	buffer.append("\n### Parent completion node ###\n");
328
	buffer.append(parentCompletionNode);
329
	buffer.append("\n### Completed identifier ###\n");
330
	buffer.append(completionIdentifier);
331
	buffer.append("\n### Replaced source ###\n");
332
	buffer.append(replacedSource);
333
	buffer.append("\n### Completed unit ###\n");
334
	buffer.append(unitToString);
335
	return buffer.toString();
336
}
373
/*
337
/*
374
 * Returns the method, the constructor or the type declaring the initializer
338
 * Returns the method, the constructor or the type declaring the initializer
375
 * at the cursor location in the given type.
339
 * at the cursor location in the given type.
(-)src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java (-423 / +760 lines)
Lines 387-393 Link Here
387
			expectedReplacedSource,
387
			expectedReplacedSource,
388
	"diet ast");
388
	"diet ast");
389
}
389
}
390
public void test0013(){
390
public void test0013_Diet(){
391
	String str =
391
	String str =
392
		"public class X {\n" +
392
		"public class X {\n" +
393
		"  public void foo() {\n" +
393
		"  public void foo() {\n" +
Lines 420-438 Link Here
420
			completionIdentifier,
420
			completionIdentifier,
421
			expectedReplacedSource,
421
			expectedReplacedSource,
422
	"diet ast");
422
	"diet ast");
423
	
423
}
424
	expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
424
public void test0013_Method(){
425
	expectedParentNodeToString = "<NONE>";
425
	String str =
426
	completionIdentifier = "MyAnn";
426
		"public class X {\n" +
427
	expectedReplacedSource = "MyAnn";
427
		"  public void foo() {\n" +
428
	expectedUnitDisplayString =
428
		"    @MyAnn class Y {\n" +
429
		"public class X {\n" + 
429
		"    }\n" +
430
		"  public X() {\n" + 
430
		"  }\n" +
431
		"  }\n" + 
431
		"}";
432
		"  public void foo() {\n" + 
432
433
		"    @<CompleteOnType:MyAnn>\n" + 
433
434
		"  }\n" + 
434
	String completeBehind = "MyAnn";
435
		"}\n";
435
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
436
	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
437
	String expectedParentNodeToString = "<NONE>";
438
	String completionIdentifier = "MyAnn";
439
	String expectedReplacedSource = "MyAnn";
440
	String expectedUnitDisplayString =
441
			"public class X {\n" + 
442
			"  public X() {\n" + 
443
			"  }\n" + 
444
			"  public void foo() {\n" + 
445
			"    @<CompleteOnType:MyAnn>\n" + 
446
			"  }\n" + 
447
			"}\n";
436
448
437
	checkMethodParse(
449
	checkMethodParse(
438
			str.toCharArray(),
450
			str.toCharArray(),
Lines 729-735 Link Here
729
			expectedReplacedSource,
741
			expectedReplacedSource,
730
	"diet ast");
742
	"diet ast");
731
}
743
}
732
public void test0024(){
744
public void test0024_Diet(){
733
	String str =
745
	String str =
734
		"public class X {\n" +
746
		"public class X {\n" +
735
		"  void foo() {@MyAnn int i}\n" +
747
		"  void foo() {@MyAnn int i}\n" +
Lines 759-777 Link Here
759
			completionIdentifier,
771
			completionIdentifier,
760
			expectedReplacedSource,
772
			expectedReplacedSource,
761
	"diet ast");
773
	"diet ast");
762
	
774
}
763
	expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
775
public void test0024_Method(){
764
	expectedParentNodeToString = "<NONE>";
776
	String str =
765
	completionIdentifier = "MyAnn";
777
		"public class X {\n" +
766
	expectedReplacedSource = "MyAnn";
778
		"  void foo() {@MyAnn int i}\n" +
767
	expectedUnitDisplayString =
779
		"}";
768
		"public class X {\n" + 
780
769
		"  public X() {\n" + 
781
770
		"  }\n" + 
782
	String completeBehind = "MyAnn";
771
		"  void foo() {\n" + 
783
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
772
		"    @<CompleteOnType:MyAnn>\n" + 
784
	String expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
773
		"  }\n" + 
785
	String expectedParentNodeToString = "<NONE>";
774
		"}\n";
786
	String completionIdentifier = "MyAnn";
787
	String expectedReplacedSource = "MyAnn";
788
	String expectedUnitDisplayString =
789
			"public class X {\n" + 
790
			"  public X() {\n" + 
791
			"  }\n" + 
792
			"  void foo() {\n" + 
793
			"    @<CompleteOnType:MyAnn>\n" + 
794
			"  }\n" + 
795
			"}\n";
775
796
776
	checkMethodParse(
797
	checkMethodParse(
777
			str.toCharArray(),
798
			str.toCharArray(),
Lines 879-885 Link Here
879
			expectedReplacedSource,
900
			expectedReplacedSource,
880
	"diet ast");
901
	"diet ast");
881
}
902
}
882
public void test0028(){
903
public void test0028_Diet(){
883
	String str =
904
	String str =
884
		"public class X {\n" +
905
		"public class X {\n" +
885
		"  void bar() {\n" +
906
		"  void bar() {\n" +
Lines 912-930 Link Here
912
			completionIdentifier,
933
			completionIdentifier,
913
			expectedReplacedSource,
934
			expectedReplacedSource,
914
	"diet ast");
935
	"diet ast");
915
	
936
}
916
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
937
public void test0028_Method(){
917
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
938
	String str =
918
	completionIdentifier = "foo";
939
		"public class X {\n" +
919
	expectedReplacedSource = "foo";
940
		"  void bar() {\n" +
920
	expectedUnitDisplayString =
941
		"    @Annot(foo)\n" +
921
		"public class X {\n" + 
942
		"    int var;\n" +
922
		"  public X() {\n" + 
943
		"  }\n" +
923
		"  }\n" + 
944
		"}";
924
		"  void bar() {\n" + 
945
925
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
946
926
		"  }\n" + 
947
	String completeBehind = "foo";
927
		"}\n";
948
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
949
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
950
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
951
	String completionIdentifier = "foo";
952
	String expectedReplacedSource = "foo";
953
	String expectedUnitDisplayString =
954
			"public class X {\n" + 
955
			"  public X() {\n" + 
956
			"  }\n" + 
957
			"  void bar() {\n" + 
958
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
959
			"  }\n" + 
960
			"}\n";
928
961
929
	checkMethodParse(
962
	checkMethodParse(
930
			str.toCharArray(),
963
			str.toCharArray(),
Lines 936-942 Link Here
936
			expectedReplacedSource,
969
			expectedReplacedSource,
937
			"full ast");
970
			"full ast");
938
}
971
}
939
public void test0029(){
972
public void test0029_Diet(){
940
	String str =
973
	String str =
941
		"public class X {\n" +
974
		"public class X {\n" +
942
		"  void bar(int var1, @Annot(foo) int var2) {\n" +
975
		"  void bar(int var1, @Annot(foo) int var2) {\n" +
Lines 967-985 Link Here
967
			completionIdentifier,
1000
			completionIdentifier,
968
			expectedReplacedSource,
1001
			expectedReplacedSource,
969
	"diet ast");
1002
	"diet ast");
970
	
1003
}
971
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1004
public void test0029_Method(){
972
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1005
	String str =
973
	completionIdentifier = "foo";
1006
		"public class X {\n" +
974
	expectedReplacedSource = "foo";
1007
		"  void bar(int var1, @Annot(foo) int var2) {\n" +
975
	expectedUnitDisplayString =
1008
		"  }\n" +
976
		"public class X {\n" + 
1009
		"}";
977
		"  public X() {\n" + 
1010
978
		"  }\n" + 
1011
979
		"  void bar(int var1) {\n" + 
1012
	String completeBehind = "foo";
980
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1013
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
981
		"  }\n" + 
1014
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
982
		"}\n";
1015
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1016
	String completionIdentifier = "foo";
1017
	String expectedReplacedSource = "foo";
1018
	String expectedUnitDisplayString =
1019
			"public class X {\n" + 
1020
			"  public X() {\n" + 
1021
			"  }\n" + 
1022
			"  void bar(int var1) {\n" + 
1023
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1024
			"  }\n" + 
1025
			"}\n";
983
1026
984
	checkMethodParse(
1027
	checkMethodParse(
985
			str.toCharArray(),
1028
			str.toCharArray(),
Lines 1119-1125 Link Here
1119
			expectedReplacedSource,
1162
			expectedReplacedSource,
1120
	"diet ast");
1163
	"diet ast");
1121
}
1164
}
1122
public void test0034(){
1165
public void test0034_Diet(){
1123
	String str =
1166
	String str =
1124
		"public class X {\n" +
1167
		"public class X {\n" +
1125
		"  void bar() {\n" +
1168
		"  void bar() {\n" +
Lines 1152-1170 Link Here
1152
			completionIdentifier,
1195
			completionIdentifier,
1153
			expectedReplacedSource,
1196
			expectedReplacedSource,
1154
	"diet ast");
1197
	"diet ast");
1155
	
1198
}
1156
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1199
public void test0034_Method(){
1157
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1200
	String str =
1158
	completionIdentifier = "foo";
1201
		"public class X {\n" +
1159
	expectedReplacedSource = "foo";
1202
		"  void bar() {\n" +
1160
	expectedUnitDisplayString =
1203
		"    @Annot(foo\n" +
1161
		"public class X {\n" + 
1204
		"    int var;\n" +
1162
		"  public X() {\n" + 
1205
		"  }\n" +
1163
		"  }\n" + 
1206
		"}";
1164
		"  void bar() {\n" + 
1207
1165
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1208
1166
		"  }\n" + 
1209
	String completeBehind = "foo";
1167
		"}\n";
1210
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1211
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1212
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1213
	String completionIdentifier = "foo";
1214
	String expectedReplacedSource = "foo";
1215
	String expectedUnitDisplayString =
1216
			"public class X {\n" + 
1217
			"  public X() {\n" + 
1218
			"  }\n" + 
1219
			"  void bar() {\n" + 
1220
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1221
			"  }\n" + 
1222
			"}\n";
1168
1223
1169
	checkMethodParse(
1224
	checkMethodParse(
1170
			str.toCharArray(),
1225
			str.toCharArray(),
Lines 1176-1182 Link Here
1176
			expectedReplacedSource,
1231
			expectedReplacedSource,
1177
			"full ast");
1232
			"full ast");
1178
}
1233
}
1179
public void test0035(){
1234
public void test0035_Diet(){
1180
	String str =
1235
	String str =
1181
		"public class X {\n" +
1236
		"public class X {\n" +
1182
		"  void bar(int var1, @Annot(foo int var2) {\n" +
1237
		"  void bar(int var1, @Annot(foo int var2) {\n" +
Lines 1207-1225 Link Here
1207
			completionIdentifier,
1262
			completionIdentifier,
1208
			expectedReplacedSource,
1263
			expectedReplacedSource,
1209
	"diet ast");
1264
	"diet ast");
1210
	
1265
}
1211
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1266
public void test0035_Method(){
1212
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1267
	String str =
1213
	completionIdentifier = "foo";
1268
		"public class X {\n" +
1214
	expectedReplacedSource = "foo";
1269
		"  void bar(int var1, @Annot(foo int var2) {\n" +
1215
	expectedUnitDisplayString =
1270
		"  }\n" +
1216
		"public class X {\n" + 
1271
		"}";
1217
		"  public X() {\n" + 
1272
1218
		"  }\n" + 
1273
1219
		"  void bar(int var1) {\n" + 
1274
	String completeBehind = "foo";
1220
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1275
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1221
		"  }\n" + 
1276
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1222
		"}\n";
1277
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1278
	String completionIdentifier = "foo";
1279
	String expectedReplacedSource = "foo";
1280
	String expectedUnitDisplayString =
1281
			"public class X {\n" + 
1282
			"  public X() {\n" + 
1283
			"  }\n" + 
1284
			"  void bar(int var1) {\n" + 
1285
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1286
			"  }\n" + 
1287
			"}\n";
1223
1288
1224
	checkMethodParse(
1289
	checkMethodParse(
1225
			str.toCharArray(),
1290
			str.toCharArray(),
Lines 1359-1365 Link Here
1359
			expectedReplacedSource,
1424
			expectedReplacedSource,
1360
	"diet ast");
1425
	"diet ast");
1361
}
1426
}
1362
public void test0040(){
1427
public void test0040_Diet(){
1363
	String str =
1428
	String str =
1364
		"public class X {\n" +
1429
		"public class X {\n" +
1365
		"  void bar() {\n" +
1430
		"  void bar() {\n" +
Lines 1392-1410 Link Here
1392
			completionIdentifier,
1457
			completionIdentifier,
1393
			expectedReplacedSource,
1458
			expectedReplacedSource,
1394
	"diet ast");
1459
	"diet ast");
1395
	
1460
}
1396
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1461
public void test0040_Method(){
1397
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1462
	String str =
1398
	completionIdentifier = "foo";
1463
		"public class X {\n" +
1399
	expectedReplacedSource = "foo";
1464
		"  void bar() {\n" +
1400
	expectedUnitDisplayString =
1465
		"    @Annot(foo=zzz)\n" +
1401
		"public class X {\n" + 
1466
		"    int var;\n" +
1402
		"  public X() {\n" + 
1467
		"  }\n" +
1403
		"  }\n" + 
1468
		"}";
1404
		"  void bar() {\n" + 
1469
1405
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1470
1406
		"  }\n" + 
1471
	String completeBehind = "foo";
1407
		"}\n";
1472
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1473
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1474
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1475
	String completionIdentifier = "foo";
1476
	String expectedReplacedSource = "foo";
1477
	String expectedUnitDisplayString =
1478
			"public class X {\n" + 
1479
			"  public X() {\n" + 
1480
			"  }\n" + 
1481
			"  void bar() {\n" + 
1482
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1483
			"  }\n" + 
1484
			"}\n";
1408
1485
1409
	checkMethodParse(
1486
	checkMethodParse(
1410
			str.toCharArray(),
1487
			str.toCharArray(),
Lines 1416-1422 Link Here
1416
			expectedReplacedSource,
1493
			expectedReplacedSource,
1417
			"full ast");
1494
			"full ast");
1418
}
1495
}
1419
public void test0041(){
1496
public void test0041_Diet(){
1420
	String str =
1497
	String str =
1421
		"public class X {\n" +
1498
		"public class X {\n" +
1422
		"  void bar(int var1, @Annot(foo=zzz) int var2) {\n" +
1499
		"  void bar(int var1, @Annot(foo=zzz) int var2) {\n" +
Lines 1447-1465 Link Here
1447
			completionIdentifier,
1524
			completionIdentifier,
1448
			expectedReplacedSource,
1525
			expectedReplacedSource,
1449
	"diet ast");
1526
	"diet ast");
1450
	
1527
}
1451
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1528
public void test0041_Method(){
1452
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1529
	String str =
1453
	completionIdentifier = "foo";
1530
		"public class X {\n" +
1454
	expectedReplacedSource = "foo";
1531
		"  void bar(int var1, @Annot(foo=zzz) int var2) {\n" +
1455
	expectedUnitDisplayString =
1532
		"  }\n" +
1456
		"public class X {\n" + 
1533
		"}";
1457
		"  public X() {\n" + 
1534
1458
		"  }\n" + 
1535
1459
		"  void bar(int var1) {\n" + 
1536
	String completeBehind = "foo";
1460
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1537
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1461
		"  }\n" + 
1538
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1462
		"}\n";
1539
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1540
	String completionIdentifier = "foo";
1541
	String expectedReplacedSource = "foo";
1542
	String expectedUnitDisplayString =
1543
			"public class X {\n" + 
1544
			"  public X() {\n" + 
1545
			"  }\n" + 
1546
			"  void bar(int var1) {\n" + 
1547
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1548
			"  }\n" + 
1549
			"}\n";
1463
1550
1464
	checkMethodParse(
1551
	checkMethodParse(
1465
			str.toCharArray(),
1552
			str.toCharArray(),
Lines 1599-1605 Link Here
1599
			expectedReplacedSource,
1686
			expectedReplacedSource,
1600
	"diet ast");
1687
	"diet ast");
1601
}
1688
}
1602
public void test0046(){
1689
public void test0046_Diet(){
1603
	String str =
1690
	String str =
1604
		"public class X {\n" +
1691
		"public class X {\n" +
1605
		"  void bar() {\n" +
1692
		"  void bar() {\n" +
Lines 1632-1650 Link Here
1632
			completionIdentifier,
1719
			completionIdentifier,
1633
			expectedReplacedSource,
1720
			expectedReplacedSource,
1634
	"diet ast");
1721
	"diet ast");
1635
	
1722
}
1636
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1723
public void test0046_Method(){
1637
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1724
	String str =
1638
	completionIdentifier = "foo";
1725
		"public class X {\n" +
1639
	expectedReplacedSource = "foo";
1726
		"  void bar() {\n" +
1640
	expectedUnitDisplayString =
1727
		"    @Annot(foo=zzz\n" +
1641
		"public class X {\n" + 
1728
		"    int var;\n" +
1642
		"  public X() {\n" + 
1729
		"  }\n" +
1643
		"  }\n" + 
1730
		"}";
1644
		"  void bar() {\n" + 
1731
1645
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1732
1646
		"  }\n" + 
1733
	String completeBehind = "foo";
1647
		"}\n";
1734
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1735
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1736
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1737
	String completionIdentifier = "foo";
1738
	String expectedReplacedSource = "foo";
1739
	String expectedUnitDisplayString =
1740
			"public class X {\n" + 
1741
			"  public X() {\n" + 
1742
			"  }\n" + 
1743
			"  void bar() {\n" + 
1744
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1745
			"  }\n" + 
1746
			"}\n";
1648
1747
1649
	checkMethodParse(
1748
	checkMethodParse(
1650
			str.toCharArray(),
1749
			str.toCharArray(),
Lines 1656-1662 Link Here
1656
			expectedReplacedSource,
1755
			expectedReplacedSource,
1657
			"full ast");
1756
			"full ast");
1658
}
1757
}
1659
public void test0047(){
1758
public void test0047_Diet(){
1660
	String str =
1759
	String str =
1661
		"public class X {\n" +
1760
		"public class X {\n" +
1662
		"  void bar(int var1, @Annot(foo=zzz int var2) {\n" +
1761
		"  void bar(int var1, @Annot(foo=zzz int var2) {\n" +
Lines 1687-1705 Link Here
1687
			completionIdentifier,
1786
			completionIdentifier,
1688
			expectedReplacedSource,
1787
			expectedReplacedSource,
1689
	"diet ast");
1788
	"diet ast");
1690
	
1789
}
1691
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1790
public void test0047_Method(){
1692
	expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1791
	String str =
1693
	completionIdentifier = "foo";
1792
		"public class X {\n" +
1694
	expectedReplacedSource = "foo";
1793
		"  void bar(int var1, @Annot(foo=zzz int var2) {\n" +
1695
	expectedUnitDisplayString =
1794
		"  }\n" +
1696
		"public class X {\n" + 
1795
		"}";
1697
		"  public X() {\n" + 
1796
1698
		"  }\n" + 
1797
1699
		"  void bar(int var1) {\n" + 
1798
	String completeBehind = "foo";
1700
		"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1799
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1701
		"  }\n" + 
1800
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1702
		"}\n";
1801
	String expectedParentNodeToString = "@Annot(<CompleteOnAttributeName:foo>)";
1802
	String completionIdentifier = "foo";
1803
	String expectedReplacedSource = "foo";
1804
	String expectedUnitDisplayString =
1805
			"public class X {\n" + 
1806
			"  public X() {\n" + 
1807
			"  }\n" + 
1808
			"  void bar(int var1) {\n" + 
1809
			"    @Annot(<CompleteOnAttributeName:foo>)\n" + 
1810
			"  }\n" + 
1811
			"}\n";
1703
1812
1704
	checkMethodParse(
1813
	checkMethodParse(
1705
			str.toCharArray(),
1814
			str.toCharArray(),
Lines 1841-1847 Link Here
1841
			expectedReplacedSource,
1950
			expectedReplacedSource,
1842
	"diet ast");
1951
	"diet ast");
1843
}
1952
}
1844
public void test0052(){
1953
public void test0052_Diet(){
1845
	String str =
1954
	String str =
1846
		"public class X {\n" +
1955
		"public class X {\n" +
1847
		"  void bar() {\n" +
1956
		"  void bar() {\n" +
Lines 1874-1892 Link Here
1874
			completionIdentifier,
1983
			completionIdentifier,
1875
			expectedReplacedSource,
1984
			expectedReplacedSource,
1876
	"diet ast");
1985
	"diet ast");
1877
	
1986
}
1878
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
1987
public void test0052_Method(){
1879
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
1988
	String str =
1880
	completionIdentifier = "foo";
1989
		"public class X {\n" +
1881
	expectedReplacedSource = "foo";
1990
		"  void bar() {\n" +
1882
	expectedUnitDisplayString =
1991
		"    @Annot(yyy=zzz,foo)\n" +
1883
		"public class X {\n" + 
1992
		"    int var;\n" +
1884
		"  public X() {\n" + 
1993
		"  }\n" +
1885
		"  }\n" + 
1994
		"}";
1886
		"  void bar() {\n" + 
1995
1887
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
1996
1888
		"  }\n" + 
1997
	String completeBehind = "foo";
1889
		"}\n";
1998
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
1999
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2000
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2001
	String completionIdentifier = "foo";
2002
	String expectedReplacedSource = "foo";
2003
	String expectedUnitDisplayString =
2004
			"public class X {\n" + 
2005
			"  public X() {\n" + 
2006
			"  }\n" + 
2007
			"  void bar() {\n" + 
2008
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2009
			"  }\n" + 
2010
			"}\n";
1890
2011
1891
	checkMethodParse(
2012
	checkMethodParse(
1892
			str.toCharArray(),
2013
			str.toCharArray(),
Lines 1898-1904 Link Here
1898
			expectedReplacedSource,
2019
			expectedReplacedSource,
1899
			"full ast");
2020
			"full ast");
1900
}
2021
}
1901
public void test0053(){
2022
public void test0053_Diet(){
1902
	String str =
2023
	String str =
1903
		"public class X {\n" +
2024
		"public class X {\n" +
1904
		"  void bar(int var1, @Annot(yyy=zzz,foo) int var2) {\n" +
2025
		"  void bar(int var1, @Annot(yyy=zzz,foo) int var2) {\n" +
Lines 1929-1950 Link Here
1929
			completionIdentifier,
2050
			completionIdentifier,
1930
			expectedReplacedSource,
2051
			expectedReplacedSource,
1931
	"diet ast");
2052
	"diet ast");
1932
	
2053
}
1933
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2054
public void test0053_Method(){
1934
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2055
	String str =
1935
	completionIdentifier = "foo";
2056
		"public class X {\n" +
1936
	expectedReplacedSource = "foo";
2057
		"  void bar(int var1, @Annot(yyy=zzz,foo) int var2) {\n" +
1937
	expectedUnitDisplayString =
2058
		"  }\n" +
1938
		"public class X {\n" + 
2059
		"}";
1939
		"  public X() {\n" + 
1940
		"  }\n" + 
1941
		"  void bar(int var1) {\n" + 
1942
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
1943
		"  }\n" + 
1944
		"}\n";
1945
2060
1946
	checkMethodParse(
2061
1947
			str.toCharArray(),
2062
	String completeBehind = "foo";
2063
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2064
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2065
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2066
	String completionIdentifier = "foo";
2067
	String expectedReplacedSource = "foo";
2068
	String expectedUnitDisplayString =
2069
			"public class X {\n" + 
2070
			"  public X() {\n" + 
2071
			"  }\n" + 
2072
			"  void bar(int var1) {\n" + 
2073
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2074
			"  }\n" + 
2075
			"}\n";
2076
2077
	checkMethodParse(
2078
			str.toCharArray(),
1948
			cursorLocation,
2079
			cursorLocation,
1949
			expectedCompletionNodeToString,
2080
			expectedCompletionNodeToString,
1950
			expectedParentNodeToString,
2081
			expectedParentNodeToString,
Lines 2081-2087 Link Here
2081
			expectedReplacedSource,
2212
			expectedReplacedSource,
2082
	"diet ast");
2213
	"diet ast");
2083
}
2214
}
2084
public void test0058(){
2215
public void test0058_Diet(){
2085
	String str =
2216
	String str =
2086
		"public class X {\n" +
2217
		"public class X {\n" +
2087
		"  void bar() {\n" +
2218
		"  void bar() {\n" +
Lines 2114-2132 Link Here
2114
			completionIdentifier,
2245
			completionIdentifier,
2115
			expectedReplacedSource,
2246
			expectedReplacedSource,
2116
	"diet ast");
2247
	"diet ast");
2117
	
2248
}
2118
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2249
public void test0058_Method(){
2119
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2250
	String str =
2120
	completionIdentifier = "foo";
2251
		"public class X {\n" +
2121
	expectedReplacedSource = "foo";
2252
		"  void bar() {\n" +
2122
	expectedUnitDisplayString =
2253
		"    @Annot(yyy=zzz,foo\n" +
2123
		"public class X {\n" + 
2254
		"    int var;\n" +
2124
		"  public X() {\n" + 
2255
		"  }\n" +
2125
		"  }\n" + 
2256
		"}";
2126
		"  void bar() {\n" + 
2257
2127
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2258
2128
		"  }\n" + 
2259
	String completeBehind = "foo";
2129
		"}\n";
2260
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2261
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2262
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2263
	String completionIdentifier = "foo";
2264
	String expectedReplacedSource = "foo";
2265
	String expectedUnitDisplayString =
2266
			"public class X {\n" + 
2267
			"  public X() {\n" + 
2268
			"  }\n" + 
2269
			"  void bar() {\n" + 
2270
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2271
			"  }\n" + 
2272
			"}\n";
2130
2273
2131
	checkMethodParse(
2274
	checkMethodParse(
2132
			str.toCharArray(),
2275
			str.toCharArray(),
Lines 2138-2144 Link Here
2138
			expectedReplacedSource,
2281
			expectedReplacedSource,
2139
			"full ast");
2282
			"full ast");
2140
}
2283
}
2141
public void test0059(){
2284
public void test0059_Diet(){
2142
	String str =
2285
	String str =
2143
		"public class X {\n" +
2286
		"public class X {\n" +
2144
		"  void bar(int var1, @Annot(yyy=zzz,foo int var2) {\n" +
2287
		"  void bar(int var1, @Annot(yyy=zzz,foo int var2) {\n" +
Lines 2169-2187 Link Here
2169
			completionIdentifier,
2312
			completionIdentifier,
2170
			expectedReplacedSource,
2313
			expectedReplacedSource,
2171
	"diet ast");
2314
	"diet ast");
2172
	
2315
}
2173
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2316
public void test0059_Method(){
2174
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2317
	String str =
2175
	completionIdentifier = "foo";
2318
		"public class X {\n" +
2176
	expectedReplacedSource = "foo";
2319
		"  void bar(int var1, @Annot(yyy=zzz,foo int var2) {\n" +
2177
	expectedUnitDisplayString =
2320
		"  }\n" +
2178
		"public class X {\n" + 
2321
		"}";
2179
		"  public X() {\n" + 
2322
2180
		"  }\n" + 
2323
2181
		"  void bar(int var1) {\n" + 
2324
	String completeBehind = "foo";
2182
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2325
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2183
		"  }\n" + 
2326
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2184
		"}\n";
2327
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2328
	String completionIdentifier = "foo";
2329
	String expectedReplacedSource = "foo";
2330
	String expectedUnitDisplayString =
2331
			"public class X {\n" + 
2332
			"  public X() {\n" + 
2333
			"  }\n" + 
2334
			"  void bar(int var1) {\n" + 
2335
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2336
			"  }\n" + 
2337
			"}\n";
2185
2338
2186
	checkMethodParse(
2339
	checkMethodParse(
2187
			str.toCharArray(),
2340
			str.toCharArray(),
Lines 2321-2327 Link Here
2321
			expectedReplacedSource,
2474
			expectedReplacedSource,
2322
	"diet ast");
2475
	"diet ast");
2323
}
2476
}
2324
public void test0064(){
2477
public void test0064_Diet(){
2325
	String str =
2478
	String str =
2326
		"public class X {\n" +
2479
		"public class X {\n" +
2327
		"  void bar() {\n" +
2480
		"  void bar() {\n" +
Lines 2354-2372 Link Here
2354
			completionIdentifier,
2507
			completionIdentifier,
2355
			expectedReplacedSource,
2508
			expectedReplacedSource,
2356
	"diet ast");
2509
	"diet ast");
2357
	
2510
}
2358
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2511
public void test0064_Method(){
2359
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2512
	String str =
2360
	completionIdentifier = "foo";
2513
		"public class X {\n" +
2361
	expectedReplacedSource = "foo";
2514
		"  void bar() {\n" +
2362
	expectedUnitDisplayString =
2515
		"    @Annot(yyy=zzz,foo=zzz)\n" +
2363
		"public class X {\n" + 
2516
		"    int var;\n" +
2364
		"  public X() {\n" + 
2517
		"  }\n" +
2365
		"  }\n" + 
2518
		"}";
2366
		"  void bar() {\n" + 
2519
2367
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2520
2368
		"  }\n" + 
2521
	String completeBehind = "foo";
2369
		"}\n";
2522
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2523
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2524
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2525
	String completionIdentifier = "foo";
2526
	String expectedReplacedSource = "foo";
2527
	String expectedUnitDisplayString =
2528
			"public class X {\n" + 
2529
			"  public X() {\n" + 
2530
			"  }\n" + 
2531
			"  void bar() {\n" + 
2532
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2533
			"  }\n" + 
2534
			"}\n";
2370
2535
2371
	checkMethodParse(
2536
	checkMethodParse(
2372
			str.toCharArray(),
2537
			str.toCharArray(),
Lines 2378-2384 Link Here
2378
			expectedReplacedSource,
2543
			expectedReplacedSource,
2379
			"full ast");
2544
			"full ast");
2380
}
2545
}
2381
public void test0065(){
2546
public void test0065_Diet(){
2382
	String str =
2547
	String str =
2383
		"public class X {\n" +
2548
		"public class X {\n" +
2384
		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz) int var2) {\n" +
2549
		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz) int var2) {\n" +
Lines 2409-2427 Link Here
2409
			completionIdentifier,
2574
			completionIdentifier,
2410
			expectedReplacedSource,
2575
			expectedReplacedSource,
2411
	"diet ast");
2576
	"diet ast");
2412
	
2577
}
2413
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2578
public void test0065_Method(){
2414
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2579
	String str =
2415
	completionIdentifier = "foo";
2580
		"public class X {\n" +
2416
	expectedReplacedSource = "foo";
2581
		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz) int var2) {\n" +
2417
	expectedUnitDisplayString =
2582
		"  }\n" +
2418
		"public class X {\n" + 
2583
		"}";
2419
		"  public X() {\n" + 
2584
2420
		"  }\n" + 
2585
2421
		"  void bar(int var1) {\n" + 
2586
	String completeBehind = "foo";
2422
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2587
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2423
		"  }\n" + 
2588
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2424
		"}\n";
2589
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2590
	String completionIdentifier = "foo";
2591
	String expectedReplacedSource = "foo";
2592
	String expectedUnitDisplayString =
2593
			"public class X {\n" + 
2594
			"  public X() {\n" + 
2595
			"  }\n" + 
2596
			"  void bar(int var1) {\n" + 
2597
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2598
			"  }\n" + 
2599
			"}\n";
2425
2600
2426
	checkMethodParse(
2601
	checkMethodParse(
2427
			str.toCharArray(),
2602
			str.toCharArray(),
Lines 2561-2567 Link Here
2561
			expectedReplacedSource,
2736
			expectedReplacedSource,
2562
	"diet ast");
2737
	"diet ast");
2563
}
2738
}
2564
public void test0070(){
2739
public void test0070_Diet(){
2565
	String str =
2740
	String str =
2566
		"public class X {\n" +
2741
		"public class X {\n" +
2567
		"  void bar() {\n" +
2742
		"  void bar() {\n" +
Lines 2594-2612 Link Here
2594
			completionIdentifier,
2769
			completionIdentifier,
2595
			expectedReplacedSource,
2770
			expectedReplacedSource,
2596
	"diet ast");
2771
	"diet ast");
2597
	
2772
}
2598
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2773
public void test0070_Method(){
2599
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2774
	String str =
2600
	completionIdentifier = "foo";
2775
		"public class X {\n" +
2601
	expectedReplacedSource = "foo";
2776
		"  void bar() {\n" +
2602
	expectedUnitDisplayString =
2777
		"    @Annot(yyy=zzz,foo=zzz\n" +
2603
		"public class X {\n" + 
2778
		"    int var;\n" +
2604
		"  public X() {\n" + 
2779
		"  }\n" +
2605
		"  }\n" + 
2780
		"}";
2606
		"  void bar() {\n" + 
2781
2607
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2782
2608
		"  }\n" + 
2783
	String completeBehind = "foo";
2609
		"}\n";
2784
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2785
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2786
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2787
	String completionIdentifier = "foo";
2788
	String expectedReplacedSource = "foo";
2789
	String expectedUnitDisplayString =
2790
			"public class X {\n" + 
2791
			"  public X() {\n" + 
2792
			"  }\n" + 
2793
			"  void bar() {\n" + 
2794
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2795
			"  }\n" + 
2796
			"}\n";
2610
2797
2611
	checkMethodParse(
2798
	checkMethodParse(
2612
			str.toCharArray(),
2799
			str.toCharArray(),
Lines 2618-2624 Link Here
2618
			expectedReplacedSource,
2805
			expectedReplacedSource,
2619
			"full ast");
2806
			"full ast");
2620
}
2807
}
2621
public void test0071(){
2808
public void test0071_Diet(){
2622
	String str =
2809
	String str =
2623
		"public class X {\n" +
2810
		"public class X {\n" +
2624
		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz int var2) {\n" +
2811
		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz int var2) {\n" +
Lines 2649-2667 Link Here
2649
			completionIdentifier,
2836
			completionIdentifier,
2650
			expectedReplacedSource,
2837
			expectedReplacedSource,
2651
	"diet ast");
2838
	"diet ast");
2652
	
2839
}
2653
	expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2840
public void test0071_Method(){
2654
	expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2841
	String str =
2655
	completionIdentifier = "foo";
2842
		"public class X {\n" +
2656
	expectedReplacedSource = "foo";
2843
		"  void bar(int var1, @Annot(yyy=zzz,foo=zzz int var2) {\n" +
2657
	expectedUnitDisplayString =
2844
		"  }\n" +
2658
		"public class X {\n" + 
2845
		"}";
2659
		"  public X() {\n" + 
2846
2660
		"  }\n" + 
2847
2661
		"  void bar(int var1) {\n" + 
2848
	String completeBehind = "foo";
2662
		"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2849
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
2663
		"  }\n" + 
2850
	String expectedCompletionNodeToString = "<CompleteOnAttributeName:foo>";
2664
		"}\n";
2851
	String expectedParentNodeToString = "@Annot(yyy = zzz,<CompleteOnAttributeName:foo>)";
2852
	String completionIdentifier = "foo";
2853
	String expectedReplacedSource = "foo";
2854
	String expectedUnitDisplayString =
2855
			"public class X {\n" + 
2856
			"  public X() {\n" + 
2857
			"  }\n" + 
2858
			"  void bar(int var1) {\n" + 
2859
			"    @Annot(yyy = zzz,<CompleteOnAttributeName:foo>)\n" + 
2860
			"  }\n" + 
2861
			"}\n";
2665
2862
2666
	checkMethodParse(
2863
	checkMethodParse(
2667
			str.toCharArray(),
2864
			str.toCharArray(),
Lines 3682-3688 Link Here
3682
			expectedReplacedSource,
3879
			expectedReplacedSource,
3683
	"diet ast");
3880
	"diet ast");
3684
}
3881
}
3685
public void test0105(){
3882
public void test0105_Diet(){
3686
	String str =
3883
	String str =
3687
		"public class X {\n" +
3884
		"public class X {\n" +
3688
		"  void bar() {\n" +
3885
		"  void bar() {\n" +
Lines 3715-3733 Link Here
3715
			completionIdentifier,
3912
			completionIdentifier,
3716
			expectedReplacedSource,
3913
			expectedReplacedSource,
3717
	"diet ast");
3914
	"diet ast");
3718
	
3915
}
3719
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
3916
public void test0105_Method(){
3720
	expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3917
	String str =
3721
	completionIdentifier = "foo";
3918
		"public class X {\n" +
3722
	expectedReplacedSource = "foo";
3919
		"  void bar() {\n" +
3723
	expectedUnitDisplayString =
3920
		"    @Annot(zzz=foo)\n" +
3724
		"public class X {\n" + 
3921
		"    int var;\n" +
3725
		"  public X() {\n" + 
3922
		"  }\n" +
3726
		"  }\n" + 
3923
		"}";
3727
		"  void bar() {\n" + 
3924
3728
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
3925
3729
		"  }\n" + 
3926
	String completeBehind = "foo";
3730
		"}\n";
3927
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3928
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3929
	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
3930
	String completionIdentifier = "foo";
3931
	String expectedReplacedSource = "foo";
3932
	String expectedUnitDisplayString =
3933
			"public class X {\n" + 
3934
			"  public X() {\n" + 
3935
			"  }\n" + 
3936
			"  void bar() {\n" + 
3937
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
3938
			"  }\n" + 
3939
			"}\n";
3731
3940
3732
	checkMethodParse(
3941
	checkMethodParse(
3733
			str.toCharArray(),
3942
			str.toCharArray(),
Lines 3739-3745 Link Here
3739
			expectedReplacedSource,
3948
			expectedReplacedSource,
3740
			"full ast");
3949
			"full ast");
3741
}
3950
}
3742
public void test0106(){
3951
public void test0106_Diet(){
3743
	String str =
3952
	String str =
3744
		"public class X {\n" +
3953
		"public class X {\n" +
3745
		"  void bar() {\n" +
3954
		"  void bar() {\n" +
Lines 3772-3790 Link Here
3772
			completionIdentifier,
3981
			completionIdentifier,
3773
			expectedReplacedSource,
3982
			expectedReplacedSource,
3774
	"diet ast");
3983
	"diet ast");
3775
	
3984
}
3776
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
3985
public void test0106_Method(){
3777
	expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3986
	String str =
3778
	completionIdentifier = "foo";
3987
		"public class X {\n" +
3779
	expectedReplacedSource = "foo";
3988
		"  void bar() {\n" +
3780
	expectedUnitDisplayString =
3989
		"    @Annot(zzz= a && foo)\n" +
3781
		"public class X {\n" + 
3990
		"    int var;\n" +
3782
		"  public X() {\n" + 
3991
		"  }\n" +
3783
		"  }\n" + 
3992
		"}";
3784
		"  void bar() {\n" + 
3993
3785
		"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" + 
3994
3786
		"  }\n" + 
3995
	String completeBehind = "foo";
3787
		"}\n";
3996
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
3997
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
3998
	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
3999
	String completionIdentifier = "foo";
4000
	String expectedReplacedSource = "foo";
4001
	String expectedUnitDisplayString =
4002
			"public class X {\n" + 
4003
			"  public X() {\n" + 
4004
			"  }\n" + 
4005
			"  void bar() {\n" + 
4006
			"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" + 
4007
			"  }\n" + 
4008
			"}\n";
3788
4009
3789
	checkMethodParse(
4010
	checkMethodParse(
3790
			str.toCharArray(),
4011
			str.toCharArray(),
Lines 3796-3802 Link Here
3796
			expectedReplacedSource,
4017
			expectedReplacedSource,
3797
			"full ast");
4018
			"full ast");
3798
}
4019
}
3799
public void test0107(){
4020
public void test0107_Diet(){
3800
	String str =
4021
	String str =
3801
		"public class X {\n" +
4022
		"public class X {\n" +
3802
		"  void bar() {\n" +
4023
		"  void bar() {\n" +
Lines 3829-3847 Link Here
3829
			completionIdentifier,
4050
			completionIdentifier,
3830
			expectedReplacedSource,
4051
			expectedReplacedSource,
3831
	"diet ast");
4052
	"diet ast");
3832
	
4053
}
3833
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4054
public void test0107_Method(){
3834
	expectedParentNodeToString = "<NONE>";
4055
	String str =
3835
	completionIdentifier = "foo";
4056
		"public class X {\n" +
3836
	expectedReplacedSource = "foo";
4057
		"  void bar() {\n" +
3837
	expectedUnitDisplayString =
4058
		"    @Annot(zzz= {foo})\n" +
3838
		"public class X {\n" + 
4059
		"    int var;\n" +
3839
		"  public X() {\n" + 
4060
		"  }\n" +
3840
		"  }\n" + 
4061
		"}";
3841
		"  void bar() {\n" + 
4062
3842
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4063
3843
		"  }\n" + 
4064
	String completeBehind = "foo";
3844
		"}\n";
4065
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4066
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4067
	String expectedParentNodeToString = "<NONE>";
4068
	String completionIdentifier = "foo";
4069
	String expectedReplacedSource = "foo";
4070
	String expectedUnitDisplayString =
4071
			"public class X {\n" + 
4072
			"  public X() {\n" + 
4073
			"  }\n" + 
4074
			"  void bar() {\n" + 
4075
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4076
			"  }\n" + 
4077
			"}\n";
3845
4078
3846
	checkMethodParse(
4079
	checkMethodParse(
3847
			str.toCharArray(),
4080
			str.toCharArray(),
Lines 3853-3859 Link Here
3853
			expectedReplacedSource,
4086
			expectedReplacedSource,
3854
			"full ast");
4087
			"full ast");
3855
}
4088
}
3856
public void test0108(){
4089
public void test0108_Diet(){
3857
	String str =
4090
	String str =
3858
		"public class X {\n" +
4091
		"public class X {\n" +
3859
		"  void bar() {\n" +
4092
		"  void bar() {\n" +
Lines 3886-3904 Link Here
3886
			completionIdentifier,
4119
			completionIdentifier,
3887
			expectedReplacedSource,
4120
			expectedReplacedSource,
3888
	"diet ast");
4121
	"diet ast");
3889
	
4122
}
3890
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4123
public void test0108_Method(){
3891
	expectedParentNodeToString = "<NONE>";
4124
	String str =
3892
	completionIdentifier = "foo";
4125
		"public class X {\n" +
3893
	expectedReplacedSource = "foo";
4126
		"  void bar() {\n" +
3894
	expectedUnitDisplayString =
4127
		"    @Annot(zzz= {yyy, foo})\n" +
3895
		"public class X {\n" + 
4128
		"    int var;\n" +
3896
		"  public X() {\n" + 
4129
		"  }\n" +
3897
		"  }\n" + 
4130
		"}";
3898
		"  void bar() {\n" + 
4131
3899
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4132
3900
		"  }\n" + 
4133
	String completeBehind = "foo";
3901
		"}\n";
4134
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4135
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4136
	String expectedParentNodeToString = "<NONE>";
4137
	String completionIdentifier = "foo";
4138
	String expectedReplacedSource = "foo";
4139
	String expectedUnitDisplayString =
4140
			"public class X {\n" + 
4141
			"  public X() {\n" + 
4142
			"  }\n" + 
4143
			"  void bar() {\n" + 
4144
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4145
			"  }\n" + 
4146
			"}\n";
3902
4147
3903
	checkMethodParse(
4148
	checkMethodParse(
3904
			str.toCharArray(),
4149
			str.toCharArray(),
Lines 3910-3916 Link Here
3910
			expectedReplacedSource,
4155
			expectedReplacedSource,
3911
			"full ast");
4156
			"full ast");
3912
}
4157
}
3913
public void test0109(){
4158
public void test0109_Diet(){
3914
	String str =
4159
	String str =
3915
		"public class X {\n" +
4160
		"public class X {\n" +
3916
		"  void bar() {\n" +
4161
		"  void bar() {\n" +
Lines 3943-3961 Link Here
3943
			completionIdentifier,
4188
			completionIdentifier,
3944
			expectedReplacedSource,
4189
			expectedReplacedSource,
3945
	"diet ast");
4190
	"diet ast");
3946
	
4191
}
3947
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4192
public void test0109_Method(){
3948
	expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4193
	String str =
3949
	completionIdentifier = "foo";
4194
		"public class X {\n" +
3950
	expectedReplacedSource = "foo";
4195
		"  void bar() {\n" +
3951
	expectedUnitDisplayString =
4196
		"    @Annot(zzz=foo\n" +
3952
		"public class X {\n" + 
4197
		"    int var;\n" +
3953
		"  public X() {\n" + 
4198
		"  }\n" +
3954
		"  }\n" + 
4199
		"}";
3955
		"  void bar() {\n" + 
4200
3956
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4201
3957
		"  }\n" + 
4202
	String completeBehind = "foo";
3958
		"}\n";
4203
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4204
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4205
	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4206
	String completionIdentifier = "foo";
4207
	String expectedReplacedSource = "foo";
4208
	String expectedUnitDisplayString =
4209
			"public class X {\n" + 
4210
			"  public X() {\n" + 
4211
			"  }\n" + 
4212
			"  void bar() {\n" + 
4213
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4214
			"  }\n" + 
4215
			"}\n";
3959
4216
3960
	checkMethodParse(
4217
	checkMethodParse(
3961
			str.toCharArray(),
4218
			str.toCharArray(),
Lines 3967-3973 Link Here
3967
			expectedReplacedSource,
4224
			expectedReplacedSource,
3968
			"full ast");
4225
			"full ast");
3969
}
4226
}
3970
public void test0110(){
4227
public void test0110_Diet(){
3971
	String str =
4228
	String str =
3972
		"public class X {\n" +
4229
		"public class X {\n" +
3973
		"  void bar() {\n" +
4230
		"  void bar() {\n" +
Lines 4000-4019 Link Here
4000
			completionIdentifier,
4257
			completionIdentifier,
4001
			expectedReplacedSource,
4258
			expectedReplacedSource,
4002
	"diet ast");
4259
	"diet ast");
4003
	
4260
}
4004
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4261
public void test0110_Method(){
4005
	expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4262
	String str =
4006
	completionIdentifier = "foo";
4263
		"public class X {\n" +
4007
	expectedReplacedSource = "foo";
4264
		"  void bar() {\n" +
4008
	expectedUnitDisplayString =
4265
		"    int var;\n" +
4009
		"public class X {\n" + 
4266
		"    @Annot(zzz= a && foo\n" +
4010
		"  public X() {\n" + 
4267
		"  }\n" +
4011
		"  }\n" + 
4268
		"}";
4012
		"  void bar() {\n" + 
4269
4013
		"    int var;\n" + 
4270
4014
		"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" + 
4271
	String completeBehind = "foo";
4015
		"  }\n" + 
4272
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4016
		"}\n";
4273
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4274
	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4275
	String completionIdentifier = "foo";
4276
	String expectedReplacedSource = "foo";
4277
	String expectedUnitDisplayString =
4278
			"public class X {\n" + 
4279
			"  public X() {\n" + 
4280
			"  }\n" + 
4281
			"  void bar() {\n" + 
4282
			"    int var;\n" + 
4283
			"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" + 
4284
			"  }\n" + 
4285
			"}\n";
4017
4286
4018
	checkMethodParse(
4287
	checkMethodParse(
4019
			str.toCharArray(),
4288
			str.toCharArray(),
Lines 4025-4031 Link Here
4025
			expectedReplacedSource,
4294
			expectedReplacedSource,
4026
			"full ast");
4295
			"full ast");
4027
}
4296
}
4028
public void test0111(){
4297
public void test0111_Diet(){
4029
	String str =
4298
	String str =
4030
		"public class X {\n" +
4299
		"public class X {\n" +
4031
		"  void bar() {\n" +
4300
		"  void bar() {\n" +
Lines 4058-4076 Link Here
4058
			completionIdentifier,
4327
			completionIdentifier,
4059
			expectedReplacedSource,
4328
			expectedReplacedSource,
4060
	"diet ast");
4329
	"diet ast");
4061
	
4330
}
4062
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4331
public void test0111_Method(){
4063
	expectedParentNodeToString = "<NONE>";
4332
	String str =
4064
	completionIdentifier = "foo";
4333
		"public class X {\n" +
4065
	expectedReplacedSource = "foo";
4334
		"  void bar() {\n" +
4066
	expectedUnitDisplayString =
4335
		"    @Annot(zzz= {yyy, foo}\n" +
4067
		"public class X {\n" + 
4336
		"    int var;\n" +
4068
		"  public X() {\n" + 
4337
		"  }\n" +
4069
		"  }\n" + 
4338
		"}";
4070
		"  void bar() {\n" + 
4339
4071
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4340
4072
		"  }\n" + 
4341
	String completeBehind = "foo";
4073
		"}\n";
4342
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4343
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4344
	String expectedParentNodeToString = "<NONE>";
4345
	String completionIdentifier = "foo";
4346
	String expectedReplacedSource = "foo";
4347
	String expectedUnitDisplayString =
4348
			"public class X {\n" + 
4349
			"  public X() {\n" + 
4350
			"  }\n" + 
4351
			"  void bar() {\n" + 
4352
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4353
			"  }\n" + 
4354
			"}\n";
4074
4355
4075
	checkMethodParse(
4356
	checkMethodParse(
4076
			str.toCharArray(),
4357
			str.toCharArray(),
Lines 4082-4088 Link Here
4082
			expectedReplacedSource,
4363
			expectedReplacedSource,
4083
			"full ast");
4364
			"full ast");
4084
}
4365
}
4085
public void test0112(){
4366
public void test0112_Diet(){
4086
	String str =
4367
	String str =
4087
		"public class X {\n" +
4368
		"public class X {\n" +
4088
		"  void bar() {\n" +
4369
		"  void bar() {\n" +
Lines 4115-4133 Link Here
4115
			completionIdentifier,
4396
			completionIdentifier,
4116
			expectedReplacedSource,
4397
			expectedReplacedSource,
4117
	"diet ast");
4398
	"diet ast");
4118
	
4399
}
4119
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4400
public void test0112_Method(){
4120
	expectedParentNodeToString = "<NONE>";
4401
	String str =
4121
	completionIdentifier = "foo";
4402
		"public class X {\n" +
4122
	expectedReplacedSource = "foo";
4403
		"  void bar() {\n" +
4123
	expectedUnitDisplayString =
4404
		"    @Annot(zzz= {yyy, foo\n" +
4124
		"public class X {\n" + 
4405
		"    int var;\n" +
4125
		"  public X() {\n" + 
4406
		"  }\n" +
4126
		"  }\n" + 
4407
		"}";
4127
		"  void bar() {\n" + 
4408
4128
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4409
4129
		"  }\n" + 
4410
	String completeBehind = "foo";
4130
		"}\n";
4411
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4412
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4413
	String expectedParentNodeToString = "<NONE>";
4414
	String completionIdentifier = "foo";
4415
	String expectedReplacedSource = "foo";
4416
	String expectedUnitDisplayString =
4417
			"public class X {\n" + 
4418
			"  public X() {\n" + 
4419
			"  }\n" + 
4420
			"  void bar() {\n" + 
4421
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4422
			"  }\n" + 
4423
			"}\n";
4131
4424
4132
	checkMethodParse(
4425
	checkMethodParse(
4133
			str.toCharArray(),
4426
			str.toCharArray(),
Lines 4139-4145 Link Here
4139
			expectedReplacedSource,
4432
			expectedReplacedSource,
4140
			"full ast");
4433
			"full ast");
4141
}
4434
}
4142
public void test0113(){
4435
public void test0113_Diet(){
4143
	String str =
4436
	String str =
4144
		"public class X {\n" +
4437
		"public class X {\n" +
4145
		"  void bar() {\n" +
4438
		"  void bar() {\n" +
Lines 4172-4190 Link Here
4172
			completionIdentifier,
4465
			completionIdentifier,
4173
			expectedReplacedSource,
4466
			expectedReplacedSource,
4174
	"diet ast");
4467
	"diet ast");
4175
	
4468
}
4176
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4469
public void test0113_Method(){
4177
	expectedParentNodeToString = "<NONE>";
4470
	String str =
4178
	completionIdentifier = "foo";
4471
		"public class X {\n" +
4179
	expectedReplacedSource = "foo";
4472
		"  void bar() {\n" +
4180
	expectedUnitDisplayString =
4473
		"    @Annot(zzz= a && (b || (foo && c)))\n" +
4181
		"public class X {\n" + 
4474
		"    int var;\n" +
4182
		"  public X() {\n" + 
4475
		"  }\n" +
4183
		"  }\n" + 
4476
		"}";
4184
		"  void bar() {\n" + 
4477
4185
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4478
4186
		"  }\n" + 
4479
	String completeBehind = "foo";
4187
		"}\n";
4480
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4481
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4482
	String expectedParentNodeToString = "<NONE>";
4483
	String completionIdentifier = "foo";
4484
	String expectedReplacedSource = "foo";
4485
	String expectedUnitDisplayString =
4486
			"public class X {\n" + 
4487
			"  public X() {\n" + 
4488
			"  }\n" + 
4489
			"  void bar() {\n" + 
4490
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4491
			"  }\n" + 
4492
			"}\n";
4188
4493
4189
	checkMethodParse(
4494
	checkMethodParse(
4190
			str.toCharArray(),
4495
			str.toCharArray(),
Lines 4196-4202 Link Here
4196
			expectedReplacedSource,
4501
			expectedReplacedSource,
4197
			"full ast");
4502
			"full ast");
4198
}
4503
}
4199
public void test0114(){
4504
public void test0114_Diet(){
4200
	String str =
4505
	String str =
4201
		"public class X {\n" +
4506
		"public class X {\n" +
4202
		"  void bar() {\n" +
4507
		"  void bar() {\n" +
Lines 4229-4247 Link Here
4229
			completionIdentifier,
4534
			completionIdentifier,
4230
			expectedReplacedSource,
4535
			expectedReplacedSource,
4231
	"diet ast");
4536
	"diet ast");
4232
	
4537
}
4233
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4538
public void test0114_Method(){
4234
	expectedParentNodeToString = "<NONE>";
4539
	String str =
4235
	completionIdentifier = "foo";
4540
		"public class X {\n" +
4236
	expectedReplacedSource = "foo";
4541
		"  void bar() {\n" +
4237
	expectedUnitDisplayString =
4542
		"    @Annot(zzz= a && (b || (foo\n" +
4238
		"public class X {\n" + 
4543
		"    int var;\n" +
4239
		"  public X() {\n" + 
4544
		"  }\n" +
4240
		"  }\n" + 
4545
		"}";
4241
		"  void bar() {\n" + 
4546
4242
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4547
4243
		"  }\n" + 
4548
	String completeBehind = "foo";
4244
		"}\n";
4549
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4550
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4551
	String expectedParentNodeToString = "<NONE>";
4552
	String completionIdentifier = "foo";
4553
	String expectedReplacedSource = "foo";
4554
	String expectedUnitDisplayString =
4555
			"public class X {\n" + 
4556
			"  public X() {\n" + 
4557
			"  }\n" + 
4558
			"  void bar() {\n" + 
4559
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4560
			"  }\n" + 
4561
			"}\n";
4245
4562
4246
	checkMethodParse(
4563
	checkMethodParse(
4247
			str.toCharArray(),
4564
			str.toCharArray(),
Lines 4381-4387 Link Here
4381
			expectedReplacedSource,
4698
			expectedReplacedSource,
4382
	"diet ast");
4699
	"diet ast");
4383
}
4700
}
4384
public void test0119(){
4701
public void test0119_Diet(){
4385
	String str =
4702
	String str =
4386
		"public class X {\n" +
4703
		"public class X {\n" +
4387
		"  void bar(@Annot(zzz=foo int var) {\n" +
4704
		"  void bar(@Annot(zzz=foo int var) {\n" +
Lines 4412-4430 Link Here
4412
			completionIdentifier,
4729
			completionIdentifier,
4413
			expectedReplacedSource,
4730
			expectedReplacedSource,
4414
	"diet ast");
4731
	"diet ast");
4415
	
4732
}
4416
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4733
public void test0119_Method(){
4417
	expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4734
	String str =
4418
	completionIdentifier = "foo";
4735
		"public class X {\n" +
4419
	expectedReplacedSource = "foo";
4736
		"  void bar(@Annot(zzz=foo int var) {\n" +
4420
	expectedUnitDisplayString =
4737
		"  }\n" +
4421
		"public class X {\n" + 
4738
		"}";
4422
		"  public X() {\n" + 
4739
4423
		"  }\n" + 
4740
4424
		"  void bar() {\n" + 
4741
	String completeBehind = "foo";
4425
		"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4742
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4426
		"  }\n" + 
4743
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4427
		"}\n";
4744
	String expectedParentNodeToString = "zzz = <CompleteOnName:foo>";
4745
	String completionIdentifier = "foo";
4746
	String expectedReplacedSource = "foo";
4747
	String expectedUnitDisplayString =
4748
			"public class X {\n" + 
4749
			"  public X() {\n" + 
4750
			"  }\n" + 
4751
			"  void bar() {\n" + 
4752
			"    @Annot(zzz = <CompleteOnName:foo>)\n" + 
4753
			"  }\n" + 
4754
			"}\n";
4428
4755
4429
	checkMethodParse(
4756
	checkMethodParse(
4430
			str.toCharArray(),
4757
			str.toCharArray(),
Lines 4436-4442 Link Here
4436
			expectedReplacedSource,
4763
			expectedReplacedSource,
4437
			"full ast");
4764
			"full ast");
4438
}
4765
}
4439
public void test0120(){
4766
public void test0120_Diet(){
4440
	String str =
4767
	String str =
4441
		"public class X {\n" +
4768
		"public class X {\n" +
4442
		"  void bar(@Annot(zzz= a && foo int var) {\n" +
4769
		"  void bar(@Annot(zzz= a && foo int var) {\n" +
Lines 4467-4485 Link Here
4467
			completionIdentifier,
4794
			completionIdentifier,
4468
			expectedReplacedSource,
4795
			expectedReplacedSource,
4469
	"diet ast");
4796
	"diet ast");
4470
	
4797
}
4471
	expectedCompletionNodeToString = "<CompleteOnName:foo>";
4798
public void test0120_Method(){
4472
	expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4799
	String str =
4473
	completionIdentifier = "foo";
4800
		"public class X {\n" +
4474
	expectedReplacedSource = "foo";
4801
		"  void bar(@Annot(zzz= a && foo int var) {\n" +
4475
	expectedUnitDisplayString =
4802
		"  }\n" +
4476
		"public class X {\n" + 
4803
		"}";
4477
		"  public X() {\n" + 
4804
4478
		"  }\n" + 
4805
4479
		"  void bar() {\n" + 
4806
	String completeBehind = "foo";
4480
		"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" + 
4807
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4481
		"  }\n" + 
4808
	String expectedCompletionNodeToString = "<CompleteOnName:foo>";
4482
		"}\n";
4809
	String expectedParentNodeToString = "(a && <CompleteOnName:foo>)";
4810
	String completionIdentifier = "foo";
4811
	String expectedReplacedSource = "foo";
4812
	String expectedUnitDisplayString =
4813
			"public class X {\n" + 
4814
			"  public X() {\n" + 
4815
			"  }\n" + 
4816
			"  void bar() {\n" + 
4817
			"    @Annot(zzz = (a && <CompleteOnName:foo>))\n" + 
4818
			"  }\n" + 
4819
			"}\n";
4483
4820
4484
	checkMethodParse(
4821
	checkMethodParse(
4485
			str.toCharArray(),
4822
			str.toCharArray(),

Return to bug 179672