You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mb...@apache.org on 2007/09/13 09:53:53 UTC

svn commit: r575205 - in /incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl: Feature_impl.java FilterFeature_impl.java RuleException_impl.java

Author: mbaessler
Date: Thu Sep 13 00:53:52 2007
New Revision: 575205

URL: http://svn.apache.org/viewvc?rev=575205&view=rev
Log:
UIMA-539

fix Findbug issues

https://issues.apache.org/jira/browse/UIMA-539

Modified:
    incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Feature_impl.java
    incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/FilterFeature_impl.java
    incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/RuleException_impl.java

Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Feature_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Feature_impl.java?rev=575205&r1=575204&r2=575205&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Feature_impl.java (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Feature_impl.java Thu Sep 13 00:53:52 2007
@@ -89,7 +89,7 @@
     this.feature = annotationType.getFeatureByBaseName(this.name);
 
     // throw exception if the feature does not exist
-    if (feature == null) {
+    if (this.feature == null) {
       throw new ResourceInitializationException(AnnotatorInitializationException.FEATURE_NOT_FOUND,
               new Object[] { Feature_impl.class.getName(), this.name });
     }

Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/FilterFeature_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/FilterFeature_impl.java?rev=575205&r1=575204&r2=575205&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/FilterFeature_impl.java (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/FilterFeature_impl.java Thu Sep 13 00:53:52 2007
@@ -85,7 +85,7 @@
     this.feature = annotationType.getFeatureByBaseName(this.name);
 
     // throw exception if the feature does not exist
-    if (feature == null) {
+    if (this.feature == null) {
       throw new ResourceInitializationException(AnnotatorInitializationException.FEATURE_NOT_FOUND,
               new Object[] { FilterFeature_impl.class.getName(), this.name });
     }

Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/RuleException_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/RuleException_impl.java?rev=575205&r1=575204&r2=575205&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/RuleException_impl.java (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/RuleException_impl.java Thu Sep 13 00:53:52 2007
@@ -61,10 +61,14 @@
    */
   public boolean matchPattern(AnnotationFS annot) {
     
-    if(lastAnnot == annot) {
-      return lastMatchResult;
+    if(this.lastAnnot == annot) {
+      return this.lastMatchResult;
     }
     
+    //save current annotation
+    this.lastAnnot = annot;
+    
+    //check if the pattern match the current annotation
     if(this.pattern != null) {
       Matcher matcher = this.pattern.matcher(annot.getCoveredText());  
       //use match strategy matchFirst