lahodaj commented on code in PR #6846:
URL: https://github.com/apache/netbeans/pull/6846#discussion_r1427916376


##########
ide/project.dependency/src/org/netbeans/modules/project/dependency/Scope.java:
##########
@@ -86,9 +86,6 @@ public final boolean equals(Object obj) {
         if (obj == null) {
             return false;
         }
-        if (getClass() != obj.getClass()) {

Review Comment:
   I am sorry, but this is wrong. I accept that two scopes with different 
implementation classes but the same name should be equal, but then please do 
something like:
   ```
   if (!(obj instanceof Scope)) {
       return false;
   }
   ```
   
   I believe generally `equals` is expected to not crash on `CCE`s, even if an 
object of an unrelated type is passed in.



-- 
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-unsubscr...@netbeans.apache.org

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


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

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

Reply via email to