Repository: opennlp
Updated Branches:
  refs/heads/master 5ff03d241 -> f06bab480


OPENNLP-942: Replace IntegerPool usage with auto boxing


Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo
Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/f06bab48
Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/f06bab48
Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/f06bab48

Branch: refs/heads/master
Commit: f06bab48060d2fb4075a339b7eb01887a241d403
Parents: 5ff03d2
Author: Jörn Kottmann <[email protected]>
Authored: Sun Jan 15 23:04:26 2017 +0100
Committer: Jörn Kottmann <[email protected]>
Committed: Sun Jan 15 23:04:26 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/opennlp/tools/ml/maxent/IntegerPool.java     | 3 +++
 .../opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java  | 6 +-----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/opennlp/blob/f06bab48/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/IntegerPool.java
----------------------------------------------------------------------
diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/IntegerPool.java 
b/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/IntegerPool.java
index e9f9d64..8737aaa 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/IntegerPool.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/ml/maxent/IntegerPool.java
@@ -24,7 +24,10 @@ package opennlp.tools.ml.maxent;
  * A pool of read-only, unsigned Integer objects within a fixed,
  * non-sparse range.  Use this class for operations in which a large
  * number of Integer wrapper objects will be created.
+ *
+ * @deprecated repalace with Integer.valueOf or auto boxing
  */
+@Deprecated
 public class IntegerPool {
   private Integer[] _table;
 

http://git-wip-us.apache.org/repos/asf/opennlp/blob/f06bab48/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java
----------------------------------------------------------------------
diff --git 
a/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java
 
b/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java
index c3d48e7..5f70ff6 100644
--- 
a/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java
+++ 
b/opennlp-tools/src/main/java/opennlp/tools/sentdetect/DefaultEndOfSentenceScanner.java
@@ -21,8 +21,6 @@ package opennlp.tools.sentdetect;
 import java.util.ArrayList;
 import java.util.List;
 
-import opennlp.tools.ml.maxent.IntegerPool;
-
 /**
  * Default implementation of the {@link EndOfSentenceScanner}.
  * It uses an character array with possible end of sentence chars
@@ -30,8 +28,6 @@ import opennlp.tools.ml.maxent.IntegerPool;
  */
 public class DefaultEndOfSentenceScanner implements EndOfSentenceScanner {
 
-  protected static final IntegerPool INT_POOL = new IntegerPool(500);
-
   private char eosCharacters[];
 
   /**
@@ -57,7 +53,7 @@ public class DefaultEndOfSentenceScanner implements 
EndOfSentenceScanner {
     for (int i = 0; i < cbuf.length; i++) {
       for (char eosCharacter : eosCharacters) {
         if (cbuf[i] == eosCharacter) {
-          l.add(INT_POOL.get(i));
+          l.add(i);
           break;
         }
       }

Reply via email to