5 Replies Latest reply on Oct 19, 2012 10:36 AM by Andrew Dinn

    problem using AFTER WRITE on local variable

    Mike Sullivan Newbie

      I'm having trouble using AFTER WRITE on a local variable.


      Here's a snippet of my class (see attached).


      public class Foo {


              public  void bar(int i, String myText) {

                      String current="hi there";

                      System.out.println(i+ " ... " + current);



      My rule is:

      RULE test debug

      CLASS Foo

      METHOD bar

      #AT ENTRY

      AFTER WRITE $current

      IF true

      DO traceln("byteman is here");



      bmcheck fails to parse the rule:

      $ /u01/app/home/asmsadm/mike/byteman_home/byteman-2.1.0/bin/bmcheck.sh -cp . myrule.txt
      checking rule test debug
      TestScript : Error transforming class Foo using  rule "test debug" loaded from myrule.txt line 6

      java.lang.Error: Failed to transform class Foo using rule test debug

      TestScript: 1 total errors
                  0 parse errors
                  0 type errors