View Javadoc
1 /*** 2 * NormalEdge 3 * 4 * This is a normal flow control edge in the 5 * flow control graph. 6 */ 7 8 package junit.quilt.cover.generic; 9 10 import junit.quilt.exception.InvalidTransitionException; 11 12 import org.apache.commons.graph.Edge; 13 14 import org.apache.bcel.generic.*; 15 16 public class JSREdge 17 extends FlowControlEdge 18 { 19 public JSREdge(BlockVertex source, 20 BlockVertex target) 21 { 22 super( source, target ); 23 } 24 25 public void connect( MethodGen method, 26 InstructionList il, 27 InstructionHandle source, 28 InstructionHandle target ) 29 throws InvalidTransitionException 30 { 31 if (source == null) return; 32 if (target == null) return; 33 34 if (source.getInstruction() instanceof JsrInstruction) { 35 ((JsrInstruction) source.getInstruction()).setTarget( target ); 36 } else { 37 if (source.getNext() != target) { 38 il.append( source, new JSR( target )); 39 } 40 } 41 } 42 43 public FlowControlEdge copy( BlockVertex source, 44 BlockVertex target ) { 45 return new JSREdge( source, target ); 46 } 47 48 public String toString() { 49 return "[J: " + getSource() + " -> " + getTarget() + "]"; 50 } 51 } 52 53 54 55

This page was automatically generated by Maven