/** Mark that this resource is closed locally. */ public void markClose(FlowInfo flowInfo, FlowContext flowContext) { FakedTrackingVariable current = this; do { flowInfo.markAsDefinitelyNonNull(current.binding); current.globalClosingState |= CLOSE_SEEN; //TODO(stephan): this might be useful, but I could not find a test case for it: if (flowContext.initsOnFinally != null) flowContext.initsOnFinally.markAsDefinitelyNonNull(this.binding); current = current.innerTracker; } while (current != null); }
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { // record setting a variable: various scenarii are possible, setting an array reference, // a field reference, a blank final field reference, a field of an enclosing instance or // just a local variable. if (this.resolvedType.id != T_JavaLangString) { this.lhs.checkNPE(currentScope, flowContext, flowInfo); } flowInfo = ((Reference) this.lhs).analyseAssignment(currentScope, flowContext, flowInfo, this, true).unconditionalInits(); if (this.resolvedType.id == T_JavaLangString) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=339250 LocalVariableBinding local = this.lhs.localVariableBinding(); if (local != null) { // compound assignment results in a definitely non null value for String flowInfo.markAsDefinitelyNonNull(local); if (flowContext.initsOnFinally != null) flowContext.initsOnFinally.markAsDefinitelyNonNull(local); } } return flowInfo; }
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { // record setting a variable: various scenarii are possible, setting an array reference, // a field reference, a blank final field reference, a field of an enclosing instance or // just a local variable. if (this.resolvedType.id != T_JavaLangString) { this.lhs.checkNPE(currentScope, flowContext, flowInfo); } flowInfo = ((Reference) this.lhs).analyseAssignment(currentScope, flowContext, flowInfo, this, true).unconditionalInits(); if (this.resolvedType.id == T_JavaLangString) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=339250 LocalVariableBinding local = this.lhs.localVariableBinding(); if (local != null) { // compound assignment results in a definitely non null value for String flowInfo.markAsDefinitelyNonNull(local); if (flowContext.initsOnFinally != null) flowContext.initsOnFinally.markAsDefinitelyNonNull(local); } } return flowInfo; }
break; case FlowInfo.NON_NULL : flowContext.initsOnFinally.markAsDefinitelyNonNull(local); break; default: