Skip to content

Review and tidy solr/modules/ltr code - #4837

Open
epugh wants to merge 1 commit into
apache:mainfrom
epugh:split/modules-ltr
Open

Review and tidy solr/modules/ltr code#4837
epugh wants to merge 1 commit into
apache:mainfrom
epugh:split/modules-ltr

Conversation

@epugh

@epugh epugh commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description

Split out from #4743 into smaller, per-module PRs to make review easier. This PR contains the tidy-up changes to solr/modules/ltr (production + test code).

Solution

Leverage IntelliJ warnings (dead field/method removal, toString()/this interchange, isEmpty() idioms, javadoc/comment fixes, interlavingAlgorithminterleavingAlgorithm field rename, TestUserTermScorereQDFTestUserTermScorerQDF typo-fix rename).

One non-cosmetic change to flag explicitly: TestWrapperModel.java's testOverwrittenMethods() now skips private methods when reflecting over LTRScoringModel's declared methods. Without this, LTRScoringModel's private calculateHashCode() was being picked up as "overridable" and the test incorrectly demanded WrapperModel declare an override for it. This is a genuine test bug fix, not just tidying — calling it out here so it doesn't get missed in review.

Tests

existing

Relates to #4743

Split out from apache#4743 into a per-module PR to make review easier.
Contains the tidy-up changes to solr/modules/ltr (dead-field/method
removal, toString()/this interchange, isEmpty() idioms, javadoc/
comment fixes, interlavingAlgorithm -> interleavingAlgorithm field
rename).

One non-cosmetic fix is included: TestWrapperModel.java's
testOverwrittenMethods() now skips private methods when reflecting
over LTRScoringModel's declared methods. Without this,
LTRScoringModel's private calculateHashCode() was being treated as
overridable, incorrectly failing the test. Flagging this explicitly
since it is a real bug fix riding along with the tidying.
@epugh
epugh requested a review from cpoerschke August 31, 2026 17:27
@epugh epugh added this to the 10.x milestone Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant