junichi11 commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1465692098


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -79,14 +85,39 @@ public String getDisplayName(Object node) throws 
UnknownTypeException {
             return builder.toString();
         } else if (node instanceof ExceptionBreakpoint) {
             ExceptionBreakpoint breakpoint = (ExceptionBreakpoint) node;
-            StringBuilder builder = new 
StringBuilder(NbBundle.getMessage(BreakpointModel.class, EXCEPTION));
+            StringBuilder builder = new StringBuilder();
+            builder.append(OPEN_HTML);
+            builder.append(NbBundle.getMessage(BreakpointModel.class, 
EXCEPTION));
             builder.append(" "); // NOI18N
             builder.append(breakpoint.getException());
+            String message = breakpoint.getExceptionMessage();
+            String code = breakpoint.getExceptionCode();
+            synchronized (myCurrentBreakpoints) {
+                for (AbstractBreakpoint brkp : myCurrentBreakpoints.values()) {
+                    if (breakpoint.equals(brkp)) {
+                        if (message != null) {
+                            buildAppend(builder, MESSAGE, message);
+                        }
+                        if (code != null) {
+                            buildAppend(builder, CODE, code);
+                        }
+                    }
+                }
+            }
+            builder.append(CLOSE_HTML);
             return builder.toString();
         }
         throw new UnknownTypeException(node);
     }
 
+    private void buildAppend(StringBuilder builder, String prepend, String 
text) {
+        builder.append(" "); // NOI18N
+        builder.append(FONT_COLOR);
+        builder.append(prepend);
+        builder.append(text);
+        builder.append(CLOSE_FONT);
+    }

Review Comment:
   I would write the following:
   ```suggestion
       private void buildAppend(StringBuilder builder, String prepend, 
@NullAllowed String text) {
           if (!StringUtils.isEmpty(text)) {
               builder.append(" "); // NOI18N
               builder.append(FONT_COLOR);
               builder.append(prepend);
               builder.append(text);
               builder.append(CLOSE_FONT);
           }
       }
   ```
   That way, we can call `buildAppend()` safely without checking `null` always.
   But, it's OK with me as it is. 



-- 
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