/** * Perform deferred checks relative to the null status of local variables. * @param scope the scope to which this context is associated * @param callerFlowInfo the flow info against which checks must be performed */ public void complainOnDeferredNullChecks(BlockScope scope, FlowInfo callerFlowInfo) { complainOnDeferredNullChecks(scope, callerFlowInfo, true); } public void complainOnDeferredNullChecks(BlockScope scope, FlowInfo callerFlowInfo, boolean updateInitsOnBreak) {
@Override protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, FlowInfo flowInfo, int nullStatus, TypeBinding expectedType, int checkType) { recordProvidedExpectedTypes(providedType, expectedType, this.nullCount); recordNullReference(expression.localVariableBinding(), expression, checkType, flowInfo); return true; } }
currentScope, (condLoopContext = new LoopingFlowContext(flowContext, flowInfo, this, null, null, currentScope, true)), condInfo); if (this.action == null || (this.action.isEmptyBlock() && currentScope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_3)) { condLoopContext.complainOnDeferredFinalChecks(currentScope, condInfo); condLoopContext.complainOnDeferredNullChecks(currentScope, condInfo.unconditionalInits()); if (isConditionTrue) { new LoopingFlowContext( flowContext, flowInfo, currentScope, true); loopingContext.copyNullCheckedFieldsFrom(condLoopContext); if (isConditionFalse) { actionInfo = FlowInfo.DEAD_END; exitBranch.addInitializationsFrom(condInfo.initsWhenFalse()); actionInfo = actionInfo.mergedWith(loopingContext.initsOnContinue.unconditionalInits()); condLoopContext.complainOnDeferredNullChecks(currentScope, actionInfo, false); loopingContext.complainOnDeferredNullChecks(currentScope,
this.continueLabel = new BranchLabel(); LoopingFlowContext loopingContext = new LoopingFlowContext( flowContext, flowInfo, currentScope, (condLoopContext = new LoopingFlowContext(flowContext, flowInfo, this, null, null, currentScope)), (this.action == null this.preConditionInitStateIndex = currentScope.methodScope().recordInitializationStates(actionInfo); if (!isConditionOptimizedFalse && this.continueLabel != null) { loopingContext.complainOnDeferredFinalChecks(currentScope, condInfo); condLoopContext.complainOnDeferredFinalChecks(currentScope, condInfo); loopingContext.complainOnDeferredNullChecks(currentScope, flowInfo.unconditionalCopy().addPotentialNullInfoFrom( condInfo.initsWhenTrue().unconditionalInits())); condLoopContext.complainOnDeferredNullChecks(currentScope, actionInfo.addPotentialNullInfoFrom( condInfo.initsWhenTrue().unconditionalInits()));
public void recordUnboxing(Scope scope, Expression expression, int nullStatus, FlowInfo flowInfo) { if (nullStatus == FlowInfo.NULL) super.recordUnboxing(scope, expression, nullStatus, flowInfo); else // defer checking: recordNullReference(null, expression, IN_UNBOXING, flowInfo); }
for (int i = 0, abruptlyExitedLoopsCount = abruptlyExitedLoops.size(); i < abruptlyExitedLoopsCount; i++) { LoopingFlowContext loop = (LoopingFlowContext) abruptlyExitedLoops.get(i); loop.recordCatchContextOfEscapingException(exceptionContext, caughtException);
FlowContext context = this.getLocalParent(); while (context != null) { context.removeFinalAssignmentIfAny(this.finalAssignments[i]);
checkUnboxing(scope, (Expression) location, flowInfo); continue; // delegation to parent already handled in the above. default: checkUnboxing(scope, (Expression) location, flowInfo); break; default:
currentScope, (condLoopContext = new LoopingFlowContext(flowContext, flowInfo, this, null, null, currentScope, true)), condInfo); if (this.action == null || (this.action.isEmptyBlock() && currentScope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_3)) { condLoopContext.complainOnDeferredFinalChecks(currentScope, condInfo); condLoopContext.complainOnDeferredNullChecks(currentScope, condInfo.unconditionalInits()); if (isConditionTrue) { new LoopingFlowContext( flowContext, flowInfo, currentScope, true); loopingContext.copyNullCheckedFieldsFrom(condLoopContext); if (isConditionFalse) { actionInfo = FlowInfo.DEAD_END; exitBranch.addInitializationsFrom(condInfo.initsWhenFalse()); actionInfo = actionInfo.mergedWith(loopingContext.initsOnContinue.unconditionalInits()); condLoopContext.complainOnDeferredNullChecks(currentScope, actionInfo, false); loopingContext.complainOnDeferredNullChecks(currentScope,
new LoopingFlowContext(flowContext, flowInfo, this, this.breakLabel, this.continueLabel, this.scope); UnconditionalFlowInfo actionInfo = } else { actionInfo = actionInfo.mergedWith(loopingContext.initsOnContinue); loopingContext.complainOnDeferredFinalChecks(this.scope, actionInfo); exitBranch.addPotentialInitializationsFrom(actionInfo); loopingContext.complainOnDeferredNullChecks(currentScope, actionInfo);
public void recordUnboxing(Scope scope, Expression expression, int nullStatus, FlowInfo flowInfo) { if (nullStatus == FlowInfo.NULL) super.recordUnboxing(scope, expression, nullStatus, flowInfo); else // defer checking: recordNullReference(null, expression, IN_UNBOXING, flowInfo); }
for (int i = 0, abruptlyExitedLoopsCount = abruptlyExitedLoops.size(); i < abruptlyExitedLoopsCount; i++) { LoopingFlowContext loop = (LoopingFlowContext) abruptlyExitedLoops.get(i); loop.recordCatchContextOfEscapingException(exceptionContext, caughtException);
FlowContext context = this.getLocalParent(); while (context != null) { context.removeFinalAssignmentIfAny(this.finalAssignments[i]);
checkUnboxing(scope, (Expression) location, flowInfo); continue; // delegation to parent already handled in the above. default: checkUnboxing(scope, (Expression) location, flowInfo); break; default:
currentScope, (condLoopContext = new LoopingFlowContext(flowContext, flowInfo, this, null, null, currentScope, true)), condInfo); if (this.action == null || (this.action.isEmptyBlock() && currentScope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_3)) { condLoopContext.complainOnDeferredFinalChecks(currentScope, condInfo); condLoopContext.complainOnDeferredNullChecks(currentScope, condInfo.unconditionalInits()); if (isConditionTrue) { new LoopingFlowContext( flowContext, flowInfo, exitBranch.addInitializationsFrom(condInfo.initsWhenFalse()); actionInfo = actionInfo.mergedWith(loopingContext.initsOnContinue.unconditionalInits()); condLoopContext.complainOnDeferredNullChecks(currentScope, actionInfo, false); loopingContext.complainOnDeferredNullChecks(currentScope, actionInfo, false); } else { condLoopContext.complainOnDeferredFinalChecks(currentScope, condInfo); actionInfo = actionInfo.mergedWith(loopingContext.initsOnContinue.unconditionalInits()); condLoopContext.complainOnDeferredNullChecks(currentScope,
new LoopingFlowContext(flowContext, flowInfo, this, this.breakLabel, this.continueLabel, this.scope); UnconditionalFlowInfo actionInfo = } else { actionInfo = actionInfo.mergedWith(loopingContext.initsOnContinue); loopingContext.complainOnDeferredFinalChecks(this.scope, actionInfo); exitBranch.addPotentialInitializationsFrom(actionInfo); loopingContext.complainOnDeferredNullChecks(currentScope, actionInfo);
protected boolean internalRecordNullityMismatch(Expression expression, TypeBinding providedType, int nullStatus, TypeBinding expectedType, int checkType) { recordProvidedExpectedTypes(providedType, expectedType, this.nullCount); recordNullReference(expression.localVariableBinding(), expression, checkType); return true; } }
@Override public void recordUnboxing(Scope scope, Expression expression, int nullStatus, FlowInfo flowInfo) { if (nullStatus == FlowInfo.NULL) super.recordUnboxing(scope, expression, nullStatus, flowInfo); else // defer checking: recordNullReference(null, expression, IN_UNBOXING, flowInfo); }
for (int i = 0, abruptlyExitedLoopsCount = abruptlyExitedLoops.size(); i < abruptlyExitedLoopsCount; i++) { LoopingFlowContext loop = (LoopingFlowContext) abruptlyExitedLoops.get(i); loop.recordCatchContextOfEscapingException(exceptionContext, caughtException);
FlowContext context = this.getLocalParent(); while (context != null) { context.removeFinalAssignmentIfAny(this.finalAssignments[i]);