View Javadoc
1 /*** 2 * ReturnEdge 3 * 4 * This is an edge which returns from 5 * the method. 6 */ 7 8 package junit.quilt.cover.generic; 9 10 import junit.quilt.exception.InvalidTransitionException; 11 import org.apache.bcel.generic.*; 12 13 public class ReturnEdge 14 extends FlowControlEdge 15 { 16 public ReturnEdge( BlockVertex source ) { 17 super( source, null ); 18 } 19 20 public void connect( MethodGen method, 21 InstructionList il, 22 InstructionHandle source, 23 InstructionHandle target ) 24 throws InvalidTransitionException 25 { 26 if (!(source.getInstruction() instanceof ReturnInstruction)) { 27 throw new InvalidTransitionException("Return Expected."); 28 } 29 // if (source.getInstruction() instanceof ReturnInstruction) { 30 // if (target instanceof FinallyVertex) { 31 // il.insert( source, new JSR( target )); 32 // } else { 33 // throw new InvalidTransitionException("Finally expected."); 34 // } 35 // } else { 36 // throw new InvalidTransitionException("Return expected."); 37 // } 38 } 39 40 public FlowControlEdge copy( BlockVertex source, 41 BlockVertex target ) { 42 FlowControlEdge RC = new ReturnEdge( source ); 43 RC.setTarget( target ); 44 return RC; 45 } 46 47 public String toString() { 48 return "[R: " + getSource() + "]"; 49 } 50 }

This page was automatically generated by Maven