1 Reply Latest reply on Aug 15, 2013 9:24 AM by smarlow

    Instrumenting Object comparison statements

    mrgirish

      Hi,

           Is there a way in Javassist to instrument object comparison statements. For examples statements of the form ( a == b) and ( a != b) . I searched the tutorial and the API and could not find it.

       

      I have been trying to extend Javassist to support instrumentation of object comparison statements.  Is there any developer manual on the implementation of javassist. For example a walkthrough of how the replace() method  in class javassist.expr.NewExpr works.

       

      Thanks a lot in advance.

       

      Regards

      Girish

        • 1. Re: Instrumenting Object comparison statements
          smarlow

          Is there any developer manual on the implementation of javassist. For example a walkthrough of how the replace() method  in class javassist.expr.NewExpr works.

           

          http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/tutorial/tutorial2.html#intro might be helpful to you.

           

          Also, step through the replace() method code while running the Javassist unit tests.  That is what I have been doing to learn more about Javassist internals.

           

          For example, open test source javassist.JvstTest4 in your debugger and set a breakpoint in method testAaload(), run the following command:

          mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787 -Xnoagent -Djava.compiler=NONE" clean install -Dtest=javassist.JvstTest4

          Then instruct your debugger to attach to port 8787.

           

          Scott