1 26 27 package net.sourceforge.groboutils.codecoverage.v2.compiler; 28 29 import junit.framework.Assert; 30 import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; 31 import net.sourceforge.groboutils.codecoverage.v2.datastore.ClassRecord; 32 33 import org.apache.bcel.classfile.JavaClass; 34 import org.apache.bcel.classfile.Method; 35 import org.apache.bcel.generic.MethodGen; 36 37 38 45 public class CompilerCreatorUtil 46 { 47 private static final Class THIS_CLASS = CompilerCreatorUtil.class; 48 49 50 51 public static ModifiedMethod createModifiedMethod( JavaClass jc, 52 int methodIndex, Method m, MethodGen mg ) 53 { 54 Assert.assertNotNull( jc ); 55 Assert.assertNotNull( m ); 56 Assert.assertNotNull( mg ); 57 ModifiedMethod mm = new ModifiedMethod( (short)methodIndex, 0, 0, 58 jc, m, mg ); 59 return mm; 60 } 61 62 63 public static IMethodCode createIMethodCode( int measureIndex, 64 ModifiedMethod mm, ClassRecord cr ) 65 { 66 IMethodCode mc = new DefaultMethodCode( (short)measureIndex, mm, cr ); 67 return mc; 68 } 69 70 71 } 72 73 | Popular Tags |