Revision: 18571
          http://sourceforge.net/p/gate/code/18571
Author:   ian_roberts
Date:     2015-02-12 18:18:17 +0000 (Thu, 12 Feb 2015)
Log Message:
-----------
A delegating SAH should always report the same operating mode (ANNOTATION or 
DOCUMENT) as its delegate uses.

Modified Paths:
--------------
    
mimir/trunk/mimir-core/src/gate/mimir/util/DelegatingSemanticAnnotationHelper.java

Modified: 
mimir/trunk/mimir-core/src/gate/mimir/util/DelegatingSemanticAnnotationHelper.java
===================================================================
--- 
mimir/trunk/mimir-core/src/gate/mimir/util/DelegatingSemanticAnnotationHelper.java
  2015-02-12 16:10:40 UTC (rev 18570)
+++ 
mimir/trunk/mimir-core/src/gate/mimir/util/DelegatingSemanticAnnotationHelper.java
  2015-02-12 18:18:17 UTC (rev 18571)
@@ -79,6 +79,7 @@
 
   public void setDelegate(SemanticAnnotationHelper delegate) {
     this.delegate = delegate;
+    this.mode = delegate.getMode();
   }
 
   
@@ -175,15 +176,13 @@
   }
 
   
-  /* (non-Javadoc)
-   * @see gate.mimir.AbstractSemanticAnnotationHelper#getMode()
+  /**
+   * Always return the delegate's mode, as it makes no sense for a delegating
+   * helper to operate in a different mode from its underlying delegate.
    */
   @Override
   public Mode getMode() {
-    if(mode == null) {
-      mode = delegate.getMode();
-    }
-    return mode;
+    return delegate.getMode();
   }
 
   @Override

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


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to