mbien commented on code in PR #8235:
URL: https://github.com/apache/netbeans/pull/8235#discussion_r1951887174


##########
platform/openide.util.ui/src/org/openide/util/ImageUtilities.java:
##########
@@ -1127,23 +1068,7 @@ public String toString() {
     /**
      * Key used for ToolTippedImage
      */
-    private static class ToolTipImageKey {
-        Image image;
-        String str;
-
-        ToolTipImageKey(Image image, String str) {
-            this.image = image;
-            this.str = str;
-        }
-
-        @Override
-        public boolean equals(Object other) {
-            if (!(other instanceof ToolTipImageKey)) {
-                return false;
-            }
-            ToolTipImageKey k = (ToolTipImageKey) other;
-            return (str.equals(k.str)) && (image == k.image);
-        }
+    private record ToolTipImageKey(Image image, String str) {

Review Comment:
   reverted the removed equals - it should make sense again: 
https://github.com/apache/netbeans/compare/d7d2132abbc36f98a4d6b763c044d0a93f17cdf6..e96788721223c95e1da6096e271a462c52863ec5
   
   Records are just classes with exclusively final fields which are all mapped 
to constructor parameters. Its fine to override equals/hashcode/tostring. Sorry 
for causing confusion by removing the equals - yes it should be kept 
symmetrical.



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