You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by bu...@apache.org on 2005/08/03 09:08:14 UTC
DO NOT REPLY [Bug 35991] New: -
Unable to generate method that returns an array of integers
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: bcel-dev@jakarta.apache.org
ReportedBy: cavengene@yahoo.de
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org