drempapis commented on code in PR #15961:
URL: https://github.com/apache/lucene/pull/15961#discussion_r3091682021


##########
lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java:
##########
@@ -509,8 +509,7 @@ public TransitionAccessor getTransitionAccessor() {
   public int hashCode() {
     final int prime = 31;
     int result = 1;
-    result = prime * result + ((runAutomaton == null) ? 0 : 
runAutomaton.hashCode());
-    result = prime * result + ((nfaRunAutomaton == null) ? 0 : 
nfaRunAutomaton.hashCode());
+    result = prime * result + normalAutomatonHashCode();

Review Comment:
   I've simplified the code by removing the new standalone comparator class and 
keeping the fix inside existing automaton classes. This update
   - Keeps `CompiledAutomaton` equality/hash behavior aligned with the original 
shape.
   - Adds structural equals/hashCode to `Automaton`.
   - Implements `NFARunAutomaton.equals/hashCode` to delegate to its wrapped 
Automaton.
   
   Is there other way to fix equality-contract issue properly?



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