本文整理汇总了Java中org.apache.bcel.generic.MethodGen.setMaxLocals方法的典型用法代码示例。如果您正苦于以下问题:Java MethodGen.setMaxLocals方法的具体用法?Java MethodGen.setMaxLocals怎么用?Java MethodGen.setMaxLocals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.bcel.generic.MethodGen
的用法示例。
在下文中一共展示了MethodGen.setMaxLocals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHelperMethodForDotClassCalls
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
/**
* Creates a method class$(String) which is used
* during SomeClass.class instruction
*
* @param generatedClassName the instance class name
*/
protected void createHelperMethodForDotClassCalls(String generatedClassName) {
InstructionList il = new InstructionList();
MethodGen method = new MethodGen(Constants.ACC_STATIC, new ObjectType("java.lang.Class"), new Type[]{Type.STRING}, new String[]{"arg0"}, "class$", generatedClassName, il, constantsPool);
InstructionHandle ih0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
il.append(factory.createInvoke("java.lang.Class", "forName", new ObjectType("java.lang.Class"), new Type[]{Type.STRING}, Constants.INVOKESTATIC));
InstructionHandle ih4 = il.append(InstructionFactory.createReturn(Type.OBJECT));
InstructionHandle ih5 = il.append(InstructionFactory.createStore(Type.OBJECT, 1));
il.append(factory.createNew("java.lang.NoClassDefFoundError"));
il.append(InstructionConstants.DUP);
il.append(InstructionFactory.createLoad(Type.OBJECT, 1));
il.append(factory.createInvoke("java.lang.Throwable", "getMessage", Type.STRING, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
il.append(factory.createInvoke("java.lang.NoClassDefFoundError", "<init>", Type.VOID, new Type[]{Type.STRING}, Constants.INVOKESPECIAL));
il.append(InstructionConstants.ATHROW);
method.addExceptionHandler(ih0, ih4, ih5, new ObjectType("java.lang.ClassNotFoundException"));
method.setMaxStack();
method.setMaxLocals();
classGen.addMethod(method.getMethod());
il.dispose();
}
示例2: generateEqualsMethod
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
private void generateEqualsMethod(String generatedClassName) {
/* public boolean equals(Object o) {
* return stubHelper.isEquals(this,o);
* }
*/
InstructionList il = new InstructionList();
MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.BOOLEAN, new Type[]{Type.OBJECT}, new String[]{"arg0"}, "equals", generatedClassName, il, constantsPool);
il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
il.append(factory.createFieldAccess(generatedClassName, "stubHelper", new ObjectType("org.codehaus.jremoting.client.StubHelper"), Constants.GETFIELD));
il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
il.append(InstructionFactory.createLoad(Type.OBJECT, 1));
il.append(factory.createInvoke("org.codehaus.jremoting.client.StubHelper", "isEquals", Type.BOOLEAN, new Type[]{Type.OBJECT, Type.OBJECT}, Constants.INVOKEINTERFACE));
il.append(InstructionFactory.createReturn(Type.INT));
method.setMaxStack();
method.setMaxLocals();
classGen.addMethod(method.getMethod());
il.dispose();
}
示例3: generateMethods
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
private static void generateMethods(RootClass k, ConstantPoolGen cp, InstructionList il, InstructionFactory factory, ClassGen cg, String className, String clonesClassName)
{
RootMember[] members = k.getMembers();
for (int i = 0; i < members.length; i++)
{
BasicMember member = (BasicMember) members[i];
Type type = member.getJavaType();
Type arrayType = new ArrayType(type, 1);
MethodGen mg = new MethodGen(ACC_PUBLIC, type, null, null, nameMangler.mangleMember(member.getName()), className, il, cp);
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createGetField(className, "clones", new ObjectType(clonesClassName)));
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createGetField(className, "index", Type.INT));
il.append(factory.createInvoke(clonesClassName, nameMangler.mangleMember(member.getName()), type, new Type[]
{
Type.INT
}, INVOKEVIRTUAL));
il.append(InstructionFactory.createReturn(type));
mg.setMaxStack();
mg.setMaxLocals();
cg.addMethod(mg.getMethod());
il.dispose();
}
}
示例4: nullAdaptClass
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
byte[] nullAdaptClass(final InputStream is, final String name)
throws Exception
{
JavaClass jc = new ClassParser(is, name + ".class").parse();
ClassGen cg = new ClassGen(jc);
ConstantPoolGen cp = cg.getConstantPool();
Method[] ms = cg.getMethods();
for (int j = 0; j < ms.length; ++j) {
MethodGen mg = new MethodGen(ms[j], cg.getClassName(), cp);
boolean lv = ms[j].getLocalVariableTable() == null;
boolean ln = ms[j].getLineNumberTable() == null;
if (lv) {
mg.removeLocalVariables();
}
if (ln) {
mg.removeLineNumbers();
}
mg.stripAttributes(skipDebug);
InstructionList il = mg.getInstructionList();
if (il != null) {
InstructionHandle ih = il.getStart();
while (ih != null) {
ih = ih.getNext();
}
if (compute) {
mg.setMaxStack();
mg.setMaxLocals();
}
}
cg.replaceMethod(ms[j], mg.getMethod());
}
return cg.getJavaClass().getBytes();
}
示例5: createConstructor
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
/**
* Method createConstructor.
* This method adds a constructor that takes in a StubHelper Instance
*
* @param generatedClassName the stub class name
*/
protected void createConstructor(String generatedClassName) {
InstructionList il = new InstructionList();
MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.VOID, new Type[]{new ObjectType("org.codehaus.jremoting.client.StubHelper")}, new String[]{"arg0"}, "<init>", generatedClassName, il, constantsPool);
il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
il.append(factory.createInvoke("java.lang.Object", "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
il.append(InstructionFactory.createLoad(Type.OBJECT, 1));
il.append(factory.createFieldAccess(generatedClassName, "stubHelper", new ObjectType("org.codehaus.jremoting.client.StubHelper"), Constants.PUTFIELD));
il.append(InstructionFactory.createReturn(Type.VOID));
method.setMaxStack();
method.setMaxLocals();
classGen.addMethod(method.getMethod());
il.dispose();
}
示例6: createGetReferenceIDMethod
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
/**
* Add method
* <pre>
* public Long jRemotingGetReferenceID(Object factoryThatIsAsking) {
* return stubHelper.getReference(factoryThatIsAsking);
* }
* </pre>
*
* @param generatedClassName the generated class name
*/
protected void createGetReferenceIDMethod(String generatedClassName) {
InstructionList il = new InstructionList();
MethodGen method = new MethodGen(Constants.ACC_PUBLIC, new ObjectType("java.lang.Long"), new Type[]{Type.OBJECT}, new String[]{"arg0"}, "jRemotingGetReferenceID", generatedClassName, il, constantsPool);
il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
il.append(factory.createFieldAccess(generatedClassName, "stubHelper", new ObjectType("org.codehaus.jremoting.client.StubHelper"), Constants.GETFIELD));
il.append(InstructionFactory.createLoad(Type.OBJECT, 1));
il.append(factory.createInvoke("org.codehaus.jremoting.client.StubHelper", "getReference", new ObjectType("java.lang.Long"), new Type[]{Type.OBJECT}, Constants.INVOKEINTERFACE));
il.append(InstructionFactory.createReturn(Type.OBJECT));
method.setMaxStack();
method.setMaxLocals();
classGen.addMethod(method.getMethod());
il.dispose();
}
示例7: createMethod
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
private void createMethod(Element method) throws IllegalXMLVMException {
instructionList = new InstructionList();
instructionHandlerManager = new InstructionHandlerManager();
String methodName = method.getAttributeValue("name");
Element signature = method.getChild("signature", nsXMLVM);
Type retType = collectReturnType(signature);
Type[] argTypes = collectArgumentTypes(signature);
short accessFlags = getAccessFlags(method);
if (methodName.equals(".cctor")) // Same concept, different names in
// .net/JVM. Note we are doing init of
// statics for a class
{
methodName = "<clinit>";
accessFlags = 0x8; // static
}
MethodGen m = new MethodGen(accessFlags, retType, argTypes, null, methodName,
fullQualifiedClassName, instructionList, constantPoolGen);
Element code = method.getChild("code", nsXMLVM);
createCode(code);
instructionHandlerManager.checkConsistency();
m.setMaxLocals();
m.setMaxStack();
classGen.addMethod(m.getMethod());
instructionList.dispose();
}
示例8: generateMethods
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
private void generateMethods(RootClass k, ConstantPoolGen cp, InstructionList il, InstructionFactory factory, ClassGen cg, String className)
{
RootMember[] members = k.getMembers();
for (int i = 0; i < members.length; i++)
{
BasicMember member = (BasicMember) members[i];
TLeaf leaf = (TLeaf) lMap.get(member);
if (leaf == null) continue;
String leafClassName = leaf.getClass().getName();
Type type = member.getJavaType();
Type arrayType = new ArrayType(type, 1);
MethodGen mg = new MethodGen(ACC_PUBLIC, type, new Type[] { Type.INT }, new String[]
{
"index"
}, nameMangler.mangleMember(member.getName()), className, il, cp);
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createGetField(className, member.getName(), arrayType));
il.append(InstructionFactory.DUP);
BranchHandle bh = il.append(new IFNONNULL(null));
il.append(InstructionFactory.POP);
il.append(factory.createGetStatic(className, member.getName() + "Leaf", new ObjectType(leafClassName)));
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createGetField("org.dianahep.root4j.core.Clones2", "hollowIndex", Type.LONG));
// BasicRootClass varClass = (BasicRootClass) member.getType();
il.append(factory.createInvoke(leafClassName, "setPosition", new ObjectType("org.dianahep.root4j.core.RootInput"), new Type[]
{
Type.LONG
}, INVOKEVIRTUAL));
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createGetField("org.dianahep.root4j.core.Clones2", "size", Type.INT));
il.append((Instruction) factory.createNewArray(type, (short) 1));
il.append(InstructionConstants.DUP_X1);
il.append(factory.createInvoke("org.dianahep.root4j.core.RootInput", "readFixedArray", Type.VOID, new Type[]
{
arrayType
}, INVOKEINTERFACE));
il.append(InstructionConstants.DUP);
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.SWAP);
il.append(factory.createPutField(className, member.getName(), arrayType));
bh.setTarget(il.append(InstructionConstants.ILOAD_1));
il.append(InstructionFactory.createArrayLoad(type));
il.append(InstructionFactory.createReturn(type));
mg.setMaxStack();
mg.setMaxLocals();
cg.addMethod(mg.getMethod());
il.dispose();
}
}
示例9: build
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public JavaClass build(GenericRootClass klass)
{
optimize = (klass.getStreamerInfo().getBits() & (1 << 12)) == 0;
String className = nameMangler.mangleFullClassName(getStem(),klass.getClassName());
String clonesClassName = nameMangler.mangleFullClassName("org.dianahep.root4j.clones2",klass.getClassName());
ClassGen cg = new ClassGen(className, "org/dianahep/root4j/core/Clone2", "<generated>", ACC_PUBLIC | ACC_SUPER, new String[]
{
nameMangler.mangleInterfaceName(klass.getClassName())
});
ConstantPoolGen cp = cg.getConstantPool();
InstructionList il = new InstructionList();
InstructionFactory factory = new InstructionFactory(cg);
cg.addEmptyConstructor(ACC_PUBLIC);
// Build the complete list of superclasses
List sup = new ArrayList();
RootClass[] superClasses = klass.getSuperClasses();
iterativelyAdd(sup, superClasses);
sup.add(klass);
// Create the fields
cg.addField(new FieldGen(ACC_PRIVATE, Type.INT, "index", cp).getField());
cg.addField(new FieldGen(ACC_PRIVATE, new ObjectType(clonesClassName), "clones", cp).getField());
//Generate the setData method
MethodGen mg = new MethodGen(ACC_PUBLIC, Type.VOID, new Type[]
{
Type.INT, new ObjectType("org.dianahep.root4j.core.Clones2")
}, new String[] { "index", "clones" }, "setData", className, il, cp);
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ILOAD_1);
il.append(factory.createPutField(className, "index", Type.INT));
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_2);
il.append(factory.createCast(new ObjectType("org.dianahep.root4j.core.Clones2"), new ObjectType(clonesClassName)));
il.append(factory.createPutField(className, "clones", new ObjectType(clonesClassName)));
il.append(InstructionConstants.RETURN);
mg.setMaxStack();
mg.setMaxLocals();
cg.addMethod(mg.getMethod());
il.dispose();
// Generate the accessor methods
for (Iterator i = sup.iterator(); i.hasNext();)
generateMethods((RootClass) i.next(), cp, il, factory, cg, className, clonesClassName);
return cg.getJavaClass();
}
示例10: build
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public JavaClass build(GenericRootClass klass)
{
optimize = (klass.getStreamerInfo().getBits() & (1 << 12)) == 0;
//System.out.println("bits=" + Integer.toHexString(klass.getStreamerInfo().getBits()) + " optimize=" + optimize);
String className = nameMangler.mangleFullClassName(getStem(),klass.getClassName());
ClassGen cg = new ClassGen(className, "org/dianahep/root4j/core/Clones", "<generated>", ACC_PUBLIC | ACC_SUPER, null);
ConstantPoolGen cp = cg.getConstantPool();
InstructionList il = new InstructionList();
InstructionFactory factory = new InstructionFactory(cg);
cg.addEmptyConstructor(ACC_PUBLIC);
// Build the complete list of superclasses
List sup = new ArrayList();
RootClass[] superClasses = klass.getSuperClasses();
iterativelyAdd(sup, superClasses);
sup.add(klass);
// Generate the fields
for (Iterator i = sup.iterator(); i.hasNext();)
generateFields((RootClass) i.next(), cp, cg);
// Generate the streamer method
MethodGen mg = new MethodGen(ACC_PUBLIC, Type.VOID, new Type[]
{
new ObjectType("org/dianahep/root4j/core/RootInput"), Type.INT
}, new String[] { "in", "nClones" }, "read", className, il, cp);
mg.addException("java/io/IOException");
for (Iterator i = sup.iterator(); i.hasNext();)
generateStreamer((RootClass) i.next(), cp, il, factory, className);
il.append(new RETURN());
mg.setMaxStack();
mg.setMaxLocals();
cg.addMethod(mg.getMethod());
il.dispose();
return cg.getJavaClass();
}
示例11: build
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
public JavaClass build(GenericRootClass klass)
{
optimize = (klass.getStreamerInfo().getBits() & (1 << 12)) == 0;
String className = nameMangler.mangleFullClassName(getStem(),klass.getClassName());
String clonesClassName = nameMangler.mangleFullClassName("org.dianahep.root4j.clones",klass.getClassName());
ClassGen cg = new ClassGen(className, "org/dianahep/root4j/core/Clone", "<generated>", ACC_PUBLIC | ACC_SUPER, new String[]
{
nameMangler.mangleInterfaceName(klass.getClassName())
});
ConstantPoolGen cp = cg.getConstantPool();
InstructionList il = new InstructionList();
InstructionFactory factory = new InstructionFactory(cg);
cg.addEmptyConstructor(ACC_PUBLIC);
// Build the complete list of superclasses
List sup = new ArrayList();
RootClass[] superClasses = klass.getSuperClasses();
iterativelyAdd(sup, superClasses);
sup.add(klass);
// Create the fields
cg.addField(new FieldGen(ACC_PRIVATE, Type.INT, "index", cp).getField());
cg.addField(new FieldGen(ACC_PRIVATE, new ObjectType(clonesClassName), "clones", cp).getField());
//Generate the setData method
MethodGen mg = new MethodGen(ACC_PUBLIC, Type.VOID, new Type[]
{
Type.INT, new ObjectType("org.dianahep.root4j.core.Clones")
}, new String[] { "index", "clones" }, "setData", className, il, cp);
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ILOAD_1);
il.append(factory.createPutField(className, "index", Type.INT));
il.append(InstructionConstants.ALOAD_0);
il.append(InstructionConstants.ALOAD_2);
il.append(factory.createCast(new ObjectType("org.dianahep.root4j.core.Clones"), new ObjectType(clonesClassName)));
il.append(factory.createPutField(className, "clones", new ObjectType(clonesClassName)));
il.append(InstructionConstants.RETURN);
mg.setMaxStack();
mg.setMaxLocals();
cg.addMethod(mg.getMethod());
il.dispose();
// Generate the accessor methods
for (Iterator i = sup.iterator(); i.hasNext();)
generateMethods((RootClass) i.next(), cp, il, factory, cg, className, clonesClassName);
return cg.getJavaClass();
}
示例12: generateMethods
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
private static void generateMethods(RootClass k, ConstantPoolGen cp, InstructionList il, InstructionFactory factory, ClassGen cg, String className, Class implementedInterface)
{
RootMember[] members = k.getMembers();
for (int i = 0; i < members.length; i++)
{
Type type = ((BasicMember) members[i]).getJavaType();
Type returnType = type;
try
{
if (implementedInterface != null) returnType = Type.getType(implementedInterface.getMethod(nameMangler.mangleMember(members[i].getName()),(Class[]) null).getReturnType());
if (!returnType.equals(type) && debugRoot)
{
System.err.println("Warning: Interface type mismatch "+implementedInterface.getName()+"."+nameMangler.mangleMember(members[i].getName())+" "+returnType+" "+type);
}
}
catch (NoSuchMethodException x)
{
}
if (cg.containsMethod(nameMangler.mangleMember(members[i].getName()), "()" + returnType.getSignature()) == null)
{
MethodGen mg = new MethodGen(ACC_PUBLIC, returnType, null, null, nameMangler.mangleMember(members[i].getName()), null, il, cp);
if (members[i].getType() == null) // Dummy object
{
il.append(new PUSH(cp, "<<Unreadable>>"));
}
else
{
il.append(InstructionConstants.ALOAD_0);
il.append(factory.createGetField(className, members[i].getName(), type));
}
if (!returnType.equals(type) && !(returnType == Type.INT && (type == Type.BYTE || type == Type.CHAR || type == Type.SHORT)))
il.append(factory.createCast(type,returnType));
il.append(InstructionFactory.createReturn(returnType));
mg.setMaxStack();
mg.setMaxLocals();
cg.addMethod(mg.getMethod());
il.dispose();
}
}
}
示例13: realMaxLocals
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
static int realMaxLocals(MethodGen m) {
m.setMaxLocals();
return m.getMaxLocals();
}
示例14: generateMain
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
void generateMain(ClassGen clg, Method origMain) {
InstructionList il = new InstructionList();
MethodGen new_main = new MethodGen(Constants.ACC_STATIC
| Constants.ACC_PUBLIC, Type.VOID, new Type[] { new ArrayType(
Type.STRING, 1) }, new String[] { "argv" }, "main", clg
.getClassName(), il, clg.getConstantPool());
il.append(ins_f.createNew(cashmereType));
il.append(new DUP());
il.append(ins_f.createInvoke("ibis.cashmere.impl.Cashmere", "<init>",
Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
il.append(ins_f.createInvoke("ibis.cashmere.impl.Cashmere", "isMaster",
Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
BranchHandle ifcmp = il.append(new IFEQ(null));
InstructionHandle origMain_handle = il.append(new ALOAD(0));
InstructionHandle try_start = il.append(ins_f.createInvoke(clg
.getClassName(), origMain.getName(), Type.VOID,
new Type[] { new ArrayType(Type.STRING, 1) },
Constants.INVOKESTATIC));
BranchHandle try_end = il.append(new GOTO(null));
InstructionHandle e_handler = il.append(getCashmere(ins_f));
il.append(new SWAP());
il.append(ins_f.createInvoke("ibis.cashmere.impl.Cashmere", "exit",
Type.VOID, new Type[] { new ObjectType("java.lang.Throwable")},
Constants.INVOKEVIRTUAL));
BranchHandle gto2 = il.append(new GOTO(null));
InstructionHandle ifeq_target = il.append(getCashmere(ins_f));
ifcmp.setTarget(ifeq_target);
il.append(ins_f.createInvoke("ibis.cashmere.impl.Cashmere", "client",
Type.VOID, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
il.append(getCashmere(ins_f));
il.append(ins_f.createInvoke("ibis.cashmere.impl.Cashmere", "isMaster",
Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
il.append(new IFNE(origMain_handle));
InstructionHandle gto_target = il.append(getCashmere(ins_f));
try_end.setTarget(gto_target);
il.append(ins_f.createInvoke("ibis.cashmere.impl.Cashmere", "exit",
Type.VOID, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
InstructionHandle gto2_target = il.append(new RETURN());
gto2.setTarget(gto2_target);
new_main.addExceptionHandler(try_start, try_end, e_handler,
new ObjectType("java.lang.Throwable"));
new_main.setMaxStack();
new_main.setMaxLocals();
new_main.addLocalVariable("argv", new ArrayType(Type.STRING, 1), 0,
origMain_handle, null);
removeLocalTypeTables(new_main);
Method main = new_main.getMethod();
gen_c.addMethod(main);
}
示例15: instrument_reflection
import org.apache.bcel.generic.MethodGen; //导入方法依赖的package包/类
private static Method instrument_reflection(InstructionFactory inf, MethodGen mgen, ConstantPoolGen cpgen) {
Method ret = mgen.getMethod();
InstructionList ilist = mgen.getInstructionList();
if (ilist == null || ilist.size() == 0)
return ret;
InstructionHandle[] ihdls = ilist.getInstructionHandles();
for (InstructionHandle ihdl : ihdls) {
Instruction instr = ihdl.getInstruction();
// go through all instructions and look for invokes
if (instr instanceof InvokeInstruction) {
InvokeInstruction invoke = (InvokeInstruction) instr;
ReferenceType rtype = invoke.getReferenceType(cpgen);
if (rtype instanceof ObjectType) {
String cname = ((ObjectType) rtype).getClassName();
String mname = invoke.getName(cpgen);
// we look for exact match
if (cname.equals("java.lang.reflect.Method") && mname.equals("invoke")) {
// Util.log(rtype.toString());
Type[] arg_types = { new ObjectType(java.lang.reflect.Method.class.getCanonicalName()), Type.OBJECT, new ArrayType(Type.OBJECT, 1) };
ihdl.setInstruction(inf.createInvoke(SIFAStub.class.getCanonicalName(), "invoke", Type.OBJECT, arg_types, Constants.INVOKESTATIC));
}
} else {
// reference type can be ArrayType or UninitializedObjectType
}
}
}
ilist.setPositions();
mgen.setInstructionList(ilist);
mgen.removeLineNumbers();
mgen.setMaxStack();
mgen.setMaxLocals();
ret = mgen.getMethod();
return ret;
}