ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1771020 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/ListAnnotator.java
Date Wed, 23 Nov 2016 18:26:12 GMT
Author: seanfinan
Date: Wed Nov 23 18:26:12 2016
New Revision: 1771020

URL: http://svn.apache.org/viewvc?rev=1771020&view=rev
Log:
Bug fix for potential string oob exceptions

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/ListAnnotator.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/ListAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/ListAnnotator.java?rev=1771020&r1=1771019&r2=1771020&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/ListAnnotator.java (original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/ListAnnotator.java Wed
Nov 23 18:26:12 2016
@@ -157,12 +157,12 @@ final public class ListAnnotator extends
                if ( boundsJ.getValue1() >= boundsI.getValue1() && boundsJ.getValue1()
<= boundsI.getValue2() ) {
                   removalTypeBounds.add( boundsJ );
                   if ( boundsJ.getValue2() > boundsI.getValue2() ) {
-                     newTypeBounds.put( new Pair<>( boundsI.getValue2(), boundsJ.getValue2()
), boundsI );
+                     newTypeBounds.put( new Pair<>( boundsI.getValue1(), boundsJ.getValue2()
), boundsI );
                   }
                } else if ( boundsJ.getValue2() >= boundsI.getValue1() && boundsJ.getValue2()
<= boundsI.getValue2() ) {
                   removalTypeBounds.add( boundsJ );
                   if ( boundsJ.getValue1() < boundsI.getValue1() ) {
-                     newTypeBounds.put( new Pair<>( boundsI.getValue1(), boundsJ.getValue1()
), boundsI );
+                     newTypeBounds.put( new Pair<>( boundsJ.getValue1(), boundsI.getValue2()
), boundsI );
                   }
                }
             }
@@ -173,6 +173,7 @@ final public class ListAnnotator extends
          for ( Map.Entry<Pair<Integer>, Pair<Integer>> pairEntry : newTypeBounds.entrySet()
) {
             listTypes.put( pairEntry.getKey(), listTypes.get( pairEntry.getValue() ) );
          }
+         removalTypeBounds.addAll( newTypeBounds.values() );
          listTypes.keySet().removeAll( removalTypeBounds );
          if ( listTypes.size() == 1 ) {
             return listTypes;



Mime
View raw message