vscode-java-debug
vscode-java-debug copied to clipboard
Prompt two same error messages in the right corner
Environment
- Operating System: Win10/Mac/Linux
- JDK version: 11.0.7/13.0.2/14.0.2
- Visual Studio Code version: 1.47.2
- Java extension version: 0.64.1
- Java Debugger extension version: 0.27.0
Steps To Reproduce
- Open project 25.restartFrame in vscode.
- Set breakpoint: Person.java line 28
- Press F5 to start debug.
- The program stopped at the Person.java line 28
- Open the debug view, find the call stack of current breakpoint
- Right click the HelloWorld$1.run(), choose Restart Frame.
Current Result

At RestartFrameHandler.java#L73:
context.getProtocolServer().sendEvent(new Events.UserNotificationEvent(NotificationType.ERROR, "Current stack frame doesn't support restart."));
throw AdapterUtils.createCompletionException("Current stack frame doesn't support restart.", ErrorCode.RESTARTFRAME_FAILURE);
The first line sends an "event" message (with "Source: Debugger for Java (Extension)"). The second line throws an exception which is handled at ProtocolServer.java#L128, which becomes a "response" message containing an error.
I could fix this, but I don't know which error handling strategy is correct.
Option A
Replace the second line with:
return CompletableFuture.completedFuture(response);
I'm not sure what response is and if completing the future with it is appropriate. Also this would skip a call to logger.log() in ProtocolServer (which might be okay).
Option B
Remove the first line.
The downside here is that the popup wouldn't look as good (it wouldn't have "Source: Debugger for Java (Extension)").