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

Summary: Popping a stack frame after exception breakpoint sets first method param to exception
Product: debugger Reporter: SirIntellegence
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Code to reproduce

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.