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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/Block.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 29-35 Link Here
29
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
29
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
30
	// empty block
30
	// empty block
31
	if (this.statements == null)	return flowInfo;
31
	if (this.statements == null)	return flowInfo;
32
	int complaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
32
	int complaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
33
	for (int i = 0, max = this.statements.length; i < max; i++) {
33
	for (int i = 0, max = this.statements.length; i < max; i++) {
34
		Statement stat = this.statements[i];
34
		Statement stat = this.statements[i];
35
		if ((complaintLevel = stat.complainIfUnreachable(flowInfo, this.scope, complaintLevel)) < Statement.COMPLAINED_UNREACHABLE) {
35
		if ((complaintLevel = stat.complainIfUnreachable(flowInfo, this.scope, complaintLevel)) < Statement.COMPLAINED_UNREACHABLE) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java (-1 / +1 lines)
Lines 43-49 Link Here
43
43
44
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
44
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
45
			FlowInfo flowInfo) {
45
			FlowInfo flowInfo) {
46
		int initialComplaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
46
		int initialComplaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
47
		Constant cst = this.condition.optimizedBooleanConstant();
47
		Constant cst = this.condition.optimizedBooleanConstant();
48
		boolean isConditionOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
48
		boolean isConditionOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
49
		boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
49
		boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 62-68 Link Here
62
	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
62
	public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
63
		this.breakLabel = new BranchLabel();
63
		this.breakLabel = new BranchLabel();
64
		this.continueLabel = new BranchLabel();
64
		this.continueLabel = new BranchLabel();
65
		int initialComplaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
65
		int initialComplaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
66
66
67
		// process the initializations
67
		// process the initializations
68
		if (this.initializations != null) {
68
		if (this.initializations != null) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 76-82 Link Here
76
		// initialize break and continue labels
76
		// initialize break and continue labels
77
		this.breakLabel = new BranchLabel();
77
		this.breakLabel = new BranchLabel();
78
		this.continueLabel = new BranchLabel();
78
		this.continueLabel = new BranchLabel();
79
		int initialComplaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
79
		int initialComplaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
80
80
81
		// process the element variable and collection
81
		// process the element variable and collection
82
		this.collection.checkNPE(currentScope, flowContext, flowInfo);
82
		this.collection.checkNPE(currentScope, flowContext, flowInfo);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java (-6 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 55-61 Link Here
55
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
55
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
56
	// process the condition
56
	// process the condition
57
	FlowInfo conditionFlowInfo = this.condition.analyseCode(currentScope, flowContext, flowInfo);
57
	FlowInfo conditionFlowInfo = this.condition.analyseCode(currentScope, flowContext, flowInfo);
58
	int initialComplaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
58
	int initialComplaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
59
59
60
	Constant cst = this.condition.optimizedBooleanConstant();
60
	Constant cst = this.condition.optimizedBooleanConstant();
61
	if ((this.condition.implicitConversion & TypeIds.UNBOXING) != 0) {
61
	if ((this.condition.implicitConversion & TypeIds.UNBOXING) != 0) {
Lines 73-85 Link Here
73
	if (isConditionOptimizedTrue) {
73
	if (isConditionOptimizedTrue) {
74
		elseFlowInfo.setReachMode(FlowInfo.UNREACHABLE);
74
		elseFlowInfo.setReachMode(FlowInfo.UNREACHABLE);
75
	}
75
	}
76
	if (((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) && 
76
	if (((flowInfo.tagBits & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) == 0) && 
77
			((thenFlowInfo.tagBits & FlowInfo.UNREACHABLE) != 0)) {
77
			((thenFlowInfo.tagBits & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0)) {
78
		// Mark then block as unreachable
78
		// Mark then block as unreachable
79
		// No need if the whole if-else construct itself lies in unreachable code
79
		// No need if the whole if-else construct itself lies in unreachable code
80
		this.bits |= ASTNode.IsThenStatementUnreachable;
80
		this.bits |= ASTNode.IsThenStatementUnreachable;
81
	} else if (((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) &&
81
	} else if (((flowInfo.tagBits & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) == 0) &&
82
			((elseFlowInfo.tagBits & FlowInfo.UNREACHABLE) != 0)) {
82
			((elseFlowInfo.tagBits & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0)) {
83
		// Mark else block as unreachable
83
		// Mark else block as unreachable
84
		// No need if the whole if-else construct itself lies in unreachable code
84
		// No need if the whole if-else construct itself lies in unreachable code
85
		this.bits |= ASTNode.IsElseStatementUnreachable;
85
		this.bits |= ASTNode.IsElseStatementUnreachable;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 97-103 Link Here
97
			}
97
			}
98
			// propagate to statements
98
			// propagate to statements
99
			if (this.statements != null) {
99
			if (this.statements != null) {
100
				int complaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) == 0 ? Statement.NOT_COMPLAINED : Statement.COMPLAINED_FAKE_REACHABLE;
100
				int complaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) == 0 ? Statement.NOT_COMPLAINED : Statement.COMPLAINED_FAKE_REACHABLE;
101
				for (int i = 0, count = this.statements.length; i < count; i++) {
101
				for (int i = 0, count = this.statements.length; i < count; i++) {
102
					Statement stat = this.statements[i];
102
					Statement stat = this.statements[i];
103
					if ((complaintLevel = stat.complainIfUnreachable(flowInfo, this.scope, complaintLevel)) < Statement.COMPLAINED_UNREACHABLE) {
103
					if ((complaintLevel = stat.complainIfUnreachable(flowInfo, this.scope, complaintLevel)) < Statement.COMPLAINED_UNREACHABLE) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java (-1 / +1 lines)
Lines 71-77 Link Here
71
// Report an error if necessary (if even more unreachable than previously reported
71
// Report an error if necessary (if even more unreachable than previously reported
72
// complaintLevel = 0 if was reachable up until now, 1 if fake reachable (deadcode), 2 if fatal unreachable (error)
72
// complaintLevel = 0 if was reachable up until now, 1 if fake reachable (deadcode), 2 if fatal unreachable (error)
73
public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previousComplaintLevel) {
73
public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previousComplaintLevel) {
74
	if ((flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0) {
74
	if ((flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0) {
75
		this.bits &= ~ASTNode.IsReachable;
75
		this.bits &= ~ASTNode.IsReachable;
76
		if (flowInfo == FlowInfo.DEAD_END) {
76
		if (flowInfo == FlowInfo.DEAD_END) {
77
			if (previousComplaintLevel < COMPLAINED_UNREACHABLE) {
77
			if (previousComplaintLevel < COMPLAINED_UNREACHABLE) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 61-67 Link Here
61
			this.preSwitchInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);
61
			this.preSwitchInitStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);
62
			int caseIndex = 0;
62
			int caseIndex = 0;
63
			if (this.statements != null) {
63
			if (this.statements != null) {
64
				int initialComplaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
64
				int initialComplaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
65
				int complaintLevel = initialComplaintLevel;
65
				int complaintLevel = initialComplaintLevel;
66
				int fallThroughState = CASE;
66
				int fallThroughState = CASE;
67
				for (int i = 0, max = this.statements.length; i < max; i++) {
67
				for (int i = 0, max = this.statements.length; i < max; i++) {
(-)compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 41-47 Link Here
41
41
42
		this.breakLabel = new BranchLabel();
42
		this.breakLabel = new BranchLabel();
43
		this.continueLabel = new BranchLabel();
43
		this.continueLabel = new BranchLabel();
44
		int initialComplaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
44
		int initialComplaintLevel = (flowInfo.reachMode() & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ? Statement.COMPLAINED_FAKE_REACHABLE : Statement.NOT_COMPLAINED;
45
45
46
		Constant cst = this.condition.constant;
46
		Constant cst = this.condition.constant;
47
		boolean isConditionTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
47
		boolean isConditionTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
(-)compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java (-6 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 565-571 Link Here
565
 */
565
 */
566
public void recordUsingNullReference(Scope scope, LocalVariableBinding local,
566
public void recordUsingNullReference(Scope scope, LocalVariableBinding local,
567
		Expression reference, int checkType, FlowInfo flowInfo) {
567
		Expression reference, int checkType, FlowInfo flowInfo) {
568
	if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) != 0 ||
568
	if ((flowInfo.tagBits & (FlowInfo.UNREACHABLE|FlowInfo.UNREACHABLE_BY_NULLANALYSIS)) != 0 ||
569
			flowInfo.isDefinitelyUnknown(local)) {
569
			flowInfo.isDefinitelyUnknown(local)) {
570
		return;
570
		return;
571
	}
571
	}
Lines 578-591 Link Here
578
						scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
578
						scope.problemReporter().localVariableRedundantCheckOnNonNull(local, reference);
579
					}
579
					}
580
					if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
580
					if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
581
						flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
581
						flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE_BY_NULLANALYSIS);
582
					}
582
					}
583
				} else {
583
				} else {
584
					if ((this.tagBits & FlowContext.HIDE_NULL_COMPARISON_WARNING) == 0) {
584
					if ((this.tagBits & FlowContext.HIDE_NULL_COMPARISON_WARNING) == 0) {
585
						scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
585
						scope.problemReporter().localVariableNonNullComparedToNull(local, reference);
586
					}
586
					}
587
					if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
587
					if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
588
						flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
588
						flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE_BY_NULLANALYSIS);
589
					}
589
					}
590
				}
590
				}
591
				return;
591
				return;
Lines 609-615 Link Here
609
							scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
609
							scope.problemReporter().localVariableRedundantCheckOnNull(local, reference);
610
						}
610
						}
611
						if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
611
						if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
612
							flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE);
612
							flowInfo.initsWhenFalse().setReachMode(FlowInfo.UNREACHABLE_BY_NULLANALYSIS);
613
						}
613
						}
614
						return;
614
						return;
615
					case FlowContext.IN_COMPARISON_NON_NULL:
615
					case FlowContext.IN_COMPARISON_NON_NULL:
Lines 621-627 Link Here
621
							scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
621
							scope.problemReporter().localVariableNullComparedToNonNull(local, reference);
622
						}
622
						}
623
						if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
623
						if (!flowInfo.isMarkedAsNullOrNonNullInAssertExpression(local)) {
624
							flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE);
624
							flowInfo.initsWhenTrue().setReachMode(FlowInfo.UNREACHABLE_BY_NULLANALYSIS);
625
						}
625
						}
626
						return;
626
						return;
627
					case FlowContext.IN_ASSIGNMENT:
627
					case FlowContext.IN_ASSIGNMENT:
(-)compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java (-4 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 24-29 Link Here
24
	public final static int REACHABLE = 0;
24
	public final static int REACHABLE = 0;
25
	public final static int UNREACHABLE = 1;
25
	public final static int UNREACHABLE = 1;
26
	public final static int NULL_FLAG_MASK = 2;
26
	public final static int NULL_FLAG_MASK = 2;
27
	public static final int UNREACHABLE_BY_NULLANALYSIS = 4;
28
	
27
29
28
	public final static int UNKNOWN = 1;
30
	public final static int UNKNOWN = 1;
29
	public final static int NULL = 2;
31
	public final static int NULL = 2;
Lines 456-468 Link Here
456
}
458
}
457
459
458
/**
460
/**
459
 * Return REACHABLE if this flow info is reachable, UNREACHABLE
461
 * Return REACHABLE if this flow info is reachable, UNREACHABLE|UNREACHABLE_BY_NULLANALYSIS
460
 * else.
462
 * else.
461
 * @return REACHABLE if this flow info is reachable, UNREACHABLE
463
 * @return REACHABLE if this flow info is reachable, UNREACHABLE|UNREACHABLE_BY_NULLANALYSIS
462
 *         else
464
 *         else
463
 */
465
 */
464
public int reachMode() {
466
public int reachMode() {
465
	return this.tagBits & UNREACHABLE;
467
	return this.tagBits & (UNREACHABLE|UNREACHABLE_BY_NULLANALYSIS);
466
}
468
}
467
469
468
/**
470
/**
(-)compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java (+14 lines)
Lines 1563-1568 Link Here
1563
		na1, na2, na3, na4,
1563
		na1, na2, na3, na4,
1564
		nb1, nb2, nb3, nb4,
1564
		nb1, nb2, nb3, nb4,
1565
		b1, b2, b3, b4;
1565
		b1, b2, b3, b4;
1566
  if ((otherInits.tagBits & FlowInfo.UNREACHABLE_BY_NULLANALYSIS) != 0) {
1567
	  otherHasNulls = false; // skip merging, otherInits is unreachable by null analysis
1568
  } else {
1569
	if ((this.tagBits & FlowInfo.UNREACHABLE_BY_NULLANALYSIS) != 0) { // directly copy if this is unreachable by null analysis
1570
		this.nullBit1 = otherInits.nullBit1;
1571
		this.nullBit2 = otherInits.nullBit2;
1572
		this.nullBit3 = otherInits.nullBit3;
1573
		this.nullBit4 = otherInits.nullBit4;
1574
		thisHadNulls = false;
1575
		thisHasNulls = otherHasNulls;
1576
	} else
1566
	if (thisHadNulls) {
1577
	if (thisHadNulls) {
1567
    	if (otherHasNulls) {
1578
    	if (otherHasNulls) {
1568
    		this.nullBit1 = (a2 = this.nullBit2) & (a3 = this.nullBit3)
1579
    		this.nullBit1 = (a2 = this.nullBit2) & (a3 = this.nullBit3)
Lines 1636-1641 Link Here
1636
    		this.nullBit3 != 0 ||
1647
    		this.nullBit3 != 0 ||
1637
    		this.nullBit4 != 0;
1648
    		this.nullBit4 != 0;
1638
	}
1649
	}
1650
  }
1639
1651
1640
	// treating extra storage
1652
	// treating extra storage
1641
	if (this.extra != null || otherInits.extra != null) {
1653
	if (this.extra != null || otherInits.extra != null) {
Lines 1858-1863 Link Here
1858
	}	
1870
	}	
1859
	if (reachMode == REACHABLE ) {
1871
	if (reachMode == REACHABLE ) {
1860
		this.tagBits &= ~UNREACHABLE;
1872
		this.tagBits &= ~UNREACHABLE;
1873
	} else if (reachMode == UNREACHABLE_BY_NULLANALYSIS) {
1874
		this.tagBits |= UNREACHABLE_BY_NULLANALYSIS; // don't interfere with definite assignment analysis
1861
	} else {
1875
	} else {
1862
		if ((this.tagBits & UNREACHABLE) == 0) {
1876
		if ((this.tagBits & UNREACHABLE) == 0) {
1863
			// reset optional inits when becoming unreachable
1877
			// reset optional inits when becoming unreachable

Return to bug 338234