1 11 package org.eclipse.jdt.internal.compiler.flow; 12 13 import org.eclipse.jdt.internal.compiler.ast.ASTNode; 14 import org.eclipse.jdt.internal.compiler.ast.SubRoutineStatement; 15 16 20 public class InsideSubRoutineFlowContext extends FlowContext { 21 22 public UnconditionalFlowInfo initsOnReturn; 23 24 public InsideSubRoutineFlowContext( 25 FlowContext parent, 26 ASTNode associatedNode) { 27 super(parent, associatedNode); 28 this.initsOnReturn = FlowInfo.DEAD_END; 29 } 30 31 public String individualToString() { 32 StringBuffer buffer = new StringBuffer ("Inside SubRoutine flow context"); buffer.append("[initsOnReturn -").append(this.initsOnReturn.toString()).append(']'); return buffer.toString(); 35 } 36 37 public UnconditionalFlowInfo initsOnReturn(){ 38 return this.initsOnReturn; 39 } 40 41 public boolean isNonReturningContext() { 42 return ((SubRoutineStatement) this.associatedNode).isSubRoutineEscaping(); 43 } 44 45 public void recordReturnFrom(UnconditionalFlowInfo flowInfo) { 46 if ((flowInfo.tagBits & FlowInfo.UNREACHABLE) == 0) { 47 if (this.initsOnReturn == FlowInfo.DEAD_END) { 48 this.initsOnReturn = (UnconditionalFlowInfo) flowInfo.copy(); 49 } else { 50 this.initsOnReturn = this.initsOnReturn.mergedWith(flowInfo); 51 } 52 } 53 } 54 55 public SubRoutineStatement subroutine() { 56 return (SubRoutineStatement) this.associatedNode; 57 } 58 } 59 | Popular Tags |