[jboss-jira] [JBoss JIRA] (JASSIST-160) Java.lang.VerifyErrors occur in specific cases when using javaassist with Java 1.7
Oliver Hernandez (JIRA)
jira-events at lists.jboss.org
Fri Oct 12 13:48:04 EDT 2012
[ https://issues.jboss.org/browse/JASSIST-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726033#comment-12726033 ]
Oliver Hernandez commented on JASSIST-160:
------------------------------------------
I'd like to add another error message that seems to be the result of this same bug:
{{java.lang.VerifyError: Bad type on operand stack in aaload in method org.foo.bar.FooBar.<init>()V at offset 101}}
My use case is also with PowerMock, and the unit test involves mocking construction of a new object using PowerMockito.whenNew(). Researching this problem led me here, and applying the latest javassist-3.17.0-GA.jar resolved this error in my test.
> Java.lang.VerifyErrors occur in specific cases when using javaassist with Java 1.7
> ----------------------------------------------------------------------------------
>
> Key: JASSIST-160
> URL: https://issues.jboss.org/browse/JASSIST-160
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.16.1-GA
> Environment: jdk1.7.0_03 on Windows XP SP 3
> Reporter: Avner Singerman
> Assignee: Shigeru Chiba
> Fix For: 3.17.0-GA
>
> Attachments: jatest.zip
>
>
> We found at least two different cases where inserting bytecode using javaassist results in a class that cannot be loaded with Java 1.7.
> java.lang.VerifyError: Inconsistent stackmap frames at branch target
> java.lang.VerifyError: Bad return type in method
> The exact same code injection on the exact same classes works fine with Java 1.6.
> We upgraded to the latest version of javaassist - 3.16.1.GA, but it didn't solve the problem.
> I'm attaching to this bug a self contained example where you can see both type of errors.
> More details in "Steps to Reproduce".
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list