jtulach commented on code in PR #9691:
URL: https://github.com/apache/netbeans/pull/9691#discussion_r4246535550
##########
java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/BreakpointOutput.java:
##########
@@ -397,43 +414,43 @@ private String substitute (String printText,
JPDABreakpointEvent event) {
}
} catch (AbsentInformationException aiex) {}
}
- try {
- value = ((Variable)
theDebugger.getClass().getMethod("evaluate", String.class,
CallStackFrame.class).
- invoke(theDebugger, expression, csf)).getValue();
- } catch (InvocationTargetException itex) {
- if (itex.getTargetException() instanceof
InvalidExpressionException) {
- throw (InvalidExpressionException)
itex.getTargetException();
- }
- } catch (Exception ex) {
- Exceptions.printStackTrace(ex);
+ Variable refValue = theDebugger.evaluate(expression, csf);
+ if (refValue instanceof ObjectVariable obj) {
+ var sessionRef = new WeakReference<>(session);
+ io.printWithAction("#" + obj.getUniqueID(), () -> {
Review Comment:
Thanks for the findings. Yes, we should continue to use use `getValue()`.
The output has been updated to _What are the local values?
args=<ins>1644(length=0)</ins> v=null b={<ins> =b</ins>} f=<ins>1659</ins>
s=<ins> "Ahoj"</ins>_ with bfa927574c - `int` values are also printed (without
a hyperlink).
It'd be good to write some tests for this behavior... done in
9ffb3a403a44f288cb05c4ac8f820bc3911b117d
--
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