jtulach commented on code in PR #9691:
URL: https://github.com/apache/netbeans/pull/9691#discussion_r4246091760
##########
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(), () -> {
+ var s = sessionRef.get();
+ var ok = s != null &&
BreakpointOutputDetails.showObjectVariable(s, obj);
+ if (!ok) {
+ io.println("Cannot display details of " + obj,
null);
+ }
+ }, false);
+ } else {
+ String textualValue = refValue == null ? "null" :
refValue.getValue();
Review Comment:
With 2bef3a6020 we keep the original format of the log messages and just
spice it with hyperlinks:
<img width="1637" height="768" alt="just hyperlinks"
src="https://github.com/user-attachments/assets/36f9b3f4-b8d2-4e4c-8c72-ea89372ba0b6"
/>
Broken expression have a hyperlink to the customizer together with printing
the exception message.
--
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