Revision: 18697
          http://sourceforge.net/p/gate/code/18697
Author:   markagreenwood
Date:     2015-05-21 10:42:00 +0000 (Thu, 21 May 2015)
Log Message:
-----------
fixed two bugs that caused the segement processing PR to re-use annotation ids 
in some circumstances leading to the loss of annotations -- fixes sourceforge 
bug #188

Modified Paths:
--------------
    
gate/trunk/plugins/Alignment/src/gate/composite/impl/SegmentProcessingPR.java
    gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java

Modified: 
gate/trunk/plugins/Alignment/src/gate/composite/impl/SegmentProcessingPR.java
===================================================================
--- 
gate/trunk/plugins/Alignment/src/gate/composite/impl/SegmentProcessingPR.java   
    2015-05-21 01:20:06 UTC (rev 18696)
+++ 
gate/trunk/plugins/Alignment/src/gate/composite/impl/SegmentProcessingPR.java   
    2015-05-21 10:42:00 UTC (rev 18697)
@@ -76,7 +76,7 @@
    */
   private String inputASName;
 
-  private boolean debug = false;
+  private boolean debug = true;
 
   /**
    * Should be called to execute this PR on a document.
@@ -172,9 +172,9 @@
           
           // try and make sure any annotations created in the segment will have
           // IDs that are valid in the original document
-          if(oldDoc instanceof DocumentImpl) {
+          if(document instanceof DocumentImpl) {
             ((CompositeDocumentImpl)compositeDoc)
-                .setNextAnnotationId(((DocumentImpl)oldDoc)
+                .setNextAnnotationId(((DocumentImpl)document)
                     .peakAtNextAnnotationId());
           }
           
@@ -186,6 +186,7 @@
         } catch(CombiningMethodException e) {
           throw new ExecutionException(e);
         } finally {
+                    
           // finally get rid of the composite document
           compoundDoc.removeDocument(nameForCompositeDoc);
           if(compositeDoc != null) {

Modified: gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java
===================================================================
--- gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java  2015-05-21 
01:20:06 UTC (rev 18696)
+++ gate/trunk/src/main/gate/annotation/AnnotationSetImpl.java  2015-05-21 
10:42:00 UTC (rev 18697)
@@ -921,7 +921,7 @@
     
     //try to ensure that if someone adds an annotation directly by ID
     //the other methods don't trample all over it later
-    if (id > doc.peakAtNextAnnotationId()) {
+    if (id >= doc.peakAtNextAnnotationId()) {
       doc.setNextAnnotationId(id+1);
     }
   } // add(id, start, end, type, features)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to