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.codegen.BranchLabel; 15 16 20 public class SwitchFlowContext extends FlowContext { 21 22 public BranchLabel breakLabel; 23 public UnconditionalFlowInfo initsOnBreak = FlowInfo.DEAD_END; 24 25 public SwitchFlowContext(FlowContext parent, ASTNode associatedNode, BranchLabel breakLabel) { 26 super(parent, associatedNode); 27 this.breakLabel = breakLabel; 28 } 29 30 public BranchLabel breakLabel() { 31 return breakLabel; 32 } 33 34 public String individualToString() { 35 StringBuffer buffer = new StringBuffer ("Switch flow context"); buffer.append("[initsOnBreak -").append(initsOnBreak.toString()).append(']'); return buffer.toString(); 38 } 39 40 public boolean isBreakable() { 41 return true; 42 } 43 44 public void recordBreakFrom(FlowInfo flowInfo) { 45 if ((initsOnBreak.tagBits & FlowInfo.UNREACHABLE) == 0) { 46 initsOnBreak = initsOnBreak.mergedWith(flowInfo.unconditionalInits()); 47 } 48 else { 49 initsOnBreak = flowInfo.unconditionalCopy(); 50 } 51 } 52 } 53 | Popular Tags |