shaie commented on code in PR #11775: URL: https://github.com/apache/lucene/pull/11775#discussion_r976038157
########## lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FacetLabel.java: ########## @@ -120,11 +120,10 @@ public int compareTo(FacetLabel other) { @Override public boolean equals(Object obj) { - if (!(obj instanceof FacetLabel)) { + if (!(obj instanceof FacetLabel other)) { Review Comment: I tried doing that, but then the rest of the method complains it doesn't recognize `other`. The pattern variable was introduced in Java 14, so I'll change the code to not using it, which will make it easier to merge to the 9.x branch. If we wanted to use the pattern variable though, we'd need to change the method body to implement equality inside `if (obj instanceof FacetLabel other)` clause. -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org