I am trying to generate(and modify) the code of an output class from another class using the ByteCode Engineering Library (by Apache) .
String class_name = c_gen.getClassName();
Method[] Methods = c_gen.getMethods();
for (int i=0;i<Methods.length;i++)
{
MethodGen m_gen = new MethodGen(Methods[i], class_name, cpg);
InstructionList il = m_gen.getInstructionList();
InstructionHandle h;
il.insert(h,factory.createInvoke("ClassName","printSomething", Type.VOID,new Type[]{Type.STRING}, INVOKESTATIC));
}
so I am trying to call printSomething from ClassName for every method.The problem is that I don't know how to actually pass the string argument to the method printSomething