When debugging in Chrome, sometimes my breakpoints get hit on a page refresh, but the code is not executed (nor should it be).
I reproduced the issue with the following:
mvn archetype:generate -DarchetypeGroupId=com.github.nalukit.archetype -DarchetypeVersion=LATEST -DarchetypeArtifactId=modular-springboot-webapp
(use any values, I just entered "a" for everything)
2. Modify the a-client\src\main\java\a\App.java with the following:
2.1 Add this static method:
public static void delay(int delayMs, com.google.gwt.user.client.Command run) {
com.google.gwt.core.client.Scheduler.get().scheduleFixedDelay(() -> {
run.execute();
return false;
}, delayMs);
}
2.2 In the MyHandler class onClick, call the static method:
public void onClick(ClickEvent event) {
delay(1000, () -> {
sendNameToServer();
});
}
3. Start it up:
3.1: mvn gwt:codeserver -pl *-client -am
3.2: mvn spring-boot:run -pl *-server -am
5. Open the Chrome debugger, put a breakpoint on the line:
delay(1000, () -> {
6. Refresh the page. The breakpoint gets hit. It looks like this:
It doesn't have a call stack, and if you try to step into it, it doesn't step into the delay method.
Any idea why this occurs?