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