mikemccand / stargazers-migration-test

Testing Lucene's Jira -> GitHub issues migration
0 stars 0 forks source link

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

Open mikemccand opened 6 years ago

mikemccand commented 6 years ago

KNearestNeighborDocumentClassifier already has the one-line fix via SOLR-8871 and this ticket here is to add the same to the remaining Classifier classes.


Legacy Jira details

LUCENE-8110 by Christine Poerschke (@cpoerschke) on Dec 28 2017 Attachments: LUCENE-8110.patch

mikemccand commented 6 years ago

Commit af41d02eae6a58fd450553f9a09c9325ddf6e0ab in lucene-solr's branch refs/heads/master from @cpoerschke https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=af41d02

LUCENE-8110: Fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int).

[Legacy Jira: ASF subversion and git services on Dec 28 2017]

mikemccand commented 6 years ago

Commit c73edb869a96bd6869da200944deb6d078cba283 in lucene-solr's branch refs/heads/branch_7x from @cpoerschke https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c73edb8

LUCENE-8110: Fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int).

[Legacy Jira: ASF subversion and git services on Dec 28 2017]

mikemccand commented 6 years ago

Should we add a test as well?

[Legacy Jira: Adrien Grand (@jpountz) on Dec 28 2017]

mikemccand commented 6 years ago

Should we add a test as well?

Yes, that would be ideal. From what I vaguely recall, one way to encounter the exception is to index a document without an assigned class before there are any other documents or before there are documents with an assigned class. Or alternatively asking for multiple predicted classes when there is only one class assigned so far, something like that. I only stumbled across this and don't have bandwidth at the moment to work on a test or tests, so will revert for now then.

[Legacy Jira: Christine Poerschke (@cpoerschke) on Dec 28 2017]

mikemccand commented 6 years ago

Commit 6652d4fb00f2c50ca7f6f640977675557734e367 in lucene-solr's branch refs/heads/branch_7x from @cpoerschke https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6652d4f

Revert "LUCENE-8110: Fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int)."

This reverts commit c73edb869a96bd6869da200944deb6d078cba283.

[Legacy Jira: ASF subversion and git services on Dec 28 2017]

mikemccand commented 6 years ago

Commit 152d223b3235459a30f6a8b1cb5331bec46dfb3d in lucene-solr's branch refs/heads/master from @cpoerschke https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=152d223

Revert "LUCENE-8110: Fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int)."

This reverts commit af41d02eae6a58fd450553f9a09c9325ddf6e0ab.

[Legacy Jira: ASF subversion and git services on Dec 28 2017]

mikemccand commented 6 years ago

Reverts complete. Another 'just noticed' thing, would it make sense to have more 'Component/s' choices e.g. classification and spatial on JIRA? A question for the dev-list that perhaps though rather than here.

[Legacy Jira: Christine Poerschke (@cpoerschke) on Dec 28 2017]