1 6 package de.uka.ipd.coverage.recording; 7 8 import java.util.LinkedList ; 9 import java.util.List ; 10 11 import org.apache.bcel.classfile.JavaClass; 12 import org.apache.bcel.classfile.Method; 13 14 18 public class RegisteredMethodBuilder { 19 private List rMethodList = new LinkedList (); 20 21 26 public void createRegisteredMethods(JavaClass jclass) { 27 Method[] methods = jclass.getMethods(); 28 for (int i = 0; i < methods.length; i++) { 29 if (! methods[i].isAbstract()) { 30 rMethodList.add(createRegisteredMethod(methods[i], jclass)); 31 } 32 } 33 } 34 35 42 RegisteredMethod createRegisteredMethod(Method method, JavaClass jclass) { 43 RegisteredMethod rMethod = new RegisteredMethod(method, jclass); 44 BasicBlock[] blocks = BasicBlockIdentifyer.getBasicBlocks(rMethod); 45 rMethod.setBasicBlocks(blocks); 46 return rMethod; 47 } 48 49 53 public RegisteredMethod[] getRegisteredMethods() { 54 return (RegisteredMethod[]) rMethodList.toArray( 55 new RegisteredMethod[rMethodList.size()]); 56 } 57 } 58 | Popular Tags |