[jboss-user] [Javassist] - Method Content Comparison

David Jakes do-not-reply at jboss.com
Thu Dec 15 23:12:07 EST 2011

David Jakes [http://community.jboss.org/people/chicken_bones] created the discussion

"Method Content Comparison"

To view the discussion, visit: http://community.jboss.org/message/641879#641879

I am trying to make a compatibility class loader.

General scenario. People edit the source file, change the contents of a few methods and add a few fields and then recompile the class.
I then compare the original class and the changed class with javassist.

I need to detect when the methods haven't been changed. I tried measuring the length of the code attribute but that fails when the change is a single field access redirection for example. I also tried comparing the contents of the arrays but that didn't work as various bytes at seemingly coordinated locations in the attribute have different values. Due to the fact I don't actually understand how to read the bytecode I'm unable to work out a solution.

If someone could help point me in the right direction or give me a sample of code that could analyse this for me that would be great.

Thankyou for your time.

Reply to this message by going to Community

Start a new discussion in Javassist at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111215/295307e2/attachment.html 

More information about the jboss-user mailing list