[jboss-jira] [JBoss JIRA] Commented: (JASSIST-85) IllegalAccessError when trying to call clone() on a class generated by ProxyFactory

Richard Reynolds (JIRA) jira-events at lists.jboss.org
Thu Feb 11 11:21:11 EST 2010


    [ https://jira.jboss.org/jira/browse/JASSIST-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12511917#action_12511917 ] 

Richard Reynolds commented on JASSIST-85:
-----------------------------------------

I believe when you applied the patch you missed a step.  

Check your 3.11.0.GA sources and you will see that you missed removing this line. 

- hash.put(key, methods[i]); 

So the IllegalAccessError still exists in the new jar.  

> IllegalAccessError when trying to call clone() on a class generated by ProxyFactory
> -----------------------------------------------------------------------------------
>
>                 Key: JASSIST-85
>                 URL: https://jira.jboss.org/jira/browse/JASSIST-85
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.10.0.GA
>            Reporter: Tobias Meyer
>            Assignee: Shigeru Chiba
>             Fix For: 3.11.0.GA
>
>
> Hibernate 3.3 uses javassist (by default) to generate LazyInitializer Objects.
> If a lazily loaded object implements the clone() method, and makes it public, there will be a runtime IllegalAccessError because the javassist proxy object exports the protected definition of Object.clone() instead of the definition in the MethodHandler's Interface.
> The supplied patch makes the ProxyFactory to never reduce the visibility of a public method, even if implemented in a higher interface or the superclass.
> Normally the java compiler would catch such an error, so this is assumed to be save.
> Side effect is of course that a superclass method given to ProxyFactory might not be called as before because a public definition of the MethodHandler (Interface) overloads it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list