1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.coding.finallocalvariable;
10
11 import java.util.ArrayList;
12 import java.util.Arrays;
13
14 public class InputFinalLocalVariableFalsePositives {
15
16
17 private void foo1() {
18 String value;
19 if (true) {
20 try {
21 value = "";
22 }
23 catch (Exception ex) {
24 if (true) {
25
26 }
27 value = "";
28 }
29 }
30 else {
31 value = "";
32 }
33 }
34
35
36 private void foo2() {
37 String stompAccessor;
38
39 if (true) {
40 throw new IllegalStateException(
41 "No header accessor (not using the SimpMessagingTemplate?): ");
42 }
43 else if (true) {
44 stompAccessor = "";
45 }
46 else if (true) {
47 stompAccessor = "";
48 }
49 else {
50 throw new IllegalStateException("Unexpected header accessor type ");
51 }
52
53 if (true) {
54 if (true) {
55 if (true) {
56 }
57 return;
58 }
59 stompAccessor.toString();
60 }
61
62 if (true) {
63 return;
64 }
65
66 if (true) {
67 if (true) {
68 }
69 stompAccessor = "";
70 stompAccessor.toString();
71 stompAccessor.toString();
72 if (true) {
73 stompAccessor.toString();
74 }
75 }
76 else if (true) {
77 if (true) {
78 if (true) {
79 }
80 return;
81 }
82 }
83 else {
84 if (true) {
85 if (true) {
86 }
87 return;
88 }
89 }
90 }
91
92
93 private void foo3() {
94 String errorCodes;
95
96 try {
97 if (true) {
98 }
99 else {
100 }
101
102 if (true) {
103 }
104
105 errorCodes = "";
106 if (true) {
107 }
108 }
109 catch (Exception ex) {
110 errorCodes = "";
111 }
112
113 final String s = errorCodes;
114 }
115
116
117 private void foo4() {
118 if (true) {
119 try {
120 int corePoolSize;
121 if (true) {
122 corePoolSize = Integer.valueOf("1");
123 if (corePoolSize > 2) {
124 }
125 if (true) {
126 if (corePoolSize == 0) {
127 corePoolSize = 2;
128 }
129 else {
130 }
131 }
132 }
133 else {
134 corePoolSize = 1;
135 }
136 }
137 catch (NumberFormatException ex) {
138 }
139 }
140 }
141
142
143 private void foo5() {
144 if (true) {
145 final String s = "";
146 String constructorToUse;
147 synchronized (s) {
148 constructorToUse = "";
149 if (constructorToUse == null) {
150 if (true) {
151 }
152 try {
153 if (System.getSecurityManager() != null) {
154 constructorToUse = "";
155 }
156 else {
157 constructorToUse = "";
158 }
159 }
160 catch (Exception ex) {
161 }
162 }
163 }
164 }
165 else {
166 }
167 }
168
169
170 private void foo6() {
171 String[] attrs;
172 if (true) {
173 attrs = null;
174 for (int i = 0; i < attrs.length; i++) {
175 }
176 }
177
178 if (true) {
179 attrs = null;
180 for (int i = 0; i < attrs.length; i++) {
181 if (attrs[i] instanceof Object) {
182 }
183 if (attrs[i] instanceof Object) {
184 }
185 }
186 }
187 }
188
189
190 private void foo7() {
191 int index;
192 if (true) {
193 index = 0;
194 }
195 else if (true) {
196 index = 2;
197 }
198 else {
199 return;
200 }
201 if (true) {
202 index += 1;
203 }
204 }
205
206
207 private void foo8() {
208 String[] attrs;
209 if (true) {
210 attrs = null;
211 for (int i = 0; i < attrs.length; i++) {
212 if (attrs[i] instanceof String) {
213 }
214 }
215 }
216 if (true) {
217 attrs = null;
218 for (int i = 0; i < attrs.length; i++) {
219 if (attrs[i] instanceof Object) {
220 }
221 if (attrs[i] instanceof String) {
222 }
223 }
224 }
225 }
226
227
228 private void foo9() {
229 int transx, transy;
230
231 if (true) {
232 if (true) {
233 if (true) {
234 }
235 else {
236 }
237 transx = 2;
238 transy = 1;
239 }
240 else {
241 transx = 0;
242 transy = 0;
243 }
244 }
245 if (true) {
246 transx = 1;
247 transy = 2;
248 }
249 else {
250 transx = transy = 0;
251 }
252
253 try {
254 }
255 finally {
256 }
257 }
258
259
260 private void foo10() {
261 int index;
262 if (false) {
263 index = 0;
264 }
265 else if (true) {
266 index = 2;
267 }
268 else {
269 return;
270 }
271 if (false) {
272 index += 1;
273 }
274 }
275
276
277 private void foo11() {
278 if (true)
279 if (true)
280 return;
281 long lastModifiedTime;
282 if (true) {
283 lastModifiedTime = 1L;
284 if (true) {
285 }
286 }
287 else if (true) {
288 }
289 if (true) {
290 lastModifiedTime = 2L;
291 if (true) {
292 }
293 }
294 }
295
296
297 private void foo12() {
298 String numElemKey;
299 if (true) {
300 numElemKey = ".NumberElements";
301 if (true) {
302 }
303 }
304 if (true) {
305 numElemKey = "";
306 if (true) {
307 }
308 }
309 }
310
311
312 private void foo13() {
313 String out;
314 if (true) {
315 out = "";
316 }
317 else {
318 out = "";
319 if (true) {
320 }
321 }
322 if (true) {
323 out = "";
324 }
325 if (true) {
326 }
327 out.toString();
328 if (true) {
329 try {
330 out = "";
331 }
332 catch (Exception ioe) {
333 }
334 finally {
335 if (true) {
336 }
337 if (true) {
338 out.toString();
339 }
340 if (true) {
341 }
342 if (true) {
343 }
344 if (true) {
345 }
346 }
347 }
348 }
349
350
351 private void foo14() {
352 int c, c2;
353 if (true) {
354 }
355 if (true) {
356 if ((c = 'd') >= 0) {
357 if (true) {
358 c2 = 'a';
359 if (true) {
360 if (true) {
361 if (true) {
362 }
363 c = c2;
364 }
365 else {
366 }
367 }
368 }
369
370 if (true) {
371 }
372 }
373 return;
374 }
375
376 }
377
378
379 private void foo15() {
380 int limit;
381 if (true) {
382 limit = 0xdc00 >> 1;
383 limit = 2 + 1;
384
385 }
386 }
387
388
389 private void foo16() {
390 final int a = 1;
391 byte level;
392 if (true) {
393 switch (a) {
394 case 1:
395 break;
396 case 2:
397 break;
398 case 3:
399 if (true) {
400 }
401 if ((true) ||
402 (true)) {
403 level = 1;
404 if (true) {
405 }
406 if (true) {
407 }
408 break;
409 }
410 for (int i = 0; i < 14; i++) {
411 }
412 if (true) {
413 }
414 break;
415 case 4:
416 if (true)
417 break;
418 case 5:
419 if (true) {
420 if (true) {
421 break;
422 }
423 if (true) {
424 }
425 break;
426 }
427 if (true) {
428 }
429 break;
430 case 6:
431 break;
432 case 7:
433 for (int i = 0; i < 15458; i++) {
434 }
435 if (true) {
436 }
437 break;
438
439 case 8:
440 break;
441
442 case 9:
443 if (true) {
444 }
445 break;
446 case 10:
447 level = (byte) 1;
448 for (int i = 0; i < 12; i++) {
449 if (true) {
450 }
451 }
452 break;
453 case 11:
454 level = 1;
455 for (int i = 0; i < 12; i++) {
456 if (true) {
457 while (level < 2) {
458 }
459 while (true) {
460 }
461 }
462 if (true) {
463 continue;
464 }
465 }
466 break;
467 case 12:
468 level = (byte) 2;
469 for (int i = 0; i < 12; i++) {
470 if (true) {
471 }
472 }
473 break;
474 default:
475 throw new IllegalStateException("Internal ICU error in processPropertySeq");
476 }
477 }
478 if (true) {
479 level = (byte) 12;
480 for (; ; ) {
481 }
482 }
483 }
484
485
486 private void foo17() {
487 try {
488 int newLen;
489 if (true) {
490 try {
491 newLen = 1;
492 }
493 catch (Exception ibse) {
494 }
495 }
496 else {
497 newLen = 2;
498 if (true) {
499 }
500 }
501 if (true) {
502 try {
503 }
504 catch (Exception e) {
505 }
506 }
507 if (true) {
508 newLen = 3;
509 if (true) {
510 if (true) {
511 }
512 }
513 }
514 return;
515 }
516 catch (Exception e) {
517 throw new ArrayIndexOutOfBoundsException(e.toString());
518 }
519 }
520
521
522 private void foo18() throws Exception {
523 int newLen;
524 if (true) {
525 try {
526 newLen = 1;
527 }
528 catch (Exception ibse) {
529 }
530 }
531 else {
532 newLen = 2;
533 if (true) {
534 }
535 }
536 if (true) {
537 try {
538 }
539 catch (Exception e) {
540 }
541 }
542 if (true) {
543 newLen = 1;
544 if (true) {
545 if (true) {
546 throw new Exception("invalid explicit IV");
547 }
548 }
549 }
550 return;
551 }
552
553
554 private String foo19() {
555 String params;
556 synchronized (this) {
557 params = "blindingCache.get(modulus)";
558 }
559 if (true) {
560 return params;
561 }
562 params = "new BlindingParameters(e, re, rInv)";
563 synchronized (this) {
564 }
565 return params;
566 }
567
568
569 private void foo20() {
570 String cert;
571 if (true) {
572 cert = "certPair.getForward()";
573 if (true) {
574 }
575 }
576 if (true) {
577 cert = "certPair.getReverse()";
578 if (true) {
579 }
580 }
581 }
582
583
584 private void foo21() throws Exception {
585 try {
586 final int keyType = 8;
587 String[] attributes;
588 switch (keyType) {
589 case 1:
590 case 2:
591 case 3:
592 attributes = null;
593 break;
594 default:
595 attributes = null;
596 break;
597 }
598 attributes = null;
599 return;
600 }
601 catch (Exception e) {
602 throw new Exception("Could not generate key", e);
603 }
604 finally {
605 }
606 }
607
608
609 private void foo22() throws Exception {
610 String subDer;
611 if (true) {
612 subDer = "";
613 if (true) {
614 while ("".equals(subDer)) {
615 }
616 for (int i = 0; i < 1541; i++) {
617
618 }
619 }
620 else {
621 throw new Exception();
622 }
623 }
624 else {
625 throw new Exception();
626 }
627 if (true) {
628 }
629 if (true) {
630 }
631 if (true) {
632 if (true) {
633 subDer = "";
634 if (true) {
635 while ("".equals(subDer)) {
636 }
637 }
638 else {
639 throw new Exception();
640 }
641 if (true) {
642 }
643 }
644 else {
645 throw new Exception();
646 }
647 }
648 if (true) {
649 throw new Exception();
650 }
651 }
652
653
654 private void foo23() throws Exception {
655 int bint;
656 if (true) {
657 throw new Exception();
658 }
659 if (true) {
660 throw new Exception();
661 }
662 if (true) {
663 bint = 1;
664 if (true) {
665 throw new Exception("");
666 }
667 }
668 else {
669 throw new Exception();
670 }
671 if (true) {
672 bint = 2;
673 if (bint == 4) {
674 throw new Exception();
675 }
676 }
677 else {
678 throw new Exception();
679 }
680 }
681
682
683 private void foo24() {
684 final String a = "";
685 String loader;
686 synchronized (this) {
687 while ("".equals(a)) {
688 if (true) {
689 }
690 }
691 if (true) {
692 if (true) {
693 }
694 loader = "";
695 }
696 loader = "";
697 }
698 }
699
700
701 private void foo25() {
702 double w, h;
703 if (true) {
704 if (true) {
705 w = 11.0;
706 h = 12.2;
707 }
708 }
709 if (true) {
710 w = 1.0;
711 h = 2.5;
712 }
713 return;
714 }
715
716
717 private void foo26() {
718 String[] attrs;
719 if (true) {
720 attrs = null;
721 for (int i = 0; i < attrs.length; i++) {
722 if (true) {
723 }
724 }
725 }
726 if (true) {
727 attrs = null;
728 for (int i = 0; i < attrs.length; i++) {
729 if (attrs[i] instanceof String) {
730 }
731 if (attrs[i] instanceof String) {
732 }
733 }
734 }
735 }
736
737
738 private void foo27() {
739 String locUrl;
740 try {
741 locUrl = "";
742 if (true) {
743 return;
744 }
745 }
746 catch (Exception mue) {
747
748 locUrl = "";
749 }
750 }
751
752
753 private void foo28() {
754 final String a = "";
755 String[] path;
756 if (true) {
757 while ("".equals(a)) {
758 }
759 path = new String[5];
760 while ("".equals(a)) {
761 if (true) {
762 path[1] = "";
763 }
764 else {
765 path[2] = "";
766 }
767 }
768 if (true) {
769 path[3] = "";
770 }
771 else {
772 path[4] = "";
773 }
774 if (true) {
775 path = new String[14];
776 }
777 }
778 else {
779 path = new String[81];
780 }
781 return;
782 }
783
784
785 private void foo29() {
786 int decExp;
787 parseNumber:
788 try {
789 if (true) {
790 throw new NumberFormatException("empty String");
791 }
792 int i = 0;
793 switch (i) {
794 case '-':
795 case '+':
796 i++;
797 }
798 if (true) {
799 if (true) {
800 return;
801 }
802 break parseNumber;
803 }
804 else if (true) {
805 if (true) {
806 return;
807 }
808 break parseNumber;
809 }
810 else if (true) {
811 if (true) {
812 if (true) {
813 return;
814 }
815 }
816 }
817 skipLeadingZerosLoop:
818 while (i < 15) {
819 if (true) {
820 }
821 else if (true) {
822 if (true) {
823 throw new NumberFormatException("multiple points");
824 }
825 if (true) {
826 }
827 }
828 else {
829 break skipLeadingZerosLoop;
830 }
831 i++;
832 }
833 digitLoop:
834 while (i < 12) {
835 if (true) {
836 }
837 else if (true) {
838 }
839 else if (true) {
840 if (true) {
841 throw new NumberFormatException("multiple points");
842 }
843 if (true) {
844 }
845 }
846 else {
847 break digitLoop;
848 }
849 i++;
850 }
851 if (true) {
852 break parseNumber;
853 }
854 if (true) {
855 decExp = 1;
856 }
857 else {
858 decExp = 2;
859 }
860 if (true) {
861 switch (i) {
862 case '-':
863 case '+':
864 i++;
865 }
866 final int expAt = i;
867 expLoop:
868 while (i < 54) {
869 if (true) {
870 }
871 if (true) {
872 }
873 else {
874 i--;
875 break expLoop;
876 }
877 }
878 if (true) {
879 decExp = 12;
880 }
881 else {
882 decExp = decExp + 123;
883 }
884 if (i == expAt) {
885 break parseNumber;
886 }
887 }
888 if (i < 9788) {
889 break parseNumber;
890 }
891 if (true) {
892 return;
893 }
894 return;
895 }
896 catch (StringIndexOutOfBoundsException e) {
897 }
898 throw new NumberFormatException();
899 }
900
901
902 private void foo30() {
903 int transx, transy;
904 if (true) {
905 if (true) {
906 if (true) {
907 }
908 else {
909 }
910 transx = 1;
911 transy = 2;
912 }
913 else {
914 transx = 0;
915 transy = 0;
916 }
917 }
918 if (true) {
919 transx = 4;
920 transy = 1;
921 }
922 else {
923 transx = transy = 0;
924 }
925 }
926
927
928 private void foo31() throws Exception {
929 String srcIL;
930 if (true) {
931 srcIL = "";
932 if (srcIL != null) {
933 return;
934 }
935 }
936 if (true) {
937 try {
938 srcIL = "";
939 }
940 catch (Exception e) {
941 throw new Exception("Unable to convert rasters");
942 }
943 for (int y = 0; y < 12; y++) {
944 for (int x = 0; x < 12; x++) {
945 for (int i = 0; i < 5478; i++) {
946 }
947 }
948 for (int x = 0; x < 5; x++) {
949 for (int i = 0; i < 541; i++) {
950 }
951 }
952 }
953 }
954 else {
955 try {
956 srcIL = "";
957 }
958 catch (Exception e) {
959 throw new Exception("Unable to convert rasters");
960 }
961 }
962 }
963
964
965 private void foo32() throws Exception {
966 String srcIL, dstIL;
967 try {
968 if (true) {
969 dstIL = "";
970
971 if (dstIL != null) {
972 srcIL = "";
973 if (srcIL != null) {
974 return;
975 }
976 }
977 }
978 }
979 catch (Exception e) {
980 throw new Exception("Unable to convert images");
981 }
982 if (true) {
983 if (true) {
984 }
985 try {
986 srcIL = "";
987 dstIL = "";
988 }
989 catch (Exception e) {
990 throw new Exception("Unable to convert images");
991 }
992 }
993 else {
994 dstIL = "";
995 }
996 }
997
998
999 private void foo33() {
1000 float advance;
1001 if (true) {
1002 advance = 1234;
1003 if (advance != Float.MAX_VALUE) {
1004 if (true) {
1005 return;
1006 }
1007 else {
1008 return;
1009 }
1010 }
1011 }
1012 else if (true) {
1013 if (true) {
1014 advance = 123;
1015 if (advance != Float.MAX_VALUE) {
1016 if (true) {
1017 return;
1018 }
1019 else {
1020 return;
1021 }
1022 }
1023 }
1024 }
1025 if (true) {
1026 return;
1027 }
1028 if (true) {
1029 advance = 12435;
1030 }
1031 else {
1032 if (true) {
1033 }
1034 else {
1035 }
1036 if (true) {
1037 advance = 123;
1038 }
1039 else {
1040 advance = 123414;
1041 }
1042 }
1043 if (true) {
1044 }
1045 else if (true) {
1046 if (true) {
1047 for (int i = 0; i < 214; i++) {
1048 }
1049 }
1050 }
1051 return;
1052 }
1053
1054
1055 private void foo34() {
1056 final String s = "";
1057 int etag;
1058 if (true) {
1059 etag = 1;
1060 do {
1061 if (true) {
1062 }
1063 if (true) {
1064 }
1065 } while ("".equals(s));
1066 if (true) {
1067 etag = 13213;
1068 }
1069 else {
1070 }
1071 }
1072 else {
1073 etag = 12312;
1074 }
1075 }
1076
1077
1078 private void foo35() {
1079 final int a = 8;
1080 String elem;
1081 switch (a) {
1082 case 1:
1083 switch (a) {
1084 case '-':
1085 while (true) {
1086 if (true) {
1087 }
1088 }
1089 default:
1090 }
1091 case '/':
1092 switch (a) {
1093 case '>':
1094 case '<':
1095 if (true) {
1096
1097 }
1098 elem = "";
1099 break;
1100 default:
1101 if (true) {
1102 return;
1103 }
1104 switch (a) {
1105 case '>':
1106 case '<':
1107 break;
1108 default:
1109 }
1110 if (true) {
1111 elem = "";
1112 }
1113 else {
1114 elem = "";
1115 }
1116 break;
1117 }
1118 if (true) {
1119 elem = "";
1120 if (true) {
1121 return;
1122 }
1123 }
1124 else {
1125 if (true) {
1126 elem = "";
1127 }
1128 else {
1129 elem = "";
1130 }
1131 }
1132 elem = "";
1133 }
1134 }
1135
1136
1137 private void foo36() {
1138 String attname;
1139 if (true) {
1140 attname = "";
1141 if (true) {
1142 }
1143 else {
1144 if (true) {
1145 if (true) {
1146 }
1147 else {
1148 }
1149 }
1150 }
1151 }
1152 else if (true) {
1153 }
1154 else if (true) {
1155 if (true) {
1156 attname = "";
1157 if (true) {
1158 }
1159 if (true) {
1160 }
1161 else {
1162 if (true) {
1163 if (true) {
1164 }
1165 }
1166 }
1167 }
1168 else {
1169 }
1170 }
1171 else if (true) {
1172 attname = "";
1173 }
1174 else if (true) {
1175 return;
1176 }
1177 else {
1178 if (true) {
1179 }
1180 else {
1181 return;
1182 }
1183 }
1184 if (true) {
1185 attname = "";
1186 }
1187 else {
1188 }
1189 }
1190
1191
1192 private void foo37() {
1193 int dot;
1194 if (true) {
1195 dot = 213213;
1196 if (true) {
1197 if (true) {
1198 }
1199 }
1200 if (true) {
1201 dot += 1;
1202 if (true) {
1203 try {
1204 }
1205 catch (Exception ble) {
1206 }
1207 }
1208 }
1209 }
1210 else if (true) {
1211 dot = 31;
1212 }
1213 }
1214
1215
1216 private void foo38() {
1217 String painter;
1218 if (true) {
1219 if ((painter = "").equals("")) {
1220 return;
1221 }
1222 }
1223 if ((painter = "").equals("")) {
1224 return;
1225 }
1226 }
1227
1228
1229 private void foo39() {
1230 int spacing;
1231 if (true) {
1232 if (true) {
1233 if (true);
1234 }
1235 else {
1236 spacing = 4;
1237 if (true) return;
1238 }
1239 }
1240 if (true) {
1241 spacing = 123;
1242 if (true) return;
1243 }
1244 if (true) {
1245 spacing = 12;
1246 }
1247 }
1248
1249
1250 private void foo40() {
1251 String cBounds;
1252 if (true) {
1253 if (true) {
1254 cBounds = "";
1255 }
1256 if (true) {
1257 cBounds = "";
1258 }
1259 }
1260 else {
1261 if (true) {
1262 cBounds = "";
1263 }
1264 if (true) {
1265 cBounds = "";
1266 }
1267 }
1268 }
1269
1270
1271 private void foo41() {
1272 String nextInsets;
1273 if (true) {
1274 nextInsets = "";
1275 }
1276 if (true) {
1277 nextInsets = "";
1278 }
1279 }
1280
1281
1282 private String foo42() {
1283 if (true) {
1284 String rowBounds;
1285 if (true) {
1286 rowBounds = "";
1287 if (true) {
1288 if (true) {
1289 return "";
1290 }
1291 return "";
1292 }
1293 if (true) {
1294 if (true) {
1295 rowBounds = "";
1296 return rowBounds;
1297 }
1298 }
1299 else {
1300 return rowBounds;
1301 }
1302 }
1303 return "";
1304 }
1305 return "";
1306 }
1307
1308
1309 private void foo43() {
1310 String providerImpls;
1311 try {
1312 providerImpls = "";
1313 }
1314 catch (Exception ex) {
1315 providerImpls = null;
1316 }
1317 String strRowsetProperties;
1318 try {
1319 strRowsetProperties = "";
1320 }
1321 catch (Exception ex) {
1322 strRowsetProperties = "";
1323 }
1324 }
1325
1326
1327 private void foo45() {
1328 String mixer;
1329 if (true) {
1330 if (true) {
1331 if (true) {
1332 mixer = "";
1333 if (mixer != null) {
1334 return;
1335 }
1336 }
1337 else {
1338 mixer = "";
1339 if (mixer != null) {
1340 return;
1341 }
1342 }
1343
1344 }
1345 }
1346 if (true) {
1347 mixer = "";
1348 if (mixer != null) {
1349 return;
1350 }
1351 }
1352 }
1353
1354
1355 private void foo46() {
1356 String e;
1357 if (true) {
1358 synchronized (this) {
1359 e = "";
1360
1361 }
1362 synchronized (this) {
1363 e = "";
1364
1365 }
1366 }
1367 }
1368
1369
1370 private void foo47() {
1371 final String a = "";
1372 String factory;
1373 if (true) {
1374 factory = "";
1375 }
1376 if ("".equals(a)) {
1377 factory = "";
1378 }
1379 }
1380
1381
1382 private void foo48() {
1383 int ch;
1384 if (true) {
1385 ch = 1;
1386 }
1387 if (true) {
1388 ch = 2;
1389 }
1390 }
1391
1392
1393 private String foo49() {
1394 long next;
1395 if (!Thread.interrupted()) {
1396 if (true) {
1397 if (true) {
1398 if ((next = 5) == 5)
1399 return "next";
1400 }
1401 else if ((next = 5) == 5)
1402 return "next";
1403 }
1404 if (true)
1405 return "0L";
1406 if (true)
1407 if ((next = 5) == 5)
1408 return "next";
1409 }
1410 return "";
1411 }
1412
1413
1414 private void foo50() {
1415 long nanos;
1416 try {
1417 nanos = 1L;
1418 }
1419 catch (Exception ex2) {
1420 nanos = 0L;
1421 }
1422 }
1423
1424
1425 private void foo51() {
1426 if (true) {
1427 int vowel;
1428 if (true) {
1429 vowel = 1;
1430 }
1431 if (true) {
1432 vowel = 2;
1433 }
1434 }
1435 if (true) {
1436 int consonant;
1437 if (true) {
1438 consonant = 23;
1439 }
1440 if (true) {
1441 consonant =2;
1442 }
1443 }
1444 }
1445
1446
1447 private void foo52() {
1448 String drivers;
1449 try {
1450 drivers = "";
1451 }
1452 catch (Exception ex) {
1453 drivers = null;
1454 }
1455 }
1456
1457
1458 private void foo53() {
1459 String pc;
1460 synchronized (this) {
1461 pc = "Hello";
1462 }
1463 pc = "";
1464 }
1465
1466
1467 private void foo54() {
1468 final int a = 1;
1469 final String linkerName;
1470 String lambdaName;
1471 switch (a) {
1472 case 1:
1473 linkerName = "linkToVirtual";
1474 lambdaName = "DMH"
1475 + ".invokeVirtual";
1476 break;
1477 case 2:
1478 linkerName = "linkToStatic";
1479 lambdaName = "DMH"
1480 + ".invokeStatic";
1481 break;
1482 case 3:
1483 linkerName = "linkToStatic";
1484 lambdaName = "DMH.invokeStaticInit";
1485 break;
1486 case 4:
1487 linkerName = "linkToSpecial";
1488 lambdaName = "DMH"
1489 + ".invokeSpecial";
1490 break;
1491 case 5:
1492 linkerName = "linkToInterface";
1493 lambdaName = "DMH"
1494 + ".invokeInterface";
1495 break;
1496 case 6:
1497 linkerName = "linkToSpecial";
1498 lambdaName = "DMH"
1499 + ".newInvokeSpecial";
1500 break;
1501 default:
1502 throw new InternalError("which=");
1503 }
1504 lambdaName += "_";
1505 }
1506
1507
1508 private String foo55() {
1509 String res;
1510 if (true) {
1511 res = "";
1512 if (res != null) return res;
1513 }
1514 if (true) {
1515 res = "temporaryRes";
1516 }
1517 else {
1518 res = "";
1519 }
1520 if (true) {
1521 if (true) {
1522 }
1523 else {
1524 }
1525 }
1526 return "";
1527 }
1528
1529
1530 private void foo56() {
1531 int num;
1532 if (true) {
1533 num = 3;
1534 }
1535 else {
1536 num = 1;
1537 if (true) {
1538 num = 2;
1539 }
1540 }
1541 if (num > 1) {
1542 num = 2;
1543 }
1544 }
1545
1546
1547 private void foo57() {
1548 final int a = 1;
1549 double T01, T10;
1550 switch (a) {
1551 case 1:
1552 break;
1553 case 9:
1554 case 11:
1555 case 12:
1556 break;
1557 case 123:
1558 case 14:
1559 break;
1560 case 1234:
1561 case 12345:
1562 break;
1563 case 566:
1564 case 8678:
1565 break;
1566 case 534:
1567 case 7968:
1568 case 86785678:
1569 case 86759789:
1570 break;
1571 case 346547:
1572 T01 =1;
1573 T10 = 2;
1574 break;
1575 case 432534523:
1576 case 5345235:
1577 break;
1578 case 235345:
1579 case 523452345:
1580 break;
1581 case 75675467:
1582 break;
1583 }
1584 T01 = 21;
1585 T10 = 53;
1586 }
1587
1588
1589 private void foo58() {
1590 final int a = 54;
1591 String typeStr;
1592 switch (a) {
1593 case 1:
1594 typeStr = "WINDOW_OPENED";
1595 break;
1596 case 2:
1597 typeStr = "WINDOW_CLOSING";
1598 break;
1599 case 3:
1600 typeStr = "WINDOW_CLOSED";
1601 break;
1602 case 4:
1603 typeStr = "WINDOW_ICONIFIED";
1604 break;
1605 case 5:
1606 typeStr = "WINDOW_DEICONIFIED";
1607 break;
1608 case 6:
1609 typeStr = "WINDOW_ACTIVATED";
1610 break;
1611 case 7:
1612 typeStr = "WINDOW_DEACTIVATED";
1613 break;
1614 case 8:
1615 typeStr = "WINDOW_GAINED_FOCUS";
1616 break;
1617 case 9:
1618 typeStr = "WINDOW_LOST_FOCUS";
1619 break;
1620 case 10:
1621 typeStr = "WINDOW_STATE_CHANGED";
1622 break;
1623 default:
1624 typeStr = "unknown type";
1625 }
1626 typeStr += ",";
1627 }
1628
1629
1630 private void foo59() {
1631 String spec;
1632 if (true) {
1633 spec = "";
1634 }
1635 if (true) {
1636 spec = "";
1637 }
1638 }
1639
1640
1641 private void foo60() throws Exception {
1642 final int a = 1;
1643 String text;
1644 switch (a) {
1645 case 1:
1646 text = "";
1647 break;
1648 case 2:
1649 text = "Warning: ";
1650 break;
1651 case 3:
1652 text = "Error: ";
1653 break;
1654 default:
1655 throw new Exception();
1656 }
1657 final String message = "";
1658 if (message != null) {
1659 text += message;
1660 }
1661 }
1662
1663
1664 private void foo61() {
1665 String tmaw;
1666 if (true) {
1667 tmaw = "";
1668 for (int i = 0; i < 10; i++) {
1669 if (true) {
1670 if (true) {
1671 tmaw = "";
1672 }
1673 }
1674 else {
1675 tmaw = "";
1676 }
1677 }
1678 if (true) {
1679 tmaw = "";
1680 }
1681 }
1682 else {
1683 tmaw = null;
1684 }
1685 }
1686
1687
1688 private void foo62() {
1689 String znode;
1690 synchronized (this) {
1691 znode = "";
1692 }
1693 if (znode != null) {
1694 synchronized (znode) {
1695 }
1696 if (true) {
1697 if (true) {
1698 synchronized (znode) {
1699 if (true) {
1700 }
1701 else if (true) {
1702 }
1703 else {
1704 return;
1705 }
1706 }
1707 if (true) {
1708 return;
1709 }
1710 }
1711 }
1712 }
1713 synchronized (this) {
1714 znode = "";
1715 }
1716 }
1717
1718
1719 private void foo63() {
1720 float h;
1721 float l;
1722 float s;
1723 synchronized (this) {
1724 h = 1;
1725 l = 2;
1726 s = 3;
1727 }
1728 h = 4;
1729 l = 5;
1730 s = 6;
1731 }
1732
1733
1734 private void foo64() {
1735 int index;
1736 if (true) {
1737 index = 0;
1738 }
1739 else if (true) {
1740 index = 2;
1741 }
1742 else {
1743 return;
1744 }
1745 if (true) {
1746 index += 1;
1747 }
1748 }
1749
1750
1751 private void foo65() {
1752 String name;
1753 if (true) {
1754 name = "uri";
1755 }
1756 else if (true) {
1757 name = "";
1758 }
1759 else if (true) {
1760 name = "";
1761 }
1762 else {
1763 name = "";
1764 }
1765 if (true) {
1766 if (true) {
1767 name = "";
1768 }
1769 }
1770 }
1771
1772
1773 private void foo66() {
1774 String cfg;
1775 if (true) {
1776 if (true) {
1777 cfg = "";
1778 }
1779 if (true) {
1780 cfg = "";
1781 }
1782 if (true) {
1783 cfg = "";
1784 }
1785 }
1786 }
1787
1788
1789 private void foo67() {
1790 String fastClass;
1791 try {
1792 fastClass = "";
1793 if (true) {
1794 if (fastClass == null) {
1795 }
1796 else {
1797 }
1798 }
1799 }
1800 catch (Throwable t) {
1801 fastClass = null;
1802 }
1803 }
1804
1805
1806 private void foo68() {
1807 int partsLo;
1808 if (true) {
1809 partsLo = 1;
1810 if ( --partsLo != 0) {
1811 return;
1812 }
1813 if (true) {
1814 return;
1815 }
1816 }
1817 else {
1818 partsLo = 0;
1819 }
1820 }
1821
1822
1823 private void foo69() {
1824 String node;
1825 if (true) {
1826 node = "";
1827 if (node == null) {
1828 return;
1829 }
1830 if (true) {
1831 node = "";
1832 }
1833 }
1834 else {
1835 node = "";
1836 }
1837 }
1838
1839
1840 private void foo70() {
1841 String supplier;
1842 try {
1843 supplier = "";
1844 }
1845 catch (Throwable t) {
1846 supplier = "";
1847 }
1848 }
1849
1850
1851 private void foo71() {
1852 int priority;
1853 if (true) {
1854 priority = 1;
1855 }
1856 else if (true) {
1857 priority = 2;
1858 }
1859 else {
1860 return;
1861 }
1862 if (true) {
1863 priority++;
1864 }
1865 if (true) {
1866 priority++;
1867 }
1868 }
1869
1870
1871 private void foo72() {
1872 String p;
1873 try {
1874 p = "";
1875 }
1876 catch (RuntimeException e) {
1877 p = "";
1878 }
1879 }
1880
1881
1882 private void foo73() {
1883 String control;
1884 if (true) {
1885 if (true) {
1886 control = "";
1887 if (control != null) {
1888 }
1889 }
1890 }
1891 if (true) {
1892 if (true) {
1893 }
1894 if (true) {
1895 control = "";
1896 if (control != null) {
1897 }
1898 }
1899 }
1900 }
1901
1902
1903 private void foo75() {
1904 String libPathAsString;
1905 try {
1906 libPathAsString = "";
1907 if (libPathAsString == null) {
1908 }
1909 libPathAsString = "";
1910 if (libPathAsString == null) {
1911 }
1912
1913 } catch(Exception ex) {
1914
1915 }
1916 }
1917
1918
1919 private void foo76() {
1920 int priority;
1921 if (true) {
1922 priority = 2;
1923 }
1924 else if (true) {
1925 priority = 3;
1926 }
1927 else {
1928 return;
1929 }
1930
1931 if (true) {
1932 priority++;
1933 }
1934 if (true) {
1935 priority++;
1936 }
1937 }
1938
1939
1940 private void foo77() {
1941 if (true) {
1942 int docId;
1943 if (true) {
1944 docId = 21;
1945 if (docId != 1254) {
1946 }
1947 else {
1948 }
1949 }
1950 else {
1951 docId = 45234;
1952 if (true) {
1953 }
1954 }
1955 if (true) {
1956 docId = 3213213;
1957 }
1958 }
1959 }
1960
1961
1962 private void foo78() {
1963 String injectionPoints;
1964 if (true) {
1965 try {
1966 injectionPoints = "";
1967 }
1968 catch (Exception e) {
1969 injectionPoints = "";
1970 }
1971 }
1972 else {
1973 injectionPoints = "";
1974 }
1975 }
1976
1977
1978 private void foo79() {
1979 String name;
1980 if (true) {
1981 name = "";
1982 }
1983 else if (true) {
1984 name = "";
1985 }
1986 else if (true) {
1987 name = "";
1988 }
1989 else {
1990 name = "";
1991 }
1992 if (true) {
1993 if (true) {
1994 name = "";
1995 }
1996 }
1997 }
1998
1999
2000 private void foo80() {
2001 String names;
2002 if (true) {
2003 names = "";
2004 if (true) {
2005 names = "";
2006 }
2007 }
2008 else {
2009 names = "";
2010 }
2011 }
2012
2013
2014 private void foo81() {
2015 StringBuffer msg;
2016 synchronized (this) {
2017 msg = new StringBuffer(" [");
2018 }
2019 synchronized (this) {
2020 msg = new StringBuffer(" [");
2021 }
2022 }
2023
2024
2025 private void foo82() {
2026 String filesToCompact;
2027 try {
2028 synchronized (this) {
2029 filesToCompact = "";
2030 filesToCompact = "";
2031 }
2032 }
2033 finally {
2034 }
2035 }
2036
2037
2038 private void foo83() {
2039 String key;
2040 if (true) {
2041 try {
2042 key = "";
2043 }
2044 catch (Exception e) {
2045 if (true) {
2046 try {
2047 key = "";
2048 }
2049 catch (Exception ex) {
2050 }
2051 }
2052 }
2053 }
2054 else {
2055 key = "";
2056 }
2057 }
2058
2059
2060 private void foo84() {
2061 float newMemstoreSize;
2062 float newBlockCacheSize;
2063 if (true) {
2064 newBlockCacheSize = 354;
2065 newMemstoreSize = 534;
2066 }
2067 else if (true) {
2068 newBlockCacheSize = 213213;
2069 newMemstoreSize = 53425;
2070 }
2071 else {
2072 return;
2073 }
2074 if (true) {
2075 newMemstoreSize = 2;
2076 }
2077 else if (true) {
2078 newMemstoreSize = 3;
2079 }
2080 if (true) {
2081 newBlockCacheSize = 354;
2082 }
2083 else if (true) {
2084 newBlockCacheSize = 14;
2085 }
2086 }
2087
2088
2089 private void foo85() {
2090 boolean needNewPlan;
2091 try {
2092 if (true) {
2093 }
2094 if (true) {
2095 needNewPlan = true;
2096 }
2097 else {
2098 if (true) {
2099 }
2100 return;
2101 }
2102 }
2103 catch (Throwable t) {
2104 if (t instanceof Object) {
2105 }
2106 if (true) {
2107 if (true) {
2108 if (t instanceof Object) {
2109 }
2110 else {
2111 }
2112 }
2113 try {
2114 needNewPlan = false;
2115 if (true) {
2116 }
2117 else if (true) {
2118 needNewPlan = true;
2119 }
2120 }
2121 catch (Exception ie) {
2122 return;
2123 }
2124 }
2125 else if (true) {
2126 needNewPlan = false;
2127 }
2128 else {
2129 needNewPlan = true;
2130 }
2131 }
2132 }
2133
2134
2135 private void foo86() {
2136 String result;
2137 try {
2138 try {
2139 result = "";
2140 if (true) {
2141 if (true) {
2142 }
2143 }
2144 }
2145 catch (Exception e) {
2146 if (true) {
2147 }
2148 if (true) {
2149 }
2150 else {
2151 }
2152 result = "";
2153 }
2154 }
2155 catch (Exception ex) {
2156 }
2157 }
2158
2159
2160 private void foo87() {
2161 int count;
2162 if (true) {
2163 return;
2164 }
2165 try {
2166 count = 2;
2167 }
2168 catch (Exception ieo) {
2169 throw ieo;
2170 }
2171 catch (Error e) {
2172 count = -1;
2173 }
2174 }
2175
2176
2177 private void foo88() {
2178 String c;
2179 synchronized (this) {
2180 try {
2181 c = "";
2182 }
2183 catch (Exception e) {
2184 return;
2185 }
2186 }
2187 if (true) {
2188 if (true)
2189 c = null;
2190 }
2191 }
2192
2193 private void foo89() {
2194 final int a = 8;
2195 String b;
2196 switch (a) {
2197 case 8:
2198 b = "b";
2199 break;
2200 default:
2201 b = "c";
2202 break;
2203 }
2204 }
2205
2206 private void foo90() {
2207 final int a = 8;
2208 String b;
2209 switch (a) {
2210 default:
2211 b = "c";
2212 }
2213 b = "b";
2214 }
2215
2216 private void foo91() {
2217 Integer[] s;
2218 if (true) {
2219 s = new Integer[0];
2220 } else {
2221 s = new Integer[5];
2222 if (true) {
2223 final ArrayList<Integer> retain = new ArrayList<>();
2224 for (final Integer c : s) {
2225 if (true) {
2226 retain.add(c);
2227 }
2228 }
2229 s = retain.toArray(new Integer[retain.size()]);
2230 }
2231 if (true && s.length > 0) {
2232 s = new Integer[] {s[0]};
2233 }
2234 }
2235 Arrays.toString(s);
2236 }
2237
2238
2239 private void foo92() {
2240 String tqa;
2241 if (true) {
2242 tqa = null;
2243 if (true) {
2244 }
2245 }
2246 else {
2247 if (true) {
2248 }
2249 tqa = "a";
2250 if (true) {
2251 }
2252 if (tqa == null) {
2253 if (true) {
2254 }
2255 tqa = "b";
2256 if (true) {
2257 if (tqa == "abc") {
2258 } else if (tqa != null) {
2259 } else {
2260 }
2261 }
2262 }
2263 if (tqa == "bcd") {
2264 tqa = null;
2265 }
2266 if (tqa == null) {
2267 if (true) {
2268 if (true) {
2269 }
2270 } else {
2271 if (true) {
2272 }
2273 tqa = "c";
2274 if (true) {
2275 }
2276 }
2277 }
2278 }
2279 }
2280
2281
2282 private void foo93() {
2283 if (true) {
2284 String evictedCopy;
2285 if (true) {
2286 final String evictedEntry = "a";
2287 evictedCopy = evictedEntry;
2288 } else {
2289 evictedCopy = "c";
2290 for (int i = 0; i < 0; ++i) {
2291 evictedCopy.trim();
2292 }
2293 evictedCopy = evictedCopy.trim();
2294 }
2295 }
2296 }
2297
2298
2299 private void foo94() {
2300 String valueClass;
2301 if (true) {
2302 valueClass = "a";
2303 }
2304 else if (true) {
2305 valueClass = "b";
2306 if (valueClass == null) {
2307 if (true) {
2308 }
2309 if (true) {
2310 }
2311 valueClass = "c";
2312 }
2313 }
2314 else {
2315 valueClass = "d";
2316 }
2317 }
2318
2319
2320 private void foo95() {
2321 String profileValueSource;
2322 if (true) {
2323 profileValueSource = "a";
2324 }
2325 else {
2326 try {
2327 profileValueSource = "b";
2328 }
2329 catch (Exception e) {
2330 if (true) {
2331 }
2332 profileValueSource = "c";
2333 }
2334 }
2335 }
2336
2337
2338 private void foo96() {
2339 Object arg;
2340 if (true) {
2341 arg = "a";
2342 }
2343 else if (true) {
2344 arg = "b";
2345 }
2346 else if (true) {
2347 arg = "c";
2348 }
2349 else if (true) {
2350 arg = "d";
2351 }
2352 else if (true) {
2353 arg = "e";
2354 }
2355 else if (true) {
2356 arg = "f";
2357 }
2358 else {
2359 try {
2360 arg = "g";
2361 if (arg != null) {
2362 if (true) {
2363 }
2364 }
2365 }
2366 catch (Exception ex) {
2367 arg = null;
2368 }
2369 }
2370 }
2371
2372
2373 private void foo97() {
2374 if (true) {
2375 String evictedCopy;
2376 if (true) {
2377 evictedCopy = "b";
2378 } else {
2379 evictedCopy = "c";
2380 for (int i = 0; i < 0; ++i) {
2381 }
2382 evictedCopy = "d";
2383 }
2384 }
2385 }
2386
2387
2388 private void foo98() {
2389 if (true) {
2390 String evictedCopy;
2391 if (true) {
2392 evictedCopy = "b";
2393 } else {
2394 evictedCopy = "c";
2395 for (int i = 0; i < 0; ++i) {
2396 }
2397 evictedCopy = "d";
2398 }
2399 }
2400 }
2401
2402
2403 private void foo99() {
2404 int insertionPoint;
2405 if (true) {
2406 insertionPoint = 0;
2407 } else if (true) {
2408 insertionPoint = 1;
2409 } else {
2410 insertionPoint = 2;
2411 if (insertionPoint < 0) {
2412 insertionPoint = -insertionPoint - 1;
2413 } else {
2414 insertionPoint++;
2415 }
2416 }
2417 }
2418
2419
2420 private void foo100() {
2421 String result;
2422 if (true) {
2423 result = "a";
2424 } else {
2425 result = "b";
2426 if (result != null) {
2427 }
2428 result = "c";
2429 }
2430 }
2431 }