apache / apache/lucene

fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int) [LUCENE-8110]

Open
#9,158 7 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

KNearestNeighborDocumentClassifier already has the [one-line fix](https://github.com/apache/lucene-solr/blob/releases/lucene-solr/7.2.0/lucene/classification/src/java/org/apache/lucene/classification/document/KNearestNeighborDocumentClassifier.java#L102) via [SOLR-8871](https://issues.apache.org/jira/browse/SOLR-8871) and this ticket here is to add the same to the remaining Classifier classes.

---
Migrated from [LUCENE-8110](https://issues.apache.org/jira/browse/LUCENE-8110) by Christine Poerschke (@cpoerschke)
Attachments: [LUCENE-8110.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-8110/LUCENE-8110.patch)

Contributor guide

Open the contributing guide

Research direction

Start with KNearestNeighborDocumentClassifier.java at the linked getClasses entry point, then inspect the remaining Classifier implementations mentioned in the issue. Compare the existing SOLR-8871 fix and the attached LUCENE-8110.patch. Done means the remaining classes no longer have the reported IndexOutOfBoundsException risk and their relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.