Author: pkluegl
Date: Thu Jun 16 07:20:46 2016
New Revision: 1748660

URL: http://svn.apache.org/viewvc?rev=1748660&view=rev
Log:
no jira- do not override anchors

Modified:
    
uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/block/ForEachBlock.java

Modified: 
uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/block/ForEachBlock.java
URL: 
http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/block/ForEachBlock.java?rev=1748660&r1=1748659&r2=1748660&view=diff
==============================================================================
--- 
uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/block/ForEachBlock.java
 (original)
+++ 
uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/block/ForEachBlock.java
 Thu Jun 16 07:20:46 2016
@@ -93,7 +93,7 @@ public class ForEachBlock extends RutaBl
         List<RuleElement> ruleElements = eachRule.getRuleElements();
         for (RuleElement ruleElement : ruleElements) {
           boolean set = setRuleElementAnchorRecursively(ruleElement);
-          if(set) {
+          if (set) {
             break;
           }
         }
@@ -104,15 +104,18 @@ public class ForEachBlock extends RutaBl
   }
 
   private boolean setRuleElementAnchorRecursively(RuleElement ruleElement) {
-    if(ruleElement instanceof RutaRuleElement) {
+    if (ruleElement instanceof RutaRuleElement) {
       RutaMatcher matcher = ((RutaRuleElement) ruleElement).getMatcher();
-     if(matcher instanceof RutaAnnotationMatcher && matcher.getExpression() 
instanceof AnnotationVariableExpression) {
-       AnnotationVariableExpression expr =  (AnnotationVariableExpression) 
matcher.getExpression();
-      boolean equals = StringUtils.equals(name, expr.getVar());
-      ruleElement.setStartAnchor(equals);
-      return equals;
-     }
-    } else if(ruleElement instanceof ComposedRuleElement) {
+      if (matcher instanceof RutaAnnotationMatcher
+              && matcher.getExpression() instanceof 
AnnotationVariableExpression) {
+        AnnotationVariableExpression expr = (AnnotationVariableExpression) 
matcher.getExpression();
+        boolean equals = StringUtils.equals(name, expr.getVar());
+        if(equals) {
+          ruleElement.setStartAnchor(equals);
+        }
+        return equals;
+      }
+    } else if (ruleElement instanceof ComposedRuleElement) {
       List<RuleElement> ruleElements = ((ComposedRuleElement) 
ruleElement).getRuleElements();
       for (RuleElement eachInnerRuleElement : ruleElements) {
         return setRuleElementAnchorRecursively(eachInnerRuleElement);
@@ -120,7 +123,7 @@ public class ForEachBlock extends RutaBl
     }
     return false;
   }
-  
+
   @Override
   public String toString() {
     String ruleString = rule == null ? "Document" : rule.toString();


Reply via email to