gsmiller commented on code in PR #11775:
URL: https://github.com/apache/lucene/pull/11775#discussion_r975666927
##########
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:
Also, I didn't know you could do a cast inline like this. Cool!
##########
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:
Should we flip this to use `== false` instead of `!` as it seems to be the
preferred style in this code base?
--
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]