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: |