Local vars not restored properly after call pausable method and throw exception
See original GitHub issuepublic 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
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
java - How do you implement a re-try-catch? - Stack Overflow
I don't think we called to just log the exception. I thing the catch block is meant to give us the opportunity of...
Read more >Exceptions and debugging - Advanced R. - Hadley Wickham
When a exiting handler from tryCatch() is called, the execution of the function is interrupted and the handler is called. withCallingHandlers() is rarely...
Read more >Proposal: Make local variables available upon exception at ...
Summary When executing through VisualStudio, having access to local variables can be invaluable for debugging exceptions.
Read more >Chaining tasks using continuation tasks | Microsoft Learn
InvalidOperationException exception. A continuation is itself a Task and doesn't block the thread on which it's started.
Read more >Local variables should not be declared and then immediately ...
Local variables should not be declared and then immediately returned or thrown ... Declaring a variable only to immediately return or throw it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i was able to reproduce and will take a look
this is fixed in kilim 2.0 by a series of commits, the last of which is https://github.com/nqzero/kilim/commit/e64e6af61ba03bd7d9d90398ed125f7d4fc63359
for the related commits, search the log messages for the words: born, live and 49 (ie this issue)