Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2010 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 27-32
Link Here
|
27 |
import org.eclipse.jdt.internal.compiler.lookup.Scope; |
27 |
import org.eclipse.jdt.internal.compiler.lookup.Scope; |
28 |
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; |
28 |
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; |
29 |
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; |
29 |
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; |
|
|
30 |
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; |
30 |
import org.eclipse.jdt.internal.compiler.lookup.VariableBinding; |
31 |
import org.eclipse.jdt.internal.compiler.lookup.VariableBinding; |
31 |
|
32 |
|
32 |
/** |
33 |
/** |
Lines 559-567
Link Here
|
559 |
if (flowInfo.isDefinitelyNull(local)) { |
560 |
if (flowInfo.isDefinitelyNull(local)) { |
560 |
switch(checkType & CONTEXT_MASK) { |
561 |
switch(checkType & CONTEXT_MASK) { |
561 |
case FlowContext.IN_COMPARISON_NULL: |
562 |
case FlowContext.IN_COMPARISON_NULL: |
|
|
563 |
if (((checkType & CHECK_MASK) == CAN_ONLY_NULL) && (reference.implicitConversion & TypeIds.UNBOXING) != 0) { // check for auto-unboxing first and report appropriate warning |
564 |
scope.problemReporter().localVariableNullReference(local, reference); |
565 |
return; |
566 |
} |
562 |
scope.problemReporter().localVariableRedundantCheckOnNull(local, reference); |
567 |
scope.problemReporter().localVariableRedundantCheckOnNull(local, reference); |
563 |
return; |
568 |
return; |
564 |
case FlowContext.IN_COMPARISON_NON_NULL: |
569 |
case FlowContext.IN_COMPARISON_NON_NULL: |
|
|
570 |
if (((checkType & CHECK_MASK) == CAN_ONLY_NULL) && (reference.implicitConversion & TypeIds.UNBOXING) != 0) { // check for auto-unboxing first and report appropriate warning |
571 |
scope.problemReporter().localVariableNullReference(local, reference); |
572 |
return; |
573 |
} |
565 |
scope.problemReporter().localVariableNullComparedToNonNull(local, reference); |
574 |
scope.problemReporter().localVariableNullComparedToNonNull(local, reference); |
566 |
return; |
575 |
return; |
567 |
case FlowContext.IN_ASSIGNMENT: |
576 |
case FlowContext.IN_ASSIGNMENT: |
Lines 571-576
Link Here
|
571 |
scope.problemReporter().localVariableNullInstanceof(local, reference); |
580 |
scope.problemReporter().localVariableNullInstanceof(local, reference); |
572 |
return; |
581 |
return; |
573 |
} |
582 |
} |
|
|
583 |
} else if (flowInfo.isPotentiallyNull(local)) { |
584 |
switch(checkType & CONTEXT_MASK) { |
585 |
case FlowContext.IN_COMPARISON_NULL: |
586 |
if (((checkType & CHECK_MASK) == CAN_ONLY_NULL) && (reference.implicitConversion & TypeIds.UNBOXING) != 0) { // check for auto-unboxing first and report appropriate warning |
587 |
scope.problemReporter().localVariablePotentialNullReference(local, reference); |
588 |
return; |
589 |
} |
590 |
break; |
591 |
case FlowContext.IN_COMPARISON_NON_NULL: |
592 |
if (((checkType & CHECK_MASK) == CAN_ONLY_NULL) && (reference.implicitConversion & TypeIds.UNBOXING) != 0) { // check for auto-unboxing first and report appropriate warning |
593 |
scope.problemReporter().localVariablePotentialNullReference(local, reference); |
594 |
return; |
595 |
} |
596 |
break; |
597 |
} |
574 |
} else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) { |
598 |
} else if (flowInfo.cannotBeDefinitelyNullOrNonNull(local)) { |
575 |
return; |
599 |
return; |
576 |
} |
600 |
} |