You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/06/24 08:23:37 UTC

[GitHub] [netbeans] sdedic commented on a diff in pull request #3981: Preventing to create hints more times.

sdedic commented on code in PR #3981:
URL: https://github.com/apache/netbeans/pull/3981#discussion_r905834998


##########
groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/compiler/error/GroovyError.java:
##########
@@ -117,4 +117,71 @@ public boolean isLineError() {
     public boolean showExplorerBadge() {
         return false;
     }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (obj.getClass() != GroovyError.class) {
+            return false;
+        }
+
+        final GroovyError test = (GroovyError)obj;
+
+        if (this.start != test.start) {
+            return false;
+        }
+
+        if (this.end != test.end) {
+            return false;
+        }
+        
+        if ((this.description == null && test.description != null) || 
+                (this.description != null && test.description == null)
+                || !this.description.equals(test.description)) {

Review Comment:
   if both `this.description` AND `test.description` are `null`, the first 2 clauses are false and the 3rd one will NPE. Please use `Objects.equals`.
   Possibly the same for `file` test below.



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