jtulach commented on code in PR #9732:
URL: https://github.com/apache/netbeans/pull/9732#discussion_r4385673161


##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/BreakpointOutput.java:
##########
@@ -462,12 +456,53 @@ final void printExpressions(
             printText = printText + "\n***\n"+ 
thr.getLocalizedMessage()+"\n***\n";
         }
         // remaining of the text with a new line
-        println.accept(printText);
+        io.print(printText, null, true);
         for (var errors : dumpErrors) {
             errors.run();
         }
     }
 
+    final void printLocals(JPDABreakpointEvent event, BreakpointOutputWriter 
io) {
+        CallStackFrame csf = findTopFrame(event);
+        if (csf != null) {
+            try {
+                for (var refValue : csf.getLocalVariables()) {
+                    io.print("  ", null, false);
+                    io.print(refValue.getName(), null, false);
+                    io.print(" = ", null, false);
+                    if (refValue instanceof ObjectVariable ov && !isNull(ov) 
&& ov.toFixed() instanceof ObjectVariable obj) {

Review Comment:
   As the potential issue is already present in `{=expr}` we don't have to 
address it in this PR in my opinion. If it becomes a problem, then we'll need 
to address it in the future and we'd need to do it regardless of this PR.
   
   Btw. the references _do not keep_ the debuggee objects alive. Those objects 
can still be GCed and then the link becomes dysfunctional as its JDI value is 
gone.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to