DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35991>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=35991
Summary: Unable to generate method that returns an array of
integers
Product: BCEL
Version: 5.1
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Main
AssignedTo: [email protected]
ReportedBy: [email protected]
I'm trying to generate the following code use BCEL:
package bci;
public class Test {
public int[] getArray() {
return new int[1];
}
public static void main(String[] args) {
}
}
I use BCELIfier to generate the code that creates Test. The snippet that creates getArray is
private void createMethod_2() {
InstructionList il = new InstructionList();
MethodGen method = new MethodGen(ACC_PUBLIC, new ArrayType(T_INT, 1), Type.NO_ARGS, new
String[] { }, "getArray", "bci.Test", il, _cp);
InstructionHandle ih_0 = il.append(new PUSH(_cp, 1));
il.append(_factory.createNewArray(new ArrayType(T_INT, 1), (short) 1));
InstructionHandle ih_3 = il.append(_factory.createReturn(Type.OBJECT));
method.setMaxStack();
method.setMaxLocals();
_cg.addMethod(method.getMethod());
il.dispose();
}
I run TestCreator (generated by BCELIfier) and execute Test, which triggers the following error:
Exception in thread "main" java.lang.VerifyError: (class: bci/Test, method: getArray signature: ()[I)
Wrong return type in function
If I return null rather than the array, everything is perfectly allright.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.