This content has been marked as final.
Show 3 replies
-
1. Re: NPE in the RuleGeneratorAdapter
adinn Mar 1, 2012 8:30 AM (in response to ant_db)Hi Anton,
Anton Ryabtsev wrote:
Hi,
I got an exception in the next scenario:
public class Foo { public void bar(Map input) { final long start = System.currentTimeMillis(); String s; try { s = new String("test"); } catch(Exception exc) { s = new String("fail"); } System.out.println(s); } }
RULE rule
CLASS Foo
METHOD bar
AT EXIT
IF true
DO traceln("yes, it works!" + $s)
ENDRULE
I think this is a bug in the injection code to do with counting local variable slots. If you change the program to this
. . .
public void bar(Map input) {
final int start = (int)System.currentTimeMillis();
String s;
. . .then it works ok.
I will raise a JIRA for this and try to patch it for the next (2.0.1) release.
-
2. Re: NPE in the RuleGeneratorAdapter
adinn Mar 1, 2012 8:45 AM (in response to adinn)The JIRA is BYTEMAN-198
-
3. Re: NPE in the RuleGeneratorAdapter
adinn Mar 1, 2012 10:33 AM (in response to adinn)This is now fixed in trunk