-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compiler warnings in :server - part 3 #76024
Fix compiler warnings in :server - part 3 #76024
Conversation
Pinging @elastic/es-delivery (Team:Delivery) |
Poke @mark-vieira |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow review. LGTM.
Are we there yet? 😉
@@ -126,6 +126,7 @@ private Response newResponse( | |||
exceptions.add(new DefaultShardOperationFailedException(shard.getIndexName(), shard.getId(), exception)); | |||
} | |||
} else { | |||
@SuppressWarnings("unchecked") | |||
NodeResponse response = (NodeResponse) responses.get(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does forciblyCast
not work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it would, but I don't really like using it - I feel like the annotation draws attention more than a function call, even with its name, and I'd prefer the engineers to want to make such cast unnecessary wherever possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have some clear guidance here then on when one is preferable over the other. As it is, it doesn't seem obvious to me. My intention behind adding that method was to eliminate the need for this suppressions all over the case when there's no alternative to casting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added something to CONTRIBUTING.md
, see what you think.
server/src/main/java/org/elasticsearch/index/fielddata/ordinals/MultiOrdinals.java
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/indices/cluster/ClusterStateChanges.java
Outdated
Show resolved
Hide resolved
@elasticmachine update branch |
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Backported to |
Part of #40366. Fix a number of javac issues when linting is enforced in
server/
. Due to the number of issues that this surfaces, the fixes will be spread of multiple PRs.