You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2015/02/16 17:18:04 UTC

svn commit: r1660152 - /uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java

Author: schor
Date: Mon Feb 16 16:18:04 2015
New Revision: 1660152

URL: http://svn.apache.org/r1660152
Log:
[UIMA-4250] fix wrong compare.  Also fix comment on remove.

Modified:
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java?rev=1660152&r1=1660151&r2=1660152&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java Mon Feb 16 16:18:04 2015
@@ -500,9 +500,10 @@ public class FSIntArrayIndex<T extends F
     final int resultAddr = find(fsRef);
     // If found, create new FS to return.
     if (resultAddr >= 0) {
-      return (fsRef == resultAddr) ? 
+      int foundFsRef = this.index.get(resultAddr);
+      return (fsRef == foundFsRef) ? 
           fs : 
-          fsi.getCASImpl().createFS(this.index.get(resultAddr));
+          fsi.getCASImpl().createFS(foundFsRef);
     }
     // Not found.
     return null;
@@ -536,8 +537,8 @@ public class FSIntArrayIndex<T extends F
    * the exact FS, not just one which matches in the sort comparator.
    * 
    * It only removes one of the exact FSs, if the same FS was indexed more than once.
-   * 
-   * No error is reported if the item is not in the index  
+   * @param fsRef the address of the fs to be removed
+   * @return true if was in the index  
    */
   @Override
   public boolean remove(int fsRef) {