Copilot commented on code in PR #60727:
URL: https://github.com/apache/doris/pull/60727#discussion_r2851970966


##########
fe/fe-common/src/main/java/org/apache/doris/catalog/VariantField.java:
##########
@@ -114,7 +136,9 @@ public boolean equals(Object other) {
             return false;
         }
         VariantField otherFiled = (VariantField) other;
-        return otherFiled.pattern.equals(pattern) && 
otherFiled.type.equals(type);
+        return otherFiled.pattern.equals(pattern)
+                && otherFiled.type.equals(type)
+                && otherFiled.patternType == patternType;
     }

Review Comment:
   The equals method has been overridden to include patternType, but the 
hashCode method is missing. This violates the equals-hashCode contract in Java. 
When two objects are equal according to equals(), they must have the same hash 
code. This can lead to incorrect behavior when VariantField objects are used in 
hash-based collections like HashMap or HashSet.



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

Reply via email to