kilim: Local vars not restored properly after call pausable method and throw exception

public class Exceptions extends Task { private String fWithOutMailBox() throws Pausable { throw new RuntimeException(); // no pausable method }

private String fWithMailBox() throws Pausable {
    new Mailbox<String>().get(1000);  // has pausable method
    throw new RuntimeException();
}

public void execute() throws Pausable {
    String foo = "data";
    try {
        foo = fWithOutMailBox();
    } catch (Throwable t) {
        System.out.println("foo=" + foo);
    }
    String foo2 = "data";
    try {
        foo2 = fWithMailBox();
    } catch (Throwable t) {
        System.out.println("foo2=" + foo2);
    }
}

public static void main(String args[]) {
    new Exceptions().start();
}

} ================expect result will be foo=data foo2=data ================while real result is foo=data foo2=null

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

i was able to reproduce and will take a look