0 Replies Latest reply on Mar 27, 2006 10:31 PM by Scott Stark

    CtClass.stopPruning signature change

    Scott Stark Master

      The CtClass.stopPruning method had an incompatible change between 1.59 and 1.60:

      public void stopPruning(boolean stop) {}
      


      public boolean stopPruning(boolean stop) { return true; }
      


      that results in the following runtime error with the aop compiler usage in the jboss-4.0.x/testsuite:

      _jars-cache:
       [mkdir] Created dir: /services/cruisecontrol/checkout/jboss-4.0-testsuite/testsuite/output/resources/META-INF
       [copy] Copying 9 files to /services/cruisecontrol/checkout/jboss-4.0-testsuite/testsuite/output/resources/META-INF
      Overriding previous definition of reference to aop.task.classpath
       [aopc] java.lang.NoSuchMethodError: javassist.CtClass.stopPruning(Z)V
       [aopc] at org.jboss.aop.instrument.FieldAccessTransformer$OptimizedTransformer.createOptimizedInvocationClass(FieldAccessTransformer.java:857)
       [aopc] at org.jboss.aop.instrument.FieldAccessTransformer$OptimizedTransformer.buildFieldWrappers(FieldAccessTransformer.java:533)
       [aopc] at org.jboss.aop.instrument.FieldAccessTransformer.buildFieldWrappers(FieldAccessTransformer.java:73)
       [aopc] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:657)
       [aopc] at org.jboss.aop.AspectManager.translate(AspectManager.java:792)
       [aopc] at org.jboss.aop.AspectManager.transform(AspectManager.java:704)
       [aopc] at org.jboss.aop.standalone.Compiler.compileFile(Compiler.java:325)
       [aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:217)
       [aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:73)
      


      The only current usage of this new stopPruning method, is only in the CtClass.debugWriteFile:

       public void debugWriteFile() {
       try {
       boolean p = stopPruning(true);
       writeFile();
       defrost();
       stopPruning(p);
       }
       catch (Exception e) {
       throw new RuntimeException(e);
       }
       }