Fix reference-equality comparison bugs found by Error Prone 2.50.0#4605
Merged
Conversation
- ZkMaintenanceUtils: compared Path objects with == in the single-file upload case, so uploading a single file could take the wrong branch - HttpShardHandler: compared a request-context Boolean with ==; now Boolean.TRUE.equals(...) so any true value enables onlyNrt - ZkShardTermsTest.waitFor: compared boxed values by reference, always burning the 10s timeout for values outside the Integer cache - Utils: document that the ClassLoader cache guard intentionally uses identity, and suppress the future ReferenceEquality finding
janhoy
added a commit
to janhoy/solr
that referenced
this pull request
Jul 3, 2026
Per review feedback, behavior-changing fixes are split into their own PRs so this PR only carries the mechanical Error Prone 2.50.0 compliance work: - Reference-equality bug fixes (ZkMaintenanceUtils, HttpShardHandler, ZkShardTermsTest) moved to apache#4605 - Charset API modernization (JdkObsolete findings) moved to apache#4606 The affected sites revert to the code on main, with @SuppressWarnings and a TODO comment pointing at the PR that carries the real fix; the suppressions are dropped when those PRs merge and this branch rebases.
dsmiley
approved these changes
Jul 3, 2026
dsmiley
left a comment
Contributor
There was a problem hiding this comment.
Thanks. HttpShardHandler one is most impactful of the 3 here.
janhoy
added a commit
to janhoy/solr
that referenced
this pull request
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three latent bugs surfaced by the Error Prone 2.50.0 upgrade in #4604, split out into their own PR per review feedback there:
Pathobjects with==in the single-file-upload case, so the intended branch was never guaranteed to be taken.Booleanwith==; nowBoolean.TRUE.equals(...)so anytruevalue enablesonlyNrt.Integercache.Also documents (with a
@SuppressWarnings("ReferenceEquality")) that the ClassLoader cache guard inUtilsintentionally uses identity comparison.#4604 will suppress these findings with TODO comments pointing here; once this merges, that branch drops the TODOs on rebase.