Lines 32-37
Link Here
|
32 |
private LoopingFlowContext innerFlowContexts[] = null; |
32 |
private LoopingFlowContext innerFlowContexts[] = null; |
33 |
private UnconditionalFlowInfo innerFlowInfos[] = null; |
33 |
private UnconditionalFlowInfo innerFlowInfos[] = null; |
34 |
private int innerFlowContextsNb = 0; |
34 |
private int innerFlowContextsNb = 0; |
|
|
35 |
private LabelFlowContext breakTargetContexts[] = null; |
36 |
public int breakTargetsNb = 0; |
35 |
|
37 |
|
36 |
Reference finalAssignments[]; |
38 |
Reference finalAssignments[]; |
37 |
VariableBinding finalVariables[]; |
39 |
VariableBinding finalVariables[]; |
Lines 101-109
Link Here
|
101 |
/** |
103 |
/** |
102 |
* Perform deferred checks relative to the null status of local variables. |
104 |
* Perform deferred checks relative to the null status of local variables. |
103 |
* @param scope the scope to which this context is associated |
105 |
* @param scope the scope to which this context is associated |
104 |
* @param flowInfo the flow info against which checks must be performed |
106 |
* @param callerFlowInfo the flow info against which checks must be performed |
105 |
*/ |
107 |
*/ |
106 |
public void complainOnDeferredNullChecks(BlockScope scope, FlowInfo flowInfo) { |
108 |
public void complainOnDeferredNullChecks(BlockScope scope, FlowInfo callerFlowInfo) { |
107 |
for (int i = 0 ; i < this.innerFlowContextsNb ; i++) { |
109 |
for (int i = 0 ; i < this.innerFlowContextsNb ; i++) { |
108 |
this.upstreamNullFlowInfo. |
110 |
this.upstreamNullFlowInfo. |
109 |
addPotentialNullInfoFrom( |
111 |
addPotentialNullInfoFrom( |
Lines 111-119
Link Here
|
111 |
addPotentialNullInfoFrom(this.innerFlowInfos[i]); |
113 |
addPotentialNullInfoFrom(this.innerFlowInfos[i]); |
112 |
} |
114 |
} |
113 |
this.innerFlowContextsNb = 0; |
115 |
this.innerFlowContextsNb = 0; |
114 |
flowInfo = this.upstreamNullFlowInfo. |
116 |
UnconditionalFlowInfo flowInfo = this.upstreamNullFlowInfo. |
115 |
addPotentialNullInfoFrom( |
117 |
addPotentialNullInfoFrom(callerFlowInfo.unconditionalInitsWithoutSideEffect()); |
116 |
flowInfo.unconditionalInitsWithoutSideEffect()); |
|
|
117 |
if (this.deferNullDiagnostic) { |
118 |
if (this.deferNullDiagnostic) { |
118 |
// check only immutable null checks on innermost looping context |
119 |
// check only immutable null checks on innermost looping context |
119 |
for (int i = 0; i < this.nullCount; i++) { |
120 |
for (int i = 0; i < this.nullCount; i++) { |
Lines 247-252
Link Here
|
247 |
} |
248 |
} |
248 |
} |
249 |
} |
249 |
} |
250 |
} |
|
|
251 |
// propagate breaks |
252 |
for (int i = 0; i < this.breakTargetsNb; i++) { |
253 |
this.breakTargetContexts[i].initsOnBreak.addPotentialNullInfoFrom(flowInfo); |
254 |
} |
250 |
} |
255 |
} |
251 |
|
256 |
|
252 |
public BranchLabel continueLabel() { |
257 |
public BranchLabel continueLabel() { |
Lines 270-275
Link Here
|
270 |
return initsOnContinue != FlowInfo.DEAD_END; |
275 |
return initsOnContinue != FlowInfo.DEAD_END; |
271 |
} |
276 |
} |
272 |
|
277 |
|
|
|
278 |
public void recordBreakTo(FlowContext targetContext) { |
279 |
if (targetContext instanceof LabelFlowContext) { |
280 |
int current; |
281 |
if ((current = this.breakTargetsNb++) == 0) { |
282 |
this.breakTargetContexts = new LabelFlowContext[2]; |
283 |
} else if (current == this.breakTargetContexts.length) { |
284 |
System.arraycopy(this.breakTargetContexts, 0, this.breakTargetContexts = new LabelFlowContext[current + 2], 0, current); |
285 |
} |
286 |
this.breakTargetContexts[current] = (LabelFlowContext) targetContext; |
287 |
} |
288 |
} |
289 |
|
273 |
public void recordContinueFrom(FlowContext innerFlowContext, FlowInfo flowInfo) { |
290 |
public void recordContinueFrom(FlowContext innerFlowContext, FlowInfo flowInfo) { |
274 |
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) { |
291 |
if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) { |
275 |
if ((initsOnContinue.tagBits & FlowInfo.UNREACHABLE) == 0) { |
292 |
if ((initsOnContinue.tagBits & FlowInfo.UNREACHABLE) == 0) { |