You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "troizet (via GitHub)" <gi...@apache.org> on 2024/01/24 17:54:21 UTC

[PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

troizet opened a new pull request, #6992:
URL: https://github.com/apache/netbeans/pull/6992

   The implementation is made for xdebug since version `3.1.6`. 
   Tested on versions of xdebug: `3.1.6`, `3.2.0`, `3.3.0`.
   
   Code example:
   ```php
   <?php
   
   class MyException extends Exception
   {}
   
   function throwException()
   {
       throw new MyException("Test exception breakpoint", 42);
   }
   
   echo 'Test exception breakpoint';
   
   $foo = $bar['foo'];
   
   try {
       throwException();
   } catch (Exception $e) {}
   ```
   
   before:
   
   https://github.com/apache/netbeans/assets/9607501/fc8914b6-1de2-482e-a5b0-c4c3dd348d7c
   
   
   after:
   
   https://github.com/apache/netbeans/assets/9607501/bdf4fb55-e0ef-45e6-a5aa-a615a88ae15c
   
   
   
   for `throw new MyException("Test exception breakpoint")` it looks like this:
   ![without_code](https://github.com/apache/netbeans/assets/9607501/23d9fb32-b951-4c13-9b8c-4a2122f5a994)
   
   for `throw new MyException("", 42)` it looks like this:
   ![with_code_without_message](https://github.com/apache/netbeans/assets/9607501/142ea073-10a2-4779-b40f-ea0e90a27ef5)
   
   for `throw new MyException("")` and `throw new MyException()` it looks like this:
   ![with_empty_message](https://github.com/apache/netbeans/assets/9607501/c74c8518-2e5d-4199-9a55-c1177082359d)
   
   How it looks in a dark theme:
   ![exception_message_dark_theme](https://github.com/apache/netbeans/assets/9607501/0caf11b1-19e0-4a0d-bdc7-f492f9c5e4e2)
   
   
   
   
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1466392668


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/RunResponse.java:
##########
@@ -57,4 +70,18 @@ private void updateBreakpointsView(DebugSession session, String id) {
         }
     }
 
+    private void setCurrentBreakpointText(DebugSession session, String message, String code) {
+        DebugSession.IDESessionBridge bridge = session.getBridge();
+        if (bridge != null) {
+            BreakpointModel breakpointModel = bridge.getBreakpointModel();
+            if (breakpointModel != null && breakpointModel.isSearchCurrentBreakpointById()) {
+                AbstractBreakpoint bp = breakpointModel.getCurrentBreakpoint(session);
+                if (bp != null && bp instanceof ExceptionBreakpoint) {

Review Comment:
   ```suggestion
                   if (bp instanceof ExceptionBreakpoint) {
   ```
   
   The check for `null` is not needed.
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#issuecomment-1909138381

   Thank you for the example code and screenshots! It's easy to understand :)


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1465685191


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +27,10 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    private String message;
+    private String code;

Review Comment:
   `@NullAllowed`



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1466388937


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +30,12 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    @NullAllowed
+    private String message;
+    @NullAllowed
+    private String code;
+    private static final String FONT_GRAY_COLOR = "<font color=\"#999999\">"; //NOI18N
+    private static final String CLOSE_FONT = "</font>"; //NOI18N

Review Comment:
   Please, could you put constants before class fields?
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 merged PR #6992:
URL: https://github.com/apache/netbeans/pull/6992


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1474588085


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +45,37 @@ public String getException() {
         return exceptionName;
     }
 
+    public synchronized void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    @CheckForNull
+    public synchronized String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public synchronized void setExceptionCode(String code) {
+        this.code = code;

Review Comment:
   OK, apparently we have more fields in this class :) But still, I believe that for `code` the same applies - it can be `volatile` and we should be fine. So, please verify the parent class, thanks.
   
   Just to explain - these 2 fields (`message` and `code`) seem to be related, right? However, we set each of them in its own method, so there is no way (in this class) how to set both these fields atomically. If we wanted to do that, we would need something like:
   
   ```java
   public synchronized void setMessageAndCode(String message, String code) {
       this.message = message;
       this.code = code;
   }
   ```
   
   In this case, we would need to use `synchronized` here and also whenever we would be reading any of these fields.
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#issuecomment-1921494516

   Looks good to me, with just one change remaining. Please, look into it. Thanks!
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1472737543


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +30,12 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    @NullAllowed
+    private String message;

Review Comment:
   This class is used in multiple threads. I added `synchronized` to the class methods that work with these fields. I hope I did it correctly.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1477192118


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +45,37 @@ public String getException() {
         return exceptionName;
     }
 
+    public synchronized void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    @CheckForNull
+    public synchronized String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public synchronized void setExceptionCode(String code) {
+        this.code = code;

Review Comment:
   Thanks for the explanation! Changed to using `volatile`.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1477382529


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +45,37 @@ public String getException() {
         return exceptionName;
     }
 
+    public synchronized void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    @CheckForNull
+    public synchronized String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public synchronized void setExceptionCode(String code) {
+        this.code = code;

Review Comment:
   Nothing to thank for, really :)
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1466386757


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -79,14 +86,37 @@ 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();

Review Comment:
   This (and similar) code can be _perhaps_ a bit nicer:
   
   ```java
           StringBuilder builder = new StringBuilder()
                   .append(OPEN_HTML)
                   .append(NbBundle.getMessage(BreakpointModel.class, EXCEPTION))
                   .append(" ") // NOI18N
                   .append(breakpoint.getException());        
   ```
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1465692841


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +40,34 @@ public String getException() {
         return exceptionName;
     }
 
+    public void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    public String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public void setExceptionCode(String code) {
+        this.code = code;
+    }
+
+    public String getExceptionCode() {
+        return buildText(code);
+    }
+
+    private String buildText(String text) {
+        if (text != null && !text.isEmpty()) {

Review Comment:
   ```suggestion
           if (!StringUtils.isEmpty(text)) {
   ```



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#issuecomment-1909379605

   I made the suggested changes and rebased the branch.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1466390827


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +30,12 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    @NullAllowed
+    private String message;

Review Comment:
   What is the threading model of this class? I mean, is it safe to add these non-final fields here? In other words, is this class used only from one thread?
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "troizet (via GitHub)" <gi...@apache.org>.
troizet commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1472738179


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -79,14 +86,37 @@ 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();

Review Comment:
   Done.



##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +30,12 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    @NullAllowed
+    private String message;
+    @NullAllowed
+    private String code;
+    private static final String FONT_GRAY_COLOR = "<font color=\"#999999\">"; //NOI18N
+    private static final String CLOSE_FONT = "</font>"; //NOI18N

Review Comment:
   Done.



##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/packets/RunResponse.java:
##########
@@ -57,4 +70,18 @@ private void updateBreakpointsView(DebugSession session, String id) {
         }
     }
 
+    private void setCurrentBreakpointText(DebugSession session, String message, String code) {
+        DebugSession.IDESessionBridge bridge = session.getBridge();
+        if (bridge != null) {
+            BreakpointModel breakpointModel = bridge.getBreakpointModel();
+            if (breakpointModel != null && breakpointModel.isSearchCurrentBreakpointById()) {
+                AbstractBreakpoint bp = breakpointModel.getCurrentBreakpoint(session);
+                if (bp != null && bp instanceof ExceptionBreakpoint) {

Review Comment:
   Done.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1474588931


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +45,37 @@ public String getException() {
         return exceptionName;
     }
 
+    public synchronized void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    @CheckForNull
+    public synchronized String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public synchronized void setExceptionCode(String code) {
+        this.code = code;
+    }
+
+    @CheckForNull
+    public synchronized String getExceptionCode() {

Review Comment:
   ```suggestion
       public String getExceptionCode() {
   ```



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#issuecomment-1925841395

   Looks good to me now. What about @junichi11?
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#issuecomment-1925976948

   Thank you, guys! Merging.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1474580154


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +30,12 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    @NullAllowed
+    private String message;

Review Comment:
   That seems to be "too much", IMHO.
   
   The field `exceptionName` is final, so no problem. However, the `message` is not, so we need to take care of it. In this particular case, `volatile` (so `private volatile String message;`) should be enough, since this is the only thing that can change.
   
   I will add more comments to this class.
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1474580503


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +45,37 @@ public String getException() {
         return exceptionName;
     }
 
+    public synchronized void setExceptionMessage(String message) {

Review Comment:
   ```suggestion
       public void setExceptionMessage(String 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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1466386757


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/BreakpointModel.java:
##########
@@ -79,14 +86,37 @@ 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();

Review Comment:
   This code can be _perhaps_ a bit nicer:
   
   ```java
           StringBuilder builder = new StringBuilder()
                   .append(OPEN_HTML)
                   .append(NbBundle.getMessage(BreakpointModel.class, EXCEPTION))
                   .append(" ") // NOI18N
                   .append(breakpoint.getException());        
   ```
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1465693376


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +40,34 @@ public String getException() {
         return exceptionName;
     }
 
+    public void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    public String getExceptionMessage() {

Review Comment:
   `@CheckForNull`



##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +40,34 @@ public String getException() {
         return exceptionName;
     }
 
+    public void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    public String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public void setExceptionCode(String code) {
+        this.code = code;
+    }
+
+    public String getExceptionCode() {

Review Comment:
   `@CheckForNull`



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1465693076


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -36,6 +40,34 @@ public String getException() {
         return exceptionName;
     }
 
+    public void setExceptionMessage(String message) {
+        this.message = message;
+    }
+
+    public String getExceptionMessage() {
+        return buildText(message);
+    }
+
+    public void setExceptionCode(String code) {
+        this.code = code;
+    }
+
+    public String getExceptionCode() {
+        return buildText(code);
+    }
+
+    private String buildText(String text) {

Review Comment:
   `@CheckForNull`



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#issuecomment-1909142913

   @troizet Could you change the target branch from the `master` to `php-nb22-features`?


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


Re: [PR] PHP: Implemented display of exception message when exception breakpoints are hit [netbeans]

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #6992:
URL: https://github.com/apache/netbeans/pull/6992#discussion_r1474580154


##########
php/php.dbgp/src/org/netbeans/modules/php/dbgp/breakpoints/ExceptionBreakpoint.java:
##########
@@ -27,6 +30,12 @@
  */
 public class ExceptionBreakpoint extends AbstractBreakpoint {
     private final String exceptionName;
+    @NullAllowed
+    private String message;

Review Comment:
   That seems to be "too much", IMHO.
   
   The field `exceptionName` is final, so no problem. However, the `message` is not, so we need to take care of it. In this particular case, `volatile` (so `private String message;`) should be enough, since this is the only thing that can change.
   
   I will add more comments to this class.
   



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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