This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251569 - Popping a stack frame after exception breakpoint sets first method param to exception
Summary: Popping a stack frame after exception breakpoint sets first method param to e...
Status: RESOLVED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.0.2
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 16:47 UTC by SirIntellegence
Modified: 2015-04-02 16:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Code to reproduce (767 bytes, text/plain)
2015-04-01 16:47 UTC, SirIntellegence
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SirIntellegence 2015-04-01 16:47:54 UTC
Created attachment 152982 [details]
Code to reproduce

As mentioned in the summary, if you debug the attached class with an exception break point, it stops at the UnsupportedOperationException (as expected). If you pop to the main method and then go back into the method, the clearly String param is now the UnsupportedOperationException. The jvm handles this surprisingly well, but is annoying when debugging.
Comment 1 Martin Entlicher 2015-04-02 16:37:28 UTC
This is clearly an issue in the debugger backend and we can not do anything with it in NetBeans.
The printing in the programs proves that.

Another prove is given by jdb, under which the program behaves in the same way:

$ jdb -attach localhost:37535
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> 
VM Started: No frames on the current call stack

main[1] cont
> 
Exception occurred: java.lang.UnsupportedOperationException (uncaught)"thread=main", exceptionbug.ExceptionBug.criticalMethod(), line=26 bci=48

main[1] pop
main[1] where
  [1] exceptionbug.ExceptionBug.main (ExceptionBug.java:16)
main[1] cont
> 
Exception occurred: java.lang.UnsupportedOperationException (uncaught)"thread=main", exceptionbug.ExceptionBug.criticalMethod(), line=26 bci=48

main[1] print importantString
 importantString = "java.lang.UnsupportedOperationException: Kaboom!"


In the mean time, the program prints out:
$ java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:37535 -classpath /tmp/NetBeansProjects/ExceptionBug/build/classes exceptionbug.ExceptionBug
Listening for transport dt_socket at address: 37535
java.lang.String
java.lang.String
java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
Comment 2 SirIntellegence 2015-04-02 16:39:21 UTC
So, should I report this to the Java bug tracker thing?
Comment 3 Martin Entlicher 2015-04-02 16:47:04 UTC
I've submitted: https://bugs.openjdk.java.net/browse/JDK-8076579
Comment 4 Martin Entlicher 2015-04-02 16:47:57 UTC
You can add a vote... :-) Thanks.