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 2006/08/30 13:19:19 UTC

DO NOT REPLY [Bug 40357] New: - bcelified method doesn't pass verification

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=40357>.
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=40357

           Summary: bcelified method doesn't pass verification
           Product: BCEL
           Version: 5.1
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: bcel-dev@jakarta.apache.org
        ReportedBy: rspazzoli@imolinfo.it


I bclified the following method:
  public String toString() {
    return ReflectionToStringBuilder.toString(this);
  }
Which is the standard toString for bean as suggested by the commons-lang project.
This code is generated:

  private void createMethod_7() {
    InstructionList il = new InstructionList();
    MethodGen method = new MethodGen(ACC_PUBLIC, Type.STRING, Type.NO_ARGS, new
String[] {  }, "toString",
"it.imolinfo.iif.webservices.utils.generators.BCELifierSampleBean", il, _cp);

    InstructionHandle ih_0 = il.append(_factory.createLoad(Type.OBJECT, 0));
   
il.append(_factory.createInvoke("org.apache.commons.lang.builder.ReflectionToStringBuilder",
"toString", Type.STRING, new Type[] { Type.OBJECT }, Constants.INVOKESTATIC));
    InstructionHandle ih_4 = il.append(_factory.createReturn(Type.OBJECT));
    method.setMaxStack();
    method.setMaxLocals();
    _cg.addMethod(method.getMethod());
    il.dispose();
  }

I'm reporting only the method that goes in error, in attachement there is the
whole class.
When I try to run the code and verify the class generated I get the following error:

verify failed on step 3b on class:
it.imolinfo.iif.webservices.utils.generators.BCELifierSampleBeanon method:
toString message: Constraint violated in method 'public String toString()':
Instruction INVOKESTATIC constraint violated: Class
'org.apache.commons.lang.builder.ReflectionToStringBuilder' is referenced, but
cannot be loaded and resolved: 'VERIFIED_REJECTED
Number of LocalVariableTable attributes of Code attribute '<CODE>' (method
'static void <clinit>()') exceeds number of local variable slots '0' ('There may
be no more than one LocalVariableTable attribute per local variable in the Code
attribute.').
'.
InstructionHandle:    1: invokestatic[184](3) 48

Execution Frame:
Local Variables:
0: it.imolinfo.iif.webservices.utils.generators.BCELifierSampleBean
OperandStack:
Slots used: 1 MaxStack: 1.
it.imolinfo.iif.webservices.utils.generators.BCELifierSampleBean (Size: 1)
Execution flow:
   0: aload_0	[InstructionContext]
   1: invokestatic 48	[InstructionContext]
	at it.imolinfo.iif.jbi.BCELClassLoader.verifyClass(BCELClassLoader.java:66)
	at it.imolinfo.iif.jbi.BCELClassLoader.addClass(BCELClassLoader.java:27)
	at
it.imolinfo.iif.test.webservices.utils.generators.BCELifierSampleBeanCreator.main(BCELifierSampleBeanCreator.java:260)

Any idea if this is a bug or how to workaround it?
Curiosly the twin method:

  public boolean equals(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj);
  }

is generated passes the verification.

-- 
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


DO NOT REPLY [Bug 40357] - bcelified method doesn't pass verification

Posted by bu...@apache.org.
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=40357>.
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=40357


tcurdt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From tcurdt@apache.org  2008-02-02 11:09 -------
thanks for reporting back

-- 
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


DO NOT REPLY [Bug 40357] - bcelified method doesn't pass verification

Posted by bu...@apache.org.
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=40357>.
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=40357





------- Additional Comments From rspazzoli@imolinfo.it  2006-08-30 11:21 -------
Created an attachment (id=18768)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18768&action=view)
the bcelified bean whose toString method gives an error


-- 
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


DO NOT REPLY [Bug 40357] - bcelified method doesn't pass verification

Posted by bu...@apache.org.
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=40357>.
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=40357





------- Additional Comments From erik@jpox.org  2007-04-06 11:08 -------
no longer happening with HEAD version

-- 
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