lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject lucene-solr:branch_7x: Revert "LUCENE-8110: Fix potential IndexOutOfBoundsException in *Classifier.getClasses(?, int)."
Date Thu, 28 Dec 2017 15:11:01 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 06438bab0 -> 6652d4fb0


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

This reverts commit c73edb869a96bd6869da200944deb6d078cba283.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6652d4fb
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6652d4fb
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6652d4fb

Branch: refs/heads/branch_7x
Commit: 6652d4fb00f2c50ca7f6f640977675557734e367
Parents: 06438ba
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Thu Dec 28 15:10:39 2017 +0000
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Thu Dec 28 15:10:39 2017 +0000

----------------------------------------------------------------------
 lucene/CHANGES.txt                                                | 3 ---
 .../java/org/apache/lucene/classification/BM25NBClassifier.java   | 1 -
 .../org/apache/lucene/classification/KNearestFuzzyClassifier.java | 1 -
 .../apache/lucene/classification/KNearestNeighborClassifier.java  | 1 -
 .../apache/lucene/classification/SimpleNaiveBayesClassifier.java  | 1 -
 .../document/SimpleNaiveBayesDocumentClassifier.java              | 1 -
 6 files changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6652d4fb/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 7f0861e..a6fb3e7 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -46,9 +46,6 @@ Bug Fixes
 * LUCENE-8077: Fixed bug in how CheckIndex verifies doc-value iterators.
   (Xiaoshan Sun via Adrien Grand)
 
-* LUCENE-8110: Fix potential IndexOutOfBoundsException in *Classifier.getClasses(?,int).
-  (Christine Poerschke)
-
 ======================= Lucene 7.2.0 =======================
 
 API Changes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6652d4fb/lucene/classification/src/java/org/apache/lucene/classification/BM25NBClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/BM25NBClassifier.java
b/lucene/classification/src/java/org/apache/lucene/classification/BM25NBClassifier.java
index 39a5b2f..1a74416 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/BM25NBClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/BM25NBClassifier.java
@@ -124,7 +124,6 @@ public class BM25NBClassifier implements Classifier<BytesRef> {
   public List<ClassificationResult<BytesRef>> getClasses(String text, int max)
throws IOException {
     List<ClassificationResult<BytesRef>> assignedClasses = assignClassNormalizedList(text);
     Collections.sort(assignedClasses);
-    max = Math.min(max, assignedClasses.size());
     return assignedClasses.subList(0, max);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6652d4fb/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
b/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
index 65effe4..cbd241b 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestFuzzyClassifier.java
@@ -140,7 +140,6 @@ public class KNearestFuzzyClassifier implements Classifier<BytesRef>
{
     TopDocs knnResults = knnSearch(text);
     List<ClassificationResult<BytesRef>> assignedClasses = buildListFromTopDocs(knnResults);
     Collections.sort(assignedClasses);
-    max = Math.min(max, assignedClasses.size());
     return assignedClasses.subList(0, max);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6652d4fb/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
index f145912..f0391f4 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java
@@ -162,7 +162,6 @@ public class KNearestNeighborClassifier implements Classifier<BytesRef>
{
     TopDocs knnResults = knnSearch(text);
     List<ClassificationResult<BytesRef>> assignedClasses = buildListFromTopDocs(knnResults);
     Collections.sort(assignedClasses);
-    max = Math.min(max, assignedClasses.size());
     return assignedClasses.subList(0, max);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6652d4fb/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
b/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
index 3bb701f..3509df5 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/SimpleNaiveBayesClassifier.java
@@ -132,7 +132,6 @@ public class SimpleNaiveBayesClassifier implements Classifier<BytesRef>
{
   public List<ClassificationResult<BytesRef>> getClasses(String text, int max)
throws IOException {
     List<ClassificationResult<BytesRef>> assignedClasses = assignClassNormalizedList(text);
     Collections.sort(assignedClasses);
-    max = Math.min(max, assignedClasses.size());
     return assignedClasses.subList(0, max);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6652d4fb/lucene/classification/src/java/org/apache/lucene/classification/document/SimpleNaiveBayesDocumentClassifier.java
----------------------------------------------------------------------
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/document/SimpleNaiveBayesDocumentClassifier.java
b/lucene/classification/src/java/org/apache/lucene/classification/document/SimpleNaiveBayesDocumentClassifier.java
index 097fe0c..6bc8573 100644
--- a/lucene/classification/src/java/org/apache/lucene/classification/document/SimpleNaiveBayesDocumentClassifier.java
+++ b/lucene/classification/src/java/org/apache/lucene/classification/document/SimpleNaiveBayesDocumentClassifier.java
@@ -105,7 +105,6 @@ public class SimpleNaiveBayesDocumentClassifier extends SimpleNaiveBayesClassifi
   public List<ClassificationResult<BytesRef>> getClasses(Document document, int
max) throws IOException {
     List<ClassificationResult<BytesRef>> assignedClasses = assignNormClasses(document);
     Collections.sort(assignedClasses);
-    max = Math.min(max, assignedClasses.size());
     return assignedClasses.subList(0, max);
   }
 


Mime
View raw message