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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/EqualExpression.java (+6 lines)
Lines 59-64 Link Here
59
				}
59
				}
60
				break;
60
				break;
61
		}
61
		}
62
		// set the optimize constant to optimize code gen
63
		if ((initsWhenTrue.tagBits & FlowInfo.UNREACHABLE)!=0) {
64
			this.optimizedBooleanConstant = BooleanConstant.fromValue(false);
65
		} else if ((initsWhenFalse.tagBits & FlowInfo.UNREACHABLE)!=0) {
66
			this.optimizedBooleanConstant = BooleanConstant.fromValue(true);
67
		}
62
		// we do not impact enclosing try context because this kind of protection
68
		// we do not impact enclosing try context because this kind of protection
63
		// does not preclude the variable from being null in an enclosing scope
69
		// does not preclude the variable from being null in an enclosing scope
64
	}
70
	}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java (-14 / +26 lines)
Lines 138-150 Link Here
138
			|| this.elseStatement.isEmptyBlock());
138
			|| this.elseStatement.isEmptyBlock());
139
	if (hasThenPart) {
139
	if (hasThenPart) {
140
		BranchLabel falseLabel = null;
140
		BranchLabel falseLabel = null;
141
		// generate boolean condition
141
		// generate boolean condition only if needed
142
		this.condition.generateOptimizedBoolean(
142
		if (cst != Constant.NotAConstant && cst.booleanValue() == true) {
143
			currentScope,
143
			// No need to generate if condition statement when we know that only the then action
144
			codeStream,
144
			// will be executed
145
			null,
145
			this.condition.generateCode(currentScope, codeStream, false);
146
			hasElsePart ? (falseLabel = new BranchLabel(codeStream)) : endifLabel,
146
		} else {
147
			true/*cst == Constant.NotAConstant*/);
147
			this.condition.generateOptimizedBoolean(
148
				currentScope,
149
				codeStream,
150
				null,
151
				hasElsePart ? (falseLabel = new BranchLabel(codeStream)) : endifLabel,
152
				true/*cst == Constant.NotAConstant*/);
153
		}
148
		// May loose some local variable initializations : affecting the local variable attributes
154
		// May loose some local variable initializations : affecting the local variable attributes
149
		if (this.thenInitStateIndex != -1) {
155
		if (this.thenInitStateIndex != -1) {
150
			codeStream.removeNotDefinitelyAssignedVariables(currentScope, this.thenInitStateIndex);
156
			codeStream.removeNotDefinitelyAssignedVariables(currentScope, this.thenInitStateIndex);
Lines 173-185 Link Here
173
			this.elseStatement.generateCode(currentScope, codeStream);
179
			this.elseStatement.generateCode(currentScope, codeStream);
174
		}
180
		}
175
	} else if (hasElsePart) {
181
	} else if (hasElsePart) {
176
		// generate boolean condition
182
		// generate boolean condition only if needed
177
		this.condition.generateOptimizedBoolean(
183
		if (cst != Constant.NotAConstant && cst.booleanValue() == false) {
178
			currentScope,
184
			// No need to generate if condition statement when we know that only the else action
179
			codeStream,
185
			// will be executed
180
			endifLabel,
186
			this.condition.generateCode(currentScope, codeStream, false);
181
			null,
187
		} else {
182
			true/*cst == Constant.NotAConstant*/);
188
			this.condition.generateOptimizedBoolean(
189
				currentScope,
190
				codeStream,
191
				endifLabel,
192
				null,
193
				true/*cst == Constant.NotAConstant*/);
194
		}
183
		// generate else statement
195
		// generate else statement
184
		// May loose some local variable initializations : affecting the local variable attributes
196
		// May loose some local variable initializations : affecting the local variable attributes
185
		if (this.elseInitStateIndex != -1) {
197
		if (this.elseInitStateIndex != -1) {
(-)compiler/org/eclipse/jdt/internal/compiler/flow/FinallyFlowContext.java (+8 lines)
Lines 192-199 Link Here
192
						if (flowInfo.cannotBeNull(local)) {
192
						if (flowInfo.cannotBeNull(local)) {
193
							if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
193
							if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
194
								scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
194
								scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
195
								flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
195
							} else if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL)) {
196
							} else if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL)) {
196
								scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
197
								scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
198
								flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
197
							}
199
							}
198
							return;
200
							return;
199
						}
201
						}
Lines 201-209 Link Here
201
							switch(checkType & CONTEXT_MASK) {
203
							switch(checkType & CONTEXT_MASK) {
202
								case FlowContext.IN_COMPARISON_NULL:
204
								case FlowContext.IN_COMPARISON_NULL:
203
									scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
205
									scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
206
									flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
204
									return;
207
									return;
205
								case FlowContext.IN_COMPARISON_NON_NULL:
208
								case FlowContext.IN_COMPARISON_NON_NULL:
206
									scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
209
									scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
210
									flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
207
									return;
211
									return;
208
								case FlowContext.IN_ASSIGNMENT:
212
								case FlowContext.IN_ASSIGNMENT:
209
									scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
213
									scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
Lines 234-241 Link Here
234
						if (flowInfo.isDefinitelyNonNull(local)) {
238
						if (flowInfo.isDefinitelyNonNull(local)) {
235
							if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
239
							if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
236
								scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
240
								scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
241
								flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
237
							} else {
242
							} else {
238
								scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
243
								scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
244
								flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);	
239
							}
245
							}
240
							return;
246
							return;
241
						}
247
						}
Lines 248-256 Link Here
248
							switch(checkType & CONTEXT_MASK) {
254
							switch(checkType & CONTEXT_MASK) {
249
								case FlowContext.IN_COMPARISON_NULL:
255
								case FlowContext.IN_COMPARISON_NULL:
250
									scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
256
									scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
257
									flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
251
									return;
258
									return;
252
								case FlowContext.IN_COMPARISON_NON_NULL:
259
								case FlowContext.IN_COMPARISON_NON_NULL:
253
									scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
260
									scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
261
									flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
254
									return;
262
									return;
255
								case FlowContext.IN_ASSIGNMENT:
263
								case FlowContext.IN_ASSIGNMENT:
256
									scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
264
									scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
(-)compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java (+4 lines)
Lines 543-550 Link Here
543
			if (flowInfo.isDefinitelyNonNull(local)) {
543
			if (flowInfo.isDefinitelyNonNull(local)) {
544
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
544
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
545
					scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
545
					scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
546
					flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
546
				} else {
547
				} else {
547
					scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
548
					scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
549
					flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
548
				}
550
				}
549
				return;
551
				return;
550
			}
552
			}
Lines 560-568 Link Here
560
				switch(checkType & CONTEXT_MASK) {
562
				switch(checkType & CONTEXT_MASK) {
561
					case FlowContext.IN_COMPARISON_NULL:
563
					case FlowContext.IN_COMPARISON_NULL:
562
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
564
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
565
						flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
563
						return;
566
						return;
564
					case FlowContext.IN_COMPARISON_NON_NULL:
567
					case FlowContext.IN_COMPARISON_NON_NULL:
565
						scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
568
						scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
569
						flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
566
						return;
570
						return;
567
					case FlowContext.IN_ASSIGNMENT:
571
					case FlowContext.IN_ASSIGNMENT:
568
						scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
572
						scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
(-)compiler/org/eclipse/jdt/internal/compiler/flow/LoopingFlowContext.java (+6 lines)
Lines 396-409 Link Here
396
			if (flowInfo.isDefinitelyNonNull(local)) {
396
			if (flowInfo.isDefinitelyNonNull(local)) {
397
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
397
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL)) {
398
					scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
398
					scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
399
					flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
399
				} else {
400
				} else {
400
					scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
401
					scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
402
					flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
401
				}
403
				}
402
			} else if (flowInfo.isDefinitelyNull(local)) {
404
			} else if (flowInfo.isDefinitelyNull(local)) {
403
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL)) {
405
				if (checkType == (CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL)) {
404
					scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
406
					scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
407
					flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
405
				} else {
408
				} else {
406
					scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
409
					scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
410
					flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
407
				}
411
				}
408
			} else if (this.upstreamNullFlowInfo.isDefinitelyNonNull(local) && !flowInfo.isPotentiallyNull(local)) {    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=291418
412
			} else if (this.upstreamNullFlowInfo.isDefinitelyNonNull(local) && !flowInfo.isPotentiallyNull(local)) {    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=291418
409
				flowInfo.markAsDefinitelyNonNull(local);
413
				flowInfo.markAsDefinitelyNonNull(local);
Lines 428-436 Link Here
428
				switch(checkType & CONTEXT_MASK) {
432
				switch(checkType & CONTEXT_MASK) {
429
					case FlowContext.IN_COMPARISON_NULL:
433
					case FlowContext.IN_COMPARISON_NULL:
430
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
434
						scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
435
						flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
431
						return;
436
						return;
432
					case FlowContext.IN_COMPARISON_NON_NULL:
437
					case FlowContext.IN_COMPARISON_NON_NULL:
433
						scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
438
						scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
439
						flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
434
						return;
440
						return;
435
					case FlowContext.IN_ASSIGNMENT:
441
					case FlowContext.IN_ASSIGNMENT:
436
						scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
442
						scope.problemReporter().localVariableRedundantNullAssignment(local, reference);
(-)Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java (-114 / +91 lines)
Lines 6531-6572 Link Here
6531
			"    40  aload 5 [data]\n" +
6531
			"    40  aload 5 [data]\n" +
6532
			"    42  invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" +
6532
			"    42  invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" +
6533
			"    45  pop\n" +
6533
			"    45  pop\n" +
6534
			"    46  goto 62\n" +
6534
			"    46  goto 54\n" +
6535
			"    49  astore 6 [e]\n" +
6535
			"    49  astore 6 [e]\n" +
6536
			"    51  aload 6 [e]\n" +
6536
			"    51  aload 6 [e]\n" +
6537
			"    53  ifnull 59\n" +
6537
			"    53  athrow\n" +
6538
			"    56  aload 6 [e]\n" +
6538
			"    54  iload_1 [delete]\n" +
6539
			"    58  athrow\n" +
6539
			"    55  ifeq 85\n" +
6540
			"    59  aconst_null\n" +
6540
			"    58  aload_3 [buffer]\n" +
6541
			"    60  astore_3 [buffer]\n" +
6541
			"    59  iconst_0\n" +
6542
			"    61  return\n" +
6542
			"    60  aload_3 [buffer]\n" +
6543
			"    62  iload_1 [delete]\n" +
6543
			"    61  invokevirtual java.lang.StringBuffer.length() : int [31]\n" +
6544
			"    63  ifeq 93\n" +
6544
			"    64  invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" +
6545
			"    66  aload_3 [buffer]\n" +
6545
			"    67  pop\n" +
6546
			"    67  iconst_0\n" +
6546
			"    68  goto 85\n" +
6547
			"    68  aload_3 [buffer]\n" +
6547
			"    71  astore 4\n" +
6548
			"    69  invokevirtual java.lang.StringBuffer.length() : int [31]\n" +
6548
			"    73  aconst_null\n" +
6549
			"    72  invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" +
6549
			"    74  astore_3 [buffer]\n" +
6550
			"    75  pop\n" +
6550
			"    75  goto 87\n" +
6551
			"    76  goto 93\n" +
6551
			"    78  astore 7\n" +
6552
			"    79  astore 4\n" +
6552
			"    80  aconst_null\n" +
6553
			"    81  aconst_null\n" +
6553
			"    81  astore_3 [buffer]\n" +
6554
			"    82  astore_3 [buffer]\n" +
6554
			"    82  aload 7\n" +
6555
			"    83  goto 95\n" +
6555
			"    84  athrow\n" +
6556
			"    86  astore 7\n" +
6556
			"    85  aconst_null\n" +
6557
			"    88  aconst_null\n" +
6557
			"    86  astore_3 [buffer]\n" +
6558
			"    89  astore_3 [buffer]\n" +
6558
			"    87  return\n" +
6559
			"    90  aload 7\n" +
6560
			"    92  athrow\n" +
6561
			"    93  aconst_null\n" +
6562
			"    94  astore_3 [buffer]\n" +
6563
			"    95  return\n" +
6564
			"      Exception Table:\n" +
6559
			"      Exception Table:\n" +
6565
			"        [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" +
6560
			"        [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" +
6566
			"        [pc: 13, pc: 59] -> 79 when : java.lang.Exception\n" +
6561
			"        [pc: 13, pc: 68] -> 71 when : java.lang.Exception\n" +
6567
			"        [pc: 62, pc: 76] -> 79 when : java.lang.Exception\n" +
6562
			"        [pc: 13, pc: 73] -> 78 when : any\n" +
6568
			"        [pc: 13, pc: 59] -> 86 when : any\n" +
6569
			"        [pc: 62, pc: 81] -> 86 when : any\n" +
6570
			"      Line numbers:\n" +
6563
			"      Line numbers:\n" +
6571
			"        [pc: 0, line: 4]\n" +
6564
			"        [pc: 0, line: 4]\n" +
6572
			"        [pc: 5, line: 5]\n" +
6565
			"        [pc: 5, line: 5]\n" +
Lines 6574-6602 Link Here
6574
			"        [pc: 24, line: 10]\n" +
6567
			"        [pc: 24, line: 10]\n" +
6575
			"        [pc: 34, line: 12]\n" +
6568
			"        [pc: 34, line: 12]\n" +
6576
			"        [pc: 49, line: 13]\n" +
6569
			"        [pc: 49, line: 13]\n" +
6577
			"        [pc: 51, line: 14]\n" +
6570
			"        [pc: 51, line: 15]\n" +
6578
			"        [pc: 56, line: 15]\n" +
6571
			"        [pc: 54, line: 19]\n" +
6579
			"        [pc: 59, line: 24]\n" +
6572
			"        [pc: 58, line: 20]\n" +
6580
			"        [pc: 61, line: 16]\n" +
6573
			"        [pc: 71, line: 22]\n" +
6581
			"        [pc: 62, line: 19]\n" +
6574
			"        [pc: 73, line: 24]\n" +
6582
			"        [pc: 66, line: 20]\n" +
6575
			"        [pc: 78, line: 23]\n" +
6583
			"        [pc: 79, line: 22]\n" +
6576
			"        [pc: 80, line: 24]\n" +
6584
			"        [pc: 81, line: 24]\n" +
6577
			"        [pc: 82, line: 25]\n" +
6585
			"        [pc: 86, line: 23]\n" +
6578
			"        [pc: 85, line: 24]\n" +
6586
			"        [pc: 88, line: 24]\n" +
6579
			"        [pc: 87, line: 26]\n" +
6587
			"        [pc: 90, line: 25]\n" +
6588
			"        [pc: 93, line: 24]\n" +
6589
			"        [pc: 95, line: 26]\n" +
6590
			"      Local variable table:\n" +
6580
			"      Local variable table:\n" +
6591
			"        [pc: 0, pc: 96] local: this index: 0 type: X\n" +
6581
			"        [pc: 0, pc: 88] local: this index: 0 type: X\n" +
6592
			"        [pc: 0, pc: 96] local: delete index: 1 type: boolean\n" +
6582
			"        [pc: 0, pc: 88] local: delete index: 1 type: boolean\n" +
6593
			"        [pc: 5, pc: 96] local: s index: 2 type: java.lang.String\n" +
6583
			"        [pc: 5, pc: 88] local: s index: 2 type: java.lang.String\n" +
6594
			"        [pc: 13, pc: 96] local: buffer index: 3 type: java.lang.StringBuffer\n" +
6584
			"        [pc: 13, pc: 88] local: buffer index: 3 type: java.lang.StringBuffer\n" +
6595
			"        [pc: 24, pc: 59] local: datas index: 4 type: java.lang.String[]\n" +
6585
			"        [pc: 24, pc: 71] local: datas index: 4 type: java.lang.String[]\n" +
6596
			"        [pc: 62, pc: 79] local: datas index: 4 type: java.lang.String[]\n" +
6586
			"        [pc: 34, pc: 71] local: data index: 5 type: java.lang.Object[]\n" +
6597
			"        [pc: 34, pc: 59] local: data index: 5 type: java.lang.Object[]\n" +
6587
			"        [pc: 51, pc: 54] local: e index: 6 type: java.lang.Exception\n"
6598
			"        [pc: 62, pc: 79] local: data index: 5 type: java.lang.Object[]\n" +
6599
			"        [pc: 51, pc: 59] local: e index: 6 type: java.lang.Exception\n"
6600
		:	"  // Method descriptor #15 (Z)V\n" +
6588
		:	"  // Method descriptor #15 (Z)V\n" +
6601
			"  // Stack: 4, Locals: 8\n" +
6589
			"  // Stack: 4, Locals: 8\n" +
6602
			"  private void foo(boolean delete);\n" +
6590
			"  private void foo(boolean delete);\n" +
Lines 6627-6668 Link Here
6627
			"    40  aload 5 [data]\n" +
6615
			"    40  aload 5 [data]\n" +
6628
			"    42  invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" +
6616
			"    42  invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" +
6629
			"    45  pop\n" +
6617
			"    45  pop\n" +
6630
			"    46  goto 62\n" +
6618
			"    46  goto 54\n" +
6631
			"    49  astore 6 [e]\n" +
6619
			"    49  astore 6 [e]\n" +
6632
			"    51  aload 6 [e]\n" +
6620
			"    51  aload 6 [e]\n" +
6633
			"    53  ifnull 59\n" +
6621
			"    53  athrow\n" +
6634
			"    56  aload 6 [e]\n" +
6622
			"    54  iload_1 [delete]\n" +
6635
			"    58  athrow\n" +
6623
			"    55  ifeq 85\n" +
6636
			"    59  aconst_null\n" +
6624
			"    58  aload_3 [buffer]\n" +
6637
			"    60  astore_3 [buffer]\n" +
6625
			"    59  iconst_0\n" +
6638
			"    61  return\n" +
6626
			"    60  aload_3 [buffer]\n" +
6639
			"    62  iload_1 [delete]\n" +
6627
			"    61  invokevirtual java.lang.StringBuffer.length() : int [31]\n" +
6640
			"    63  ifeq 93\n" +
6628
			"    64  invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" +
6641
			"    66  aload_3 [buffer]\n" +
6629
			"    67  pop\n" +
6642
			"    67  iconst_0\n" +
6630
			"    68  goto 85\n" +
6643
			"    68  aload_3 [buffer]\n" +
6631
			"    71  astore 4\n" +
6644
			"    69  invokevirtual java.lang.StringBuffer.length() : int [31]\n" +
6632
			"    73  aconst_null\n" +
6645
			"    72  invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" +
6633
			"    74  astore_3 [buffer]\n" +
6646
			"    75  pop\n" +
6634
			"    75  goto 87\n" +
6647
			"    76  goto 93\n" +
6635
			"    78  astore 7\n" +
6648
			"    79  astore 4\n" +
6636
			"    80  aconst_null\n" +
6649
			"    81  aconst_null\n" +
6637
			"    81  astore_3 [buffer]\n" + 
6650
			"    82  astore_3 [buffer]\n" +
6638
			"    82  aload 7\n" +
6651
			"    83  goto 95\n" +
6639
			"    84  athrow\n" +
6652
			"    86  astore 7\n" +
6640
			"    85  aconst_null\n" +
6653
			"    88  aconst_null\n" +
6641
			"    86  astore_3 [buffer]\n" +
6654
			"    89  astore_3 [buffer]\n" +
6642
			"    87  return\n" +
6655
			"    90  aload 7\n" +
6656
			"    92  athrow\n" +
6657
			"    93  aconst_null\n" +
6658
			"    94  astore_3 [buffer]\n" +
6659
			"    95  return\n" +
6660
			"      Exception Table:\n" +
6643
			"      Exception Table:\n" +
6661
			"        [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" +
6644
			"        [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" +
6662
			"        [pc: 13, pc: 59] -> 79 when : java.lang.Exception\n" +
6645
			"        [pc: 13, pc: 68] -> 71 when : java.lang.Exception\n" +
6663
			"        [pc: 62, pc: 76] -> 79 when : java.lang.Exception\n" +
6646
			"        [pc: 13, pc: 73] -> 78 when : any\n" +
6664
			"        [pc: 13, pc: 59] -> 86 when : any\n" +
6665
			"        [pc: 62, pc: 81] -> 86 when : any\n" +
6666
			"      Line numbers:\n" +
6647
			"      Line numbers:\n" +
6667
			"        [pc: 0, line: 4]\n" +
6648
			"        [pc: 0, line: 4]\n" +
6668
			"        [pc: 5, line: 5]\n" +
6649
			"        [pc: 5, line: 5]\n" +
Lines 6670-6705 Link Here
6670
			"        [pc: 24, line: 10]\n" +
6651
			"        [pc: 24, line: 10]\n" +
6671
			"        [pc: 34, line: 12]\n" +
6652
			"        [pc: 34, line: 12]\n" +
6672
			"        [pc: 49, line: 13]\n" +
6653
			"        [pc: 49, line: 13]\n" +
6673
			"        [pc: 51, line: 14]\n" +
6654
			"        [pc: 51, line: 15]\n" +
6674
			"        [pc: 56, line: 15]\n" +
6655
			"        [pc: 54, line: 19]\n" +
6675
			"        [pc: 59, line: 24]\n" +
6656
			"        [pc: 58, line: 20]\n" +
6676
			"        [pc: 61, line: 16]\n" +
6657
			"        [pc: 71, line: 22]\n" +
6677
			"        [pc: 62, line: 19]\n" +
6658
			"        [pc: 73, line: 24]\n" +
6678
			"        [pc: 66, line: 20]\n" +
6659
			"        [pc: 78, line: 23]\n" +
6679
			"        [pc: 79, line: 22]\n" +
6660
			"        [pc: 80, line: 24]\n" +
6680
			"        [pc: 81, line: 24]\n" +
6661
			"        [pc: 82, line: 25]\n" +
6681
			"        [pc: 86, line: 23]\n" +
6662
			"        [pc: 85, line: 24]\n" +
6682
			"        [pc: 88, line: 24]\n" +
6663
			"        [pc: 87, line: 26]\n" +
6683
			"        [pc: 90, line: 25]\n" +
6684
			"        [pc: 93, line: 24]\n" +
6685
			"        [pc: 95, line: 26]\n" +
6686
			"      Local variable table:\n" +
6664
			"      Local variable table:\n" +
6687
			"        [pc: 0, pc: 96] local: this index: 0 type: X\n" +
6665
			"        [pc: 0, pc: 88] local: this index: 0 type: X\n" +
6688
			"        [pc: 0, pc: 96] local: delete index: 1 type: boolean\n" +
6666
			"        [pc: 0, pc: 88] local: delete index: 1 type: boolean\n" +
6689
			"        [pc: 5, pc: 96] local: s index: 2 type: java.lang.String\n" +
6667
			"        [pc: 5, pc: 88] local: s index: 2 type: java.lang.String\n" +
6690
			"        [pc: 13, pc: 96] local: buffer index: 3 type: java.lang.StringBuffer\n" +
6668
			"        [pc: 13, pc: 88] local: buffer index: 3 type: java.lang.StringBuffer\n" +
6691
			"        [pc: 24, pc: 79] local: datas index: 4 type: java.lang.String[]\n" +
6669
			"        [pc: 24, pc: 71] local: datas index: 4 type: java.lang.String[]\n" +
6692
			"        [pc: 34, pc: 79] local: data index: 5 type: java.lang.Object[]\n" +
6670
			"        [pc: 34, pc: 71] local: data index: 5 type: java.lang.Object[]\n" +
6693
			"        [pc: 51, pc: 62] local: e index: 6 type: java.lang.Exception\n" +
6671
			"        [pc: 51, pc: 54] local: e index: 6 type: java.lang.Exception\n" +
6694
			"      Stack map table: number of frames 8\n" +
6672
			"      Stack map table: number of frames 7\n" +
6695
			"        [pc: 49, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer, java.lang.String[], java.lang.Object[]}]\n" +
6673
			"        [pc: 49, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer, java.lang.String[], java.lang.Object[]}]\n" +
6696
			"        [pc: 59, append: {java.lang.Exception}]\n" +
6674
			"        [pc: 54, same]\n" +
6697
			"        [pc: 62, chop 1 local(s)]\n" +
6675
			"        [pc: 68, same]\n" +
6698
			"        [pc: 76, same]\n" +
6676
			"        [pc: 71, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer}]\n" +
6699
			"        [pc: 79, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer}]\n" +
6677
			"        [pc: 78, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
6700
			"        [pc: 86, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
6678
			"        [pc: 85, same]\n" +
6701
			"        [pc: 93, same]\n" +
6679
			"        [pc: 87, same]\n";
6702
			"        [pc: 95, same]\n";
6703
6680
6704
	File f = new File(OUTPUT_DIR + File.separator + "X.class");
6681
	File f = new File(OUTPUT_DIR + File.separator + "X.class");
6705
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
6682
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
(-)Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/InitializationTest.java (-2 / +10 lines)
Lines 4890-4896 Link Here
4890
4890
4891
// 45357
4891
// 45357
4892
public void test169() {
4892
public void test169() {
4893
	this.runConformTest(
4893
	this.runNegativeTest(
4894
		new String[] {
4894
		new String[] {
4895
			"X.java",
4895
			"X.java",
4896
			"public class X {\n" +
4896
			"public class X {\n" +
Lines 4921-4927 Link Here
4921
			"	}\n" +
4921
			"	}\n" +
4922
			"}",
4922
			"}",
4923
		},
4923
		},
4924
		"SUCCESS");
4924
		"----------\n" +
4925
		"1. WARNING in X.java (at line 18)\n" +
4926
		"	if (obj != null) {\n" +
4927
		"			result = null;\n" +
4928
		"			foo(); \n" +
4929
		"		} else {\n" +
4930
		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4931
		"Dead code\n" +
4932
		"----------\n");
4925
}
4933
}
4926
4934
4927
// 45433
4935
// 45433
(-)Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java (+5 lines)
Lines 9622-9627 Link Here
9622
		"	fireTableCellUpdated();\n" + 
9622
		"	fireTableCellUpdated();\n" + 
9623
		"	^^^^^^^^^^^^^^^^^^^^\n" + 
9623
		"	^^^^^^^^^^^^^^^^^^^^\n" + 
9624
		"Cannot refer to an instance method while explicitly invoking a constructor\n" + 
9624
		"Cannot refer to an instance method while explicitly invoking a constructor\n" + 
9625
		"----------\n" +
9626
		"4. WARNING in p\\d\\One.java (at line 40)\n" +
9627
		"	if (m == null) return;\n" +
9628
		"	               ^^^^^^^\n" +
9629
		"Dead code\n" +
9625
		"----------\n");
9630
		"----------\n");
9626
}
9631
}
9627
public void test236() {
9632
public void test236() {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AssignmentTest.java (-34 / +7 lines)
Lines 23-28 Link Here
23
}
23
}
24
protected Map getCompilerOptions() {
24
protected Map getCompilerOptions() {
25
	Map options = super.getCompilerOptions();
25
	Map options = super.getCompilerOptions();
26
	options.put(CompilerOptions.OPTION_ReportDeadCode, CompilerOptions.IGNORE);
26
	options.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
27
	options.put(CompilerOptions.OPTION_ReportNullReference, CompilerOptions.ERROR);
27
	options.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.ERROR);
28
	options.put(CompilerOptions.OPTION_ReportPotentialNullReference, CompilerOptions.ERROR);
28
	options.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.ERROR);
29
	options.put(CompilerOptions.OPTION_ReportRedundantNullCheck, CompilerOptions.ERROR);
Lines 975-989 Link Here
975
		null /* no class libraries */,
976
		null /* no class libraries */,
976
		options /* custom options */,
977
		options /* custom options */,
977
		// compiler results
978
		// compiler results
978
		"----------\n" + /* expected compiler log */
979
		"1. WARNING in X.java (at line 3)\n" + 
980
		"	if (false) {\n" + 
981
		"      b = false;\n" + 
982
		"    }\n" + 
983
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
984
		"Dead code\n" + 
985
		"----------\n" + 
979
		"----------\n" + 
986
		"2. ERROR in X.java (at line 4)\n" + 
980
		"1. ERROR in X.java (at line 4)\n" + 
987
		"	b = false;\n" + 
981
		"	b = false;\n" + 
988
		"	^\n" + 
982
		"	^\n" + 
989
		"The parameter b should not be assigned\n" + 
983
		"The parameter b should not be assigned\n" + 
Lines 1016-1027 Link Here
1016
		options /* custom options */,
1010
		options /* custom options */,
1017
		// compiler results
1011
		// compiler results
1018
		"----------\n" + /* expected compiler log */
1012
		"----------\n" + /* expected compiler log */
1019
		"1. WARNING in X.java (at line 6)\n" + 
1013
		"1. ERROR in X.java (at line 6)\n" + 
1020
		"	b = false;\n" + 
1021
		"	^^^^^^^^^\n" + 
1022
		"Dead code\n" + 
1023
		"----------\n" + 
1024
		"2. ERROR in X.java (at line 6)\n" + 
1025
		"	b = false;\n" + 
1014
		"	b = false;\n" + 
1026
		"	^\n" + 
1015
		"	^\n" + 
1027
		"The parameter b should not be assigned\n" + 
1016
		"The parameter b should not be assigned\n" + 
Lines 1046-1060 Link Here
1046
			"  }\n" +
1035
			"  }\n" +
1047
			"}\n",
1036
			"}\n",
1048
		},
1037
		},
1049
		"----------\n" +
1050
		"1. WARNING in X.java (at line 3)\n" + 
1051
		"	if (false) {\n" + 
1052
		"      b = false;\n" + 
1053
		"    }\n" + 
1054
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
1055
		"Dead code\n" + 
1056
		"----------\n" + 
1038
		"----------\n" + 
1057
		"2. ERROR in X.java (at line 4)\n" + 
1039
		"1. ERROR in X.java (at line 4)\n" + 
1058
		"	b = false;\n" + 
1040
		"	b = false;\n" + 
1059
		"	^\n" + 
1041
		"	^\n" + 
1060
		"The final local variable b cannot be assigned. It must be blank and not using a compound assignment\n" + 
1042
		"The final local variable b cannot be assigned. It must be blank and not using a compound assignment\n" + 
Lines 1371-1389 Link Here
1371
			"class MyException extends Exception {\n" +
1353
			"class MyException extends Exception {\n" +
1372
			"  private static final long serialVersionUID = 1L;\n" +
1354
			"  private static final long serialVersionUID = 1L;\n" +
1373
			"}"
1355
			"}"
1374
	 	},
1356
		},
1375
		// compiler results
1357
		// compiler results
1376
	 	"----------\n" + /* expected compiler log */
1358
		"----------\n" + /* expected compiler log */
1377
		"1. WARNING in X.java (at line 5)\n" + 
1359
		"1. ERROR in X.java (at line 11)\n" + 
1378
		"	if (false) {\n" + 
1379
		"            i = 0;\n" + 
1380
		"            System.out.println(i);\n" + 
1381
		"            throw new MyException();\n" + 
1382
		"      }\n" + 
1383
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
1384
		"Dead code\n" + 
1385
		"----------\n" + 
1386
		"2. ERROR in X.java (at line 11)\n" + 
1387
		"	i = 1;\n" + 
1360
		"	i = 1;\n" + 
1388
		"	^\n" + 
1361
		"	^\n" + 
1389
		"The final local variable i may already have been assigned\n" + 
1362
		"The final local variable i may already have been assigned\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BooleanTest.java (-22 / +17 lines)
Lines 2266-2285 Link Here
2266
		"  X(boolean b1);\n" +
2266
		"  X(boolean b1);\n" +
2267
		"     0  aload_0 [this]\n" +
2267
		"     0  aload_0 [this]\n" +
2268
		"     1  invokespecial java.lang.Object() [8]\n" +
2268
		"     1  invokespecial java.lang.Object() [8]\n" +
2269
		"     4  iload_1 [b1]\n" +
2269
		"     4  getstatic java.lang.System.out : java.io.PrintStream [11]\n" +
2270
		"     5  ifeq 8\n" +
2270
		"     7  iload_1 [b1]\n" +
2271
		"     8  getstatic java.lang.System.out : java.io.PrintStream [11]\n" +
2271
		"     8  invokevirtual java.io.PrintStream.println(boolean) : void [17]\n" +
2272
		"    11  iload_1 [b1]\n" +
2272
		"    11  return\n" +
2273
		"    12  invokevirtual java.io.PrintStream.println(boolean) : void [17]\n" +
2274
		"    15  return\n" +
2275
		"      Line numbers:\n" +
2273
		"      Line numbers:\n" +
2276
		"        [pc: 0, line: 2]\n" +
2274
		"        [pc: 0, line: 2]\n" +
2277
		"        [pc: 4, line: 4]\n" +
2275
		"        [pc: 4, line: 5]\n" +
2278
		"        [pc: 8, line: 5]\n" +
2276
		"        [pc: 11, line: 7]\n" +
2279
		"        [pc: 15, line: 7]\n" +
2280
		"      Local variable table:\n" +
2277
		"      Local variable table:\n" +
2281
		"        [pc: 0, pc: 16] local: this index: 0 type: X\n" +
2278
		"        [pc: 0, pc: 12] local: this index: 0 type: X\n" +
2282
		"        [pc: 0, pc: 16] local: b1 index: 1 type: boolean\n";
2279
		"        [pc: 0, pc: 12] local: b1 index: 1 type: boolean\n";
2283
2280
2284
	File f = new File(OUTPUT_DIR + File.separator + "X.class");
2281
	File f = new File(OUTPUT_DIR + File.separator + "X.class");
2285
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
2282
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
Lines 2362-2382 Link Here
2362
		"     0  aload_0 [this]\n" +
2359
		"     0  aload_0 [this]\n" +
2363
		"     1  invokespecial java.lang.Object() [8]\n" +
2360
		"     1  invokespecial java.lang.Object() [8]\n" +
2364
		"     4  iload_1 [b1]\n" +
2361
		"     4  iload_1 [b1]\n" +
2365
		"     5  ifeq 12\n" +
2362
		"     5  ifeq 8\n" +
2366
		"     8  iload_1 [b1]\n" +
2363
		"     8  getstatic java.lang.System.out : java.io.PrintStream [11]\n" +
2367
		"     9  ifeq 12\n" +
2364
		"    11  iload_1 [b1]\n" +
2368
		"    12  getstatic java.lang.System.out : java.io.PrintStream [11]\n" +
2365
		"    12  invokevirtual java.io.PrintStream.println(boolean) : void [17]\n" +
2369
		"    15  iload_1 [b1]\n" +
2366
		"    15  return\n" +
2370
		"    16  invokevirtual java.io.PrintStream.println(boolean) : void [17]\n" +
2371
		"    19  return\n" +
2372
		"      Line numbers:\n" +
2367
		"      Line numbers:\n" +
2373
		"        [pc: 0, line: 2]\n" +
2368
		"        [pc: 0, line: 2]\n" +
2374
		"        [pc: 4, line: 4]\n" +
2369
		"        [pc: 4, line: 4]\n" +
2375
		"        [pc: 12, line: 5]\n" +
2370
		"        [pc: 8, line: 5]\n" +
2376
		"        [pc: 19, line: 7]\n" +
2371
		"        [pc: 15, line: 7]\n" +
2377
		"      Local variable table:\n" +
2372
		"      Local variable table:\n" +
2378
		"        [pc: 0, pc: 20] local: this index: 0 type: X\n" +
2373
		"        [pc: 0, pc: 16] local: this index: 0 type: X\n" +
2379
		"        [pc: 0, pc: 20] local: b1 index: 1 type: boolean\n";
2374
		"        [pc: 0, pc: 16] local: b1 index: 1 type: boolean\n";
2380
2375
2381
	File f = new File(OUTPUT_DIR + File.separator + "X.class");
2376
	File f = new File(OUTPUT_DIR + File.separator + "X.class");
2382
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
2377
	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_4.java (-70 / +58 lines)
Lines 385-405 Link Here
385
			"  public static void main(java.lang.String[] args);\n" +
385
			"  public static void main(java.lang.String[] args);\n" +
386
			"     0  bipush 6\n" +
386
			"     0  bipush 6\n" +
387
			"     2  istore_1 [i]\n" +
387
			"     2  istore_1 [i]\n" +
388
			"     3  iload_1 [i]\n" +
388
			"     3  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
389
			"     4  bipush 6\n" +
389
			"     6  iload_1 [i]\n" +
390
			"     6  if_icmpeq 9\n" +
390
			"     7  invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
391
			"     9  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
391
			"    10  return\n" +
392
			"    12  iload_1 [i]\n" +
393
			"    13  invokevirtual java.io.PrintStream.println(int) : void [22]\n" +
394
			"    16  return\n" +
395
			"      Line numbers:\n" +
392
			"      Line numbers:\n" +
396
			"        [pc: 0, line: 3]\n" +
393
			"        [pc: 0, line: 3]\n" +
397
			"        [pc: 3, line: 4]\n" +
394
			"        [pc: 3, line: 6]\n" +
398
			"        [pc: 9, line: 6]\n" +
395
			"        [pc: 10, line: 8]\n" +
399
			"        [pc: 16, line: 8]\n" +
400
			"      Local variable table:\n" +
396
			"      Local variable table:\n" +
401
			"        [pc: 0, pc: 17] local: args index: 0 type: java.lang.String[]\n" +
397
			"        [pc: 0, pc: 11] local: args index: 0 type: java.lang.String[]\n" +
402
			"        [pc: 3, pc: 17] local: i index: 1 type: int\n";
398
			"        [pc: 3, pc: 11] local: i index: 1 type: int\n";
403
		checkClassFile("A", source, expectedOutput);
399
		checkClassFile("A", source, expectedOutput);
404
	}
400
	}
405
401
Lines 1950-1969 Link Here
1950
			"  static void foo();\n" +
1946
			"  static void foo();\n" +
1951
			"     0  iconst_5\n" +
1947
			"     0  iconst_5\n" +
1952
			"     1  istore_0 [i]\n" +
1948
			"     1  istore_0 [i]\n" +
1953
			"     2  iload_0 [i]\n" +
1949
			"     2  getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
1954
			"     3  bipush 6\n" +
1950
			"     5  iload_0 [i]\n" +
1955
			"     5  if_icmpne 8\n" +
1951
			"     6  invokevirtual java.io.PrintStream.println(int) : void [27]\n" +
1956
			"     8  getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
1952
			"     9  return\n" +
1957
			"    11  iload_0 [i]\n" +
1958
			"    12  invokevirtual java.io.PrintStream.println(int) : void [27]\n" +
1959
			"    15  return\n" +
1960
			"      Line numbers:\n" +
1953
			"      Line numbers:\n" +
1961
			"        [pc: 0, line: 6]\n" +
1954
			"        [pc: 0, line: 6]\n" +
1962
			"        [pc: 2, line: 7]\n" +
1955
			"        [pc: 2, line: 9]\n" +
1963
			"        [pc: 8, line: 9]\n" +
1956
			"        [pc: 9, line: 11]\n" +
1964
			"        [pc: 15, line: 11]\n" +
1965
			"      Local variable table:\n" +
1957
			"      Local variable table:\n" +
1966
			"        [pc: 2, pc: 16] local: i index: 0 type: int\n";
1958
			"        [pc: 2, pc: 10] local: i index: 0 type: int\n";
1967
		checkClassFile("X", source, expectedOutput);
1959
		checkClassFile("X", source, expectedOutput);
1968
	}
1960
	}
1969
1961
Lines 2015-2034 Link Here
2015
			"  static void bar();\n" +
2007
			"  static void bar();\n" +
2016
			"     0  bipush 6\n" +
2008
			"     0  bipush 6\n" +
2017
			"     2  istore_0 [i]\n" +
2009
			"     2  istore_0 [i]\n" +
2018
			"     3  iload_0 [i]\n" +
2010
			"     3  getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
2019
			"     4  bipush 6\n" +
2011
			"     6  iload_0 [i]\n" +
2020
			"     6  if_icmpeq 9\n" +
2012
			"     7  invokevirtual java.io.PrintStream.println(int) : void [27]\n" +
2021
			"     9  getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
2013
			"    10  return\n" +
2022
			"    12  iload_0 [i]\n" +
2023
			"    13  invokevirtual java.io.PrintStream.println(int) : void [27]\n" +
2024
			"    16  return\n" +
2025
			"      Line numbers:\n" +
2014
			"      Line numbers:\n" +
2026
			"        [pc: 0, line: 6]\n" +
2015
			"        [pc: 0, line: 6]\n" +
2027
			"        [pc: 3, line: 7]\n" +
2016
			"        [pc: 3, line: 8]\n" +
2028
			"        [pc: 9, line: 8]\n" +
2017
			"        [pc: 10, line: 10]\n" +
2029
			"        [pc: 16, line: 10]\n" +
2030
			"      Local variable table:\n" +
2018
			"      Local variable table:\n" +
2031
			"        [pc: 3, pc: 17] local: i index: 0 type: int\n";
2019
			"        [pc: 3, pc: 11] local: i index: 0 type: int\n";
2032
		checkClassFile("X", source, expectedOutput);
2020
		checkClassFile("X", source, expectedOutput);
2033
	}
2021
	}
2034
2022
Lines 2094-2113 Link Here
2094
			"     1  istore_0 [i]\n" +
2082
			"     1  istore_0 [i]\n" +
2095
			"     2  iload_0 [i]\n" +
2083
			"     2  iload_0 [i]\n" +
2096
			"     3  bipush 6\n" +
2084
			"     3  bipush 6\n" +
2097
			"     5  if_icmpne 14\n" +
2085
			"     5  if_icmpne 12\n" +
2098
			"     8  invokestatic X.boom() : boolean [26]\n" +
2086
			"     8  invokestatic X.boom() : boolean [26]\n" +
2099
			"    11  ifeq 14\n" +
2087
			"    11  pop\n" +
2100
			"    14  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2088
			"    12  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2101
			"    17  iload_0 [i]\n" +
2089
			"    15  iload_0 [i]\n" +
2102
			"    18  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2090
			"    16  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2103
			"    21  return\n" +
2091
			"    19  return\n" +
2104
			"      Line numbers:\n" +
2092
			"      Line numbers:\n" +
2105
			"        [pc: 0, line: 9]\n" +
2093
			"        [pc: 0, line: 9]\n" +
2106
			"        [pc: 2, line: 10]\n" +
2094
			"        [pc: 2, line: 10]\n" +
2107
			"        [pc: 14, line: 12]\n" +
2095
			"        [pc: 12, line: 12]\n" +
2108
			"        [pc: 21, line: 14]\n" +
2096
			"        [pc: 19, line: 14]\n" +
2109
			"      Local variable table:\n" +
2097
			"      Local variable table:\n" +
2110
			"        [pc: 2, pc: 22] local: i index: 0 type: int\n";
2098
			"        [pc: 2, pc: 20] local: i index: 0 type: int\n";
2111
		checkClassFile("X", source, expectedOutput);
2099
		checkClassFile("X", source, expectedOutput);
2112
	}
2100
	}
2113
2101
Lines 2173-2192 Link Here
2173
			"     2  istore_0 [i]\n" +
2161
			"     2  istore_0 [i]\n" +
2174
			"     3  iload_0 [i]\n" +
2162
			"     3  iload_0 [i]\n" +
2175
			"     4  bipush 6\n" +
2163
			"     4  bipush 6\n" +
2176
			"     6  if_icmpeq 15\n" +
2164
			"     6  if_icmpeq 13\n" +
2177
			"     9  invokestatic X.boom() : boolean [26]\n" +
2165
			"     9  invokestatic X.boom() : boolean [26]\n" +
2178
			"    12  ifne 15\n" +
2166
			"    12  pop\n" +
2179
			"    15  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2167
			"    13  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2180
			"    18  iload_0 [i]\n" +
2168
			"    16  iload_0 [i]\n" +
2181
			"    19  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2169
			"    17  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2182
			"    22  return\n" +
2170
			"    20  return\n" +
2183
			"      Line numbers:\n" +
2171
			"      Line numbers:\n" +
2184
			"        [pc: 0, line: 9]\n" +
2172
			"        [pc: 0, line: 9]\n" +
2185
			"        [pc: 3, line: 10]\n" +
2173
			"        [pc: 3, line: 10]\n" +
2186
			"        [pc: 15, line: 11]\n" +
2174
			"        [pc: 13, line: 11]\n" +
2187
			"        [pc: 22, line: 13]\n" +
2175
			"        [pc: 20, line: 13]\n" +
2188
			"      Local variable table:\n" +
2176
			"      Local variable table:\n" +
2189
			"        [pc: 3, pc: 23] local: i index: 0 type: int\n";
2177
			"        [pc: 3, pc: 21] local: i index: 0 type: int\n";
2190
		checkClassFile("X", source, expectedOutput);
2178
		checkClassFile("X", source, expectedOutput);
2191
	}
2179
	}
2192
2180
Lines 2508-2527 Link Here
2508
			"     1  istore_0 [i]\n" +
2496
			"     1  istore_0 [i]\n" +
2509
			"     2  iload_0 [i]\n" +
2497
			"     2  iload_0 [i]\n" +
2510
			"     3  bipush 6\n" +
2498
			"     3  bipush 6\n" +
2511
			"     5  if_icmpne 14\n" +
2499
			"     5  if_icmpne 12\n" +
2512
			"     8  invokestatic X.boom() : boolean [26]\n" +
2500
			"     8  invokestatic X.boom() : boolean [26]\n" +
2513
			"    11  ifeq 14\n" +
2501
			"    11  pop\n" +
2514
			"    14  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2502
			"    12  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2515
			"    17  iload_0 [i]\n" +
2503
			"    15  iload_0 [i]\n" +
2516
			"    18  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2504
			"    16  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2517
			"    21  return\n" +
2505
			"    19  return\n" +
2518
			"      Line numbers:\n" +
2506
			"      Line numbers:\n" +
2519
			"        [pc: 0, line: 9]\n" +
2507
			"        [pc: 0, line: 9]\n" +
2520
			"        [pc: 2, line: 10]\n" +
2508
			"        [pc: 2, line: 10]\n" +
2521
			"        [pc: 14, line: 12]\n" +
2509
			"        [pc: 12, line: 12]\n" +
2522
			"        [pc: 21, line: 14]\n" +
2510
			"        [pc: 19, line: 14]\n" +
2523
			"      Local variable table:\n" +
2511
			"      Local variable table:\n" +
2524
			"        [pc: 2, pc: 22] local: i index: 0 type: int\n";
2512
			"        [pc: 2, pc: 20] local: i index: 0 type: int\n";
2525
		checkClassFile("X", source, expectedOutput);
2513
		checkClassFile("X", source, expectedOutput);
2526
	}
2514
	}
2527
2515
Lines 2587-2606 Link Here
2587
			"     2  istore_0 [i]\n" +
2575
			"     2  istore_0 [i]\n" +
2588
			"     3  iload_0 [i]\n" +
2576
			"     3  iload_0 [i]\n" +
2589
			"     4  bipush 6\n" +
2577
			"     4  bipush 6\n" +
2590
			"     6  if_icmpeq 15\n" +
2578
			"     6  if_icmpeq 13\n" +
2591
			"     9  invokestatic X.boom() : boolean [26]\n" +
2579
			"     9  invokestatic X.boom() : boolean [26]\n" +
2592
			"    12  ifne 15\n" +
2580
			"    12  pop\n" +
2593
			"    15  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2581
			"    13  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
2594
			"    18  iload_0 [i]\n" +
2582
			"    16  iload_0 [i]\n" +
2595
			"    19  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2583
			"    17  invokevirtual java.io.PrintStream.println(int) : void [34]\n" +
2596
			"    22  return\n" +
2584
			"    20  return\n" +
2597
			"      Line numbers:\n" +
2585
			"      Line numbers:\n" +
2598
			"        [pc: 0, line: 9]\n" +
2586
			"        [pc: 0, line: 9]\n" +
2599
			"        [pc: 3, line: 10]\n" +
2587
			"        [pc: 3, line: 10]\n" +
2600
			"        [pc: 15, line: 11]\n" +
2588
			"        [pc: 13, line: 11]\n" +
2601
			"        [pc: 22, line: 13]\n" +
2589
			"        [pc: 20, line: 13]\n" +
2602
			"      Local variable table:\n" +
2590
			"      Local variable table:\n" +
2603
			"        [pc: 3, pc: 23] local: i index: 0 type: int\n";
2591
			"        [pc: 3, pc: 21] local: i index: 0 type: int\n";
2604
		checkClassFile("X", source, expectedOutput);
2592
		checkClassFile("X", source, expectedOutput);
2605
	}
2593
	}
2606
2594
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java (-38 / +34 lines)
Lines 382-398 Link Here
382
		"    66  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
382
		"    66  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
383
		"    69  aconst_null\n" +
383
		"    69  aconst_null\n" +
384
		"    70  astore_2 [s]\n" +
384
		"    70  astore_2 [s]\n" +
385
		"    71  aload_2 [s]\n" +
385
		"    71  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
386
		"    72  ifnonnull 83\n" +
386
		"    74  ldc <String \"4\"> [55]\n" +
387
		"    75  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
387
		"    76  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
388
		"    78  ldc <String \"4\"> [55]\n" +
388
		"    79  ldc <String \"aaa\"> [57]\n" +
389
		"    80  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
389
		"    81  astore_3 [s2]\n" +
390
		"    83  ldc <String \"aaa\"> [57]\n" +
390
		"    82  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
391
		"    85  astore_3 [s2]\n" +
391
		"    85  ldc <String \"5\"> [59]\n" +
392
		"    86  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
392
		"    87  invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
393
		"    89  ldc <String \"5\"> [59]\n" +
393
		"    90  return\n" +
394
		"    91  invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
395
		"    94  return\n" +
396
		"      Line numbers:\n" +
394
		"      Line numbers:\n" +
397
		"        [pc: 0, line: 3]\n" +
395
		"        [pc: 0, line: 3]\n" +
398
		"        [pc: 8, line: 4]\n" +
396
		"        [pc: 8, line: 4]\n" +
Lines 401-414 Link Here
401
		"        [pc: 61, line: 7]\n" +
399
		"        [pc: 61, line: 7]\n" +
402
		"        [pc: 69, line: 8]\n" +
400
		"        [pc: 69, line: 8]\n" +
403
		"        [pc: 71, line: 9]\n" +
401
		"        [pc: 71, line: 9]\n" +
404
		"        [pc: 83, line: 10]\n" +
402
		"        [pc: 79, line: 10]\n" +
405
		"        [pc: 86, line: 11]\n" +
403
		"        [pc: 82, line: 11]\n" +
406
		"        [pc: 94, line: 12]\n" +
404
		"        [pc: 90, line: 12]\n" +
407
		"      Local variable table:\n" +
405
		"      Local variable table:\n" +
408
		"        [pc: 0, pc: 95] local: args index: 0 type: java.lang.String[]\n" +
406
		"        [pc: 0, pc: 91] local: args index: 0 type: java.lang.String[]\n" +
409
		"        [pc: 61, pc: 95] local: b index: 1 type: boolean\n" +
407
		"        [pc: 61, pc: 91] local: b index: 1 type: boolean\n" +
410
		"        [pc: 71, pc: 95] local: s index: 2 type: java.lang.String\n" +
408
		"        [pc: 71, pc: 91] local: s index: 2 type: java.lang.String\n" +
411
		"        [pc: 86, pc: 95] local: s2 index: 3 type: java.lang.String\n";
409
		"        [pc: 82, pc: 91] local: s2 index: 3 type: java.lang.String\n";
412
410
413
	String expectedOutput15 =
411
	String expectedOutput15 =
414
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
412
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
Lines 447-463 Link Here
447
		"    66  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
445
		"    66  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
448
		"    69  aconst_null\n" +
446
		"    69  aconst_null\n" +
449
		"    70  astore_2 [s]\n" +
447
		"    70  astore_2 [s]\n" +
450
		"    71  aload_2 [s]\n" +
448
		"    71  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
451
		"    72  ifnonnull 83\n" +
449
		"    74  ldc <String \"4\"> [55]\n" +
452
		"    75  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
450
		"    76  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
453
		"    78  ldc <String \"4\"> [55]\n" +
451
		"    79  ldc <String \"aaa\"> [57]\n" +
454
		"    80  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" +
452
		"    81  astore_3 [s2]\n" +
455
		"    83  ldc <String \"aaa\"> [57]\n" +
453
		"    82  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
456
		"    85  astore_3 [s2]\n" +
454
		"    85  ldc <String \"5\"> [59]\n" +
457
		"    86  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
455
		"    87  invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
458
		"    89  ldc <String \"5\"> [59]\n" +
456
		"    90  return\n" +
459
		"    91  invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" +
460
		"    94  return\n" +
461
		"      Line numbers:\n" +
457
		"      Line numbers:\n" +
462
		"        [pc: 0, line: 3]\n" +
458
		"        [pc: 0, line: 3]\n" +
463
		"        [pc: 8, line: 4]\n" +
459
		"        [pc: 8, line: 4]\n" +
Lines 466-479 Link Here
466
		"        [pc: 61, line: 7]\n" +
462
		"        [pc: 61, line: 7]\n" +
467
		"        [pc: 69, line: 8]\n" +
463
		"        [pc: 69, line: 8]\n" +
468
		"        [pc: 71, line: 9]\n" +
464
		"        [pc: 71, line: 9]\n" +
469
		"        [pc: 83, line: 10]\n" +
465
		"        [pc: 79, line: 10]\n" +
470
		"        [pc: 86, line: 11]\n" +
466
		"        [pc: 82, line: 11]\n" +
471
		"        [pc: 94, line: 12]\n" +
467
		"        [pc: 90, line: 12]\n" +
472
		"      Local variable table:\n" +
468
		"      Local variable table:\n" +
473
		"        [pc: 0, pc: 95] local: args index: 0 type: java.lang.String[]\n" +
469
		"        [pc: 0, pc: 91] local: args index: 0 type: java.lang.String[]\n" +
474
		"        [pc: 61, pc: 95] local: b index: 1 type: boolean\n" +
470
		"        [pc: 61, pc: 91] local: b index: 1 type: boolean\n" +
475
		"        [pc: 71, pc: 95] local: s index: 2 type: java.lang.String\n" +
471
		"        [pc: 71, pc: 91] local: s index: 2 type: java.lang.String\n" +
476
		"        [pc: 86, pc: 95] local: s2 index: 3 type: java.lang.String\n";
472
		"        [pc: 82, pc: 91] local: s2 index: 3 type: java.lang.String\n";
477
473
478
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
474
	if (this.complianceLevel >= ClassFileConstants.JDK1_5) {
479
		int index = actualOutput.indexOf(expectedOutput15);
475
		int index = actualOutput.indexOf(expectedOutput15);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (-51 / +359 lines)
Lines 178-183 Link Here
178
		"	if (o != null) { /* */ }\n" +
178
		"	if (o != null) { /* */ }\n" +
179
		"	    ^\n" +
179
		"	    ^\n" +
180
		"Null comparison always yields false: The variable o can only be null at this location\n" +
180
		"Null comparison always yields false: The variable o can only be null at this location\n" +
181
		"----------\n" +
182
		"2. WARNING in X.java (at line 4)\n" + 
183
		"	if (o != null) { /* */ }\n" + 
184
		"	               ^^^^^^^^^\n" + 
185
		"Dead code\n" + 
181
		"----------\n",
186
		"----------\n",
182
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
187
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
183
}
188
}
Lines 849-854 Link Here
849
			"	if (i == null) {};\n" +
854
			"	if (i == null) {};\n" +
850
			"	    ^\n" +
855
			"	    ^\n" +
851
			"Null comparison always yields false: The variable i cannot be null at this location\n" +
856
			"Null comparison always yields false: The variable i cannot be null at this location\n" +
857
			"----------\n" +
858
			"2. WARNING in X.java (at line 4)\n" + 
859
			"	if (i == null) {};\n" + 
860
			"	               ^^\n" + 
861
			"Dead code\n" + 
852
			"----------\n",
862
			"----------\n",
853
		    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
863
		    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
854
	}
864
	}
Lines 911-916 Link Here
911
			"	if (i == null) {}\n" +
921
			"	if (i == null) {}\n" +
912
			"	    ^\n" +
922
			"	    ^\n" +
913
			"Null comparison always yields false: The variable i cannot be null at this location\n" +
923
			"Null comparison always yields false: The variable i cannot be null at this location\n" +
924
			"----------\n" +
925
			"2. WARNING in X.java (at line 4)\n" + 
926
			"	if (i == null) {}\n" + 
927
			"	               ^^\n" + 
928
			"Dead code\n" + 
914
			"----------\n",
929
			"----------\n",
915
		    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
930
		    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
916
	}
931
	}
Lines 996-1001 Link Here
996
		"	if (o == null) {};\n" +
1011
		"	if (o == null) {};\n" +
997
		"	    ^\n" +
1012
		"	    ^\n" +
998
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1013
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1014
		"----------\n" +
1015
		"2. WARNING in X.java (at line 4)\n" + 
1016
		"	if (o == null) {};\n" + 
1017
		"	               ^^\n" + 
1018
		"Dead code\n" + 
999
		"----------\n",
1019
		"----------\n",
1000
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1020
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1001
}
1021
}
Lines 1062-1067 Link Here
1062
		"	if (o == null) {/* empty */}\n" +
1082
		"	if (o == null) {/* empty */}\n" +
1063
		"	    ^\n" +
1083
		"	    ^\n" +
1064
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1084
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1085
		"----------\n" +
1086
		"2. WARNING in X.java (at line 4)\n" + 
1087
		"	if (o == null) {/* empty */}\n" + 
1088
		"	               ^^^^^^^^^^^^^\n" + 
1089
		"Dead code\n" + 
1065
		"----------\n",
1090
		"----------\n",
1066
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1091
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1067
}
1092
}
Lines 1116-1121 Link Here
1116
		"	if (o == null)  { /* */ }\n" +
1141
		"	if (o == null)  { /* */ }\n" +
1117
		"	    ^\n" +
1142
		"	    ^\n" +
1118
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1143
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1144
		"----------\n" +
1145
		"2. WARNING in X.java (at line 4)\n" + 
1146
		"	if (o == null)  { /* */ }\n" + 
1147
		"	                ^^^^^^^^^\n" + 
1148
		"Dead code\n" + 
1119
		"----------\n",
1149
		"----------\n",
1120
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1150
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1121
}
1151
}
Lines 1153-1158 Link Here
1153
		"	if (c == null) {};\n" +
1183
		"	if (c == null) {};\n" +
1154
		"	    ^\n" +
1184
		"	    ^\n" +
1155
		"Null comparison always yields false: The variable c cannot be null at this location\n" +
1185
		"Null comparison always yields false: The variable c cannot be null at this location\n" +
1186
		"----------\n" +
1187
		"2. WARNING in X.java (at line 4)\n" + 
1188
		"	if (c == null) {};\n" + 
1189
		"	               ^^\n" + 
1190
		"Dead code\n" + 
1156
		"----------\n",
1191
		"----------\n",
1157
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1192
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1158
}
1193
}
Lines 1216-1221 Link Here
1216
		"	if (o == null) { /* */ }\n" +
1251
		"	if (o == null) { /* */ }\n" +
1217
		"	    ^\n" +
1252
		"	    ^\n" +
1218
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1253
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1254
		"----------\n" +
1255
		"3. WARNING in X.java (at line 6)\n" + 
1256
		"	if (o == null) { /* */ }\n" + 
1257
		"	               ^^^^^^^^^\n" + 
1258
		"Dead code\n" + 
1219
		"----------\n",
1259
		"----------\n",
1220
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1260
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1221
}
1261
}
Lines 1243-1248 Link Here
1243
		"	if (o == null) { /* */ }\n" +
1283
		"	if (o == null) { /* */ }\n" +
1244
		"	    ^\n" +
1284
		"	    ^\n" +
1245
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1285
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1286
		"----------\n" +
1287
		"3. WARNING in X.java (at line 6)\n" + 
1288
		"	if (o == null) { /* */ }\n" + 
1289
		"	               ^^^^^^^^^\n" + 
1290
		"Dead code\n" + 
1246
		"----------\n",
1291
		"----------\n",
1247
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1292
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1248
}
1293
}
Lines 1415-1420 Link Here
1415
		"	if (x == null) { /* */ }\n" +
1460
		"	if (x == null) { /* */ }\n" +
1416
		"	    ^\n" +
1461
		"	    ^\n" +
1417
		"Null comparison always yields false: The variable x cannot be null at this location\n" +
1462
		"Null comparison always yields false: The variable x cannot be null at this location\n" +
1463
		"----------\n" +
1464
		"2. WARNING in X.java (at line 4)\n" + 
1465
		"	if (x == null) { /* */ }\n" + 
1466
		"	               ^^^^^^^^^\n" + 
1467
		"Dead code\n" + 
1418
		"----------\n",
1468
		"----------\n",
1419
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1469
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1420
}
1470
}
Lines 1776-1781 Link Here
1776
		"	if (o == null) {\n" +
1826
		"	if (o == null) {\n" +
1777
		"	    ^\n" +
1827
		"	    ^\n" +
1778
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1828
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1829
		"----------\n" +
1830
		"2. WARNING in X.java (at line 4)\n" + 
1831
		"	if (o == null) {\n" + 
1832
		"        // do nothing\n" + 
1833
		"      }\n" + 
1834
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
1835
		"Dead code\n" + 
1779
		"----------\n",
1836
		"----------\n",
1780
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1837
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1781
}
1838
}
Lines 1918-1927 Link Here
1918
		"	    ^\n" +
1975
		"	    ^\n" +
1919
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1976
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
1920
		"----------\n" +
1977
		"----------\n" +
1921
		"2. ERROR in X.java (at line 7)\n" +
1978
		"2. WARNING in X.java (at line 5)\n" +
1922
		"	o.toString();\n" +
1979
		"	if (o == null) { /* */ }\n" +
1923
		"	^\n" +
1980
		"	               ^^^^^^^^^\n" +
1924
		"Potential null pointer access: The variable o may be null at this location\n" +
1981
		"Dead code\n" +
1982
		"----------\n" +
1983
		"3. ERROR in X.java (at line 6)\n" +
1984
		"	if (o != null) { /* */ }\n" +
1985
		"	    ^\n" +
1986
		"Redundant null check: The variable o cannot be null at this location\n" +
1925
		"----------\n",
1987
		"----------\n",
1926
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1988
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1927
}
1989
}
Lines 1945-1950 Link Here
1945
		"	if (o == null) { /* */ }\n" +
2007
		"	if (o == null) { /* */ }\n" +
1946
		"	    ^\n" +
2008
		"	    ^\n" +
1947
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
2009
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
2010
		"----------\n" +
2011
		"2. WARNING in X.java (at line 6)\n" + 
2012
		"	if (o == null) { /* */ }\n" + 
2013
		"	               ^^^^^^^^^\n" + 
2014
		"Dead code\n" + 
1948
		"----------\n",
2015
		"----------\n",
1949
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2016
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
1950
}
2017
}
Lines 2083-2088 Link Here
2083
		"	if (o == null) { /* */ }\n" +
2150
		"	if (o == null) { /* */ }\n" +
2084
		"	    ^\n" +
2151
		"	    ^\n" +
2085
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
2152
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
2153
		"----------\n" +
2154
		"2. WARNING in X.java (at line 4)\n" + 
2155
		"	if (o == null) { /* */ }\n" + 
2156
		"	               ^^^^^^^^^\n" + 
2157
		"Dead code\n" + 
2086
		"----------\n",
2158
		"----------\n",
2087
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2159
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2088
}
2160
}
Lines 2121-2126 Link Here
2121
		"	if (o == null) { /* */ }\n" +
2193
		"	if (o == null) { /* */ }\n" +
2122
		"	    ^\n" +
2194
		"	    ^\n" +
2123
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
2195
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
2196
		"----------\n" +
2197
		"2. WARNING in X.java (at line 5)\n" + 
2198
		"	if (o == null) { /* */ }\n" + 
2199
		"	               ^^^^^^^^^\n" + 
2200
		"Dead code\n" + 
2124
		"----------\n",
2201
		"----------\n",
2125
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2202
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2126
}
2203
}
Lines 2402-2408 Link Here
2402
			"      o.toString();\n" +
2479
			"      o.toString();\n" +
2403
			"    }\n" +
2480
			"    }\n" +
2404
			"    else {\n" +
2481
			"    else {\n" +
2405
			"      o.toString();\n" + // must complain anyway (could be quite distant from the if test)
2482
			"      o.toString();\n" +
2406
			"    }\n" +
2483
			"    }\n" +
2407
			"    o.toString();\n" + // quiet
2484
			"    o.toString();\n" + // quiet
2408
			"  }\n" +
2485
			"  }\n" +
Lines 2413-2431 Link Here
2413
		"	    ^\n" +
2490
		"	    ^\n" +
2414
		"Redundant null check: The variable o cannot be null at this location\n" +
2491
		"Redundant null check: The variable o cannot be null at this location\n" +
2415
		"----------\n" +
2492
		"----------\n" +
2416
		"2. ERROR in X.java (at line 8)\n" +
2493
		"2. WARNING in X.java (at line 7)\n" +
2417
		"	o.toString();\n" +
2494
		"	else {\n" + 
2418
		"	^\n" +
2495
		"      o.toString();\n" + 
2419
		"Null pointer access: The variable o can only be null at this location\n" +
2496
		"    }\n" + 
2497
		"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2498
		"Dead code\n" + 
2420
		"----------\n",
2499
		"----------\n",
2421
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2500
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2422
}
2501
}
2423
2502
2424
// null analysis - if/else
2503
// null analysis - if/else
2425
// TODO (maxime) https://bugs.eclipse.org/bugs/show_bug.cgi?id=129581
2504
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=129581
2426
// this is a limit of the fix for bug 128014 - calls for a nuance
2505
// Test that no false null reference warning is issued for a variable
2427
// between potential null and tainted null
2506
// that has been wrongly tainted by a redundant null check upstream.
2428
public void _test0335_if_else() {
2507
public void test0335_if_else() {
2429
	this.runNegativeTest(
2508
	this.runNegativeTest(
2430
		new String[] {
2509
		new String[] {
2431
			"X.java",
2510
			"X.java",
Lines 2473-2482 Link Here
2473
		"	    ^\n" +
2552
		"	    ^\n" +
2474
		"Redundant null check: The variable o cannot be null at this location\n" +
2553
		"Redundant null check: The variable o cannot be null at this location\n" +
2475
		"----------\n" +
2554
		"----------\n" +
2476
		"2. ERROR in X.java (at line 8)\n" +
2555
		"2. WARNING in X.java (at line 7)\n" + 
2477
		"	o.toString();\n" +
2556
		"	else {\n" + 
2478
		"	^\n" +
2557
		"        o.toString();\n" + 
2479
		"Null pointer access: The variable o can only be null at this location\n" +
2558
		"      }\n" + 
2559
		"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
2560
		"Dead code\n" + 
2480
		"----------\n",
2561
		"----------\n",
2481
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2562
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
2482
}
2563
}
Lines 3147-3152 Link Here
3147
		"	if (o == null) { /* */ }\n" +
3228
		"	if (o == null) { /* */ }\n" +
3148
		"	    ^\n" +
3229
		"	    ^\n" +
3149
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
3230
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
3231
		"----------\n" +
3232
		"2. WARNING in X.java (at line 7)\n" + 
3233
		"	if (o == null) { /* */ }\n" + 
3234
		"	               ^^^^^^^^^\n" + 
3235
		"Dead code\n" + 
3150
		"----------\n",
3236
		"----------\n",
3151
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
3237
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
3152
}
3238
}
Lines 3172-3177 Link Here
3172
		"	if (o == null) { /* */ }\n" +
3258
		"	if (o == null) { /* */ }\n" +
3173
		"	    ^\n" +
3259
		"	    ^\n" +
3174
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
3260
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
3261
		"----------\n" +
3262
		"2. WARNING in X.java (at line 7)\n" + 
3263
		"	if (o == null) { /* */ }\n" + 
3264
		"	               ^^^^^^^^^\n" + 
3265
		"Dead code\n" + 
3175
		"----------\n",
3266
		"----------\n",
3176
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
3267
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
3177
}
3268
}
Lines 3241-3246 Link Here
3241
		"	if (o == null) { /* */ }\n" +
3332
		"	if (o == null) { /* */ }\n" +
3242
		"	    ^\n" +
3333
		"	    ^\n" +
3243
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
3334
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
3335
		"----------\n" +
3336
		"2. WARNING in X.java (at line 6)\n" + 
3337
		"	if (o == null) { /* */ }\n" + 
3338
		"	               ^^^^^^^^^\n" + 
3339
		"Dead code\n" + 
3244
		"----------\n",
3340
		"----------\n",
3245
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
3341
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
3246
}
3342
}
Lines 4492-4497 Link Here
4492
		"	if (o == null) { /* */ }\n" +
4588
		"	if (o == null) { /* */ }\n" +
4493
		"	    ^\n" +
4589
		"	    ^\n" +
4494
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
4590
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
4591
		"----------\n" + 
4592
		"2. WARNING in X.java (at line 7)\n" + 
4593
		"	if (o == null) { /* */ }\n" + 
4594
		"	               ^^^^^^^^^\n" + 
4595
		"Dead code\n" + 
4495
		"----------\n",
4596
		"----------\n",
4496
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4597
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4497
}
4598
}
Lines 4517-4522 Link Here
4517
		"	if (o == null) {\n" +
4618
		"	if (o == null) {\n" +
4518
		"	    ^\n" +
4619
		"	    ^\n" +
4519
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
4620
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
4621
		"----------\n" +
4622
		"2. WARNING in X.java (at line 7)\n" + 
4623
		"	if (o == null) {\n" + 
4624
		"      o = new Object();\n" + 
4625
		"    }\n" + 
4626
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
4627
		"Dead code\n" + 
4520
		"----------\n",
4628
		"----------\n",
4521
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4629
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
4522
}
4630
}
Lines 5810-5815 Link Here
5810
		"	if (ex == null) {\n" +
5918
		"	if (ex == null) {\n" +
5811
		"	    ^^\n" +
5919
		"	    ^^\n" +
5812
		"Null comparison always yields false: The variable ex cannot be null at this location\n" +
5920
		"Null comparison always yields false: The variable ex cannot be null at this location\n" +
5921
		"----------\n" +
5922
		"2. WARNING in X.java (at line 20)\n" + 
5923
		"	if (ex == null) {\n" + 
5924
		"    }\n" + 
5925
		"	                ^^^^^^^\n" + 
5926
		"Dead code\n" + 
5813
		"----------\n",
5927
		"----------\n",
5814
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
5928
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
5815
}
5929
}
Lines 7587-7592 Link Here
7587
		"	if(o == null) { /* */ }\n" +
7701
		"	if(o == null) { /* */ }\n" +
7588
		"	   ^\n" +
7702
		"	   ^\n" +
7589
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
7703
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
7704
		"----------\n" +
7705
		"2. WARNING in X.java (at line 12)\n" + 
7706
		"	if(o == null) { /* */ }\n" + 
7707
		"	              ^^^^^^^^^\n" + 
7708
		"Dead code\n" + 
7590
		"----------\n",
7709
		"----------\n",
7591
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
7710
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
7592
}
7711
}
Lines 7962-7968 Link Here
7962
			"	    ^^\n" +
8081
			"	    ^^\n" +
7963
			"Null comparison always yields false: The variable o1 cannot be null at this location\n" +
8082
			"Null comparison always yields false: The variable o1 cannot be null at this location\n" +
7964
			"----------\n" +
8083
			"----------\n" +
7965
			"2. ERROR in X.java (at line 5)\n" +
8084
			"2. WARNING in X.java (at line 4)\n" + 
8085
			"	if (o1 == null) { };\n" + 
8086
			"	                ^^^\n" + 
8087
			"Dead code\n" + 
8088
			"----------\n" + 
8089
			"3. ERROR in X.java (at line 5)\n" +
7966
			"	if (o2 == null) { };\n" +
8090
			"	if (o2 == null) { };\n" +
7967
			"	    ^^\n" +
8091
			"	    ^^\n" +
7968
			"Redundant null check: The variable o2 can only be null at this location\n" +
8092
			"Redundant null check: The variable o2 can only be null at this location\n" +
Lines 8011-8016 Link Here
8011
		"	if (o == null) { };\n" +
8135
		"	if (o == null) { };\n" +
8012
		"	    ^\n" +
8136
		"	    ^\n" +
8013
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8137
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8138
		"----------\n" +
8139
		"2. WARNING in X.java (at line 4)\n" + 
8140
		"	if (o == null) { };\n" + 
8141
		"	               ^^^\n" + 
8142
		"Dead code\n" + 
8014
		"----------\n",
8143
		"----------\n",
8015
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8144
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8016
	}
8145
	}
Lines 8040-8045 Link Here
8040
		"	if (o == null) { };\n" +
8169
		"	if (o == null) { };\n" +
8041
		"	    ^\n" +
8170
		"	    ^\n" +
8042
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8171
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8172
		"----------\n" +
8173
		"3. WARNING in X.java (at line 5)\n" + 
8174
		"	if (o == null) { };\n" + 
8175
		"	               ^^^\n" + 
8176
		"Dead code\n" + 
8043
		"----------\n",
8177
		"----------\n",
8044
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8178
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8045
	}
8179
	}
Lines 8208-8227 Link Here
8208
		"	    ^\n" +
8342
		"	    ^\n" +
8209
		"Null comparison always yields false: The variable x cannot be null at this location\n" +
8343
		"Null comparison always yields false: The variable x cannot be null at this location\n" +
8210
		"----------\n" +
8344
		"----------\n" +
8211
		"3. ERROR in X.java (at line 6)\n" +
8345
		"3. WARNING in X.java (at line 5)\n" +
8212
		"	x.foo(null); // 3\n" +
8346
		"	if (x == null) { // 2\n" +
8213
		"	^\n" +
8347
		"        x.foo(null); // 3\n" +
8214
		"Null pointer access: The variable x can only be null at this location\n" +
8348
		"      } else if (x instanceof X) { // 4\n" +
8349
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8350
		"Dead code\n" +
8215
		"----------\n" +
8351
		"----------\n" +
8216
		"4. ERROR in X.java (at line 9)\n" +
8352
		"4. ERROR in X.java (at line 9)\n" +
8217
		"	} else if (x != null) { // 6\n" +
8353
		"	} else if (x != null) { // 6\n" +
8218
		"	           ^\n" +
8354
		"	           ^\n" +
8219
		"Redundant null check: The variable x cannot be null at this location\n" +
8355
		"Redundant null check: The variable x cannot be null at this location\n" +
8220
		"----------\n" +
8221
		"5. ERROR in X.java (at line 12)\n" +
8222
		"	x.foo(null); // 8\n" +
8223
		"	^\n" +
8224
		"Potential null pointer access: The variable x may be null at this location\n" +
8225
		"----------\n",
8356
		"----------\n",
8226
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8357
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8227
}
8358
}
Lines 8375-8380 Link Here
8375
		"	if (other != null) {\n" +
8506
		"	if (other != null) {\n" +
8376
		"	    ^^^^^\n" +
8507
		"	    ^^^^^\n" +
8377
		"Redundant null check: The variable other cannot be null at this location\n" +
8508
		"Redundant null check: The variable other cannot be null at this location\n" +
8509
		"----------\n" +
8510
		"2. ERROR in X.java (at line 11)\n" + 
8511
		"	if (other == null) {\n" + 
8512
		"	    ^^^^^\n" + 
8513
		"Null comparison always yields false: The variable other cannot be null at this location\n" + 
8514
		"----------\n" + 
8515
		"3. WARNING in X.java (at line 11)\n" + 
8516
		"	if (other == null) {\n" + 
8517
		"      }\n" + 
8518
		"	                   ^^^^^^^^^\n" + 
8519
		"Dead code\n" + 
8378
		"----------\n",
8520
		"----------\n",
8379
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8521
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8380
}
8522
}
Lines 8428-8437 Link Here
8428
		"	    ^\n" +
8570
		"	    ^\n" +
8429
		"Null comparison always yields false: The variable x cannot be null at this location\n" +
8571
		"Null comparison always yields false: The variable x cannot be null at this location\n" +
8430
		"----------\n" +
8572
		"----------\n" +
8431
		"2. ERROR in X.java (at line 5)\n" +
8573
		"2. WARNING in X.java (at line 4)\n" +
8432
		"	x.foo(this);\n" +
8574
		"	if (x == null) {\n" +
8433
		"	^\n" +
8575
		"        x.foo(this);\n" +
8434
		"Null pointer access: The variable x can only be null at this location\n" +
8576
		"      }\n" +
8577
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8578
		"Dead code\n" +
8435
		"----------\n",
8579
		"----------\n",
8436
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8580
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8437
}
8581
}
Lines 8680-8685 Link Here
8680
		"	if (o == null) return;\n" +
8824
		"	if (o == null) return;\n" +
8681
		"	    ^\n" +
8825
		"	    ^\n" +
8682
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8826
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8827
		"----------\n" +
8828
		"2. WARNING in X.java (at line 13)\n" + 
8829
		"	if (o == null) return;\n" + 
8830
		"	               ^^^^^^^\n" + 
8831
		"Dead code\n" + 
8683
		"----------\n",
8832
		"----------\n",
8684
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8833
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8685
}
8834
}
Lines 8739-8744 Link Here
8739
		"	if (o == null) return;\n" +
8888
		"	if (o == null) return;\n" +
8740
		"	    ^\n" +
8889
		"	    ^\n" +
8741
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8890
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
8891
		"----------\n" +
8892
		"2. WARNING in X.java (at line 10)\n" + 
8893
		"	if (o == null) return;\n" + 
8894
		"	               ^^^^^^^\n" + 
8895
		"Dead code\n" + 
8742
		"----------\n",
8896
		"----------\n",
8743
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8897
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8744
}
8898
}
Lines 8890-8895 Link Here
8890
		"	if (a == null) {\n" +
9044
		"	if (a == null) {\n" +
8891
		"	    ^\n" +
9045
		"	    ^\n" +
8892
		"Null comparison always yields false: The variable a cannot be null at this location\n" +
9046
		"Null comparison always yields false: The variable a cannot be null at this location\n" +
9047
		"----------\n" +
9048
		"3. WARNING in X.java (at line 13)\n" + 
9049
		"	if (a == null) {\n" + 
9050
		"      System.out.println();\n" + 
9051
		"    }\n" + 
9052
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9053
		"Dead code\n" + 
8893
		"----------\n",
9054
		"----------\n",
8894
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9055
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8895
}
9056
}
Lines 8947-8952 Link Here
8947
		"	if(a!=null)\n" +
9108
		"	if(a!=null)\n" +
8948
		"	   ^\n" +
9109
		"	   ^\n" +
8949
		"Null comparison always yields false: The variable a can only be null at this location\n" +
9110
		"Null comparison always yields false: The variable a can only be null at this location\n" +
9111
		"----------\n" +
9112
		"3. WARNING in X.java (at line 9)\n" + 
9113
		"	{ /* */ }\n" + 
9114
		"	^^^^^^^^^\n" + 
9115
		"Dead code\n" + 
8950
		"----------\n",
9116
		"----------\n",
8951
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9117
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
8952
}
9118
}
Lines 9043-9049 Link Here
9043
				  "}\n"
9209
				  "}\n"
9044
				  } /* testFiles */,
9210
				  } /* testFiles */,
9045
			"----------\n" +
9211
			"----------\n" +
9046
			"1. WARNING in X.java (at line 8)\n" +
9212
			"1. WARNING in X.java (at line 4)\n" +
9213
			"	if (o != null) {\n" +
9214
			"       o = null;\n" +
9215
			"    }\n" +
9216
			"	               ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9217
			"Dead code\n" +
9218
			"----------\n" +
9219
			"2. WARNING in X.java (at line 8)\n" +
9047
			"	o.toString();\n" +
9220
			"	o.toString();\n" +
9048
			"	^\n" +
9221
			"	^\n" +
9049
			"Null pointer access: The variable o can only be null at this location\n" +
9222
			"Null pointer access: The variable o can only be null at this location\n" +
Lines 9105-9122 Link Here
9105
			  "  }\n" +
9278
			  "  }\n" +
9106
			  "}\n"},
9279
			  "}\n"},
9107
		"----------\n" +
9280
		"----------\n" +
9108
		"1. ERROR in X.java (at line 4)\r\n" +
9281
		"1. ERROR in X.java (at line 4)\n" +
9109
		"	if (o != null) {\r\n" +
9282
		"	if (o != null) {\n" +
9110
		"	    ^\n" +
9283
		"	    ^\n" +
9111
		"Null comparison always yields false: The variable o can only be null at this location\n" +
9284
		"Null comparison always yields false: The variable o can only be null at this location\n" + 
9112
		"----------\n" +
9285
		"----------\n" +
9113
		"2. ERROR in X.java (at line 8)\r\n" +
9286
		"2. WARNING in X.java (at line 4)\n" + 
9114
		"	o.toString();\r\n" +
9287
		"	if (o != null) {\n" + 
9288
		"       o = null;\n" + 
9289
		"    }\n" + 
9290
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9291
		"Dead code\n" + 
9292
		"----------\n" +
9293
		"3. ERROR in X.java (at line 8)\n" +
9294
		"	o.toString();\n" +
9115
		"	^\n" +
9295
		"	^\n" +
9116
		"Null pointer access: The variable o can only be null at this location\n" +
9296
		"Null pointer access: The variable o can only be null at this location\n" +
9117
		"----------\n" +
9297
		"----------\n" +
9118
		"3. ERROR in X.java (at line 9)\r\n" +
9298
		"4. ERROR in X.java (at line 9)\n" +
9119
		"	p.toString();\r\n" +
9299
		"	p.toString();\n" +
9120
		"	^\n" +
9300
		"	^\n" +
9121
		"Potential null pointer access: The variable p may be null at this location\n" +
9301
		"Potential null pointer access: The variable p may be null at this location\n" +
9122
		"----------\n",
9302
		"----------\n",
Lines 9152-9159 Link Here
9152
		customOptions /* custom options */,
9332
		customOptions /* custom options */,
9153
		// compiler results
9333
		// compiler results
9154
		"----------\n" +  /* expected compiler log */
9334
		"----------\n" +  /* expected compiler log */
9155
		"1. ERROR in X.java (at line 8)\r\n" +
9335
		"1. WARNING in X.java (at line 4)\n" + 
9156
		"	o.toString();\r\n" +
9336
		"	if (o != null) {\n" + 
9337
		"       o = null;\n" + 
9338
		"    }\n" + 
9339
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9340
		"Dead code\n" + 
9341
		"----------\n" +
9342
		"2. ERROR in X.java (at line 8)\n" +
9343
		"	o.toString();\n" +
9157
		"	^\n" +
9344
		"	^\n" +
9158
		"Null pointer access: The variable o can only be null at this location\n" +
9345
		"Null pointer access: The variable o can only be null at this location\n" +
9159
		"----------\n",
9346
		"----------\n",
Lines 9190-9202 Link Here
9190
		customOptions /* custom options */,
9377
		customOptions /* custom options */,
9191
		// compiler results
9378
		// compiler results
9192
		"----------\n" +  /* expected compiler log */
9379
		"----------\n" +  /* expected compiler log */
9193
		"1. ERROR in X.java (at line 4)\r\n" +
9380
		"1. ERROR in X.java (at line 4)\n" +
9194
		"	if (o != null) {\r\n" +
9381
		"	if (o != null) {\n" +
9195
		"	    ^\n" +
9382
		"	    ^\n" +
9196
		"Null comparison always yields false: The variable o can only be null at this location\n" +
9383
		"Null comparison always yields false: The variable o can only be null at this location\n" +
9197
		"----------\n" +
9384
		"----------\n" +
9198
		"2. WARNING in X.java (at line 8)\r\n" +
9385
		"2. WARNING in X.java (at line 4)\n" + 
9199
		"	o.toString();\r\n" +
9386
		"	if (o != null) {\n" + 
9387
		"       o = null;\n" + 
9388
		"    }\n" + 
9389
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9390
		"Dead code\n" + 
9391
		"----------\n" +
9392
		"3. WARNING in X.java (at line 8)\n" +
9393
		"	o.toString();\n" +
9200
		"	^\n" +
9394
		"	^\n" +
9201
		"Null pointer access: The variable o can only be null at this location\n" +
9395
		"Null pointer access: The variable o can only be null at this location\n" +
9202
		"----------\n",
9396
		"----------\n",
Lines 9233-9245 Link Here
9233
		customOptions /* custom options */,
9427
		customOptions /* custom options */,
9234
		// compiler results
9428
		// compiler results
9235
		"----------\n" +  /* expected compiler log */
9429
		"----------\n" +  /* expected compiler log */
9236
		"1. ERROR in X.java (at line 4)\r\n" +
9430
		"1. ERROR in X.java (at line 4)\n" +
9237
		"	if (o != null) {\r\n" +
9431
		"	if (o != null) {\n" +
9238
		"	    ^\n" +
9432
		"	    ^\n" +
9239
		"Null comparison always yields false: The variable o can only be null at this location\n" +
9433
		"Null comparison always yields false: The variable o can only be null at this location\n" +
9240
		"----------\n" +
9434
		"----------\n" +
9241
		"2. ERROR in X.java (at line 9)\r\n" +
9435
		"2. WARNING in X.java (at line 4)\n" + 
9242
		"	p.toString();\r\n" +
9436
		"	if (o != null) {\n" + 
9437
		"       o = null;\n" + 
9438
		"    }\n" + 
9439
		"	               ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9440
		"Dead code\n" + 
9441
		"----------\n" +
9442
		"3. ERROR in X.java (at line 9)\n" +
9443
		"	p.toString();\n" +
9243
		"	^\n" +
9444
		"	^\n" +
9244
		"Potential null pointer access: The variable p may be null at this location\n" +
9445
		"Potential null pointer access: The variable p may be null at this location\n" +
9245
		"----------\n",
9446
		"----------\n",
Lines 9278-9285 Link Here
9278
			customOptions /* custom options */,
9479
			customOptions /* custom options */,
9279
			// compiler results
9480
			// compiler results
9280
			"----------\n" +  /* expected compiler log */
9481
			"----------\n" +  /* expected compiler log */
9281
			"1. ERROR in X.java (at line 9)\r\n" +
9482
			"1. WARNING in X.java (at line 5)\n" + 
9282
			"	o.toString();\r\n" +
9483
			"	if (o != null) {\n" + 
9484
			"       o = null;\n" + 
9485
			"    }\n" + 
9486
			"	               ^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
9487
			"Dead code\n" + 
9488
			"----------\n" +
9489
			"2. ERROR in X.java (at line 9)\n" +
9490
			"	o.toString();\n" +
9283
			"	^\n" +
9491
			"	^\n" +
9284
			"Null pointer access: The variable o can only be null at this location\n" +
9492
			"Null pointer access: The variable o can only be null at this location\n" +
9285
			"----------\n",
9493
			"----------\n",
Lines 9489-9494 Link Here
9489
		"	if (o65 == null) { /* */ }\n" +
9697
		"	if (o65 == null) { /* */ }\n" +
9490
		"	    ^^^\n" +
9698
		"	    ^^^\n" +
9491
		"Null comparison always yields false: The variable o65 cannot be null at this location\n" +
9699
		"Null comparison always yields false: The variable o65 cannot be null at this location\n" +
9700
		"----------\n" +
9701
		"2. WARNING in X.java (at line 18)\n" + 
9702
		"	if (o65 == null) { /* */ }\n" + 
9703
		"	                 ^^^^^^^^^\n" + 
9704
		"Dead code\n" + 
9705
		"----------\n" + 
9706
		"3. ERROR in X.java (at line 19)\n" + 
9707
		"	if (o65 != null) { /* */ }\n" + 
9708
		"	    ^^^\n" + 
9709
		"Redundant null check: The variable o65 cannot be null at this location\n" + 
9492
		"----------\n",
9710
		"----------\n",
9493
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9711
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9494
}
9712
}
Lines 9746-9751 Link Here
9746
		"	if (o == null) { /* */ }\n" +
9964
		"	if (o == null) { /* */ }\n" +
9747
		"	    ^\n" +
9965
		"	    ^\n" +
9748
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
9966
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
9967
		"----------\n" +
9968
		"2. WARNING in X.java (at line 20)\n" + 
9969
		"	if (o == null) { /* */ }\n" + 
9970
		"	               ^^^^^^^^^\n" + 
9971
		"Dead code\n" + 
9749
		"----------\n",
9972
		"----------\n",
9750
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9973
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9751
}
9974
}
Lines 9783-9788 Link Here
9783
		"	if (o == null) { /* */ }\n" +
10006
		"	if (o == null) { /* */ }\n" +
9784
		"	    ^\n" +
10007
		"	    ^\n" +
9785
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
10008
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
10009
		"----------\n" +
10010
		"2. WARNING in X.java (at line 21)\n" + 
10011
		"	if (o == null) { /* */ }\n" + 
10012
		"	               ^^^^^^^^^\n" + 
10013
		"Dead code\n" + 
9786
		"----------\n",
10014
		"----------\n",
9787
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
10015
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9788
}
10016
}
Lines 9823-9828 Link Here
9823
		"	if (o == null) { /* */ }\n" +
10051
		"	if (o == null) { /* */ }\n" +
9824
		"	    ^\n" +
10052
		"	    ^\n" +
9825
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
10053
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
10054
		"----------\n" +
10055
		"2. WARNING in X.java (at line 24)\n" + 
10056
		"	if (o == null) { /* */ }\n" + 
10057
		"	               ^^^^^^^^^\n" + 
10058
		"Dead code\n" + 
9826
		"----------\n",
10059
		"----------\n",
9827
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
10060
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9828
}
10061
}
Lines 9863-9868 Link Here
9863
		"	if (o == null) { /* */ }\n" +
10096
		"	if (o == null) { /* */ }\n" +
9864
		"	    ^\n" +
10097
		"	    ^\n" +
9865
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
10098
		"Null comparison always yields false: The variable o cannot be null at this location\n" +
10099
		"----------\n" +
10100
		"2. WARNING in X.java (at line 24)\n" + 
10101
		"	if (o == null) { /* */ }\n" + 
10102
		"	               ^^^^^^^^^\n" + 
10103
		"Dead code\n" + 
9866
		"----------\n",
10104
		"----------\n",
9867
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
10105
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9868
}
10106
}
Lines 10328-10331 Link Here
10328
				"----------\n");
10566
				"----------\n");
10329
	}
10567
	}
10330
}
10568
}
10569
10570
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=293917
10571
// Test that a redundant null check doesn't affect the null status of
10572
// a variable downstream.
10573
public void testBug293917() {
10574
	this.runNegativeTest(
10575
		new String[] {
10576
			"X.java",
10577
			"public class X {\n" +
10578
			"	public void foo(){\n" +
10579
			"		String x = null, y = null;\n" +
10580
			"		if (x == null) x = \"foo\";\n" +
10581
			"		if (x != null) y = \"bar\";\n" +
10582
			"		x.length();\n" +   // shouldn't warn here    
10583
			"		y.length();\n" +   // shouldn't warn here
10584
			"	}\n" +
10585
			"}\n"},
10586
		"----------\n" +
10587
		"1. ERROR in X.java (at line 4)\n" + 
10588
		"	if (x == null) x = \"foo\";\n" + 
10589
		"	    ^\n" + 
10590
		"Redundant null check: The variable x can only be null at this location\n" + 
10591
		"----------\n" + 
10592
		"2. ERROR in X.java (at line 5)\n" + 
10593
		"	if (x != null) y = \"bar\";\n" + 
10594
		"	    ^\n" + 
10595
		"Redundant null check: The variable x cannot be null at this location\n" + 
10596
		"----------\n",
10597
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
10598
}
10599
10600
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=190623
10601
//Test that a redundant null check doesn't affect the null status of
10602
//a variable downstream.
10603
public void testBug190623() {
10604
	this.runNegativeTest(
10605
		new String[] {
10606
			"X.java",
10607
			"public class X {\n" +
10608
			"    public static void main(String[] args) {\n" +
10609
			"        Number n = getNumber();\n" +
10610
			"        if (n instanceof Double) {\n" +
10611
			"            Double d= (Double) n;\n" +
10612
			"            if (d != null && d.isNaN()) {\n" +
10613
			"                System.out.println(\"outside loop\");\n" +
10614
			"            }\n" +
10615
			"            for (int i= 0; i < 10; i++) {\n" +
10616
			"                if (d != null && d.isNaN()) {\n" +
10617
			"                    System.out.println(\"inside loop\");\n" +
10618
			"                }\n" +
10619
			"            }\n" +
10620
			"        }\n" +
10621
			"    }\n" +
10622
			"    private static Number getNumber() {\n" +
10623
			"        return new Double(Math.sqrt(-1));\n" +
10624
			"    }\n" +
10625
			"}\n"},
10626
		"----------\n" +
10627
		"1. ERROR in X.java (at line 6)\n" + 
10628
		"	if (d != null && d.isNaN()) {\n" + 
10629
		"	    ^\n" + 
10630
		"Redundant null check: The variable d cannot be null at this location\n" + 
10631
		"----------\n" + 
10632
		"2. ERROR in X.java (at line 10)\n" + 
10633
		"	if (d != null && d.isNaN()) {\n" + 
10634
		"	    ^\n" + 
10635
		"Redundant null check: The variable d cannot be null at this location\n" + 
10636
		"----------\n",
10637
	    JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
10638
}
10331
}
10639
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java (-34 / +44 lines)
Lines 6142-6149 Link Here
6142
				"		int b = 1;\n" + 
6142
				"		int b = 1;\n" + 
6143
				"	};\n" + 
6143
				"	};\n" + 
6144
				"\n" + 
6144
				"\n" + 
6145
				"	private Object bar2() {\n" + 
6146
				"		return null;\n" + 
6147
				"	}\n" + 
6145
				"	private Object bar() {\n" + 
6148
				"	private Object bar() {\n" + 
6146
				"		Object o = null;\n" + 
6149
				"		Object o = bar2();\n" + 
6147
				"		if (o != null) {\n" + 
6150
				"		if (o != null) {\n" + 
6148
				"			o.toString();\n" + 
6151
				"			o.toString();\n" + 
6149
				"		}\n" + 
6152
				"		}\n" + 
Lines 6154-6180 Link Here
6154
			},
6157
			},
6155
		"");
6158
		"");
6156
		String expectedOutput =
6159
		String expectedOutput =
6160
			"  // Method descriptor #23 ()Ljava/lang/Object;\n" + 
6157
			"  // Stack: 1, Locals: 2\n" + 
6161
			"  // Stack: 1, Locals: 2\n" + 
6158
			"  private java.lang.Object bar();\n" + 
6162
			"  private java.lang.Object bar();\n" + 
6159
			"     0  aconst_null\n" + 
6163
			"     0  aload_0 [this]\n" + 
6160
			"     1  astore_1 [o]\n" + 
6164
			"     1  invokespecial X.bar2() : java.lang.Object [25]\n" + 
6161
			"     2  aload_1 [o]\n" + 
6165
			"     4  astore_1 [o]\n" + 
6162
			"     3  ifnull 11\n" + 
6166
			"     5  aload_1 [o]\n" + 
6163
			"     6  aload_1 [o]\n" + 
6167
			"     6  ifnull 14\n" + 
6164
			"     7  invokevirtual java.lang.Object.toString() : java.lang.String [24]\n" + 
6168
			"     9  aload_1 [o]\n" + 
6165
			"    10  pop\n" + 
6169
			"    10  invokevirtual java.lang.Object.toString() : java.lang.String [27]\n" + 
6166
			"    11  aconst_null\n" + 
6170
			"    13  pop\n" + 
6167
			"    12  areturn\n" + 
6171
			"    14  aconst_null\n" + 
6172
			"    15  areturn\n" + 
6168
			"      Line numbers:\n" + 
6173
			"      Line numbers:\n" + 
6169
			"        [pc: 0, line: 8]\n" + 
6174
			"        [pc: 0, line: 11]\n" + 
6170
			"        [pc: 2, line: 9]\n" + 
6175
			"        [pc: 5, line: 12]\n" + 
6171
			"        [pc: 6, line: 10]\n" + 
6176
			"        [pc: 9, line: 13]\n" + 
6172
			"        [pc: 11, line: 12]\n" + 
6177
			"        [pc: 14, line: 15]\n" + 
6173
			"      Local variable table:\n" + 
6178
			"      Local variable table:\n" + 
6174
			"        [pc: 0, pc: 13] local: this index: 0 type: X\n" + 
6179
			"        [pc: 0, pc: 16] local: this index: 0 type: X\n" + 
6175
			"        [pc: 2, pc: 13] local: o index: 1 type: java.lang.Object\n" + 
6180
			"        [pc: 5, pc: 16] local: o index: 1 type: java.lang.Object\n" + 
6176
			"      Stack map table: number of frames 1\n" + 
6181
			"      Stack map table: number of frames 1\n" + 
6177
			"        [pc: 11, append: {java.lang.Object}]\n";
6182
			"        [pc: 14, append: {java.lang.Object}]\n";
6178
		checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
6183
		checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
6179
	}
6184
	}
6180
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=251539
6185
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=251539
Lines 6203-6210 Link Here
6203
				"		int b = 1;\n" + 
6208
				"		int b = 1;\n" + 
6204
				"		int c = 2;\n" + 
6209
				"		int c = 2;\n" + 
6205
				"	};\n" +
6210
				"	};\n" +
6211
				"	private Object bar2() {\n" + 
6212
				"		return null;\n" + 
6213
				"	}\n" + 
6206
				"	private Object bar() {\n" + 
6214
				"	private Object bar() {\n" + 
6207
				"		Object o = null;\n" + 
6215
				"		Object o = bar2();\n" + 
6208
				"		if (o != null) {\n" + 
6216
				"		if (o != null) {\n" + 
6209
				"			o.toString();\n" + 
6217
				"			o.toString();\n" + 
6210
				"		}\n" + 
6218
				"		}\n" + 
Lines 6215-6241 Link Here
6215
		"");
6223
		"");
6216
	
6224
	
6217
		String expectedOutput =
6225
		String expectedOutput =
6226
			"  // Method descriptor #29 ()Ljava/lang/Object;\n" + 
6218
			"  // Stack: 1, Locals: 2\n" + 
6227
			"  // Stack: 1, Locals: 2\n" + 
6219
			"  private java.lang.Object bar();\n" + 
6228
			"  private java.lang.Object bar();\n" + 
6220
			"     0  aconst_null\n" + 
6229
			"     0  aload_0 [this]\n" + 
6221
			"     1  astore_1 [o]\n" + 
6230
			"     1  invokespecial X.bar2() : java.lang.Object [31]\n" + 
6222
			"     2  aload_1 [o]\n" + 
6231
			"     4  astore_1 [o]\n" + 
6223
			"     3  ifnull 11\n" + 
6232
			"     5  aload_1 [o]\n" + 
6224
			"     6  aload_1 [o]\n" + 
6233
			"     6  ifnull 14\n" + 
6225
			"     7  invokevirtual java.lang.Object.toString() : java.lang.String [30]\n" + 
6234
			"     9  aload_1 [o]\n" + 
6226
			"    10  pop\n" + 
6235
			"    10  invokevirtual java.lang.Object.toString() : java.lang.String [33]\n" + 
6227
			"    11  aconst_null\n" + 
6236
			"    13  pop\n" + 
6228
			"    12  areturn\n" + 
6237
			"    14  aconst_null\n" + 
6238
			"    15  areturn\n" + 
6229
			"      Line numbers:\n" + 
6239
			"      Line numbers:\n" + 
6230
			"        [pc: 0, line: 12]\n" + 
6240
			"        [pc: 0, line: 15]\n" + 
6231
			"        [pc: 2, line: 13]\n" + 
6241
			"        [pc: 5, line: 16]\n" + 
6232
			"        [pc: 6, line: 14]\n" + 
6242
			"        [pc: 9, line: 17]\n" + 
6233
			"        [pc: 11, line: 16]\n" + 
6243
			"        [pc: 14, line: 19]\n" + 
6234
			"      Local variable table:\n" + 
6244
			"      Local variable table:\n" + 
6235
			"        [pc: 0, pc: 13] local: this index: 0 type: X\n" + 
6245
			"        [pc: 0, pc: 16] local: this index: 0 type: X\n" + 
6236
			"        [pc: 2, pc: 13] local: o index: 1 type: java.lang.Object\n" + 
6246
			"        [pc: 5, pc: 16] local: o index: 1 type: java.lang.Object\n" + 
6237
			"      Stack map table: number of frames 1\n" + 
6247
			"      Stack map table: number of frames 1\n" + 
6238
			"        [pc: 11, append: {java.lang.Object}]\n";
6248
			"        [pc: 14, append: {java.lang.Object}]\n";
6239
		checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
6249
		checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput);
6240
	}
6250
	}
6241
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=260031
6251
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=260031

Return to bug 293917