View | Details | Raw Unified | Return to bug 175570 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java (-4 / +4 lines)
Lines 185-196 Link Here
185
		"1. ERROR in X.java (at line 7)\n" + 
185
		"1. ERROR in X.java (at line 7)\n" + 
186
		"	}while(a!=null);\n" + 
186
		"	}while(a!=null);\n" + 
187
		"	       ^\n" + 
187
		"	       ^\n" + 
188
		"The variable a cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
188
		"Redundant null check: The variable a cannot be null at this location\n" + 
189
		"----------\n" + 
189
		"----------\n" + 
190
		"2. ERROR in X.java (at line 9)\n" + 
190
		"2. ERROR in X.java (at line 9)\n" + 
191
		"	if(a!=null)\n" + 
191
		"	if(a!=null)\n" + 
192
		"	   ^\n" + 
192
		"	   ^\n" + 
193
		"The variable a can only be null; it was either set to null or checked for null when last used\n" + 
193
		"Null comparison always yields false: The variable a can only be null at this location\n" + 
194
		"----------\n" + 
194
		"----------\n" + 
195
		"3. ERROR in X.java (at line 13)\n" + 
195
		"3. ERROR in X.java (at line 13)\n" + 
196
		"	System.out.println(a+b);\n" + 
196
		"	System.out.println(a+b);\n" + 
Lines 641-652 Link Here
641
		"1. ERROR in X.java (at line 7)\n" + 
641
		"1. ERROR in X.java (at line 7)\n" + 
642
		"	} while (o != null);\n" + 
642
		"	} while (o != null);\n" + 
643
		"	         ^\n" + 
643
		"	         ^\n" + 
644
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
644
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
645
		"----------\n" + 
645
		"----------\n" + 
646
		"2. ERROR in X.java (at line 8)\n" + 
646
		"2. ERROR in X.java (at line 8)\n" + 
647
		"	if (o == null) {\n" + 
647
		"	if (o == null) {\n" + 
648
		"	    ^\n" + 
648
		"	    ^\n" + 
649
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
649
		"Redundant null check: The variable o can only be null at this location\n" + 
650
		"----------\n");
650
		"----------\n");
651
}
651
}
652
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93588
652
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93588
(-)src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (-240 / +273 lines)
Lines 72-78 Link Here
72
	    "1. ERROR in X.java (at line 4)\n" + 
72
	    "1. ERROR in X.java (at line 4)\n" + 
73
	    "	o.toString();\n" + 
73
	    "	o.toString();\n" + 
74
	    "	^\n" + 
74
	    "	^\n" + 
75
	    "The variable o can only be null; it was either set to null or checked for null when last used\n" + 
75
		"Null pointer access: The variable o can only be null at this location\n" + 
76
	    "----------\n");
76
	    "----------\n");
77
}
77
}
78
  
78
  
Lines 114-120 Link Here
114
		"1. ERROR in X.java (at line 4)\n" + 
114
		"1. ERROR in X.java (at line 4)\n" + 
115
		"	o.toString();\n" + 
115
		"	o.toString();\n" + 
116
		"	^\n" + 
116
		"	^\n" + 
117
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
117
		"Null pointer access: The variable o can only be null at this location\n" + 
118
		"----------\n");
118
		"----------\n");
119
}
119
}
120
120
Lines 133-139 Link Here
133
		"1. ERROR in X.java (at line 4)\n" + 
133
		"1. ERROR in X.java (at line 4)\n" + 
134
		"	o.toString();\n" + 
134
		"	o.toString();\n" + 
135
		"	^\n" + 
135
		"	^\n" + 
136
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
136
		"Null pointer access: The variable o can only be null at this location\n" + 
137
		"----------\n");
137
		"----------\n");
138
}
138
}
139
139
Lines 172-178 Link Here
172
		"1. ERROR in X.java (at line 4)\n" + 
172
		"1. ERROR in X.java (at line 4)\n" + 
173
		"	if (o != null) { /* */ }\n" + 
173
		"	if (o != null) { /* */ }\n" + 
174
		"	    ^\n" + 
174
		"	    ^\n" + 
175
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
175
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
176
		"----------\n");
176
		"----------\n");
177
}
177
}
178
 
178
 
Lines 192-198 Link Here
192
		"1. ERROR in X.java (at line 5)\n" + 
192
		"1. ERROR in X.java (at line 5)\n" + 
193
		"	x.m.toString();\n" + 
193
		"	x.m.toString();\n" + 
194
		"	^\n" + 
194
		"	^\n" + 
195
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
195
		"Null pointer access: The variable x can only be null at this location\n" + 
196
		"----------\n");
196
		"----------\n");
197
}
197
}
198
198
Lines 212-218 Link Here
212
		"1. ERROR in X.java (at line 5)\n" + 
212
		"1. ERROR in X.java (at line 5)\n" + 
213
		"	System.out.println(x.m);\n" + 
213
		"	System.out.println(x.m);\n" + 
214
		"	                   ^\n" + 
214
		"	                   ^\n" + 
215
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
215
		"Null pointer access: The variable x can only be null at this location\n" + 
216
		"----------\n");
216
		"----------\n");
217
}
217
}
218
218
Lines 578-584 Link Here
578
		"1. ERROR in X.java (at line 5)\n" + 
578
		"1. ERROR in X.java (at line 5)\n" + 
579
		"	o.toString();\n" + 
579
		"	o.toString();\n" + 
580
		"	^\n" + 
580
		"	^\n" + 
581
		"The variable o may be null\n" + 
581
		"Potential null pointer access: The variable o may be null at this location\n" + 
582
		"----------\n");
582
		"----------\n");
583
}
583
}
584
584
Lines 613-619 Link Here
613
		"1. ERROR in X.java (at line 5)\n" + 
613
		"1. ERROR in X.java (at line 5)\n" + 
614
		"	x.m = new Object();\n" + 
614
		"	x.m = new Object();\n" + 
615
		"	^\n" + 
615
		"	^\n" + 
616
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
616
		"Null pointer access: The variable x can only be null at this location\n" + 
617
		"----------\n");
617
		"----------\n");
618
}
618
}
619
619
Lines 632-638 Link Here
632
		"1. ERROR in X.java (at line 4)\n" + 
632
		"1. ERROR in X.java (at line 4)\n" + 
633
		"	o.toString();\n" + 
633
		"	o.toString();\n" + 
634
		"	^\n" + 
634
		"	^\n" + 
635
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
635
		"Null pointer access: The variable o can only be null at this location\n" + 
636
		"----------\n");
636
		"----------\n");
637
}
637
}
638
638
Lines 651-657 Link Here
651
		"1. ERROR in X.java (at line 4)\n" + 
651
		"1. ERROR in X.java (at line 4)\n" + 
652
		"	o.toString();\n" + 
652
		"	o.toString();\n" + 
653
		"	^\n" + 
653
		"	^\n" + 
654
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
654
		"Null pointer access: The variable o can only be null at this location\n" + 
655
		"----------\n");
655
		"----------\n");
656
}
656
}
657
657
Lines 684-690 Link Here
684
		"1. ERROR in X.java (at line 4)\n" + 
684
		"1. ERROR in X.java (at line 4)\n" + 
685
		"	o.toString();\n" + 
685
		"	o.toString();\n" + 
686
		"	^\n" + 
686
		"	^\n" + 
687
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
687
		"Null pointer access: The variable o can only be null at this location\n" + 
688
		"----------\n");
688
		"----------\n");
689
}
689
}
690
690
Lines 749-755 Link Here
749
		"1. ERROR in X.java (at line 5)\n" + 
749
		"1. ERROR in X.java (at line 5)\n" + 
750
		"	if (o == null) { /* */ }\n" + 
750
		"	if (o == null) { /* */ }\n" + 
751
		"	    ^\n" + 
751
		"	    ^\n" + 
752
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
752
		"Redundant null check: The variable o can only be null at this location\n" + 
753
		"----------\n");
753
		"----------\n");
754
}
754
}
755
755
Lines 769-775 Link Here
769
			"1. ERROR in X.java (at line 4)\n" + 
769
			"1. ERROR in X.java (at line 4)\n" + 
770
			"	i += 1;\n" + 
770
			"	i += 1;\n" + 
771
			"	^\n" + 
771
			"	^\n" + 
772
			"The variable i can only be null; it was either set to null or checked for null when last used\n" + 
772
			"Null pointer access: The variable i can only be null at this location\n" +  
773
			"----------\n");
773
			"----------\n");
774
	}
774
	}
775
}
775
}
Lines 791-797 Link Here
791
			"1. ERROR in X.java (at line 4)\n" + 
791
			"1. ERROR in X.java (at line 4)\n" + 
792
			"	i++;\n" + 
792
			"	i++;\n" + 
793
			"	^\n" + 
793
			"	^\n" + 
794
			"The variable i can only be null; it was either set to null or checked for null when last used\n" + 
794
			"Null pointer access: The variable i can only be null at this location\n" +  
795
			"----------\n");
795
			"----------\n");
796
	}
796
	}
797
}
797
}
Lines 812-818 Link Here
812
			"1. ERROR in X.java (at line 4)\n" + 
812
			"1. ERROR in X.java (at line 4)\n" + 
813
			"	if (i == null) {};\n" + 
813
			"	if (i == null) {};\n" + 
814
			"	    ^\n" + 
814
			"	    ^\n" + 
815
			"The variable i cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
815
			"Null comparison always yields false: The variable i cannot be null at this location\n" +  
816
			"----------\n");
816
			"----------\n");
817
	}
817
	}
818
}
818
}
Lines 833-839 Link Here
833
			"1. ERROR in X.java (at line 4)\n" + 
833
			"1. ERROR in X.java (at line 4)\n" + 
834
			"	System.out.println(i + 4);\n" + 
834
			"	System.out.println(i + 4);\n" + 
835
			"	                   ^\n" + 
835
			"	                   ^\n" + 
836
			"The variable i can only be null; it was either set to null or checked for null when last used\n" + 
836
			"Null pointer access: The variable i can only be null at this location\n" + 
837
			"----------\n");
837
			"----------\n");
838
	}
838
	}
839
}
839
}
Lines 872-878 Link Here
872
			"1. ERROR in X.java (at line 4)\n" + 
872
			"1. ERROR in X.java (at line 4)\n" + 
873
			"	if (i == null) {}\n" + 
873
			"	if (i == null) {}\n" + 
874
			"	    ^\n" + 
874
			"	    ^\n" + 
875
			"The variable i cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
875
			"Null comparison always yields false: The variable i cannot be null at this location\n" + 
876
			"----------\n");
876
			"----------\n");
877
	}
877
	}
878
}
878
}
Lines 908-914 Link Here
908
		"1. ERROR in X.java (at line 4)\n" + 
908
		"1. ERROR in X.java (at line 4)\n" + 
909
		"	args[0].toString();\n" + 
909
		"	args[0].toString();\n" + 
910
		"	^^^^\n" + 
910
		"	^^^^\n" + 
911
		"The variable args can only be null; it was either set to null or checked for null when last used\n" + 
911
		"Null pointer access: The variable args can only be null at this location\n" +  
912
		"----------\n");
912
		"----------\n");
913
}
913
}
914
914
Lines 955-961 Link Here
955
		"1. ERROR in X.java (at line 4)\n" + 
955
		"1. ERROR in X.java (at line 4)\n" + 
956
		"	if (o == null) {};\n" + 
956
		"	if (o == null) {};\n" + 
957
		"	    ^\n" + 
957
		"	    ^\n" + 
958
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
958
		"Null comparison always yields false: The variable o cannot be null at this location\n" +  
959
		"----------\n");
959
		"----------\n");
960
} 
960
} 
961
961
Lines 978-984 Link Here
978
		"1. ERROR in X.java (at line 4)\n" + 
978
		"1. ERROR in X.java (at line 4)\n" + 
979
		"	if (o == null) {/* empty */}\n" + 
979
		"	if (o == null) {/* empty */}\n" + 
980
		"	    ^\n" + 
980
		"	    ^\n" + 
981
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
981
		"Redundant null check: The variable o can only be null at this location\n" + 
982
		"----------\n");
982
		"----------\n");
983
}   
983
}   
984
984
Lines 1019-1025 Link Here
1019
		"1. ERROR in X.java (at line 4)\n" + 
1019
		"1. ERROR in X.java (at line 4)\n" + 
1020
		"	if (o == null) {/* empty */}\n" + 
1020
		"	if (o == null) {/* empty */}\n" + 
1021
		"	    ^\n" + 
1021
		"	    ^\n" + 
1022
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1022
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1023
		"----------\n");
1023
		"----------\n");
1024
}   
1024
}   
1025
1025
Lines 1052-1058 Link Here
1052
		"1. ERROR in X.java (at line 4)\n" + 
1052
		"1. ERROR in X.java (at line 4)\n" + 
1053
		"	(o = null).toString();\n" + 
1053
		"	(o = null).toString();\n" + 
1054
		"	^^^^^^^^^^\n" + 
1054
		"	^^^^^^^^^^\n" + 
1055
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1055
		"Null pointer access: The variable o can only be null at this location\n" + 
1056
		"----------\n");
1056
		"----------\n");
1057
}   
1057
}   
1058
1058
Lines 1071-1077 Link Here
1071
		"1. ERROR in X.java (at line 4)\n" + 
1071
		"1. ERROR in X.java (at line 4)\n" + 
1072
		"	if (o == null)  { /* */ }\n" + 
1072
		"	if (o == null)  { /* */ }\n" + 
1073
		"	    ^\n" + 
1073
		"	    ^\n" + 
1074
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1074
		"Null comparison always yields false: The variable o cannot be null at this location\n" +  
1075
		"----------\n");
1075
		"----------\n");
1076
}  
1076
}  
1077
1077
Lines 1107-1113 Link Here
1107
		"1. ERROR in X.java (at line 4)\n" + 
1107
		"1. ERROR in X.java (at line 4)\n" + 
1108
		"	if (c == null) {};\n" + 
1108
		"	if (c == null) {};\n" + 
1109
		"	    ^\n" + 
1109
		"	    ^\n" + 
1110
		"The variable c cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1110
		"Null comparison always yields false: The variable c cannot be null at this location\n" +  
1111
		"----------\n");
1111
		"----------\n");
1112
}
1112
}
1113
1113
Lines 1124-1130 Link Here
1124
		"1. ERROR in X.java (at line 3)\n" + 
1124
		"1. ERROR in X.java (at line 3)\n" + 
1125
		"	if (o1 != null && (o2 = o1) != null) { /* */ }\n" + 
1125
		"	if (o1 != null && (o2 = o1) != null) { /* */ }\n" + 
1126
		"	                  ^^^^^^^^^\n" + 
1126
		"	                  ^^^^^^^^^\n" + 
1127
		"The variable o2 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1127
		"Redundant null check: The variable o2 cannot be null at this location\n" +  
1128
		"----------\n"
1128
		"----------\n"
1129
	);
1129
	);
1130
}
1130
}
Lines 1142-1148 Link Here
1142
		"1. ERROR in X.java (at line 3)\n" + 
1142
		"1. ERROR in X.java (at line 3)\n" + 
1143
		"	while (o1 != null && (o2 = o1) != null) { /* */ }\n" + 
1143
		"	while (o1 != null && (o2 = o1) != null) { /* */ }\n" + 
1144
		"	                     ^^^^^^^^^\n" + 
1144
		"	                     ^^^^^^^^^\n" + 
1145
		"The variable o2 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1145
		"Redundant null check: The variable o2 cannot be null at this location\n" +  
1146
		"----------\n"
1146
		"----------\n"
1147
	);
1147
	);
1148
}
1148
}
Lines 1164-1175 Link Here
1164
		"1. ERROR in X.java (at line 3)\n" + 
1164
		"1. ERROR in X.java (at line 3)\n" + 
1165
		"	if (o == null || o == null) {\n" + 
1165
		"	if (o == null || o == null) {\n" + 
1166
		"	                 ^\n" + 
1166
		"	                 ^\n" + 
1167
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1167
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1168
		"----------\n" + 
1168
		"----------\n" + 
1169
		"2. ERROR in X.java (at line 6)\n" + 
1169
		"2. ERROR in X.java (at line 6)\n" + 
1170
		"	if (o == null) { /* */ }\n" + 
1170
		"	if (o == null) { /* */ }\n" + 
1171
		"	    ^\n" + 
1171
		"	    ^\n" + 
1172
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1172
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1173
		"----------\n");
1173
		"----------\n");
1174
}
1174
}
1175
1175
Lines 1190-1201 Link Here
1190
		"1. ERROR in X.java (at line 3)\n" + 
1190
		"1. ERROR in X.java (at line 3)\n" + 
1191
		"	if (o == null && o == null) {\n" + 
1191
		"	if (o == null && o == null) {\n" + 
1192
		"	                 ^\n" + 
1192
		"	                 ^\n" + 
1193
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1193
		"Redundant null check: The variable o can only be null at this location\n" + 
1194
		"----------\n" + 
1194
		"----------\n" + 
1195
		"2. ERROR in X.java (at line 6)\n" + 
1195
		"2. ERROR in X.java (at line 6)\n" + 
1196
		"	if (o == null) { /* */ }\n" + 
1196
		"	if (o == null) { /* */ }\n" + 
1197
		"	    ^\n" + 
1197
		"	    ^\n" + 
1198
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1198
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1199
		"----------\n");
1199
		"----------\n");
1200
}
1200
}
1201
1201
Lines 1215-1221 Link Here
1215
		"1. ERROR in X.java (at line 4)\n" + 
1215
		"1. ERROR in X.java (at line 4)\n" + 
1216
		"	|| (i1.byteValue() == i2.byteValue());\n" + 
1216
		"	|| (i1.byteValue() == i2.byteValue());\n" + 
1217
		"	    ^^\n" + 
1217
		"	    ^^\n" + 
1218
		"The variable i1 may be null\n" + 
1218
		"Potential null pointer access: The variable i1 may be null at this location\n" + 
1219
		"----------\n");
1219
		"----------\n");
1220
}
1220
}
1221
1221
Lines 1235-1246 Link Here
1235
		"1. ERROR in X.java (at line 4)\n" + 
1235
		"1. ERROR in X.java (at line 4)\n" + 
1236
		"	|| (i1.byteValue() == i2.byteValue());\n" + 
1236
		"	|| (i1.byteValue() == i2.byteValue());\n" + 
1237
		"	    ^^\n" + 
1237
		"	    ^^\n" + 
1238
		"The variable i1 may be null\n" + 
1238
		"Potential null pointer access: The variable i1 may be null at this location\n" + 
1239
		"----------\n" + 
1239
		"----------\n" + 
1240
		"2. ERROR in X.java (at line 4)\n" + 
1240
		"2. ERROR in X.java (at line 4)\n" + 
1241
		"	|| (i1.byteValue() == i2.byteValue());\n" + 
1241
		"	|| (i1.byteValue() == i2.byteValue());\n" + 
1242
		"	                      ^^\n" + 
1242
		"	                      ^^\n" + 
1243
		"The variable i2 may be null\n" + 
1243
		"Potential null pointer access: The variable i2 may be null at this location\n" + 
1244
		"----------\n");
1244
		"----------\n");
1245
}
1245
}
1246
1246
Lines 1297-1303 Link Here
1297
		"1. ERROR in X.java (at line 5)\n" + 
1297
		"1. ERROR in X.java (at line 5)\n" + 
1298
		"	if (o instanceof X) { /* */ }\n" + 
1298
		"	if (o instanceof X) { /* */ }\n" + 
1299
		"	    ^\n" + 
1299
		"	    ^\n" + 
1300
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1300
		"instanceof always yields false: The variable o can only be null at this location\n" +  
1301
		"----------\n");
1301
		"----------\n");
1302
}
1302
}
1303
1303
Lines 1317-1323 Link Here
1317
		"1. ERROR in X.java (at line 4)\n" + 
1317
		"1. ERROR in X.java (at line 4)\n" + 
1318
		"	if (x == null) { /* */ }\n" + 
1318
		"	if (x == null) { /* */ }\n" + 
1319
		"	    ^\n" + 
1319
		"	    ^\n" + 
1320
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1320
		"Null comparison always yields false: The variable x cannot be null at this location\n" +  
1321
		"----------\n");
1321
		"----------\n");
1322
}
1322
}
1323
1323
Lines 1356-1362 Link Here
1356
		"1. ERROR in X.java (at line 4)\n" + 
1356
		"1. ERROR in X.java (at line 4)\n" + 
1357
		"	|| x == null) {\n" + 
1357
		"	|| x == null) {\n" + 
1358
		"	   ^\n" + 
1358
		"	   ^\n" + 
1359
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1359
		"Null comparison always yields false: The variable x cannot be null at this location\n" +  
1360
		"----------\n");
1360
		"----------\n");
1361
}
1361
}
1362
1362
Lines 1408-1414 Link Here
1408
		"1. ERROR in X.java (at line 4)\n" + 
1408
		"1. ERROR in X.java (at line 4)\n" + 
1409
		"	return s1.toString();\n" + 
1409
		"	return s1.toString();\n" + 
1410
		"	       ^^\n" + 
1410
		"	       ^^\n" + 
1411
		"The variable s1 may be null\n" + 
1411
		"Potential null pointer access: The variable s1 may be null at this location\n" + 
1412
		"----------\n");
1412
		"----------\n");
1413
}
1413
}
1414
1414
Lines 1528-1534 Link Here
1528
		"1. ERROR in X.java (at line 13)\n" + 
1528
		"1. ERROR in X.java (at line 13)\n" + 
1529
		"	o.toString();\n" + 
1529
		"	o.toString();\n" + 
1530
		"	^\n" + 
1530
		"	^\n" + 
1531
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1531
		"Null pointer access: The variable o can only be null at this location\n" +  
1532
		"----------\n");
1532
		"----------\n");
1533
}
1533
}
1534
1534
Lines 1548-1554 Link Here
1548
		"1. ERROR in X.java (at line 4)\n" + 
1548
		"1. ERROR in X.java (at line 4)\n" + 
1549
		"	if (o != null) {\n" + 
1549
		"	if (o != null) {\n" + 
1550
		"	    ^\n" + 
1550
		"	    ^\n" + 
1551
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1551
		"Redundant null check: The variable o cannot be null at this location\n" +  
1552
		"----------\n");
1552
		"----------\n");
1553
}
1553
}
1554
1554
Lines 1570-1576 Link Here
1570
		"1. ERROR in X.java (at line 6)\n" + 
1570
		"1. ERROR in X.java (at line 6)\n" + 
1571
		"	if (o != null) {\n" + 
1571
		"	if (o != null) {\n" + 
1572
		"	    ^\n" + 
1572
		"	    ^\n" + 
1573
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1573
		"Redundant null check: The variable o cannot be null at this location\n" +  
1574
		"----------\n");
1574
		"----------\n");
1575
}
1575
}
1576
1576
Lines 1592-1598 Link Here
1592
		"1. ERROR in X.java (at line 6)\n" + 
1592
		"1. ERROR in X.java (at line 6)\n" + 
1593
		"	if (o != null) {\n" + 
1593
		"	if (o != null) {\n" + 
1594
		"	    ^\n" + 
1594
		"	    ^\n" + 
1595
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1595
		"Redundant null check: The variable o cannot be null at this location\n" +  
1596
		"----------\n");
1596
		"----------\n");
1597
}
1597
}
1598
1598
Lines 1612-1618 Link Here
1612
		"1. ERROR in X.java (at line 4)\n" + 
1612
		"1. ERROR in X.java (at line 4)\n" + 
1613
		"	o.toString();\n" + 
1613
		"	o.toString();\n" + 
1614
		"	^\n" + 
1614
		"	^\n" + 
1615
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1615
		"Null pointer access: The variable o can only be null at this location\n" +  
1616
		"----------\n");
1616
		"----------\n");
1617
}
1617
}
1618
1618
Lines 1633-1639 Link Here
1633
		"1. ERROR in X.java (at line 6)\n" + 
1633
		"1. ERROR in X.java (at line 6)\n" + 
1634
		"	o.toString();\n" + 
1634
		"	o.toString();\n" + 
1635
		"	^\n" + 
1635
		"	^\n" + 
1636
		"The variable o may be null\n" + 
1636
		"Potential null pointer access: The variable o may be null at this location\n" + 
1637
		"----------\n");
1637
		"----------\n");
1638
}
1638
}
1639
1639
Lines 1655-1661 Link Here
1655
		"1. ERROR in X.java (at line 4)\n" + 
1655
		"1. ERROR in X.java (at line 4)\n" + 
1656
		"	if (o == null) {\n" + 
1656
		"	if (o == null) {\n" + 
1657
		"	    ^\n" + 
1657
		"	    ^\n" + 
1658
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1658
		"Null comparison always yields false: The variable o cannot be null at this location\n" +  
1659
		"----------\n");
1659
		"----------\n");
1660
}
1660
}
1661
1661
Lines 1699-1705 Link Here
1699
		"1. ERROR in X.java (at line 7)\n" + 
1699
		"1. ERROR in X.java (at line 7)\n" + 
1700
		"	o.toString();\n" + 
1700
		"	o.toString();\n" + 
1701
		"	^\n" + 
1701
		"	^\n" + 
1702
		"The variable o may be null\n" + 
1702
		"Potential null pointer access: The variable o may be null at this location\n" + 
1703
		"----------\n");
1703
		"----------\n");
1704
}   
1704
}   
1705
1705
Lines 1724-1730 Link Here
1724
		"1. ERROR in X.java (at line 10)\n" + 
1724
		"1. ERROR in X.java (at line 10)\n" + 
1725
		"	o.toString();\n" + 
1725
		"	o.toString();\n" + 
1726
		"	^\n" + 
1726
		"	^\n" + 
1727
		"The variable o may be null\n" + 
1727
		"Potential null pointer access: The variable o may be null at this location\n" + 
1728
		"----------\n");
1728
		"----------\n");
1729
}   
1729
}   
1730
1730
Lines 1750-1761 Link Here
1750
		"1. ERROR in X.java (at line 8)\n" + 
1750
		"1. ERROR in X.java (at line 8)\n" + 
1751
		"	o.toString();\n" + 
1751
		"	o.toString();\n" + 
1752
		"	^\n" + 
1752
		"	^\n" + 
1753
		"The variable o may be null\n" + 
1753
		"Potential null pointer access: The variable o may be null at this location\n" + 
1754
		"----------\n" + 
1754
		"----------\n" + 
1755
		"2. ERROR in X.java (at line 11)\n" + 
1755
		"2. ERROR in X.java (at line 11)\n" + 
1756
		"	o.toString();\n" + 
1756
		"	o.toString();\n" + 
1757
		"	^\n" + 
1757
		"	^\n" + 
1758
		"The variable o may be null\n" + 
1758
		"Potential null pointer access: The variable o may be null at this location\n" + 
1759
		"----------\n");
1759
		"----------\n");
1760
}   
1760
}   
1761
1761
Lines 1792-1803 Link Here
1792
		"1. ERROR in X.java (at line 5)\n" + 
1792
		"1. ERROR in X.java (at line 5)\n" + 
1793
		"	if (o == null) { /* */ }\n" + 
1793
		"	if (o == null) { /* */ }\n" + 
1794
		"	    ^\n" + 
1794
		"	    ^\n" + 
1795
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1795
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1796
		"----------\n" + 
1796
		"----------\n" + 
1797
		"2. ERROR in X.java (at line 7)\n" + 
1797
		"2. ERROR in X.java (at line 7)\n" + 
1798
		"	o.toString();\n" + 
1798
		"	o.toString();\n" + 
1799
		"	^\n" + 
1799
		"	^\n" + 
1800
		"The variable o may be null\n" + 
1800
		"Potential null pointer access: The variable o may be null at this location\n" + 
1801
		"----------\n");
1801
		"----------\n");
1802
}
1802
}
1803
 
1803
 
Lines 1819-1825 Link Here
1819
		"1. ERROR in X.java (at line 6)\n" + 
1819
		"1. ERROR in X.java (at line 6)\n" + 
1820
		"	if (o == null) { /* */ }\n" + 
1820
		"	if (o == null) { /* */ }\n" + 
1821
		"	    ^\n" + 
1821
		"	    ^\n" + 
1822
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1822
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1823
		"----------\n");
1823
		"----------\n");
1824
}
1824
}
1825
1825
Lines 1840-1846 Link Here
1840
		"1. ERROR in X.java (at line 6)\n" + 
1840
		"1. ERROR in X.java (at line 6)\n" + 
1841
		"	if (o == null) { /* */ }\n" + 
1841
		"	if (o == null) { /* */ }\n" + 
1842
		"	    ^\n" + 
1842
		"	    ^\n" + 
1843
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1843
		"Redundant null check: The variable o can only be null at this location\n" + 
1844
		"----------\n");
1844
		"----------\n");
1845
}
1845
}
1846
1846
Lines 1861-1867 Link Here
1861
		"1. ERROR in X.java (at line 6)\n" + 
1861
		"1. ERROR in X.java (at line 6)\n" + 
1862
		"	o.toString();\n" + 
1862
		"	o.toString();\n" + 
1863
		"	^\n" + 
1863
		"	^\n" + 
1864
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
1864
		"Null pointer access: The variable o can only be null at this location\n" + 
1865
		"----------\n");
1865
		"----------\n");
1866
}
1866
}
1867
1867
Lines 1881-1887 Link Here
1881
		"1. ERROR in X.java (at line 5)\n" + 
1881
		"1. ERROR in X.java (at line 5)\n" + 
1882
		"	o.toString();\n" + 
1882
		"	o.toString();\n" + 
1883
		"	^\n" + 
1883
		"	^\n" + 
1884
		"The variable o may be null\n" + 
1884
		"Potential null pointer access: The variable o may be null at this location\n" + 
1885
		"----------\n");
1885
		"----------\n");
1886
}
1886
}
1887
1887
Lines 1953-1959 Link Here
1953
		"1. ERROR in X.java (at line 4)\n" + 
1953
		"1. ERROR in X.java (at line 4)\n" + 
1954
		"	if (o == null) { /* */ }\n" + 
1954
		"	if (o == null) { /* */ }\n" + 
1955
		"	    ^\n" + 
1955
		"	    ^\n" + 
1956
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1956
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1957
		"----------\n");
1957
		"----------\n");
1958
}
1958
}
1959
1959
Lines 1990-1996 Link Here
1990
		"1. ERROR in X.java (at line 5)\n" + 
1990
		"1. ERROR in X.java (at line 5)\n" + 
1991
		"	if (o == null) { /* */ }\n" + 
1991
		"	if (o == null) { /* */ }\n" + 
1992
		"	    ^\n" + 
1992
		"	    ^\n" + 
1993
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
1993
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
1994
		"----------\n");
1994
		"----------\n");
1995
}
1995
}
1996
1996
Lines 2069-2075 Link Here
2069
		"1. ERROR in X.java (at line 20)\n" + 
2069
		"1. ERROR in X.java (at line 20)\n" + 
2070
		"	s.toString();\n" + 
2070
		"	s.toString();\n" + 
2071
		"	^\n" + 
2071
		"	^\n" + 
2072
		"The variable s may be null\n" + 
2072
		"Potential null pointer access: The variable s may be null at this location\n" + 
2073
		"----------\n");
2073
		"----------\n");
2074
}
2074
}
2075
2075
Lines 2093-2099 Link Here
2093
		"1. ERROR in X.java (at line 7)\n" + 
2093
		"1. ERROR in X.java (at line 7)\n" + 
2094
		"	s1.toString();\n" + 
2094
		"	s1.toString();\n" + 
2095
		"	^^\n" + 
2095
		"	^^\n" + 
2096
		"The variable s1 may be null\n" + 
2096
		"Potential null pointer access: The variable s1 may be null at this location\n" + 
2097
		"----------\n");
2097
		"----------\n");
2098
}
2098
}
2099
2099
Lines 2119-2125 Link Here
2119
		"1. ERROR in X.java (at line 9)\n" + 
2119
		"1. ERROR in X.java (at line 9)\n" + 
2120
		"	s2.toString();\n" + 
2120
		"	s2.toString();\n" + 
2121
		"	^^\n" + 
2121
		"	^^\n" + 
2122
		"The variable s2 may be null\n" + 
2122
		"Potential null pointer access: The variable s2 may be null at this location\n" + 
2123
		"----------\n");
2123
		"----------\n");
2124
}
2124
}
2125
2125
Lines 2143-2149 Link Here
2143
		"1. ERROR in X.java (at line 9)\n" + 
2143
		"1. ERROR in X.java (at line 9)\n" + 
2144
		"	o.toString();\n" + 
2144
		"	o.toString();\n" + 
2145
		"	^\n" + 
2145
		"	^\n" + 
2146
		"The variable o may be null\n" + 
2146
		"Potential null pointer access: The variable o may be null at this location\n" + 
2147
		"----------\n");
2147
		"----------\n");
2148
}
2148
}
2149
2149
Lines 2164-2170 Link Here
2164
		"1. ERROR in X.java (at line 6)\n" + 
2164
		"1. ERROR in X.java (at line 6)\n" + 
2165
		"	o.toString();\n" + 
2165
		"	o.toString();\n" + 
2166
		"	^\n" + 
2166
		"	^\n" + 
2167
		"The variable o may be null\n" + 
2167
		"Potential null pointer access: The variable o may be null at this location\n" + 
2168
		"----------\n");
2168
		"----------\n");
2169
}
2169
}
2170
2170
Lines 2222-2228 Link Here
2222
		"1. ERROR in X.java (at line 7)\n" + 
2222
		"1. ERROR in X.java (at line 7)\n" + 
2223
		"	if (o != null) { /* */ }\n" + 
2223
		"	if (o != null) { /* */ }\n" + 
2224
		"	    ^\n" + 
2224
		"	    ^\n" + 
2225
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
2225
		"Redundant null check: The variable o cannot be null at this location\n" + 
2226
		"----------\n");
2226
		"----------\n");
2227
}
2227
}
2228
2228
Lines 2246-2252 Link Here
2246
		"1. ERROR in X.java (at line 4)\n" + 
2246
		"1. ERROR in X.java (at line 4)\n" + 
2247
		"	if (o != null) {\n" + 
2247
		"	if (o != null) {\n" + 
2248
		"	    ^\n" + 
2248
		"	    ^\n" + 
2249
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
2249
		"Redundant null check: The variable o cannot be null at this location\n" + 
2250
		"----------\n");
2250
		"----------\n");
2251
}
2251
}
2252
2252
Lines 2273-2284 Link Here
2273
		"1. ERROR in X.java (at line 4)\n" + 
2273
		"1. ERROR in X.java (at line 4)\n" + 
2274
		"	if (o != null) {\n" + 
2274
		"	if (o != null) {\n" + 
2275
		"	    ^\n" + 
2275
		"	    ^\n" + 
2276
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
2276
		"Redundant null check: The variable o cannot be null at this location\n" + 
2277
		"----------\n" + 
2277
		"----------\n" + 
2278
		"2. ERROR in X.java (at line 8)\n" + 
2278
		"2. ERROR in X.java (at line 8)\n" + 
2279
		"	o.toString();\n" + 
2279
		"	o.toString();\n" + 
2280
		"	^\n" + 
2280
		"	^\n" + 
2281
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2281
		"Null pointer access: The variable o can only be null at this location\n" + 
2282
		"----------\n");
2282
		"----------\n");
2283
}
2283
}
2284
2284
Lines 2304-2310 Link Here
2304
		"1. ERROR in X.java (at line 4)\n" + 
2304
		"1. ERROR in X.java (at line 4)\n" + 
2305
		"	if (o != null) {\n" + 
2305
		"	if (o != null) {\n" + 
2306
		"	    ^\n" + 
2306
		"	    ^\n" + 
2307
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
2307
		"Redundant null check: The variable o cannot be null at this location\n" + 
2308
		"----------\n");
2308
		"----------\n");
2309
}
2309
}
2310
2310
Lines 2332-2343 Link Here
2332
		"1. ERROR in X.java (at line 4)\n" + 
2332
		"1. ERROR in X.java (at line 4)\n" + 
2333
		"	if (o != null) {\n" + 
2333
		"	if (o != null) {\n" + 
2334
		"	    ^\n" + 
2334
		"	    ^\n" + 
2335
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
2335
		"Redundant null check: The variable o cannot be null at this location\n" + 
2336
		"----------\n" + 
2336
		"----------\n" + 
2337
		"2. ERROR in X.java (at line 8)\n" + 
2337
		"2. ERROR in X.java (at line 8)\n" + 
2338
		"	o.toString();\n" + 
2338
		"	o.toString();\n" + 
2339
		"	^\n" + 
2339
		"	^\n" + 
2340
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2340
		"Null pointer access: The variable o can only be null at this location\n" + 
2341
		"----------\n");
2341
		"----------\n");
2342
}
2342
}
2343
2343
Lines 2433-2439 Link Here
2433
		"1. ERROR in X.java (at line 5)\n" + 
2433
		"1. ERROR in X.java (at line 5)\n" + 
2434
		"	o.toString();\n" + 
2434
		"	o.toString();\n" + 
2435
		"	^\n" + 
2435
		"	^\n" + 
2436
		"The variable o may be null\n" + 
2436
		"Potential null pointer access: The variable o may be null at this location\n" + 
2437
		"----------\n");
2437
		"----------\n");
2438
}
2438
}
2439
2439
Lines 2458-2464 Link Here
2458
		"1. ERROR in X.java (at line 5)\n" + 
2458
		"1. ERROR in X.java (at line 5)\n" + 
2459
		"	o.toString();\n" + 
2459
		"	o.toString();\n" + 
2460
		"	^\n" + 
2460
		"	^\n" + 
2461
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2461
		"Null pointer access: The variable o can only be null at this location\n" + 
2462
		"----------\n");
2462
		"----------\n");
2463
}
2463
}
2464
2464
Lines 2480-2486 Link Here
2480
		"1. ERROR in X.java (at line 5)\n" + 
2480
		"1. ERROR in X.java (at line 5)\n" + 
2481
		"	o1.toString();\n" + 
2481
		"	o1.toString();\n" + 
2482
		"	^^\n" + 
2482
		"	^^\n" + 
2483
		"The variable o1 may be null\n" + 
2483
		"Potential null pointer access: The variable o1 may be null at this location\n" + 
2484
		"----------\n");
2484
		"----------\n");
2485
}
2485
}
2486
2486
Lines 2502-2508 Link Here
2502
		"1. ERROR in X.java (at line 5)\n" + 
2502
		"1. ERROR in X.java (at line 5)\n" + 
2503
		"	o1.toString();\n" + 
2503
		"	o1.toString();\n" + 
2504
		"	^^\n" + 
2504
		"	^^\n" + 
2505
		"The variable o1 may be null\n" + 
2505
		"Potential null pointer access: The variable o1 may be null at this location\n" + 
2506
		"----------\n");
2506
		"----------\n");
2507
}
2507
}
2508
2508
Lines 2522-2528 Link Here
2522
		"1. ERROR in X.java (at line 4)\n" + 
2522
		"1. ERROR in X.java (at line 4)\n" + 
2523
		"	while (o.toString() != null) {/* */}\n" + 
2523
		"	while (o.toString() != null) {/* */}\n" + 
2524
		"	       ^\n" + 
2524
		"	       ^\n" + 
2525
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2525
		"Null pointer access: The variable o can only be null at this location\n" + 
2526
		"----------\n");
2526
		"----------\n");
2527
}
2527
}
2528
2528
Lines 2542-2548 Link Here
2542
		"1. ERROR in X.java (at line 4)\n" + 
2542
		"1. ERROR in X.java (at line 4)\n" + 
2543
		"	while (o != null) {/* */}\n" + 
2543
		"	while (o != null) {/* */}\n" + 
2544
		"	       ^\n" + 
2544
		"	       ^\n" + 
2545
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2545
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
2546
		"----------\n");
2546
		"----------\n");
2547
}
2547
}
2548
2548
Lines 2604-2610 Link Here
2604
		"1. ERROR in X.java (at line 7)\n" + 
2604
		"1. ERROR in X.java (at line 7)\n" + 
2605
		"	o.toString();\n" + 
2605
		"	o.toString();\n" + 
2606
		"	^\n" + 
2606
		"	^\n" + 
2607
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2607
		"Null pointer access: The variable o can only be null at this location\n" + 
2608
		"----------\n");
2608
		"----------\n");
2609
}
2609
}
2610
2610
Lines 2624-2630 Link Here
2624
		"1. ERROR in X.java (at line 5)\n" + 
2624
		"1. ERROR in X.java (at line 5)\n" + 
2625
		"	while (dummy || o != null) { /* */ }\n" + 
2625
		"	while (dummy || o != null) { /* */ }\n" + 
2626
		"	                ^\n" + 
2626
		"	                ^\n" + 
2627
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2627
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
2628
		"----------\n");
2628
		"----------\n");
2629
}
2629
}
2630
2630
Lines 2647-2653 Link Here
2647
		"1. ERROR in X.java (at line 6)\n" + 
2647
		"1. ERROR in X.java (at line 6)\n" + 
2648
		"	o.toString();\n" + 
2648
		"	o.toString();\n" + 
2649
		"	^\n" + 
2649
		"	^\n" + 
2650
		"The variable o may be null\n" + 
2650
		"Potential null pointer access: The variable o may be null at this location\n" + 
2651
		"----------\n");
2651
		"----------\n");
2652
}
2652
}
2653
2653
Lines 2702-2708 Link Here
2702
		"1. ERROR in X.java (at line 6)\n" + 
2702
		"1. ERROR in X.java (at line 6)\n" + 
2703
		"	o.toString();\n" + 
2703
		"	o.toString();\n" + 
2704
		"	^\n" + 
2704
		"	^\n" + 
2705
		"The variable o may be null\n" + 
2705
		"Potential null pointer access: The variable o may be null at this location\n" + 
2706
		"----------\n");
2706
		"----------\n");
2707
}
2707
}
2708
2708
Lines 2775-2781 Link Here
2775
		"1. ERROR in X.java (at line 7)\n" + 
2775
		"1. ERROR in X.java (at line 7)\n" + 
2776
		"	o.toString();\n" + 
2776
		"	o.toString();\n" + 
2777
		"	^\n" + 
2777
		"	^\n" + 
2778
		"The variable o may be null\n" + 
2778
		"Potential null pointer access: The variable o may be null at this location\n" + 
2779
		"----------\n");
2779
		"----------\n");
2780
}
2780
}
2781
2781
Lines 2814-2820 Link Here
2814
		"1. ERROR in X.java (at line 7)\n" + 
2814
		"1. ERROR in X.java (at line 7)\n" + 
2815
		"	o.toString();\n" + 
2815
		"	o.toString();\n" + 
2816
		"	^\n" + 
2816
		"	^\n" + 
2817
		"The variable o may be null\n" + 
2817
		"Potential null pointer access: The variable o may be null at this location\n" + 
2818
		"----------\n");
2818
		"----------\n");
2819
}
2819
}
2820
2820
Lines 2858-2864 Link Here
2858
		"1. ERROR in X.java (at line 8)\n" + 
2858
		"1. ERROR in X.java (at line 8)\n" + 
2859
		"	o.toString();\n" + 
2859
		"	o.toString();\n" + 
2860
		"	^\n" + 
2860
		"	^\n" + 
2861
		"The variable o may be null\n" + 
2861
		"Potential null pointer access: The variable o may be null at this location\n" + 
2862
		"----------\n");
2862
		"----------\n");
2863
}
2863
}
2864
2864
Lines 2879-2885 Link Here
2879
		"1. ERROR in X.java (at line 6)\n" + 
2879
		"1. ERROR in X.java (at line 6)\n" + 
2880
		"	o.toString();\n" + 
2880
		"	o.toString();\n" + 
2881
		"	^\n" + 
2881
		"	^\n" + 
2882
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2882
		"Null pointer access: The variable o can only be null at this location\n" + 
2883
		"----------\n");
2883
		"----------\n");
2884
}
2884
}
2885
2885
Lines 2923-2929 Link Here
2923
		"1. ERROR in X.java (at line 5)\n" + 
2923
		"1. ERROR in X.java (at line 5)\n" + 
2924
		"	o.toString();      o = null;\n" + 
2924
		"	o.toString();      o = null;\n" + 
2925
		"	^\n" + 
2925
		"	^\n" + 
2926
		"The variable o may be null\n" + 
2926
		"Potential null pointer access: The variable o may be null at this location\n" + 
2927
		"----------\n");
2927
		"----------\n");
2928
}
2928
}
2929
2929
Lines 2948-2954 Link Here
2948
		"1. ERROR in X.java (at line 10)\n" + 
2948
		"1. ERROR in X.java (at line 10)\n" + 
2949
		"	if (o == null) { /* */ }\n" + 
2949
		"	if (o == null) { /* */ }\n" + 
2950
		"	    ^\n" + 
2950
		"	    ^\n" + 
2951
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
2951
		"Redundant null check: The variable o can only be null at this location\n" + 
2952
		"----------\n");
2952
		"----------\n");
2953
}
2953
}
2954
2954
Lines 2990-2996 Link Here
2990
		"1. ERROR in X.java (at line 7)\n" + 
2990
		"1. ERROR in X.java (at line 7)\n" + 
2991
		"	if (o == null) { /* */ }\n" + 
2991
		"	if (o == null) { /* */ }\n" + 
2992
		"	    ^\n" + 
2992
		"	    ^\n" + 
2993
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
2993
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
2994
		"----------\n");
2994
		"----------\n");
2995
}
2995
}
2996
2996
Lines 3014-3020 Link Here
3014
		"1. ERROR in X.java (at line 7)\n" + 
3014
		"1. ERROR in X.java (at line 7)\n" + 
3015
		"	if (o == null) { /* */ }\n" + 
3015
		"	if (o == null) { /* */ }\n" + 
3016
		"	    ^\n" + 
3016
		"	    ^\n" + 
3017
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3017
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
3018
		"----------\n");
3018
		"----------\n");
3019
}
3019
}
3020
3020
Lines 3060-3066 Link Here
3060
		"1. ERROR in X.java (at line 8)\n" + 
3060
		"1. ERROR in X.java (at line 8)\n" + 
3061
		"	o.toString();\n" + 
3061
		"	o.toString();\n" + 
3062
		"	^\n" + 
3062
		"	^\n" + 
3063
		"The variable o may be null\n" + 
3063
		"Potential null pointer access: The variable o may be null at this location\n" + 
3064
		"----------\n");
3064
		"----------\n");
3065
}
3065
}
3066
3066
Lines 3081-3087 Link Here
3081
		"1. ERROR in X.java (at line 6)\n" + 
3081
		"1. ERROR in X.java (at line 6)\n" + 
3082
		"	if (o == null) { /* */ }\n" + 
3082
		"	if (o == null) { /* */ }\n" + 
3083
		"	    ^\n" + 
3083
		"	    ^\n" + 
3084
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3084
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
3085
		"----------\n");
3085
		"----------\n");
3086
}
3086
}
3087
3087
Lines 3105-3111 Link Here
3105
		"1. ERROR in X.java (at line 6)\n" + 
3105
		"1. ERROR in X.java (at line 6)\n" + 
3106
		"	if (o == null) {\n" + 
3106
		"	if (o == null) {\n" + 
3107
		"	    ^\n" + 
3107
		"	    ^\n" + 
3108
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
3108
		"Redundant null check: The variable o can only be null at this location\n" + 
3109
		"----------\n");
3109
		"----------\n");
3110
}
3110
}
3111
3111
Lines 3239-3245 Link Here
3239
		"1. ERROR in X.java (at line 6)\n" + 
3239
		"1. ERROR in X.java (at line 6)\n" + 
3240
		"	x.toString();\n" + 
3240
		"	x.toString();\n" + 
3241
		"	^\n" + 
3241
		"	^\n" + 
3242
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
3242
		"Null pointer access: The variable x can only be null at this location\n" +  
3243
		"----------\n");
3243
		"----------\n");
3244
}
3244
}
3245
3245
Lines 3347-3353 Link Here
3347
		"1. ERROR in X.java (at line 5)\n" + 
3347
		"1. ERROR in X.java (at line 5)\n" + 
3348
		"	if (o != null) { /* */ }\n" + 
3348
		"	if (o != null) { /* */ }\n" + 
3349
		"	    ^\n" + 
3349
		"	    ^\n" + 
3350
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3350
		"Redundant null check: The variable o cannot be null at this location\n" + 
3351
		"----------\n");
3351
		"----------\n");
3352
} 
3352
} 
3353
3353
Lines 3384-3390 Link Here
3384
		"1. ERROR in X.java (at line 6)\n" + 
3384
		"1. ERROR in X.java (at line 6)\n" + 
3385
		"	if (o != null) { /* */ }\n" + 
3385
		"	if (o != null) { /* */ }\n" + 
3386
		"	    ^\n" + 
3386
		"	    ^\n" + 
3387
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3387
		"Redundant null check: The variable o cannot be null at this location\n" + 
3388
		"----------\n");
3388
		"----------\n");
3389
}
3389
}
3390
3390
Lines 3408-3414 Link Here
3408
		"1. ERROR in X.java (at line 9)\n" + 
3408
		"1. ERROR in X.java (at line 9)\n" + 
3409
		"	if (o != null) { /* */ }\n" + 
3409
		"	if (o != null) { /* */ }\n" + 
3410
		"	    ^\n" + 
3410
		"	    ^\n" + 
3411
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3411
		"Redundant null check: The variable o cannot be null at this location\n" + 
3412
		"----------\n");
3412
		"----------\n");
3413
}
3413
}
3414
3414
Lines 3430-3436 Link Here
3430
		"1. ERROR in X.java (at line 7)\n" + 
3430
		"1. ERROR in X.java (at line 7)\n" + 
3431
		"	o.toString();\n" + 
3431
		"	o.toString();\n" + 
3432
		"	^\n" + 
3432
		"	^\n" + 
3433
		"The variable o may be null\n" + 
3433
		"Potential null pointer access: The variable o may be null at this location\n" + 
3434
		"----------\n");
3434
		"----------\n");
3435
} 
3435
} 
3436
3436
Lines 3511-3517 Link Here
3511
		"1. ERROR in X.java (at line 5)\n" + 
3511
		"1. ERROR in X.java (at line 5)\n" + 
3512
		"	if (o != null) {\n" + 
3512
		"	if (o != null) {\n" + 
3513
		"	    ^\n" + 
3513
		"	    ^\n" + 
3514
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
3514
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
3515
		"----------\n");
3515
		"----------\n");
3516
} 
3516
} 
3517
3517
Lines 3532-3538 Link Here
3532
		"1. ERROR in X.java (at line 6)\n" + 
3532
		"1. ERROR in X.java (at line 6)\n" + 
3533
		"	if (o != null) { /* */ }\n" + 
3533
		"	if (o != null) { /* */ }\n" + 
3534
		"	    ^\n" + 
3534
		"	    ^\n" + 
3535
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3535
		"Redundant null check: The variable o cannot be null at this location\n" + 
3536
		"----------\n");
3536
		"----------\n");
3537
}
3537
}
3538
3538
Lines 3590-3596 Link Here
3590
		"1. ERROR in X.java (at line 5)\n" + 
3590
		"1. ERROR in X.java (at line 5)\n" + 
3591
		"	if (o != null) {\n" + 
3591
		"	if (o != null) {\n" + 
3592
		"	    ^\n" + 
3592
		"	    ^\n" + 
3593
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
3593
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
3594
		"----------\n");
3594
		"----------\n");
3595
} 
3595
} 
3596
3596
Lines 3635-3641 Link Here
3635
		"1. ERROR in X.java (at line 7)\n" + 
3635
		"1. ERROR in X.java (at line 7)\n" + 
3636
		"	if (o != null) { /* */ }\n" + 
3636
		"	if (o != null) { /* */ }\n" + 
3637
		"	    ^\n" + 
3637
		"	    ^\n" + 
3638
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3638
		"Redundant null check: The variable o cannot be null at this location\n" + 
3639
		"----------\n");
3639
		"----------\n");
3640
} 
3640
} 
3641
3641
Lines 3660-3666 Link Here
3660
		"1. ERROR in X.java (at line 9)\n" + 
3660
		"1. ERROR in X.java (at line 9)\n" + 
3661
		"	if (o != null) { /* */ }\n" + 
3661
		"	if (o != null) { /* */ }\n" + 
3662
		"	    ^\n" + 
3662
		"	    ^\n" + 
3663
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3663
		"Redundant null check: The variable o cannot be null at this location\n" + 
3664
		"----------\n");
3664
		"----------\n");
3665
} 
3665
} 
3666
3666
Lines 3685-3691 Link Here
3685
		"1. ERROR in X.java (at line 6)\n" + 
3685
		"1. ERROR in X.java (at line 6)\n" + 
3686
		"	if (o == null) {\n" + 
3686
		"	if (o == null) {\n" + 
3687
		"	    ^\n" + 
3687
		"	    ^\n" + 
3688
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
3688
		"Redundant null check: The variable o can only be null at this location\n" + 
3689
		"----------\n"
3689
		"----------\n"
3690
	);
3690
	);
3691
}
3691
}
Lines 3759-3765 Link Here
3759
		"1. ERROR in X.java (at line 7)\n" + 
3759
		"1. ERROR in X.java (at line 7)\n" + 
3760
		"	if (o != null) { /* */ }\n" + 
3760
		"	if (o != null) { /* */ }\n" + 
3761
		"	    ^\n" + 
3761
		"	    ^\n" + 
3762
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
3762
		"Redundant null check: The variable o cannot be null at this location\n" + 
3763
		"----------\n");
3763
		"----------\n");
3764
} 
3764
} 
3765
3765
Lines 3838-3843 Link Here
3838
		"");
3838
		"");
3839
} 
3839
} 
3840
3840
3841
// null analysis -- while nested hits CAN_ONLY_NON_NULL
3842
public void test0459_while_nested() {
3843
	this.runNegativeTest(
3844
		new String[] {
3845
			"X.java",
3846
			"public class X {\n" + 
3847
			"  void foo(boolean b) {\n" + 
3848
			"    Object o = b ? null : new Object(),\n" + 
3849
			"           u = new Object(),\n" + 
3850
			"           v = new Object();\n" + 
3851
			"    while (o != null) {\n" + 
3852
			"      while (b) {\n" + 
3853
			"        if (v == null) {\n" +
3854
			"          o = new Object();\n" +
3855
			"        };\n" +
3856
			"        while (o == null) {\n" +
3857
			"          if (u == null) {\n" +
3858
			"            v = null;\n" +
3859
			"          };\n" +
3860
			"          u = null;\n" +
3861
			"        }\n" +
3862
			"      }\n" +
3863
			"    }\n" +
3864
			"  }\n" + 
3865
			"}\n"},
3866
		"----------\n" + 
3867
		"1. ERROR in X.java (at line 11)\r\n" + 
3868
		"	while (o == null) {\r\n" + 
3869
		"	       ^\n" + 
3870
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
3871
		"----------\n");
3872
}
3873
3841
// null analysis -- try/finally
3874
// null analysis -- try/finally
3842
public void test0500_try_finally() {
3875
public void test0500_try_finally() {
3843
	this.runConformTest(
3876
	this.runConformTest(
Lines 3877-3883 Link Here
3877
		"1. ERROR in X.java (at line 8)\n" + 
3910
		"1. ERROR in X.java (at line 8)\n" + 
3878
		"	o.toString();\n" + 
3911
		"	o.toString();\n" + 
3879
		"	^\n" + 
3912
		"	^\n" + 
3880
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
3913
		"Null pointer access: The variable o can only be null at this location\n" + 
3881
		"----------\n" // because finally assigns to null 
3914
		"----------\n" // because finally assigns to null 
3882
	);
3915
	);
3883
}
3916
}
Lines 3920-3926 Link Here
3920
		"1. ERROR in X.java (at line 5)\n" + 
3953
		"1. ERROR in X.java (at line 5)\n" + 
3921
		"	x = null;\n" + 
3954
		"	x = null;\n" + 
3922
		"	^\n" + 
3955
		"	^\n" + 
3923
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
3956
		"Redundant assignment: The variable x can only be null at this location\n" + 
3924
		"----------\n");
3957
		"----------\n");
3925
}
3958
}
3926
3959
Lines 3942-3948 Link Here
3942
		"1. ERROR in X.java (at line 6)\n" + 
3975
		"1. ERROR in X.java (at line 6)\n" + 
3943
		"	if (x != null) { /* */ }\n" + 
3976
		"	if (x != null) { /* */ }\n" + 
3944
		"	    ^\n" + 
3977
		"	    ^\n" + 
3945
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
3978
		"Null comparison always yields false: The variable x can only be null at this location\n" + 
3946
		"----------\n");
3979
		"----------\n");
3947
}
3980
}
3948
3981
Lines 3988-3994 Link Here
3988
		"1. ERROR in X.java (at line 7)\n" + 
4021
		"1. ERROR in X.java (at line 7)\n" + 
3989
		"	if (o == null) { /* */ }\n" + 
4022
		"	if (o == null) { /* */ }\n" + 
3990
		"	    ^\n" + 
4023
		"	    ^\n" + 
3991
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
4024
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
3992
		"----------\n");
4025
		"----------\n");
3993
}
4026
}
3994
4027
Lines 4012-4018 Link Here
4012
		"1. ERROR in X.java (at line 7)\n" + 
4045
		"1. ERROR in X.java (at line 7)\n" + 
4013
		"	if (o == null) {\n" + 
4046
		"	if (o == null) {\n" + 
4014
		"	    ^\n" + 
4047
		"	    ^\n" + 
4015
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
4048
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
4016
		"----------\n");
4049
		"----------\n");
4017
}
4050
}
4018
4051
Lines 4036-4042 Link Here
4036
		"1. ERROR in X.java (at line 5)\n" + 
4069
		"1. ERROR in X.java (at line 5)\n" + 
4037
		"	o.toString();\n" + 
4070
		"	o.toString();\n" + 
4038
		"	^\n" + 
4071
		"	^\n" + 
4039
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
4072
		"Null pointer access: The variable o can only be null at this location\n" + 
4040
		"----------\n");
4073
		"----------\n");
4041
}
4074
}
4042
4075
Lines 4063-4069 Link Here
4063
		"1. ERROR in X.java (at line 7)\n" + 
4096
		"1. ERROR in X.java (at line 7)\n" + 
4064
		"	o2.toString();\n" + 
4097
		"	o2.toString();\n" + 
4065
		"	^^\n" + 
4098
		"	^^\n" + 
4066
		"The variable o2 can only be null; it was either set to null or checked for null when last used\n" + 
4099
		"Null pointer access: The variable o2 can only be null at this location\n" +  
4067
		"----------\n");
4100
		"----------\n");
4068
}
4101
}
4069
4102
Lines 4133-4139 Link Here
4133
		"1. ERROR in X.java (at line 7)\n" + 
4166
		"1. ERROR in X.java (at line 7)\n" + 
4134
		"	x.toString();\n" + 
4167
		"	x.toString();\n" + 
4135
		"	^\n" + 
4168
		"	^\n" + 
4136
		"The variable x may be null\n" + 
4169
		"Potential null pointer access: The variable x may be null at this location\n" + 
4137
		"----------\n");
4170
		"----------\n");
4138
}
4171
}
4139
4172
Lines 4337-4343 Link Here
4337
		"1. ERROR in X.java (at line 28)\n" + 
4370
		"1. ERROR in X.java (at line 28)\n" + 
4338
		"	x.toString();\n" + 
4371
		"	x.toString();\n" + 
4339
		"	^\n" + 
4372
		"	^\n" + 
4340
		"The variable x may be null\n" + 
4373
		"Potential null pointer access: The variable x may be null at this location\n" + 
4341
		"----------\n");
4374
		"----------\n");
4342
}
4375
}
4343
4376
Lines 4458-4464 Link Here
4458
		"1. ERROR in X.java (at line 10)\n" + 
4491
		"1. ERROR in X.java (at line 10)\n" + 
4459
		"	if(t.bar()) {\n" + 
4492
		"	if(t.bar()) {\n" + 
4460
		"	   ^\n" + 
4493
		"	   ^\n" + 
4461
		"The variable t can only be null; it was either set to null or checked for null when last used\n" + 
4494
		"Null pointer access: The variable t can only be null at this location\n" +  
4462
		"----------\n");
4495
		"----------\n");
4463
}
4496
}
4464
4497
Lines 4491-4497 Link Here
4491
		"1. ERROR in X.java (at line 10)\n" + 
4524
		"1. ERROR in X.java (at line 10)\n" + 
4492
		"	if(t == null ? false : (t == null ? false : t.bar())) {\n" + 
4525
		"	if(t == null ? false : (t == null ? false : t.bar())) {\n" + 
4493
		"	                        ^\n" + 
4526
		"	                        ^\n" + 
4494
		"The variable t cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
4527
		"Null comparison always yields false: The variable t cannot be null at this location\n" +  
4495
		"----------\n");
4528
		"----------\n");
4496
}
4529
}
4497
4530
Lines 4524-4530 Link Here
4524
		"1. ERROR in X.java (at line 10)\n" + 
4557
		"1. ERROR in X.java (at line 10)\n" + 
4525
		"	if(t != null ? false : (t == null ? false : t.bar())) {\n" + 
4558
		"	if(t != null ? false : (t == null ? false : t.bar())) {\n" + 
4526
		"	                        ^\n" + 
4559
		"	                        ^\n" + 
4527
		"The variable t can only be null; it was either set to null or checked for null when last used\n" + 
4560
		"Redundant null check: The variable t can only be null at this location\n" + 
4528
		"----------\n");
4561
		"----------\n");
4529
}
4562
}
4530
4563
Lines 4559-4565 Link Here
4559
		"1. ERROR in X.java (at line 13)\r\n" + 
4592
		"1. ERROR in X.java (at line 13)\r\n" + 
4560
		"	o.toString();\r\n" + 
4593
		"	o.toString();\r\n" + 
4561
		"	^\n" + 
4594
		"	^\n" + 
4562
		"The variable o may be null\n" + 
4595
		"Potential null pointer access: The variable o may be null at this location\n" + 
4563
		"----------\n");
4596
		"----------\n");
4564
}
4597
}
4565
4598
Lines 4594-4600 Link Here
4594
		"1. ERROR in X.java (at line 12)\n" + 
4627
		"1. ERROR in X.java (at line 12)\n" + 
4595
		"	o.toString();\n" + 
4628
		"	o.toString();\n" + 
4596
		"	^\n" + 
4629
		"	^\n" + 
4597
		"The variable o may be null\n" + 
4630
		"Potential null pointer access: The variable o may be null at this location\n" + 
4598
		"----------\n");
4631
		"----------\n");
4599
}
4632
}
4600
4633
Lines 4626-4632 Link Here
4626
		"1. ERROR in X.java (at line 12)\n" + 
4659
		"1. ERROR in X.java (at line 12)\n" + 
4627
		"	o.toString();\n" + 
4660
		"	o.toString();\n" + 
4628
		"	^\n" + 
4661
		"	^\n" + 
4629
		"The variable o may be null\n" + 
4662
		"Potential null pointer access: The variable o may be null at this location\n" + 
4630
		"----------\n");
4663
		"----------\n");
4631
}
4664
}
4632
4665
Lines 4651-4662 Link Here
4651
		"1. ERROR in X.java (at line 7)\n" + 
4684
		"1. ERROR in X.java (at line 7)\n" + 
4652
		"	if (x != null) { /* */ }\n" + 
4685
		"	if (x != null) { /* */ }\n" + 
4653
		"	    ^\n" + 
4686
		"	    ^\n" + 
4654
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
4687
		"Null comparison always yields false: The variable x can only be null at this location\n" + 
4655
		"----------\n" + 
4688
		"----------\n" + 
4656
		"2. ERROR in X.java (at line 8)\n" + 
4689
		"2. ERROR in X.java (at line 8)\n" + 
4657
		"	if (y != null) { /* */ }\n" + 
4690
		"	if (y != null) { /* */ }\n" + 
4658
		"	    ^\n" + 
4691
		"	    ^\n" + 
4659
		"The variable y can only be null; it was either set to null or checked for null when last used\n" + 
4692
		"Null comparison always yields false: The variable y can only be null at this location\n" +  
4660
		"----------\n");
4693
		"----------\n");
4661
}
4694
}
4662
4695
Lines 4681-4692 Link Here
4681
		"1. ERROR in X.java (at line 7)\n" + 
4714
		"1. ERROR in X.java (at line 7)\n" + 
4682
		"	o.toString();\n" + 
4715
		"	o.toString();\n" + 
4683
		"	^\n" + 
4716
		"	^\n" + 
4684
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
4717
		"Null pointer access: The variable o can only be null at this location\n" + 
4685
		"----------\n" + 
4718
		"----------\n" + 
4686
		"2. ERROR in X.java (at line 8)\n" + 
4719
		"2. ERROR in X.java (at line 8)\n" + 
4687
		"	o2.toString();\n" + 
4720
		"	o2.toString();\n" + 
4688
		"	^^\n" + 
4721
		"	^^\n" + 
4689
		"The variable o2 can only be null; it was either set to null or checked for null when last used\n" + 
4722
		"Null pointer access: The variable o2 can only be null at this location\n" +  
4690
		"----------\n");
4723
		"----------\n");
4691
}
4724
}
4692
4725
Lines 4712-4723 Link Here
4712
		"1. ERROR in X.java (at line 8)\n" + 
4745
		"1. ERROR in X.java (at line 8)\n" + 
4713
		"	x.toString();\n" + 
4746
		"	x.toString();\n" + 
4714
		"	^\n" + 
4747
		"	^\n" + 
4715
		"The variable x may be null\n" + 
4748
		"Potential null pointer access: The variable x may be null at this location\n" + 
4716
		"----------\n" + 
4749
		"----------\n" + 
4717
		"2. ERROR in X.java (at line 9)\n" + 
4750
		"2. ERROR in X.java (at line 9)\n" + 
4718
		"	y.toString();\n" + 
4751
		"	y.toString();\n" + 
4719
		"	^\n" + 
4752
		"	^\n" + 
4720
		"The variable y can only be null; it was either set to null or checked for null when last used\n" + 
4753
		"Null pointer access: The variable y can only be null at this location\n" +  
4721
		"----------\n");
4754
		"----------\n");
4722
}
4755
}
4723
4756
Lines 4744-4755 Link Here
4744
		"1. ERROR in X.java (at line 7)\n" + 
4777
		"1. ERROR in X.java (at line 7)\n" + 
4745
		"	if (x != null) {\n" + 
4778
		"	if (x != null) {\n" + 
4746
		"	    ^\n" + 
4779
		"	    ^\n" + 
4747
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
4780
		"Redundant null check: The variable x cannot be null at this location\n" + 
4748
		"----------\n" + 
4781
		"----------\n" + 
4749
		"2. ERROR in X.java (at line 10)\n" + 
4782
		"2. ERROR in X.java (at line 10)\n" + 
4750
		"	y.toString();\n" + 
4783
		"	y.toString();\n" + 
4751
		"	^\n" + 
4784
		"	^\n" + 
4752
		"The variable y can only be null; it was either set to null or checked for null when last used\n" + 
4785
		"Null pointer access: The variable y can only be null at this location\n" + 
4753
		"----------\n");
4786
		"----------\n");
4754
}
4787
}
4755
4788
Lines 4799-4805 Link Here
4799
		"1. ERROR in X.java (at line 13)\n" + 
4832
		"1. ERROR in X.java (at line 13)\n" + 
4800
		"	o.toString();\n" + 
4833
		"	o.toString();\n" + 
4801
		"	^\n" + 
4834
		"	^\n" + 
4802
		"The variable o may be null\n" + 
4835
		"Potential null pointer access: The variable o may be null at this location\n" + 
4803
		"----------\n");
4836
		"----------\n");
4804
}
4837
}
4805
4838
Lines 4859-4865 Link Here
4859
		"1. ERROR in X.java (at line 15)\n" + 
4892
		"1. ERROR in X.java (at line 15)\n" + 
4860
		"	o.toString();\n" + 
4893
		"	o.toString();\n" + 
4861
		"	^\n" + 
4894
		"	^\n" + 
4862
		"The variable o may be null\n" + 
4895
		"Potential null pointer access: The variable o may be null at this location\n" + 
4863
		"----------\n");
4896
		"----------\n");
4864
}
4897
}
4865
4898
Lines 4895-4901 Link Here
4895
//		"1. ERROR in X.java (at line 10)\n" + 
4928
//		"1. ERROR in X.java (at line 10)\n" + 
4896
//		"	if (o != null) {\n" + 
4929
//		"	if (o != null) {\n" + 
4897
//		"	    ^\n" + 
4930
//		"	    ^\n" + 
4898
//		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
4931
//		"Redundant null check: The variable o can only be null at this location\n" + 
4899
//		"----------\n"
4932
//		"----------\n"
4900
	);
4933
	);
4901
}
4934
}
Lines 4924-4930 Link Here
4924
		"1. ERROR in X.java (at line 9)\n" + 
4957
		"1. ERROR in X.java (at line 9)\n" + 
4925
		"	o.toString();\n" + 
4958
		"	o.toString();\n" + 
4926
		"	^\n" + 
4959
		"	^\n" + 
4927
		"The variable o may be null\n" + 
4960
		"Potential null pointer access: The variable o may be null at this location\n" + 
4928
		"----------\n");
4961
		"----------\n");
4929
}
4962
}
4930
4963
Lines 4952-4958 Link Here
4952
		"1. ERROR in X.java (at line 9)\n" + 
4985
		"1. ERROR in X.java (at line 9)\n" + 
4953
		"	o.toString();\n" + 
4986
		"	o.toString();\n" + 
4954
		"	^\n" + 
4987
		"	^\n" + 
4955
		"The variable o may be null\n" + 
4988
		"Potential null pointer access: The variable o may be null at this location\n" + 
4956
		"----------\n");
4989
		"----------\n");
4957
}
4990
}
4958
4991
Lines 4980-4986 Link Here
4980
		"1. ERROR in X.java (at line 12)\n" + 
5013
		"1. ERROR in X.java (at line 12)\n" + 
4981
		"	o.toString();\n" + 
5014
		"	o.toString();\n" + 
4982
		"	^\n" + 
5015
		"	^\n" + 
4983
		"The variable o may be null\n" + 
5016
		"Potential null pointer access: The variable o may be null at this location\n" + 
4984
		"----------\n");
5017
		"----------\n");
4985
}
5018
}
4986
5019
Lines 5012-5019 Link Here
5012
		"1. ERROR in X.java (at line 13)\n" + 
5045
		"1. ERROR in X.java (at line 13)\n" + 
5013
		"	o.toString();\n" + 
5046
		"	o.toString();\n" + 
5014
		"	^\n" + 
5047
		"	^\n" + 
5015
//		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5048
//		"Null pointer access: The variable o can only be null at this location\n" + 
5016
		"The variable o may be null\n" +
5049
		"Potential null pointer access: The variable o may be null at this location\n" +
5017
		// conservative flow analysis softens the error
5050
		// conservative flow analysis softens the error
5018
		"----------\n");
5051
		"----------\n");
5019
}
5052
}
Lines 5048-5055 Link Here
5048
		"1. ERROR in X.java (at line 12)\n" + 
5081
		"1. ERROR in X.java (at line 12)\n" + 
5049
		"	o.toString();\n" + 
5082
		"	o.toString();\n" + 
5050
		"	^\n" + 
5083
		"	^\n" + 
5051
//		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5084
//		"Null pointer access: The variable o can only be null at this location\n" + 
5052
		"The variable o may be null\n" +
5085
		"Potential null pointer access: The variable o may be null at this location\n" +
5053
		// conservative flow analysis softens the error
5086
		// conservative flow analysis softens the error
5054
		"----------\n");
5087
		"----------\n");
5055
}
5088
}
Lines 5086-5092 Link Here
5086
		"1. ERROR in X.java (at line 19)\n" + 
5119
		"1. ERROR in X.java (at line 19)\n" + 
5087
		"	if (c == null) { // should complain: c can only be null\n" + 
5120
		"	if (c == null) { // should complain: c can only be null\n" + 
5088
		"	    ^\n" + 
5121
		"	    ^\n" + 
5089
		"The variable c can only be null; it was either set to null or checked for null when last used\n" + 
5122
		"Redundant null check: The variable c can only be null at this location\n" +  
5090
		"----------\n");
5123
		"----------\n");
5091
}
5124
}
5092
5125
Lines 5113-5119 Link Here
5113
		"1. ERROR in X.java (at line 7)\n" + 
5146
		"1. ERROR in X.java (at line 7)\n" + 
5114
		"	o.toString();\n" + 
5147
		"	o.toString();\n" + 
5115
		"	^\n" + 
5148
		"	^\n" + 
5116
		"The variable o may be null\n" + 
5149
		"Potential null pointer access: The variable o may be null at this location\n" + 
5117
		"----------\n");
5150
		"----------\n");
5118
}
5151
}
5119
5152
Lines 5140-5146 Link Here
5140
		"1. ERROR in X.java (at line 8)\n" + 
5173
		"1. ERROR in X.java (at line 8)\n" + 
5141
		"	o.toString();\n" + 
5174
		"	o.toString();\n" + 
5142
		"	^\n" + 
5175
		"	^\n" + 
5143
		"The variable o may be null\n" + 
5176
		"Potential null pointer access: The variable o may be null at this location\n" + 
5144
		"----------\n");
5177
		"----------\n");
5145
}
5178
}
5146
5179
Lines 5177-5183 Link Here
5177
		"1. ERROR in X.java (at line 20)\n" + 
5210
		"1. ERROR in X.java (at line 20)\n" + 
5178
		"	if (ex == null) {\n" + 
5211
		"	if (ex == null) {\n" + 
5179
		"	    ^^\n" + 
5212
		"	    ^^\n" + 
5180
		"The variable ex cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
5213
		"Null comparison always yields false: The variable ex cannot be null at this location\n" +  
5181
		"----------\n");
5214
		"----------\n");
5182
}
5215
}
5183
5216
Lines 5271-5277 Link Here
5271
		"1. ERROR in X.java (at line 5)\n" + 
5304
		"1. ERROR in X.java (at line 5)\n" + 
5272
		"	while (o.toString() != null);\n" + 
5305
		"	while (o.toString() != null);\n" + 
5273
		"	       ^\n" + 
5306
		"	       ^\n" + 
5274
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5307
		"Null pointer access: The variable o can only be null at this location\n" + 
5275
		"----------\n");
5308
		"----------\n");
5276
}
5309
}
5277
5310
Lines 5292-5298 Link Here
5292
		"1. ERROR in X.java (at line 5)\n" + 
5325
		"1. ERROR in X.java (at line 5)\n" + 
5293
		"	while (o != null);\n" + 
5326
		"	while (o != null);\n" + 
5294
		"	       ^\n" + 
5327
		"	       ^\n" + 
5295
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5328
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
5296
		"----------\n");
5329
		"----------\n");
5297
}
5330
}
5298
5331
Lines 5315-5321 Link Here
5315
		"1. ERROR in X.java (at line 7)\n" + 
5348
		"1. ERROR in X.java (at line 7)\n" + 
5316
		"	while (o == null);\n" + 
5349
		"	while (o == null);\n" + 
5317
		"	       ^\n" + 
5350
		"	       ^\n" + 
5318
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
5351
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
5319
		"----------\n");
5352
		"----------\n");
5320
}
5353
}
5321
5354
Lines 5357-5363 Link Here
5357
		"1. ERROR in X.java (at line 8)\n" + 
5390
		"1. ERROR in X.java (at line 8)\n" + 
5358
		"	while (dummy || o != null);\n" + 
5391
		"	while (dummy || o != null);\n" + 
5359
		"	                ^\n" + 
5392
		"	                ^\n" + 
5360
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5393
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
5361
		"----------\n");
5394
		"----------\n");
5362
}
5395
}
5363
5396
Lines 5407-5413 Link Here
5407
		"1. ERROR in X.java (at line 6)\n" + 
5440
		"1. ERROR in X.java (at line 6)\n" + 
5408
		"	o.toString();\n" + 
5441
		"	o.toString();\n" + 
5409
		"	^\n" + 
5442
		"	^\n" + 
5410
		"The variable o may be null\n" + 
5443
		"Potential null pointer access: The variable o may be null at this location\n" + 
5411
		"----------\n");
5444
		"----------\n");
5412
}
5445
}
5413
5446
Lines 5448-5454 Link Here
5448
		"1. ERROR in X.java (at line 7)\n" + 
5481
		"1. ERROR in X.java (at line 7)\n" + 
5449
		"	o.toString();\n" + 
5482
		"	o.toString();\n" + 
5450
		"	^\n" + 
5483
		"	^\n" + 
5451
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5484
		"Null pointer access: The variable o can only be null at this location\n" + 
5452
		"----------\n");
5485
		"----------\n");
5453
}
5486
}
5454
5487
Lines 5491-5497 Link Here
5491
		"1. ERROR in X.java (at line 9)\n" + 
5524
		"1. ERROR in X.java (at line 9)\n" + 
5492
		"	if (o != null) { /* */ }\n" + 
5525
		"	if (o != null) { /* */ }\n" + 
5493
		"	    ^\n" + 
5526
		"	    ^\n" + 
5494
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
5527
		"Redundant null check: The variable o cannot be null at this location\n" + 
5495
		"----------\n");
5528
		"----------\n");
5496
}
5529
}
5497
5530
Lines 5519-5525 Link Here
5519
		"1. ERROR in X.java (at line 6)\n" + 
5552
		"1. ERROR in X.java (at line 6)\n" + 
5520
		"	if (o == null) {\n" + 
5553
		"	if (o == null) {\n" + 
5521
		"	    ^\n" + 
5554
		"	    ^\n" + 
5522
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5555
		"Redundant null check: The variable o can only be null at this location\n" + 
5523
		"----------\n"
5556
		"----------\n"
5524
	);
5557
	);
5525
}
5558
}
Lines 5567-5573 Link Here
5567
		"1. ERROR in X.java (at line 6)\n" + 
5600
		"1. ERROR in X.java (at line 6)\n" + 
5568
		"	if (o == null) {\n" + 
5601
		"	if (o == null) {\n" + 
5569
		"	    ^\n" + 
5602
		"	    ^\n" + 
5570
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5603
		"Redundant null check: The variable o can only be null at this location\n" + 
5571
		"----------\n"
5604
		"----------\n"
5572
	);
5605
	);
5573
}
5606
}
Lines 5593-5599 Link Here
5593
		"1. ERROR in X.java (at line 6)\n" + 
5626
		"1. ERROR in X.java (at line 6)\n" + 
5594
		"	if (o == null) {\n" + 
5627
		"	if (o == null) {\n" + 
5595
		"	    ^\n" + 
5628
		"	    ^\n" + 
5596
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5629
		"Redundant null check: The variable o can only be null at this location\n" + 
5597
		"----------\n"
5630
		"----------\n"
5598
	);
5631
	);
5599
}
5632
}
Lines 5614-5620 Link Here
5614
		"1. ERROR in X.java (at line 4)\n" + 
5647
		"1. ERROR in X.java (at line 4)\n" + 
5615
		"	for (;o.toString() != null;) {/* */}\n" + 
5648
		"	for (;o.toString() != null;) {/* */}\n" + 
5616
		"	      ^\n" + 
5649
		"	      ^\n" + 
5617
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5650
		"Null pointer access: The variable o can only be null at this location\n" + 
5618
		"----------\n");
5651
		"----------\n");
5619
}
5652
}
5620
5653
Lines 5634-5640 Link Here
5634
		"1. ERROR in X.java (at line 4)\n" + 
5667
		"1. ERROR in X.java (at line 4)\n" + 
5635
		"	for (;o != null;) {/* */}\n" + 
5668
		"	for (;o != null;) {/* */}\n" + 
5636
		"	      ^\n" + 
5669
		"	      ^\n" + 
5637
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5670
		"Null comparison always yields false: The variable o can only be null at this location\n" +  
5638
		"----------\n");
5671
		"----------\n");
5639
}
5672
}
5640
5673
Lines 5696-5702 Link Here
5696
		"1. ERROR in X.java (at line 7)\n" + 
5729
		"1. ERROR in X.java (at line 7)\n" + 
5697
		"	o.toString();\n" + 
5730
		"	o.toString();\n" + 
5698
		"	^\n" + 
5731
		"	^\n" + 
5699
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5732
		"Null pointer access: The variable o can only be null at this location\n" + 
5700
		"----------\n");
5733
		"----------\n");
5701
}
5734
}
5702
5735
Lines 5730-5736 Link Here
5730
		"1. ERROR in X.java (at line 3)\n" + 
5763
		"1. ERROR in X.java (at line 3)\n" + 
5731
		"	for (;o == null; o.toString()) {\n" + 
5764
		"	for (;o == null; o.toString()) {\n" + 
5732
		"	                 ^\n" + 
5765
		"	                 ^\n" + 
5733
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5766
		"Null pointer access: The variable o can only be null at this location\n" + 
5734
		"----------\n");
5767
		"----------\n");
5735
}
5768
}
5736
5769
Lines 5748-5754 Link Here
5748
		"1. ERROR in X.java (at line 3)\n" + 
5781
		"1. ERROR in X.java (at line 3)\n" + 
5749
		"	for (o.toString(); o == null;) { /* */ }\n" + 
5782
		"	for (o.toString(); o == null;) { /* */ }\n" + 
5750
		"	                   ^\n" + 
5783
		"	                   ^\n" + 
5751
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
5784
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
5752
		"----------\n");
5785
		"----------\n");
5753
}
5786
}
5754
5787
Lines 5771-5777 Link Here
5771
		"1. ERROR in X.java (at line 7)\n" + 
5804
		"1. ERROR in X.java (at line 7)\n" + 
5772
		"	for (o.toString(); bar();) {\n" + 
5805
		"	for (o.toString(); bar();) {\n" + 
5773
		"	     ^\n" + 
5806
		"	     ^\n" + 
5774
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
5807
		"Null pointer access: The variable o can only be null at this location\n" + 
5775
		"----------\n");
5808
		"----------\n");
5776
}
5809
}
5777
5810
Lines 5792-5798 Link Here
5792
			"1. ERROR in X.java (at line 4)\n" + 
5825
			"1. ERROR in X.java (at line 4)\n" + 
5793
			"	for (Object o : t) {/* */}\n" + 
5826
			"	for (Object o : t) {/* */}\n" + 
5794
			"	                ^\n" + 
5827
			"	                ^\n" + 
5795
			"The variable t can only be null; it was either set to null or checked for null when last used\n" + 
5828
			"Null pointer access: The variable t can only be null at this location\n" +  
5796
			"----------\n");
5829
			"----------\n");
5797
	}
5830
	}
5798
}
5831
}
Lines 5814-5820 Link Here
5814
			"1. ERROR in X.java (at line 4)\n" + 
5847
			"1. ERROR in X.java (at line 4)\n" + 
5815
			"	for (Object o : i) {/* */}\n" + 
5848
			"	for (Object o : i) {/* */}\n" + 
5816
			"	                ^\n" + 
5849
			"	                ^\n" + 
5817
			"The variable i can only be null; it was either set to null or checked for null when last used\n" + 
5850
			"Null pointer access: The variable i can only be null at this location\n" +  
5818
			"----------\n");
5851
			"----------\n");
5819
	}
5852
	}
5820
}
5853
}
Lines 5872-5878 Link Here
5872
			"1. ERROR in X.java (at line 8)\n" + 
5905
			"1. ERROR in X.java (at line 8)\n" + 
5873
			"	flag.toString();\n" + 
5906
			"	flag.toString();\n" + 
5874
			"	^^^^\n" + 
5907
			"	^^^^\n" + 
5875
			"The variable flag may be null\n" + 
5908
			"Potential null pointer access: The variable flag may be null at this location\n" + 
5876
			"----------\n");
5909
			"----------\n");
5877
	}
5910
	}
5878
}
5911
}
Lines 5895-5901 Link Here
5895
			"1. ERROR in X.java (at line 6)\n" + 
5928
			"1. ERROR in X.java (at line 6)\n" + 
5896
			"	flag.toString();\n" + 
5929
			"	flag.toString();\n" + 
5897
			"	^^^^\n" + 
5930
			"	^^^^\n" + 
5898
			"The variable flag can only be null; it was either set to null or checked for null when last used\n" + 
5931
			"Null pointer access: The variable flag can only be null at this location\n" +  
5899
			"----------\n");
5932
			"----------\n");
5900
	}
5933
	}
5901
}
5934
}
Lines 5919-5925 Link Here
5919
			"1. ERROR in X.java (at line 7)\n" + 
5952
			"1. ERROR in X.java (at line 7)\n" + 
5920
			"	flag.toString();\n" + 
5953
			"	flag.toString();\n" + 
5921
			"	^^^^\n" + 
5954
			"	^^^^\n" + 
5922
			"The variable flag may be null\n" + 
5955
			"Potential null pointer access: The variable flag may be null at this location\n" + 
5923
			"----------\n");
5956
			"----------\n");
5924
	}
5957
	}
5925
}
5958
}
Lines 5940-5946 Link Here
5940
		"1. ERROR in X.java (at line 5)\n" + 
5973
		"1. ERROR in X.java (at line 5)\n" + 
5941
		"	flag.toString();\n" + 
5974
		"	flag.toString();\n" + 
5942
		"	^^^^\n" + 
5975
		"	^^^^\n" + 
5943
		"The variable flag can only be null; it was either set to null or checked for null when last used\n" + 
5976
		"Null pointer access: The variable flag can only be null at this location\n" +  
5944
		"----------\n");
5977
		"----------\n");
5945
}
5978
}
5946
5979
Lines 5992-5998 Link Here
5992
		"1. ERROR in X.java (at line 5)\n" + 
6025
		"1. ERROR in X.java (at line 5)\n" + 
5993
		"	if (o == null) {\n" + 
6026
		"	if (o == null) {\n" + 
5994
		"	    ^\n" + 
6027
		"	    ^\n" + 
5995
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6028
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
5996
		"----------\n");
6029
		"----------\n");
5997
}
6030
}
5998
	
6031
	
Lines 6037-6043 Link Here
6037
		"1. ERROR in X.java (at line 6)\n" + 
6070
		"1. ERROR in X.java (at line 6)\n" + 
6038
		"	if (o == null) {\n" + 
6071
		"	if (o == null) {\n" + 
6039
		"	    ^\n" + 
6072
		"	    ^\n" + 
6040
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
6073
		"Redundant null check: The variable o can only be null at this location\n" + 
6041
		"----------\n");
6074
		"----------\n");
6042
}
6075
}
6043
	
6076
	
Lines 6207-6213 Link Here
6207
		"1. ERROR in X.java (at line 6)\n" + 
6240
		"1. ERROR in X.java (at line 6)\n" + 
6208
		"	if (o != null) { /* */ }\n" + 
6241
		"	if (o != null) { /* */ }\n" + 
6209
		"	    ^\n" + 
6242
		"	    ^\n" + 
6210
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6243
		"Redundant null check: The variable o cannot be null at this location\n" + 
6211
		"----------\n");
6244
		"----------\n");
6212
}
6245
}
6213
6246
Lines 6231-6237 Link Here
6231
		"1. ERROR in X.java (at line 9)\n" + 
6264
		"1. ERROR in X.java (at line 9)\n" + 
6232
		"	if (o != null) { /* */ }\n" + 
6265
		"	if (o != null) { /* */ }\n" + 
6233
		"	    ^\n" + 
6266
		"	    ^\n" + 
6234
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6267
		"Redundant null check: The variable o cannot be null at this location\n" + 
6235
		"----------\n");
6268
		"----------\n");
6236
}
6269
}
6237
6270
Lines 6382-6388 Link Here
6382
		"1. ERROR in X.java (at line 11)\n" + 
6415
		"1. ERROR in X.java (at line 11)\n" + 
6383
		"	if (b.booleanValue()) {\n" + 
6416
		"	if (b.booleanValue()) {\n" + 
6384
		"	    ^\n" + 
6417
		"	    ^\n" + 
6385
		"The variable b can only be null; it was either set to null or checked for null when last used\n" + 
6418
		"Null pointer access: The variable b can only be null at this location\n" +  
6386
		"----------\n");
6419
		"----------\n");
6387
}
6420
}
6388
6421
Lines 6460-6466 Link Here
6460
		"1. ERROR in X.java (at line 12)\n" + 
6493
		"1. ERROR in X.java (at line 12)\n" + 
6461
		"	if(o == null) { /* */ }\n" + 
6494
		"	if(o == null) { /* */ }\n" + 
6462
		"	   ^\n" + 
6495
		"	   ^\n" + 
6463
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6496
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
6464
		"----------\n");
6497
		"----------\n");
6465
}
6498
}
6466
6499
Lines 6484-6490 Link Here
6484
		"1. ERROR in X.java (at line 7)\n" + 
6517
		"1. ERROR in X.java (at line 7)\n" + 
6485
		"	o.toString();\n" + 
6518
		"	o.toString();\n" + 
6486
		"	^\n" + 
6519
		"	^\n" + 
6487
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
6520
		"Null pointer access: The variable o can only be null at this location\n" + 
6488
		"----------\n");
6521
		"----------\n");
6489
}
6522
}
6490
6523
Lines 6510-6516 Link Here
6510
		"1. ERROR in X.java (at line 9)\n" + 
6543
		"1. ERROR in X.java (at line 9)\n" + 
6511
		"	o.toString();\n" + 
6544
		"	o.toString();\n" + 
6512
		"	^\n" + 
6545
		"	^\n" + 
6513
		"The variable o may be null\n" + 
6546
		"Potential null pointer access: The variable o may be null at this location\n" + 
6514
		"----------\n");
6547
		"----------\n");
6515
}
6548
}
6516
6549
Lines 6540-6546 Link Here
6540
		"1. ERROR in X.java (at line 15)\n" + 
6573
		"1. ERROR in X.java (at line 15)\n" + 
6541
		"	if(o != null) { /* */ }\n" + 
6574
		"	if(o != null) { /* */ }\n" + 
6542
		"	   ^\n" + 
6575
		"	   ^\n" + 
6543
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6576
		"Redundant null check: The variable o cannot be null at this location\n" + 
6544
		"----------\n");
6577
		"----------\n");
6545
}
6578
}
6546
6579
Lines 6677-6708 Link Here
6677
		"1. ERROR in X.java (at line 6)\n" + 
6710
		"1. ERROR in X.java (at line 6)\n" + 
6678
		"	o/*N N*/.toString();\n" + 
6711
		"	o/*N N*/.toString();\n" + 
6679
		"	^\n" + 
6712
		"	^\n" + 
6680
		"The variable o may be null\n" + 
6713
		"Potential null pointer access: The variable o may be null at this location\n" + 
6681
		"----------\n" + 
6714
		"----------\n" + 
6682
		"2. ERROR in X.java (at line 10)\n" + 
6715
		"2. ERROR in X.java (at line 10)\n" + 
6683
		"	o/*NNa*/.toString();\n" + 
6716
		"	o/*NNa*/.toString();\n" + 
6684
		"	^\n" + 
6717
		"	^\n" + 
6685
		"The variable o may be null\n" + 
6718
		"Potential null pointer access: The variable o may be null at this location\n" + 
6686
		"----------\n" + 
6719
		"----------\n" + 
6687
		"3. ERROR in X.java (at line 14)\n" + 
6720
		"3. ERROR in X.java (at line 14)\n" + 
6688
		"	o/*aNN */.toString();\n" + 
6721
		"	o/*aNN */.toString();\n" + 
6689
		"	^\n" + 
6722
		"	^\n" + 
6690
		"The variable o may be null\n" + 
6723
		"Potential null pointer access: The variable o may be null at this location\n" + 
6691
		"----------\n" + 
6724
		"----------\n" + 
6692
		"4. ERROR in X.java (at line 18)\n" + 
6725
		"4. ERROR in X.java (at line 18)\n" + 
6693
		"	o/*NON NULL*/.toString();\n" + 
6726
		"	o/*NON NULL*/.toString();\n" + 
6694
		"	^\n" + 
6727
		"	^\n" + 
6695
		"The variable o may be null\n" + 
6728
		"Potential null pointer access: The variable o may be null at this location\n" + 
6696
		"----------\n" + 
6729
		"----------\n" + 
6697
		"5. ERROR in X.java (at line 22)\n" + 
6730
		"5. ERROR in X.java (at line 22)\n" + 
6698
		"	o/*Non-Null*/.toString();\n" + 
6731
		"	o/*Non-Null*/.toString();\n" + 
6699
		"	^\n" + 
6732
		"	^\n" + 
6700
		"The variable o may be null\n" + 
6733
		"Potential null pointer access: The variable o may be null at this location\n" + 
6701
		"----------\n" + 
6734
		"----------\n" + 
6702
		"6. ERROR in X.java (at line 26)\n" + 
6735
		"6. ERROR in X.java (at line 26)\n" + 
6703
		"	o/*aNON-NULL */.toString();\n" + 
6736
		"	o/*aNON-NULL */.toString();\n" + 
6704
		"	^\n" + 
6737
		"	^\n" + 
6705
		"The variable o may be null\n" + 
6738
		"Potential null pointer access: The variable o may be null at this location\n" + 
6706
		"----------\n");
6739
		"----------\n");
6707
}
6740
}
6708
6741
Lines 6722-6728 Link Here
6722
		"1. ERROR in X.java (at line 4)\n" + 
6755
		"1. ERROR in X.java (at line 4)\n" + 
6723
		"	o.toString();/*NN*/\n" + 
6756
		"	o.toString();/*NN*/\n" + 
6724
		"	^\n" + 
6757
		"	^\n" + 
6725
		"The variable o may be null\n" + 
6758
		"Potential null pointer access: The variable o may be null at this location\n" + 
6726
		"----------\n");
6759
		"----------\n");
6727
}
6760
}
6728
6761
Lines 6741-6747 Link Here
6741
		"1. ERROR in X.java (at line 4)\n" + 
6774
		"1. ERROR in X.java (at line 4)\n" + 
6742
		"	/*NN*/o.toString();\n" + 
6775
		"	/*NN*/o.toString();\n" + 
6743
		"	      ^\n" + 
6776
		"	      ^\n" + 
6744
		"The variable o may be null\n" + 
6777
		"Potential null pointer access: The variable o may be null at this location\n" + 
6745
		"----------\n");
6778
		"----------\n");
6746
}
6779
}
6747
6780
Lines 6780-6786 Link Here
6780
		"1. ERROR in X.java (at line 4)\n" + 
6813
		"1. ERROR in X.java (at line 4)\n" + 
6781
		"	o.toString();\n" + 
6814
		"	o.toString();\n" + 
6782
		"	^\n" + 
6815
		"	^\n" + 
6783
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
6816
		"Null pointer access: The variable o can only be null at this location\n" + 
6784
		"----------\n");
6817
		"----------\n");
6785
	}
6818
	}
6786
}
6819
}
Lines 6802-6808 Link Here
6802
		"1. ERROR in X.java (at line 4)\n" + 
6835
		"1. ERROR in X.java (at line 4)\n" + 
6803
		"	o.toString();\n" + 
6836
		"	o.toString();\n" + 
6804
		"	^\n" + 
6837
		"	^\n" + 
6805
		"The variable o may be null\n" + 
6838
		"Potential null pointer access: The variable o may be null at this location\n" + 
6806
		"----------\n");
6839
		"----------\n");
6807
	}
6840
	}
6808
}
6841
}
Lines 6821-6837 Link Here
6821
				"    if (o2 == null) { };\n" + 		// complain
6854
				"    if (o2 == null) { };\n" + 		// complain
6822
				"  }\n" + 
6855
				"  }\n" + 
6823
				"}\n"},
6856
				"}\n"},
6824
		"----------\n" + 
6857
			"----------\n" + 
6825
		"1. ERROR in X.java (at line 4)\n" + 
6858
			"1. ERROR in X.java (at line 4)\n" + 
6826
		"	if (o1 == null) { };\n" + 
6859
			"	if (o1 == null) { };\n" + 
6827
		"	    ^^\n" + 
6860
			"	    ^^\n" + 
6828
		"The variable o1 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6861
			"Null comparison always yields false: The variable o1 cannot be null at this location\n" + 
6829
		"----------\n" + 
6862
			"----------\n" + 
6830
		"2. ERROR in X.java (at line 5)\n" + 
6863
			"2. ERROR in X.java (at line 5)\n" + 
6831
		"	if (o2 == null) { };\n" + 
6864
			"	if (o2 == null) { };\n" + 
6832
		"	    ^^\n" + 
6865
			"	    ^^\n" + 
6833
		"The variable o2 can only be null; it was either set to null or checked for null when last used\n" + 
6866
			"Redundant null check: The variable o2 can only be null at this location\n" + 
6834
		"----------\n");
6867
			"----------\n");
6835
	}
6868
	}
6836
}
6869
}
6837
6870
Lines 6869-6875 Link Here
6869
		"1. ERROR in X.java (at line 4)\n" + 
6902
		"1. ERROR in X.java (at line 4)\n" + 
6870
		"	if (o == null) { };\n" + 
6903
		"	if (o == null) { };\n" + 
6871
		"	    ^\n" + 
6904
		"	    ^\n" + 
6872
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6905
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
6873
		"----------\n");
6906
		"----------\n");
6874
	}
6907
	}
6875
}
6908
}
Lines 6892-6903 Link Here
6892
		"1. ERROR in X.java (at line 4)\n" + 
6925
		"1. ERROR in X.java (at line 4)\n" + 
6893
		"	assert(o != null);\n" + 
6926
		"	assert(o != null);\n" + 
6894
		"	       ^\n" + 
6927
		"	       ^\n" + 
6895
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
6928
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
6896
		"----------\n" + 
6929
		"----------\n" + 
6897
		"2. ERROR in X.java (at line 5)\n" + 
6930
		"2. ERROR in X.java (at line 5)\n" + 
6898
		"	if (o == null) { };\n" + 
6931
		"	if (o == null) { };\n" + 
6899
		"	    ^\n" + 
6932
		"	    ^\n" + 
6900
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
6933
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
6901
		"----------\n");
6934
		"----------\n");
6902
	}
6935
	}
6903
}
6936
}
Lines 7058-7084 Link Here
7058
		"1. ERROR in X.java (at line 4)\n" + 
7091
		"1. ERROR in X.java (at line 4)\n" + 
7059
		"	if (x != null) { // 1\n" + 
7092
		"	if (x != null) { // 1\n" + 
7060
		"	    ^\n" + 
7093
		"	    ^\n" + 
7061
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7094
		"Redundant null check: The variable x cannot be null at this location\n" + 
7062
		"----------\n" + 
7095
		"----------\n" + 
7063
		"2. ERROR in X.java (at line 5)\n" + 
7096
		"2. ERROR in X.java (at line 5)\n" + 
7064
		"	if (x == null) { // 2\n" + 
7097
		"	if (x == null) { // 2\n" + 
7065
		"	    ^\n" + 
7098
		"	    ^\n" + 
7066
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7099
		"Null comparison always yields false: The variable x cannot be null at this location\n" + 
7067
		"----------\n" + 
7100
		"----------\n" + 
7068
		"3. ERROR in X.java (at line 6)\n" + 
7101
		"3. ERROR in X.java (at line 6)\n" + 
7069
		"	x.foo(null); // 3\n" + 
7102
		"	x.foo(null); // 3\n" + 
7070
		"	^\n" + 
7103
		"	^\n" + 
7071
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
7104
		"Null pointer access: The variable x can only be null at this location\n" + 
7072
		"----------\n" + 
7105
		"----------\n" + 
7073
		"4. ERROR in X.java (at line 9)\n" + 
7106
		"4. ERROR in X.java (at line 9)\n" + 
7074
		"	} else if (x != null) { // 6\n" + 
7107
		"	} else if (x != null) { // 6\n" + 
7075
		"	           ^\n" + 
7108
		"	           ^\n" + 
7076
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7109
		"Redundant null check: The variable x cannot be null at this location\n" + 
7077
		"----------\n" + 
7110
		"----------\n" + 
7078
		"5. ERROR in X.java (at line 12)\n" + 
7111
		"5. ERROR in X.java (at line 12)\n" + 
7079
		"	x.foo(null); // 8\n" + 
7112
		"	x.foo(null); // 8\n" + 
7080
		"	^\n" + 
7113
		"	^\n" + 
7081
		"The variable x may be null\n" + 
7114
		"Potential null pointer access: The variable x may be null at this location\n" + 
7082
		"----------\n");
7115
		"----------\n");
7083
}
7116
}
7084
7117
Lines 7182-7188 Link Here
7182
		"1. ERROR in X.java (at line 22)\n" + 
7215
		"1. ERROR in X.java (at line 22)\n" + 
7183
		"	if (c == null) {// should complain: c can only be null\n" + 
7216
		"	if (c == null) {// should complain: c can only be null\n" + 
7184
		"	    ^\n" + 
7217
		"	    ^\n" + 
7185
		"The variable c can only be null; it was either set to null or checked for null when last used\n" + 
7218
		"Redundant null check: The variable c can only be null at this location\n" +  
7186
		"----------\n");
7219
		"----------\n");
7187
}
7220
}
7188
7221
Lines 7229-7235 Link Here
7229
		"1. ERROR in X.java (at line 9)\n" + 
7262
		"1. ERROR in X.java (at line 9)\n" + 
7230
		"	if (other != null) {\n" + 
7263
		"	if (other != null) {\n" + 
7231
		"	    ^^^^^\n" + 
7264
		"	    ^^^^^\n" + 
7232
		"The variable other cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7265
		"Redundant null check: The variable other cannot be null at this location\n" +  
7233
		"----------\n");
7266
		"----------\n");
7234
}
7267
}
7235
7268
Lines 7256-7262 Link Here
7256
		"1. ERROR in X.java (at line 6)\n" + 
7289
		"1. ERROR in X.java (at line 6)\n" + 
7257
		"	if (o == null) {\n" + 
7290
		"	if (o == null) {\n" + 
7258
		"	    ^\n" + 
7291
		"	    ^\n" + 
7259
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7292
		"Redundant null check: The variable o can only be null at this location\n" + 
7260
		"----------\n"
7293
		"----------\n"
7261
	);
7294
	);
7262
}
7295
}
Lines 7280-7291 Link Here
7280
		"1. ERROR in X.java (at line 4)\n" + 
7313
		"1. ERROR in X.java (at line 4)\n" + 
7281
		"	if (x == null) {\n" + 
7314
		"	if (x == null) {\n" + 
7282
		"	    ^\n" + 
7315
		"	    ^\n" + 
7283
		"The variable x cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7316
		"Null comparison always yields false: The variable x cannot be null at this location\n" + 
7284
		"----------\n" + 
7317
		"----------\n" + 
7285
		"2. ERROR in X.java (at line 5)\n" + 
7318
		"2. ERROR in X.java (at line 5)\n" + 
7286
		"	x.foo(this);\n" + 
7319
		"	x.foo(this);\n" + 
7287
		"	^\n" + 
7320
		"	^\n" + 
7288
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
7321
		"Null pointer access: The variable x can only be null at this location\n" + 
7289
		"----------\n");
7322
		"----------\n");
7290
}
7323
}
7291
7324
Lines 7307-7313 Link Here
7307
		"1. ERROR in X.java (at line 7)\n" + 
7340
		"1. ERROR in X.java (at line 7)\n" + 
7308
		"	x.foo(null);\n" + 
7341
		"	x.foo(null);\n" + 
7309
		"	^\n" + 
7342
		"	^\n" + 
7310
		"The variable x may be null\n" + 
7343
		"Potential null pointer access: The variable x may be null at this location\n" + 
7311
		"----------\n");
7344
		"----------\n");
7312
}
7345
}
7313
7346
Lines 7351-7362 Link Here
7351
		"1. ERROR in X.java (at line 5)\n" + 
7384
		"1. ERROR in X.java (at line 5)\n" + 
7352
		"	x = null;\n" + 
7385
		"	x = null;\n" + 
7353
		"	^\n" + 
7386
		"	^\n" + 
7354
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
7387
		"Redundant assignment: The variable x can only be null at this location\n" + 
7355
		"----------\n" + 
7388
		"----------\n" + 
7356
		"2. ERROR in X.java (at line 7)\n" + 
7389
		"2. ERROR in X.java (at line 7)\n" + 
7357
		"	if (x != null) {\n" + 
7390
		"	if (x != null) {\n" + 
7358
		"	    ^\n" + 
7391
		"	    ^\n" + 
7359
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
7392
		"Null comparison always yields false: The variable x can only be null at this location\n" + 
7360
		"----------\n");
7393
		"----------\n");
7361
}
7394
}
7362
7395
Lines 7380-7386 Link Here
7380
		"1. ERROR in X.java (at line 8)\n" + 
7413
		"1. ERROR in X.java (at line 8)\n" + 
7381
		"	x.foo(null);\n" + 
7414
		"	x.foo(null);\n" + 
7382
		"	^\n" + 
7415
		"	^\n" + 
7383
		"The variable x can only be null; it was either set to null or checked for null when last used\n" + 
7416
		"Null pointer access: The variable x can only be null at this location\n" + 
7384
		"----------\n");
7417
		"----------\n");
7385
}
7418
}
7386
7419
Lines 7405-7416 Link Here
7405
		"1. ERROR in X.java (at line 6)\r\n" + 
7438
		"1. ERROR in X.java (at line 6)\r\n" + 
7406
		"	if (o != null) return;\r\n" + 
7439
		"	if (o != null) return;\r\n" + 
7407
		"	    ^\n" + 
7440
		"	    ^\n" + 
7408
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7441
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
7409
		"----------\n" + 
7442
		"----------\n" + 
7410
		"2. ERROR in X.java (at line 7)\r\n" + 
7443
		"2. ERROR in X.java (at line 7)\r\n" + 
7411
		"	o = null;\r\n" + 
7444
		"	o = null;\r\n" + 
7412
		"	^\n" + 
7445
		"	^\n" + 
7413
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7446
		"Redundant assignment: The variable o can only be null at this location\n" + 
7414
		"----------\n");
7447
		"----------\n");
7415
}
7448
}
7416
7449
Lines 7528-7534 Link Here
7528
		"1. ERROR in X.java (at line 13)\n" + 
7561
		"1. ERROR in X.java (at line 13)\n" + 
7529
		"	if (o == null) return;\n" + 
7562
		"	if (o == null) return;\n" + 
7530
		"	    ^\n" + 
7563
		"	    ^\n" + 
7531
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7564
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
7532
		"----------\n");
7565
		"----------\n");
7533
}
7566
}
7534
7567
Lines 7561-7567 Link Here
7561
		"1. ERROR in X.java (at line 13)\n" + 
7594
		"1. ERROR in X.java (at line 13)\n" + 
7562
		"	if (progressJob == null) {\n" + 
7595
		"	if (progressJob == null) {\n" + 
7563
		"	    ^^^^^^^^^^^\n" + 
7596
		"	    ^^^^^^^^^^^\n" + 
7564
		"The variable progressJob can only be null; it was either set to null or checked for null when last used\n" + 
7597
		"Redundant null check: The variable progressJob can only be null at this location\n" +  
7565
		"----------\n");
7598
		"----------\n");
7566
}
7599
}
7567
7600
Lines 7585-7591 Link Here
7585
		"1. ERROR in X.java (at line 10)\n" + 
7618
		"1. ERROR in X.java (at line 10)\n" + 
7586
		"	if (o == null) return;\n" + 
7619
		"	if (o == null) return;\n" + 
7587
		"	    ^\n" + 
7620
		"	    ^\n" + 
7588
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7621
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
7589
		"----------\n");
7622
		"----------\n");
7590
}
7623
}
7591
7624
Lines 7700-7706 Link Here
7700
		"1. ERROR in X.java (at line 7)\n" + 
7733
		"1. ERROR in X.java (at line 7)\n" + 
7701
		"	if (a == null) {\n" + 
7734
		"	if (a == null) {\n" + 
7702
		"	    ^\n" + 
7735
		"	    ^\n" + 
7703
		"The variable a can only be null; it was either set to null or checked for null when last used\n" + 
7736
		"Redundant null check: The variable a can only be null at this location\n" +  
7704
		"----------\n");
7737
		"----------\n");
7705
}
7738
}
7706
7739
Lines 7729-7740 Link Here
7729
		"1. ERROR in X.java (at line 7)\n" + 
7762
		"1. ERROR in X.java (at line 7)\n" + 
7730
		"	if (a == null) {\n" + 
7763
		"	if (a == null) {\n" + 
7731
		"	    ^\n" + 
7764
		"	    ^\n" + 
7732
		"The variable a can only be null; it was either set to null or checked for null when last used\n" + 
7765
		"Redundant null check: The variable a can only be null at this location\n" + 
7733
		"----------\n" + 
7766
		"----------\n" + 
7734
		"2. ERROR in X.java (at line 13)\n" + 
7767
		"2. ERROR in X.java (at line 13)\n" + 
7735
		"	if (a == null) {\n" + 
7768
		"	if (a == null) {\n" + 
7736
		"	    ^\n" + 
7769
		"	    ^\n" + 
7737
		"The variable a cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7770
		"Null comparison always yields false: The variable a cannot be null at this location\n" + 
7738
		"----------\n");
7771
		"----------\n");
7739
}
7772
}
7740
7773
Lines 7755-7766 Link Here
7755
		"1. ERROR in X.java (at line 5)\n" + 
7788
		"1. ERROR in X.java (at line 5)\n" + 
7756
		"	while (o1 != null && (o3 = o1) != null) {\n" + 
7789
		"	while (o1 != null && (o3 = o1) != null) {\n" + 
7757
		"	       ^^\n" + 
7790
		"	       ^^\n" + 
7758
		"The variable o1 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7791
		"Redundant null check: The variable o1 cannot be null at this location\n" + 
7759
		"----------\n" + 
7792
		"----------\n" + 
7760
		"2. ERROR in X.java (at line 5)\n" + 
7793
		"2. ERROR in X.java (at line 5)\n" + 
7761
		"	while (o1 != null && (o3 = o1) != null) {\n" + 
7794
		"	while (o1 != null && (o3 = o1) != null) {\n" + 
7762
		"	                     ^^^^^^^^^\n" + 
7795
		"	                     ^^^^^^^^^\n" + 
7763
		"The variable o3 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7796
		"Redundant null check: The variable o3 cannot be null at this location\n" + 
7764
		"----------\n");
7797
		"----------\n");
7765
}
7798
}
7766
7799
Lines 7784-7795 Link Here
7784
		"1. ERROR in X.java (at line 7)\n" + 
7817
		"1. ERROR in X.java (at line 7)\n" + 
7785
		"	}while(a!=null);\n" + 
7818
		"	}while(a!=null);\n" + 
7786
		"	       ^\n" + 
7819
		"	       ^\n" + 
7787
		"The variable a cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
7820
		"Redundant null check: The variable a cannot be null at this location\n" + 
7788
		"----------\n" + 
7821
		"----------\n" + 
7789
		"2. ERROR in X.java (at line 8)\n" + 
7822
		"2. ERROR in X.java (at line 8)\n" + 
7790
		"	if(a!=null)\n" + 
7823
		"	if(a!=null)\n" + 
7791
		"	   ^\n" + 
7824
		"	   ^\n" + 
7792
		"The variable a can only be null; it was either set to null or checked for null when last used\n" + 
7825
		"Null comparison always yields false: The variable a can only be null at this location\n" + 
7793
		"----------\n");
7826
		"----------\n");
7794
}
7827
}
7795
7828
Lines 7851-7862 Link Here
7851
		"1. ERROR in X.java (at line 7)\n" + 
7884
		"1. ERROR in X.java (at line 7)\n" + 
7852
		"	} while (o != null);\n" + 
7885
		"	} while (o != null);\n" + 
7853
		"	         ^\n" + 
7886
		"	         ^\n" + 
7854
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7887
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
7855
		"----------\n" + 
7888
		"----------\n" + 
7856
		"2. ERROR in X.java (at line 8)\n" + 
7889
		"2. ERROR in X.java (at line 8)\n" + 
7857
		"	if (o == null) {\n" + 
7890
		"	if (o == null) {\n" + 
7858
		"	    ^\n" + 
7891
		"	    ^\n" + 
7859
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7892
		"Redundant null check: The variable o can only be null at this location\n" + 
7860
		"----------\n");
7893
		"----------\n");
7861
}
7894
}
7862
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704
7895
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704
Lines 7936-7952 Link Here
7936
		"1. ERROR in X.java (at line 4)\r\n" + 
7969
		"1. ERROR in X.java (at line 4)\r\n" + 
7937
		"	if (o != null) {\r\n" + 
7970
		"	if (o != null) {\r\n" + 
7938
		"	    ^\n" + 
7971
		"	    ^\n" + 
7939
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7972
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
7940
		"----------\n" + 
7973
		"----------\n" + 
7941
		"2. ERROR in X.java (at line 8)\r\n" + 
7974
		"2. ERROR in X.java (at line 8)\r\n" + 
7942
		"	o.toString();\r\n" + 
7975
		"	o.toString();\r\n" + 
7943
		"	^\n" + 
7976
		"	^\n" + 
7944
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
7977
		"Null pointer access: The variable o can only be null at this location\n" + 
7945
		"----------\n" + 
7978
		"----------\n" + 
7946
		"3. ERROR in X.java (at line 9)\r\n" + 
7979
		"3. ERROR in X.java (at line 9)\r\n" + 
7947
		"	p.toString();\r\n" + 
7980
		"	p.toString();\r\n" + 
7948
		"	^\n" + 
7981
		"	^\n" + 
7949
		"The variable p may be null\n" + 
7982
		"Potential null pointer access: The variable p may be null at this location\n" + 
7950
		"----------\n");
7983
		"----------\n");
7951
}
7984
}
7952
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704
7985
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704
Lines 7975-7981 Link Here
7975
		"1. ERROR in X.java (at line 8)\r\n" + 
8008
		"1. ERROR in X.java (at line 8)\r\n" + 
7976
		"	o.toString();\r\n" + 
8009
		"	o.toString();\r\n" + 
7977
		"	^\n" + 
8010
		"	^\n" + 
7978
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
8011
		"Null pointer access: The variable o can only be null at this location\n" + 
7979
		"----------\n",
8012
		"----------\n",
7980
		null /* no extra class libraries */, 
8013
		null /* no extra class libraries */, 
7981
		true /* flush output directory */, 
8014
		true /* flush output directory */, 
Lines 8012-8023 Link Here
8012
		"1. ERROR in X.java (at line 4)\r\n" + 
8045
		"1. ERROR in X.java (at line 4)\r\n" + 
8013
		"	if (o != null) {\r\n" + 
8046
		"	if (o != null) {\r\n" + 
8014
		"	    ^\n" + 
8047
		"	    ^\n" + 
8015
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
8048
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
8016
		"----------\n" + 
8049
		"----------\n" + 
8017
		"2. WARNING in X.java (at line 8)\r\n" + 
8050
		"2. WARNING in X.java (at line 8)\r\n" + 
8018
		"	o.toString();\r\n" + 
8051
		"	o.toString();\r\n" + 
8019
		"	^\n" + 
8052
		"	^\n" + 
8020
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
8053
		"Null pointer access: The variable o can only be null at this location\n" + 
8021
		"----------\n",
8054
		"----------\n",
8022
		null /* no extra class libraries */, 
8055
		null /* no extra class libraries */, 
8023
		true /* flush output directory */, 
8056
		true /* flush output directory */, 
Lines 8054-8065 Link Here
8054
		"1. ERROR in X.java (at line 4)\r\n" + 
8087
		"1. ERROR in X.java (at line 4)\r\n" + 
8055
		"	if (o != null) {\r\n" + 
8088
		"	if (o != null) {\r\n" + 
8056
		"	    ^\n" + 
8089
		"	    ^\n" + 
8057
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
8090
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
8058
		"----------\n" + 
8091
		"----------\n" + 
8059
		"2. ERROR in X.java (at line 9)\r\n" + 
8092
		"2. ERROR in X.java (at line 9)\r\n" + 
8060
		"	p.toString();\r\n" + 
8093
		"	p.toString();\r\n" + 
8061
		"	^\n" + 
8094
		"	^\n" + 
8062
		"The variable p may be null\n" + 
8095
		"Potential null pointer access: The variable p may be null at this location\n" + 
8063
		"----------\n",
8096
		"----------\n",
8064
		null /* no extra class libraries */, 
8097
		null /* no extra class libraries */, 
8065
		true /* flush output directory */, 
8098
		true /* flush output directory */, 
Lines 8098-8104 Link Here
8098
		"1. ERROR in X.java (at line 9)\r\n" + 
8131
		"1. ERROR in X.java (at line 9)\r\n" + 
8099
		"	o.toString();\r\n" + 
8132
		"	o.toString();\r\n" + 
8100
		"	^\n" + 
8133
		"	^\n" + 
8101
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
8134
		"Null pointer access: The variable o can only be null at this location\n" + 
8102
		"----------\n",
8135
		"----------\n",
8103
		null /* no extra class libraries */, 
8136
		null /* no extra class libraries */, 
8104
		true /* flush output directory */, 
8137
		true /* flush output directory */, 
Lines 8128-8134 Link Here
8128
		"1. ERROR in X.java (at line 5)\n" + 
8161
		"1. ERROR in X.java (at line 5)\n" + 
8129
		"	if (o instanceof String) {};\n" + 
8162
		"	if (o instanceof String) {};\n" + 
8130
		"	    ^\n" + 
8163
		"	    ^\n" + 
8131
		"The variable o can only be null; it was either set to null or checked for null when last used\n" + 
8164
		"instanceof always yields false: The variable o can only be null at this location\n" + 
8132
		"----------\n");
8165
		"----------\n");
8133
}
8166
}
8134
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704
8167
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=170704
Lines 8310-8316 Link Here
8310
		"1. ERROR in X.java (at line 18)\n" + 
8343
		"1. ERROR in X.java (at line 18)\n" + 
8311
		"	if (o65 == null) { /* */ }\n" + 
8344
		"	if (o65 == null) { /* */ }\n" + 
8312
		"	    ^^^\n" + 
8345
		"	    ^^^\n" + 
8313
		"The variable o65 cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
8346
		"Null comparison always yields false: The variable o65 cannot be null at this location\n" +  
8314
		"----------\n");
8347
		"----------\n");
8315
}
8348
}
8316
8349
Lines 8566-8572 Link Here
8566
		"1. ERROR in X.java (at line 20)\n" + 
8599
		"1. ERROR in X.java (at line 20)\n" + 
8567
		"	if (o == null) { /* */ }\n" + 
8600
		"	if (o == null) { /* */ }\n" + 
8568
		"	    ^\n" + 
8601
		"	    ^\n" + 
8569
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
8602
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
8570
		"----------\n");
8603
		"----------\n");
8571
}
8604
}
8572
8605
Lines 8602-8608 Link Here
8602
		"1. ERROR in X.java (at line 21)\n" + 
8635
		"1. ERROR in X.java (at line 21)\n" + 
8603
		"	if (o == null) { /* */ }\n" + 
8636
		"	if (o == null) { /* */ }\n" + 
8604
		"	    ^\n" + 
8637
		"	    ^\n" + 
8605
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
8638
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
8606
		"----------\n");
8639
		"----------\n");
8607
}
8640
}
8608
8641
Lines 8641-8647 Link Here
8641
		"1. ERROR in X.java (at line 24)\n" + 
8674
		"1. ERROR in X.java (at line 24)\n" + 
8642
		"	if (o == null) { /* */ }\n" + 
8675
		"	if (o == null) { /* */ }\n" + 
8643
		"	    ^\n" + 
8676
		"	    ^\n" + 
8644
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
8677
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
8645
		"----------\n");
8678
		"----------\n");
8646
}
8679
}
8647
8680
Lines 8680-8686 Link Here
8680
		"1. ERROR in X.java (at line 24)\n" + 
8713
		"1. ERROR in X.java (at line 24)\n" + 
8681
		"	if (o == null) { /* */ }\n" + 
8714
		"	if (o == null) { /* */ }\n" + 
8682
		"	    ^\n" + 
8715
		"	    ^\n" + 
8683
		"The variable o cannot be null; it was either set to a non-null value or assumed to be non-null when last used\n" + 
8716
		"Null comparison always yields false: The variable o cannot be null at this location\n" + 
8684
		"----------\n");
8717
		"----------\n");
8685
}
8718
}
8686
8719
Lines 8710-8716 Link Here
8710
		"1. ERROR in X.java (at line 15)\n" + 
8743
		"1. ERROR in X.java (at line 15)\n" + 
8711
		"	o.toString();\n" + 
8744
		"	o.toString();\n" + 
8712
		"	^\n" + 
8745
		"	^\n" + 
8713
		"The variable o may be null\n" + 
8746
		"Potential null pointer access: The variable o may be null at this location\n" + 
8714
		"----------\n");
8747
		"----------\n");
8715
}
8748
}
8716
8749
Lines 8942-8948 Link Here
8942
		"2. ERROR in X.java (at line 18)\n" + 
8975
		"2. ERROR in X.java (at line 18)\n" + 
8943
		"	o.toString();\n" + 
8976
		"	o.toString();\n" + 
8944
		"	^\n" + 
8977
		"	^\n" + 
8945
		"The variable o may be null\n" + 
8978
		"Potential null pointer access: The variable o may be null at this location\n" + 
8946
		"----------\n");
8979
		"----------\n");
8947
}
8980
}
8948
8981
Lines 8979-8985 Link Here
8979
		"2. ERROR in X.java (at line 18)\n" + 
9012
		"2. ERROR in X.java (at line 18)\n" + 
8980
		"	o.toString();\n" + 
9013
		"	o.toString();\n" + 
8981
		"	^\n" + 
9014
		"	^\n" + 
8982
		"The variable o may be null\n" + 
9015
		"Potential null pointer access: The variable o may be null at this location\n" + 
8983
		"----------\n");
9016
		"----------\n");
8984
}
9017
}
8985
9018
Lines 9024-9030 Link Here
9024
		"2. ERROR in X.java (at line 26)\n" + 
9057
		"2. ERROR in X.java (at line 26)\n" + 
9025
		"	o1.toString();\n" + 
9058
		"	o1.toString();\n" + 
9026
		"	^^\n" + 
9059
		"	^^\n" + 
9027
		"The variable o1 may be null\n" + 
9060
		"Potential null pointer access: The variable o1 may be null at this location\n" + 
9028
		"----------\n");
9061
		"----------\n");
9029
}
9062
}
9030
}
9063
}
(-)compiler/org/eclipse/jdt/core/compiler/IProblem.java (-7 / +31 lines)
Lines 99-104 Link Here
99
 *                                 TypeHidingTypeParameterFromType
99
 *                                 TypeHidingTypeParameterFromType
100
 *                                 TypeHidingTypeParameterFromMethod
100
 *                                 TypeHidingTypeParameterFromMethod
101
 *                                 TypeHidingType
101
 *                                 TypeHidingType
102
 *     IBM Corporation - added the following constants
103
 *								   NullLocalVariableReference
104
 *								   PotentialNullLocalVariableReference
105
 *								   RedundantNullCheckOnNullLocalVariable
106
 * 								   NullLocalVariableComparisonYieldsFalse
107
 * 								   RedundantLocalVariableNullAssignment
108
 * 								   NullLocalVariableInstanceofYieldsFalse
109
 * 								   RedundantNullCheckOnNonNullLocalVariable
110
 * 								   NonNullLocalVariableComparisonYieldsFalse
102
 *******************************************************************************/
111
 *******************************************************************************/
103
package org.eclipse.jdt.core.compiler;
112
package org.eclipse.jdt.core.compiler;
104
 
113
 
Lines 718-732 Link Here
718
	// local variable related problems
727
	// local variable related problems
719
	int DuplicateModifierForVariable = MethodRelated + 395;
728
	int DuplicateModifierForVariable = MethodRelated + 395;
720
	int IllegalModifierForVariable = MethodRelated + 396;
729
	int IllegalModifierForVariable = MethodRelated + 396;
721
	/** @since 3.1 */
730
	/** @deprecated - problem is no longer generated, use {@link #RedundantNullCheckOnNonNullLocalVariable} instead */
722
	int LocalVariableCannotBeNull = Internal + 397; // since 3.3: semantics are LocalVariableRedundantCheckOnNonNull
731
	int LocalVariableCannotBeNull = Internal + 397; // since 3.3: semantics are LocalVariableRedundantCheckOnNonNull
723
	/** @since 3.1 */
732
	/** @deprecated - problem is no longer generated, use {@link #NullLocalVariableReference}, {@link #RedundantNullCheckOnNullLocalVariable} or {@link #RedundantLocalVariableNullAssignment} instead */
724
	int LocalVariableCanOnlyBeNull = Internal + 398; // since 3.3: split with LocalVariableRedundantCheckOnNull depending on context
733
	int LocalVariableCanOnlyBeNull = Internal + 398; // since 3.3: split with LocalVariableRedundantCheckOnNull depending on context
725
													 //            this id shares the null dereference errors with LocalVariableMayBeNull
734
	/** @deprecated - problem is no longer generated, use {@link #PotentialNullLocalVariableReference} instead */
726
	/** @since 3.2 */
727
	int LocalVariableMayBeNull = Internal + 399;
735
	int LocalVariableMayBeNull = Internal + 399;
728
	/** @since 3.3 */
729
	int LocalVariableRedundantCheckOnNull = Internal + 392;
730
736
731
	// method verifier problems
737
	// method verifier problems
732
	int AbstractMethodMustBeImplemented = MethodRelated + 400;
738
	int AbstractMethodMustBeImplemented = MethodRelated + 400;
Lines 775-785 Link Here
775
	int UseEnumAsAnIdentifier = Internal + 441;
781
	int UseEnumAsAnIdentifier = Internal + 441;
776
	/** @since 3.2 */
782
	/** @since 3.2 */
777
	int EnumConstantsCannotBeSurroundedByParenthesis = Syntax + Internal + 442;
783
	int EnumConstantsCannotBeSurroundedByParenthesis = Syntax + Internal + 442;
778
	
784
779
	// detected task
785
	// detected task
780
	/** @since 2.1 */
786
	/** @since 2.1 */
781
	int Task = Internal + 450;
787
	int Task = Internal + 450;
782
	
788
	
789
	// local variables related problems, cont'd
790
	/** @since 3.3 */
791
	int NullLocalVariableReference = Internal + 451;
792
	/** @since 3.3 */
793
	int PotentialNullLocalVariableReference = Internal + 452;
794
	/** @since 3.3 */
795
	int RedundantNullCheckOnNullLocalVariable = Internal + 453;
796
	/** @since 3.3 */
797
	int NullLocalVariableComparisonYieldsFalse = Internal + 454;
798
	/** @since 3.3 */
799
	int RedundantLocalVariableNullAssignment = Internal + 455;
800
	/** @since 3.3 */
801
	int NullLocalVariableInstanceofYieldsFalse = Internal + 456;
802
	/** @since 3.3 */
803
	int RedundantNullCheckOnNonNullLocalVariable = Internal + 457;
804
	/** @since 3.3 */
805
	int NonNullLocalVariableComparisonYieldsFalse = Internal + 458;
806
783
	// block
807
	// block
784
	/** @since 3.0 */
808
	/** @since 3.0 */
785
	int UndocumentedEmptyBlock = Internal + 460;
809
	int UndocumentedEmptyBlock = Internal + 460;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java (-4 / +9 lines)
Lines 36-56 Link Here
36
	private void checkVariableComparison(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo, FlowInfo initsWhenTrue, FlowInfo initsWhenFalse, LocalVariableBinding local, int nullStatus, Expression reference) {
36
	private void checkVariableComparison(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo, FlowInfo initsWhenTrue, FlowInfo initsWhenFalse, LocalVariableBinding local, int nullStatus, Expression reference) {
37
		switch (nullStatus) {
37
		switch (nullStatus) {
38
			case FlowInfo.NULL :
38
			case FlowInfo.NULL :
39
				flowContext.recordUsingNullReference(scope, local, reference, 
40
					FlowContext.CAN_ONLY_NULL_NON_NULL, flowInfo);
41
				if (((this.bits & OperatorMASK) >> OperatorSHIFT) == EQUAL_EQUAL) {
39
				if (((this.bits & OperatorMASK) >> OperatorSHIFT) == EQUAL_EQUAL) {
40
					flowContext.recordUsingNullReference(scope, local, reference, 
41
							FlowContext.CAN_ONLY_NULL_NON_NULL | FlowContext.IN_COMPARISON_NULL, flowInfo);
42
					initsWhenTrue.markAsComparedEqualToNull(local); // from thereon it is set
42
					initsWhenTrue.markAsComparedEqualToNull(local); // from thereon it is set
43
					initsWhenFalse.markAsComparedEqualToNonNull(local); // from thereon it is set
43
					initsWhenFalse.markAsComparedEqualToNonNull(local); // from thereon it is set
44
				} else {
44
				} else {
45
					flowContext.recordUsingNullReference(scope, local, reference, 
46
							FlowContext.CAN_ONLY_NULL_NON_NULL | FlowContext.IN_COMPARISON_NON_NULL, flowInfo);
45
					initsWhenTrue.markAsComparedEqualToNonNull(local); // from thereon it is set
47
					initsWhenTrue.markAsComparedEqualToNonNull(local); // from thereon it is set
46
					initsWhenFalse.markAsComparedEqualToNull(local); // from thereon it is set
48
					initsWhenFalse.markAsComparedEqualToNull(local); // from thereon it is set
47
				}
49
				}
48
				break;
50
				break;
49
			case FlowInfo.NON_NULL :
51
			case FlowInfo.NON_NULL :
50
				flowContext.recordUsingNullReference(scope, local, reference, 
51
					FlowContext.CAN_ONLY_NULL, flowInfo);
52
				if (((this.bits & OperatorMASK) >> OperatorSHIFT) == EQUAL_EQUAL) {
52
				if (((this.bits & OperatorMASK) >> OperatorSHIFT) == EQUAL_EQUAL) {
53
					flowContext.recordUsingNullReference(scope, local, reference, 
54
							FlowContext.CAN_ONLY_NULL | FlowContext.IN_COMPARISON_NON_NULL, flowInfo);
53
					initsWhenTrue.markAsComparedEqualToNonNull(local); // from thereon it is set
55
					initsWhenTrue.markAsComparedEqualToNonNull(local); // from thereon it is set
56
				} else {
57
					flowContext.recordUsingNullReference(scope, local, reference, 
58
							FlowContext.CAN_ONLY_NULL | FlowContext.IN_COMPARISON_NULL, flowInfo);
54
				}
59
				}
55
				break;
60
				break;
56
		}	
61
		}	
(-)compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java (-1 / +1 lines)
Lines 38-44 Link Here
38
	LocalVariableBinding local = this.expression.localVariableBinding();
38
	LocalVariableBinding local = this.expression.localVariableBinding();
39
	if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) {
39
	if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) {
40
		flowContext.recordUsingNullReference(currentScope, local, 
40
		flowContext.recordUsingNullReference(currentScope, local, 
41
			this.expression, FlowContext.CAN_ONLY_NULL, flowInfo);
41
			this.expression, FlowContext.CAN_ONLY_NULL | FlowContext.IN_INSTANCEOF, flowInfo);
42
		flowInfo = expression.analyseCode(currentScope, flowContext, flowInfo).
42
		flowInfo = expression.analyseCode(currentScope, flowContext, flowInfo).
43
			unconditionalInits();
43
			unconditionalInits();
44
		FlowInfo initsWhenTrue = flowInfo.copy();
44
		FlowInfo initsWhenTrue = flowInfo.copy();
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java (-1 / +1 lines)
Lines 42-48 Link Here
42
	if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) {
42
	if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) {
43
		if (nullStatus == FlowInfo.NULL) {
43
		if (nullStatus == FlowInfo.NULL) {
44
			flowContext.recordUsingNullReference(currentScope, local, this.lhs, 
44
			flowContext.recordUsingNullReference(currentScope, local, this.lhs, 
45
				FlowContext.CAN_ONLY_NULL, flowInfo);
45
				FlowContext.CAN_ONLY_NULL | FlowContext.IN_ASSIGNMENT, flowInfo);
46
		}
46
		}
47
	}
47
	}
48
	flowInfo = ((Reference) lhs)
48
	flowInfo = ((Reference) lhs)
(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-4 / +12 lines)
Lines 320-332 Link Here
320
###[obsolete] 394 = The imported type {0} is defined in an inherited type and an enclosing scope
320
###[obsolete] 394 = The imported type {0} is defined in an inherited type and an enclosing scope
321
321
322
391 = The static import {0} must be a field or member type
322
391 = The static import {0} must be a field or member type
323
392 = The variable {0} can only be null; it was either set to null or checked for null when last used
324
323
325
395 = Duplicate modifier for the variable {0}
324
395 = Duplicate modifier for the variable {0}
326
396 = Illegal modifier for the variable {0}; only final is permitted
325
396 = Illegal modifier for the variable {0}; only final is permitted
327
397 = The variable {0} cannot be null; it was either set to a non-null value or assumed to be non-null when last used
326
###[obsolete] 397 = Redundant null check: The variable {0} cannot be null at this location
328
398 = The variable {0} can only be null; it was either set to null or checked for null when last used
327
###[obsolete] 398 = Null pointer access: The variable {0} can only be null at this location
329
399 = The variable {0} may be null
328
###[obsolete] 399 = Potential null pointer access: The variable {0} may be null at this location
330
	
329
	
331
400 = The type {3} must implement the inherited abstract method {2}.{0}({1})
330
400 = The type {3} must implement the inherited abstract method {2}.{0}({1})
332
401 = Cannot override the final method from {0}
331
401 = Cannot override the final method from {0}
Lines 362-367 Link Here
362
361
363
450 = {0} {1}
362
450 = {0} {1}
364
363
364
451 = Null pointer access: The variable {0} can only be null at this location
365
452 = Potential null pointer access: The variable {0} may be null at this location
366
453 = Redundant null check: The variable {0} can only be null at this location
367
454 = Null comparison always yields false: The variable {0} can only be null at this location
368
455 = Redundant assignment: The variable {0} can only be null at this location
369
456 = instanceof always yields false: The variable {0} can only be null at this location
370
457 = Redundant null check: The variable {0} cannot be null at this location
371
458 = Null comparison always yields false: The variable {0} cannot be null at this location
372
365
460 = Empty block should be documented
373
460 = Empty block should be documented
366
374
367
### DOC 
375
### DOC 
(-)compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java (-33 / +85 lines)
Lines 184-197 Link Here
184
		case IProblem.ConstructorVarargsArgumentNeedCast :
184
		case IProblem.ConstructorVarargsArgumentNeedCast :
185
			return CompilerOptions.VarargsArgumentNeedCast;
185
			return CompilerOptions.VarargsArgumentNeedCast;
186
186
187
		case IProblem.LocalVariableCanOnlyBeNull:
187
		case IProblem.NullLocalVariableReference:
188
			return CompilerOptions.NullReference;
188
			return CompilerOptions.NullReference;
189
189
190
		case IProblem.LocalVariableMayBeNull:
190
		case IProblem.PotentialNullLocalVariableReference:
191
			return CompilerOptions.PotentialNullReference;
191
			return CompilerOptions.PotentialNullReference;
192
			
192
			
193
		case IProblem.LocalVariableCannotBeNull:
193
		case IProblem.RedundantLocalVariableNullAssignment:
194
		case IProblem.LocalVariableRedundantCheckOnNull:
194
		case IProblem.RedundantNullCheckOnNonNullLocalVariable:
195
		case IProblem.RedundantNullCheckOnNullLocalVariable:
196
		case IProblem.NonNullLocalVariableComparisonYieldsFalse:
197
		case IProblem.NullLocalVariableComparisonYieldsFalse:
198
		case IProblem.NullLocalVariableInstanceofYieldsFalse:
195
			return CompilerOptions.RedundantNullCheck;
199
			return CompilerOptions.RedundantNullCheck;
196
			
200
			
197
		case IProblem.BoxingConversion :
201
		case IProblem.BoxingConversion :
Lines 4385-4414 Link Here
4385
	}
4389
	}
4386
	return argument;
4390
	return argument;
4387
}
4391
}
4388
public void localVariableCannotBeNull(LocalVariableBinding local, ASTNode location) {
4389
	int severity = computeSeverity(IProblem.LocalVariableCannotBeNull);
4390
	if (severity == ProblemSeverities.Ignore) return;
4391
	String[] arguments = new String[] {new String(local.name)  };
4392
	this.handle(
4393
		IProblem.LocalVariableCannotBeNull,
4394
		arguments,
4395
		arguments,
4396
		severity,
4397
		nodeSourceStart(local, location),
4398
		nodeSourceEnd(local, location));
4399
}
4400
public void localVariableCanOnlyBeNull(LocalVariableBinding local, ASTNode location) {
4401
	int severity = computeSeverity(IProblem.LocalVariableCanOnlyBeNull);
4402
	if (severity == ProblemSeverities.Ignore) return;
4403
	String[] arguments = new String[] {new String(local.name)  };
4404
	this.handle(
4405
		IProblem.LocalVariableCanOnlyBeNull,
4406
		arguments,
4407
		arguments,
4408
		severity,
4409
		nodeSourceStart(local, location),
4410
		nodeSourceEnd(local, location));
4411
}
4412
public void localVariableHiding(LocalDeclaration local, Binding hiddenVariable, boolean  isSpecialArgHidingField) {
4392
public void localVariableHiding(LocalDeclaration local, Binding hiddenVariable, boolean  isSpecialArgHidingField) {
4413
	if (hiddenVariable instanceof LocalVariableBinding) {
4393
	if (hiddenVariable instanceof LocalVariableBinding) {
4414
		int id = (local instanceof Argument) 
4394
		int id = (local instanceof Argument) 
Lines 4443-4454 Link Here
4443
			local.sourceEnd);
4423
			local.sourceEnd);
4444
	}
4424
	}
4445
}
4425
}
4446
public void localVariableMayBeNull(LocalVariableBinding local, ASTNode location) {
4426
public void localVariableNonNullComparedToNull(LocalVariableBinding local, ASTNode location) {
4447
	int severity = computeSeverity(IProblem.LocalVariableMayBeNull);
4427
	int severity = computeSeverity(IProblem.NonNullLocalVariableComparisonYieldsFalse);
4428
	if (severity == ProblemSeverities.Ignore) return;
4429
	String[] arguments = new String[] {new String(local.name)  };
4430
	this.handle(
4431
		IProblem.NonNullLocalVariableComparisonYieldsFalse,
4432
		arguments,
4433
		arguments,
4434
		severity,
4435
		nodeSourceStart(local, location),
4436
		nodeSourceEnd(local, location));
4437
}
4438
public void localVariableNullComparedToNonNull(LocalVariableBinding local, ASTNode location) {
4439
	int severity = computeSeverity(IProblem.NullLocalVariableComparisonYieldsFalse);
4440
	if (severity == ProblemSeverities.Ignore) return;
4441
	String[] arguments = new String[] {new String(local.name)  };
4442
	this.handle(
4443
		IProblem.NullLocalVariableComparisonYieldsFalse,
4444
		arguments,
4445
		arguments,
4446
		severity,
4447
		nodeSourceStart(local, location),
4448
		nodeSourceEnd(local, location));
4449
}
4450
public void localVariableNullInstanceof(LocalVariableBinding local, ASTNode location) {
4451
	int severity = computeSeverity(IProblem.NullLocalVariableInstanceofYieldsFalse);
4452
	if (severity == ProblemSeverities.Ignore) return;
4453
	String[] arguments = new String[] {new String(local.name)  };
4454
	this.handle(
4455
		IProblem.NullLocalVariableInstanceofYieldsFalse,
4456
		arguments,
4457
		arguments,
4458
		severity,
4459
		nodeSourceStart(local, location),
4460
		nodeSourceEnd(local, location));
4461
}
4462
public void localVariableNullReference(LocalVariableBinding local, ASTNode location) {
4463
	int severity = computeSeverity(IProblem.NullLocalVariableReference);
4464
	if (severity == ProblemSeverities.Ignore) return;
4465
	String[] arguments = new String[] {new String(local.name)  };
4466
	this.handle(
4467
		IProblem.NullLocalVariableReference,
4468
		arguments,
4469
		arguments,
4470
		severity,
4471
		nodeSourceStart(local, location),
4472
		nodeSourceEnd(local, location));
4473
}
4474
public void localVariablePotentialNullReference(LocalVariableBinding local, ASTNode location) {
4475
	int severity = computeSeverity(IProblem.PotentialNullLocalVariableReference);
4448
	if (severity == ProblemSeverities.Ignore) return;
4476
	if (severity == ProblemSeverities.Ignore) return;
4449
	String[] arguments = new String[] {new String(local.name)};
4477
	String[] arguments = new String[] {new String(local.name)};
4450
	this.handle(
4478
	this.handle(
4451
		IProblem.LocalVariableMayBeNull,
4479
		IProblem.PotentialNullLocalVariableReference,
4480
		arguments,
4481
		arguments,
4482
		severity,
4483
		nodeSourceStart(local, location),
4484
		nodeSourceEnd(local, location));
4485
}
4486
public void localVariableRedundantCheckOnNonNull(LocalVariableBinding local, ASTNode location) {
4487
	int severity = computeSeverity(IProblem.RedundantNullCheckOnNonNullLocalVariable);
4488
	if (severity == ProblemSeverities.Ignore) return;
4489
	String[] arguments = new String[] {new String(local.name)  };
4490
	this.handle(
4491
		IProblem.RedundantNullCheckOnNonNullLocalVariable,
4452
		arguments,
4492
		arguments,
4453
		arguments,
4493
		arguments,
4454
		severity,
4494
		severity,
Lines 4456-4466 Link Here
4456
		nodeSourceEnd(local, location));
4496
		nodeSourceEnd(local, location));
4457
}
4497
}
4458
public void localVariableRedundantCheckOnNull(LocalVariableBinding local, ASTNode location) {
4498
public void localVariableRedundantCheckOnNull(LocalVariableBinding local, ASTNode location) {
4459
	int severity = computeSeverity(IProblem.LocalVariableRedundantCheckOnNull);
4499
	int severity = computeSeverity(IProblem.RedundantNullCheckOnNullLocalVariable);
4500
	if (severity == ProblemSeverities.Ignore) return;
4501
	String[] arguments = new String[] {new String(local.name)  };
4502
	this.handle(
4503
		IProblem.RedundantNullCheckOnNullLocalVariable,
4504
		arguments,
4505
		arguments,
4506
		severity,
4507
		nodeSourceStart(local, location),
4508
		nodeSourceEnd(local, location));
4509
}
4510
public void localVariableRedundantNullAssignment(LocalVariableBinding local, ASTNode location) {
4511
	int severity = computeSeverity(IProblem.RedundantLocalVariableNullAssignment);
4460
	if (severity == ProblemSeverities.Ignore) return;
4512
	if (severity == ProblemSeverities.Ignore) return;
4461
	String[] arguments = new String[] {new String(local.name)  };
4513
	String[] arguments = new String[] {new String(local.name)  };
4462
	this.handle(
4514
	this.handle(
4463
		IProblem.LocalVariableRedundantCheckOnNull,
4515
		IProblem.RedundantLocalVariableNullAssignment,
4464
		arguments,
4516
		arguments,
4465
		arguments,
4517
		arguments,
4466
		severity,
4518
		severity,
(-)compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java (-21 / +80 lines)
Lines 92-114 Link Here
92
			// final local variable
92
			// final local variable
93
			LocalVariableBinding local = this.nullLocals[i];
93
			LocalVariableBinding local = this.nullLocals[i];
94
			switch (this.nullCheckTypes[i]) {
94
			switch (this.nullCheckTypes[i]) {
95
				case CAN_ONLY_NULL_NON_NULL :
95
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
96
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
96
					if (flowInfo.isDefinitelyNonNull(local)) {
97
					if (flowInfo.isDefinitelyNonNull(local)) {
97
						scope.problemReporter().localVariableCannotBeNull(local, expression);				
98
						if (this.nullCheckTypes[i] == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
99
							scope.problemReporter().localVariableRedundantCheckOnNonNull(local, expression);
100
						} else {
101
							scope.problemReporter().localVariableNonNullComparedToNull(local, expression);
102
						}
98
						continue;
103
						continue;
99
					}
104
					}
100
				case CAN_ONLY_NULL:
105
				case CAN_ONLY_NULL | IN_COMPARISON_NULL:
106
				case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
107
				case CAN_ONLY_NULL | IN_ASSIGNMENT:
108
				case CAN_ONLY_NULL | IN_INSTANCEOF:
101
					if (flowInfo.isDefinitelyNull(local)) {
109
					if (flowInfo.isDefinitelyNull(local)) {
102
						scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
110
						switch(this.nullCheckTypes[i] & CONTEXT_MASK) {
111
							case FlowContext.IN_COMPARISON_NULL:
112
								scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
113
								continue;
114
							case FlowContext.IN_COMPARISON_NON_NULL:
115
								scope.problemReporter().localVariableNullComparedToNonNull(local, expression);
116
								continue;
117
							case FlowContext.IN_ASSIGNMENT:
118
								scope.problemReporter().localVariableRedundantNullAssignment(local, expression);
119
								continue;
120
							case FlowContext.IN_INSTANCEOF:
121
								scope.problemReporter().localVariableNullInstanceof(local, expression);
122
								continue;
123
						}
103
					}
124
					}
104
					break;
125
					break;
105
				case MAY_NULL :
126
				case MAY_NULL:
106
					if (flowInfo.isDefinitelyNull(local)) {
127
					if (flowInfo.isDefinitelyNull(local)) {
107
						scope.problemReporter().localVariableCanOnlyBeNull(local, expression);
128
						scope.problemReporter().localVariableNullReference(local, expression);
108
						continue;
129
						continue;
109
					}
130
					}
110
					if (flowInfo.isPotentiallyNull(local)) {
131
					if (flowInfo.isPotentiallyNull(local)) {
111
						scope.problemReporter().localVariableMayBeNull(local, expression);
132
						scope.problemReporter().localVariablePotentialNullReference(local, expression);
112
					}
133
					}
113
					break;
134
					break;
114
				default:
135
				default:
Lines 161-177 Link Here
161
		if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0)	{
182
		if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0)	{
162
		if (deferNullDiagnostic) { // within an enclosing loop, be conservative
183
		if (deferNullDiagnostic) { // within an enclosing loop, be conservative
163
			switch (checkType) {
184
			switch (checkType) {
164
				case CAN_ONLY_NULL_NON_NULL :
185
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
165
				case CAN_ONLY_NULL:
186
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
187
				case CAN_ONLY_NULL | IN_COMPARISON_NULL:
188
				case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
189
				case CAN_ONLY_NULL | IN_ASSIGNMENT:
190
				case CAN_ONLY_NULL | IN_INSTANCEOF:
166
					if (flowInfo.cannotBeNull(local)) {
191
					if (flowInfo.cannotBeNull(local)) {
167
						if (checkType == CAN_ONLY_NULL_NON_NULL) {
192
						if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
168
							scope.problemReporter().localVariableCannotBeNull(local, reference);
193
							scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
194
						} else {
195
							scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
169
						}
196
						}
170
						return;
197
						return;
171
					}
198
					}
172
					if (flowInfo.canOnlyBeNull(local)) {
199
					if (flowInfo.canOnlyBeNull(local)) {
173
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
200
						switch(checkType & CONTEXT_MASK) {
174
						return;
201
							case FlowContext.IN_COMPARISON_NULL:
202
								scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
203
								return;
204
							case FlowContext.IN_COMPARISON_NON_NULL:
205
								scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
206
								return;
207
							case FlowContext.IN_ASSIGNMENT:
208
								scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
209
								return;
210
							case FlowContext.IN_INSTANCEOF:
211
								scope.problemReporter().localVariableNullInstanceof(local, reference);
212
								return;
213
						}
175
					}
214
					}
176
					break;
215
					break;
177
				case MAY_NULL :
216
				case MAY_NULL :
Lines 179-185 Link Here
179
						return;
218
						return;
180
					}
219
					}
181
					if (flowInfo.canOnlyBeNull(local)) {
220
					if (flowInfo.canOnlyBeNull(local)) {
182
						scope.problemReporter().localVariableCanOnlyBeNull(local, reference);
221
						scope.problemReporter().localVariableNullReference(local, reference);
183
						return;
222
						return;
184
					}
223
					}
185
					break;
224
					break;
Lines 189-212 Link Here
189
		}
228
		}
190
		else { // no enclosing loop, be as precise as possible right now
229
		else { // no enclosing loop, be as precise as possible right now
191
			switch (checkType) {
230
			switch (checkType) {
192
				case CAN_ONLY_NULL_NON_NULL :
231
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
232
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
193
					if (flowInfo.isDefinitelyNonNull(local)) {
233
					if (flowInfo.isDefinitelyNonNull(local)) {
194
						scope.problemReporter().localVariableCannotBeNull(local, reference);				
234
						if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
235
							scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
236
						} else {
237
							scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
238
						}
195
						return;
239
						return;
196
					}
240
					}
197
				case CAN_ONLY_NULL:
241
				case CAN_ONLY_NULL | IN_COMPARISON_NULL:
242
				case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
243
				case CAN_ONLY_NULL | IN_ASSIGNMENT:
244
				case CAN_ONLY_NULL | IN_INSTANCEOF:
198
					if (flowInfo.isDefinitelyNull(local)) {
245
					if (flowInfo.isDefinitelyNull(local)) {
199
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
246
						switch(checkType & CONTEXT_MASK) {
200
						return;
247
							case FlowContext.IN_COMPARISON_NULL:
248
								scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
249
								return;
250
							case FlowContext.IN_COMPARISON_NON_NULL:
251
								scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
252
								return;
253
							case FlowContext.IN_ASSIGNMENT:
254
								scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
255
								return;
256
							case FlowContext.IN_INSTANCEOF:
257
								scope.problemReporter().localVariableNullInstanceof(local, reference);
258
								return;
259
						}
201
					}
260
					}
202
					break;
261
					break;
203
				case MAY_NULL :
262
				case MAY_NULL :
204
					if (flowInfo.isDefinitelyNull(local)) {
263
					if (flowInfo.isDefinitelyNull(local)) {
205
						scope.problemReporter().localVariableCanOnlyBeNull(local, reference);
264
						scope.problemReporter().localVariableNullReference(local, reference);
206
						return;
265
						return;
207
					}
266
					}
208
					if (flowInfo.isPotentiallyNull(local)) {
267
					if (flowInfo.isPotentiallyNull(local)) {
209
						scope.problemReporter().localVariableMayBeNull(local, reference);
268
						scope.problemReporter().localVariablePotentialNullReference(local, reference);
210
						return;
269
						return;
211
					}
270
					}
212
					if (flowInfo.isDefinitelyNonNull(local)) {
271
					if (flowInfo.isDefinitelyNonNull(local)) {
(-)compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java (-36 / +104 lines)
Lines 121-156 Link Here
121
			Expression expression = this.nullReferences[i];
121
			Expression expression = this.nullReferences[i];
122
			// final local variable
122
			// final local variable
123
			switch (this.nullCheckTypes[i]) {
123
			switch (this.nullCheckTypes[i]) {
124
				case CAN_ONLY_NON_NULL :
124
				case CAN_ONLY_NON_NULL | IN_COMPARISON_NULL:
125
				case CAN_ONLY_NON_NULL | IN_COMPARISON_NON_NULL:
125
					if (flowInfo.isDefinitelyNonNull(local)) {
126
					if (flowInfo.isDefinitelyNonNull(local)) {
126
						this.nullReferences[i] = null;
127
						this.nullReferences[i] = null;
127
						scope.problemReporter().localVariableCannotBeNull(local, expression);
128
						if (this.nullCheckTypes[i] == (CAN_ONLY_NON_NULL | IN_COMPARISON_NON_NULL)) {
129
							scope.problemReporter().localVariableRedundantCheckOnNonNull(local, expression);
130
						} else {
131
							scope.problemReporter().localVariableNonNullComparedToNull(local, expression);
132
						}
128
						continue;
133
						continue;
129
					}
134
					}
130
					break;
135
					break;
131
				case CAN_ONLY_NULL_NON_NULL :
136
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
137
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
132
					if (flowInfo.isDefinitelyNonNull(local)) {
138
					if (flowInfo.isDefinitelyNonNull(local)) {
133
						this.nullReferences[i] = null;
139
						this.nullReferences[i] = null;
134
						scope.problemReporter().localVariableCannotBeNull(local, expression);
140
						if (this.nullCheckTypes[i] == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
141
							scope.problemReporter().localVariableRedundantCheckOnNonNull(local, expression);
142
						} else {
143
							scope.problemReporter().localVariableNonNullComparedToNull(local, expression);
144
						}
135
						continue;
145
						continue;
136
					}
146
					}
137
					if (flowInfo.isDefinitelyNull(local)) {
147
					if (flowInfo.isDefinitelyNull(local)) {
138
						this.nullReferences[i] = null;
148
						this.nullReferences[i] = null;
139
						scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
149
						if (this.nullCheckTypes[i] == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL)) {
150
							scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
151
						} else {
152
							scope.problemReporter().localVariableNullComparedToNonNull(local, expression);
153
						}
140
						continue;
154
						continue;
141
					}
155
					}
142
					break;
156
					break;
143
				case CAN_ONLY_NULL :
157
				case CAN_ONLY_NULL | IN_COMPARISON_NULL:
158
				case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
159
				case CAN_ONLY_NULL | IN_ASSIGNMENT:
160
				case CAN_ONLY_NULL | IN_INSTANCEOF:
144
					if (flowInfo.isDefinitelyNull(local)) {
161
					if (flowInfo.isDefinitelyNull(local)) {
145
						this.nullReferences[i] = null;
162
						this.nullReferences[i] = null;
146
						scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
163
						switch(this.nullCheckTypes[i] & CONTEXT_MASK) {
147
						continue;
164
							case FlowContext.IN_COMPARISON_NULL:
165
								scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
166
								continue;
167
							case FlowContext.IN_COMPARISON_NON_NULL:
168
								scope.problemReporter().localVariableNullComparedToNonNull(local, expression);
169
								continue;
170
							case FlowContext.IN_ASSIGNMENT:
171
								scope.problemReporter().localVariableRedundantNullAssignment(local, expression);
172
								continue;
173
							case FlowContext.IN_INSTANCEOF:
174
								scope.problemReporter().localVariableNullInstanceof(local, expression);
175
								continue;
176
						}
148
					}
177
					}
149
					break;
178
					break;
150
				case MAY_NULL:
179
				case MAY_NULL:
151
					if (flowInfo.isDefinitelyNull(local)) {
180
					if (flowInfo.isDefinitelyNull(local)) {
152
						this.nullReferences[i] = null;
181
						this.nullReferences[i] = null;
153
						scope.problemReporter().localVariableCanOnlyBeNull(local, expression);
182
						scope.problemReporter().localVariableNullReference(local, expression);
154
						continue;
183
						continue;
155
					}
184
					}
156
					break;
185
					break;
Lines 168-195 Link Here
168
			// final local variable
197
			// final local variable
169
			LocalVariableBinding local = this.nullLocals[i];
198
			LocalVariableBinding local = this.nullLocals[i];
170
			switch (this.nullCheckTypes[i]) {
199
			switch (this.nullCheckTypes[i]) {
171
				case CAN_ONLY_NULL_NON_NULL :
200
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
201
				case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
172
					if (flowInfo.isDefinitelyNonNull(local)) {
202
					if (flowInfo.isDefinitelyNonNull(local)) {
173
						this.nullReferences[i] = null;
203
						this.nullReferences[i] = null;
174
						scope.problemReporter().localVariableCannotBeNull(local, expression);
204
						if (this.nullCheckTypes[i] == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
205
							scope.problemReporter().localVariableRedundantCheckOnNonNull(local, expression);
206
						} else {
207
							scope.problemReporter().localVariableNonNullComparedToNull(local, expression);
208
						}
175
						continue;
209
						continue;
176
					}
210
					}
177
				case CAN_ONLY_NULL :
211
				case CAN_ONLY_NULL | IN_COMPARISON_NULL:
212
				case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
213
				case CAN_ONLY_NULL | IN_ASSIGNMENT:
214
				case CAN_ONLY_NULL | IN_INSTANCEOF:
178
					if (flowInfo.isDefinitelyNull(local)) {
215
					if (flowInfo.isDefinitelyNull(local)) {
179
						this.nullReferences[i] = null;
216
						this.nullReferences[i] = null;
180
						scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
217
						switch(this.nullCheckTypes[i] & CONTEXT_MASK) {
181
						continue;
218
							case FlowContext.IN_COMPARISON_NULL:
219
								scope.problemReporter().localVariableRedundantCheckOnNull(local, expression);
220
								continue;
221
							case FlowContext.IN_COMPARISON_NON_NULL:
222
								scope.problemReporter().localVariableNullComparedToNonNull(local, expression);
223
								continue;
224
							case FlowContext.IN_ASSIGNMENT:
225
								scope.problemReporter().localVariableRedundantNullAssignment(local, expression);
226
								continue;
227
							case FlowContext.IN_INSTANCEOF:
228
								scope.problemReporter().localVariableNullInstanceof(local, expression);
229
								continue;
230
						}
182
					}
231
					}
183
					break;
232
					break;
184
				case MAY_NULL:
233
				case MAY_NULL:
185
					if (flowInfo.isDefinitelyNull(local)) {
234
					if (flowInfo.isDefinitelyNull(local)) {
186
						this.nullReferences[i] = null;
235
						this.nullReferences[i] = null;
187
						scope.problemReporter().localVariableCanOnlyBeNull(local, expression);
236
						scope.problemReporter().localVariableNullReference(local, expression);
188
						continue;
237
						continue;
189
					}
238
					}
190
					if (flowInfo.isPotentiallyNull(local)) {
239
					if (flowInfo.isPotentiallyNull(local)) {
191
						this.nullReferences[i] = null;
240
						this.nullReferences[i] = null;
192
						scope.problemReporter().localVariableMayBeNull(local, expression);
241
						scope.problemReporter().localVariablePotentialNullReference(local, expression);
193
						continue;
242
						continue;
194
					}
243
					}
195
					break;
244
					break;
Lines 323-354 Link Here
323
		return;
372
		return;
324
	}
373
	}
325
	switch (checkType) {
374
	switch (checkType) {
326
		case CAN_ONLY_NULL_NON_NULL :
375
		case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
376
		case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
327
			if (flowInfo.isDefinitelyNonNull(local)) {
377
			if (flowInfo.isDefinitelyNonNull(local)) {
328
				scope.problemReporter().localVariableCannotBeNull(local, reference);
378
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
329
				return;
379
					scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
330
			}
380
				} else {
331
			if (flowInfo.isDefinitelyNull(local)) {
381
					scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
332
				scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
382
				}
333
				return;
383
			} else if (flowInfo.isDefinitelyNull(local)) {
334
			}
384
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL)) {
335
			if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
385
					scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
336
				return;
386
				} else {
337
			}
387
					scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
338
			if (flowInfo.isPotentiallyNonNull(local)) {
388
				}
339
			  recordNullReference(local, reference,CAN_ONLY_NON_NULL);
389
			} else if (! flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
340
			} else {
390
				if (flowInfo.isPotentiallyNonNull(local)) {
341
			  recordNullReference(local, reference, checkType);
391
					recordNullReference(local, reference, CAN_ONLY_NON_NULL | checkType & CONTEXT_MASK);
392
				} else {
393
					recordNullReference(local, reference, checkType);
394
				}
342
			}
395
			}
343
			return;
396
			return;
344
		case CAN_ONLY_NULL:
397
		case CAN_ONLY_NULL | IN_COMPARISON_NULL:
398
		case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
399
		case CAN_ONLY_NULL | IN_ASSIGNMENT:
400
		case CAN_ONLY_NULL | IN_INSTANCEOF:
345
			if (flowInfo.isPotentiallyNonNull(local)
401
			if (flowInfo.isPotentiallyNonNull(local)
346
					|| flowInfo.isPotentiallyUnknown(local)) {
402
					|| flowInfo.isPotentiallyUnknown(local)) {
347
				return;
403
				return;
348
			}
404
			}
349
			if (flowInfo.isDefinitelyNull(local)) {
405
			if (flowInfo.isDefinitelyNull(local)) {
350
				scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
406
				switch(checkType & CONTEXT_MASK) {
351
				return;
407
					case FlowContext.IN_COMPARISON_NULL:
408
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
409
						return;
410
					case FlowContext.IN_COMPARISON_NON_NULL:
411
						scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
412
						return;
413
					case FlowContext.IN_ASSIGNMENT:
414
						scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
415
						return;
416
					case FlowContext.IN_INSTANCEOF:
417
						scope.problemReporter().localVariableNullInstanceof(local, reference);
418
						return;
419
				}
352
			}
420
			}
353
			recordNullReference(local, reference, checkType);
421
			recordNullReference(local, reference, checkType);
354
			return;
422
			return;
Lines 357-367 Link Here
357
				return;
425
				return;
358
			}
426
			}
359
			if (flowInfo.isDefinitelyNull(local)) {
427
			if (flowInfo.isDefinitelyNull(local)) {
360
				scope.problemReporter().localVariableCanOnlyBeNull(local, reference);
428
				scope.problemReporter().localVariableNullReference(local, reference);
361
				return;
429
				return;
362
			}
430
			}
363
			if (flowInfo.isPotentiallyNull(local)) {
431
			if (flowInfo.isPotentiallyNull(local)) {
364
				scope.problemReporter().localVariableMayBeNull(local, reference);
432
				scope.problemReporter().localVariablePotentialNullReference(local, reference);
365
				return;
433
				return;
366
			}
434
			}
367
			recordNullReference(local, reference, checkType);
435
			recordNullReference(local, reference, checkType);
(-)compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java (-18 / +50 lines)
Lines 437-443 Link Here
437
 * @param expression the expression within which local lays
437
 * @param expression the expression within which local lays
438
 * @param status the status against which the check must be performed; one of
438
 * @param status the status against which the check must be performed; one of
439
 * 		{@link #CAN_ONLY_NULL CAN_ONLY_NULL}, {@link #CAN_ONLY_NULL_NON_NULL 
439
 * 		{@link #CAN_ONLY_NULL CAN_ONLY_NULL}, {@link #CAN_ONLY_NULL_NON_NULL 
440
 * 		CAN_ONLY_NULL_NON_NULL}, {@link #MAY_NULL MAY_NULL} 
440
 * 		CAN_ONLY_NULL_NON_NULL}, {@link #MAY_NULL MAY_NULL}, 
441
 *      {@link #CAN_ONLY_NON_NULL CAN_ONLY_NON_NULL}, potentially 
442
 *      combined with a context indicator (one of {@link #IN_COMPARISON_NULL},
443
 *      {@link #IN_COMPARISON_NON_NULL}, {@link #IN_ASSIGNMENT} or {@link #IN_INSTANCEOF})
441
 */
444
 */
442
protected void recordNullReference(LocalVariableBinding local, 
445
protected void recordNullReference(LocalVariableBinding local, 
443
	Expression expression, int status) {
446
	Expression expression, int status) {
Lines 462-476 Link Here
462
}
465
}
463
466
464
public static final int 
467
public static final int 
465
  CAN_ONLY_NULL_NON_NULL = 20, 
468
  CAN_ONLY_NULL_NON_NULL = 0x0000, 
466
  	// check against null and non null, with definite values -- comparisons
469
  	// check against null and non null, with definite values -- comparisons
467
  CAN_ONLY_NULL = 21,
470
  CAN_ONLY_NULL = 0x0001,
468
  	// check against null, with definite values -- assignment to null
471
  	// check against null, with definite values -- comparisons
469
  MAY_NULL = 22,
472
  CAN_ONLY_NON_NULL = 0x0002,
473
	// check against non null, with definite values -- comparisons
474
  MAY_NULL = 0x0003,
470
	// check against null, with potential values -- NPE guard
475
	// check against null, with potential values -- NPE guard
471
  CAN_ONLY_NON_NULL = 23;
476
  CHECK_MASK = 0x00FF,
472
	// subcase of CAN_ONLY_NULL_NON_NULL, in which we know that the local
477
  IN_COMPARISON_NULL = 0x0100,
473
	// may be non null
478
  IN_COMPARISON_NON_NULL = 0x0200,
479
    // check happened in a comparison
480
  IN_ASSIGNMENT = 0x0300,
481
    // check happened in an assignment
482
  IN_INSTANCEOF = 0x0400,
483
    // check happened in an instanceof expression
484
  CONTEXT_MASK = ~CHECK_MASK;
474
485
475
/**
486
/**
476
 * Record a null reference for use by deferred checks. Only looping or 
487
 * Record a null reference for use by deferred checks. Only looping or 
Lines 485-491 Link Here
485
 * @param reference the expression within which local lies
496
 * @param reference the expression within which local lies
486
 * @param checkType the status against which the check must be performed; one 
497
 * @param checkType the status against which the check must be performed; one 
487
 * 		of {@link #CAN_ONLY_NULL CAN_ONLY_NULL}, {@link #CAN_ONLY_NULL_NON_NULL 
498
 * 		of {@link #CAN_ONLY_NULL CAN_ONLY_NULL}, {@link #CAN_ONLY_NULL_NON_NULL 
488
 * 		CAN_ONLY_NULL_NON_NULL}, {@link #MAY_NULL MAY_NULL}
499
 * 		CAN_ONLY_NULL_NON_NULL}, {@link #MAY_NULL MAY_NULL}, potentially 
500
 *      combined with a context indicator (one of {@link #IN_COMPARISON_NULL},
501
 *      {@link #IN_COMPARISON_NON_NULL}, {@link #IN_ASSIGNMENT} or {@link #IN_INSTANCEOF})
489
 * @param flowInfo the flow info at the check point; deferring contexts will
502
 * @param flowInfo the flow info at the check point; deferring contexts will
490
 *  	perform supplementary checks against flow info instances that cannot
503
 *  	perform supplementary checks against flow info instances that cannot
491
 *  	be known at the time of calling this method (they are influenced by
504
 *  	be known at the time of calling this method (they are influenced by
Lines 498-527 Link Here
498
		return;
511
		return;
499
	}
512
	}
500
	switch (checkType) {
513
	switch (checkType) {
501
		case CAN_ONLY_NULL_NON_NULL :
514
		case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
515
		case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
502
			if (flowInfo.isDefinitelyNonNull(local)) {
516
			if (flowInfo.isDefinitelyNonNull(local)) {
503
				scope.problemReporter().localVariableCannotBeNull(local, reference);				
517
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
518
					scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
519
				} else {
520
					scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
521
				}
504
				return;
522
				return;
505
			}
523
			}
506
			else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
524
			else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
507
				return;
525
				return;
508
			}
526
			}
509
		case CAN_ONLY_NULL:
527
		case CAN_ONLY_NULL | IN_COMPARISON_NULL:
528
		case CAN_ONLY_NULL | IN_COMPARISON_NON_NULL:
529
		case CAN_ONLY_NULL | IN_ASSIGNMENT:
530
		case CAN_ONLY_NULL | IN_INSTANCEOF:
510
			if (flowInfo.isDefinitelyNull(local)) {
531
			if (flowInfo.isDefinitelyNull(local)) {
511
				scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
532
				switch(checkType & CONTEXT_MASK) {
512
				return;
533
					case FlowContext.IN_COMPARISON_NULL:
513
			}
534
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
514
			else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
535
						return;
536
					case FlowContext.IN_COMPARISON_NON_NULL:
537
						scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
538
						return;
539
					case FlowContext.IN_ASSIGNMENT:
540
						scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
541
						return;
542
					case FlowContext.IN_INSTANCEOF:
543
						scope.problemReporter().localVariableNullInstanceof(local, reference);
544
						return;
545
				}
546
			} else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) {
515
				return;
547
				return;
516
			}
548
			}
517
			break;
549
			break;
518
		case MAY_NULL :
550
		case MAY_NULL :
519
			if (flowInfo.isDefinitelyNull(local)) {
551
			if (flowInfo.isDefinitelyNull(local)) {
520
				scope.problemReporter().localVariableCanOnlyBeNull(local, reference);
552
				scope.problemReporter().localVariableNullReference(local, reference);
521
				return;
553
				return;
522
			}
554
			}
523
			if (flowInfo.isPotentiallyNull(local)) {
555
			if (flowInfo.isPotentiallyNull(local)) {
524
				scope.problemReporter().localVariableMayBeNull(local, reference);
556
				scope.problemReporter().localVariablePotentialNullReference(local, reference);
525
				return;
557
				return;
526
			}
558
			}
527
			break;
559
			break;

Return to bug 175570