Author: pkluegl
Date: Mon Jul  9 12:53:29 2012
New Revision: 1359125

URL: http://svn.apache.org/viewvc?rev=1359125&view=rev
Log:
UIMA-2428
- ignoring "-" prefix for conditions when validating their names

Modified:
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerVarRefChecker.java

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerVarRefChecker.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerVarRefChecker.java?rev=1359125&r1=1359124&r2=1359125&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerVarRefChecker.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/validator/TextMarkerVarRefChecker.java
 Mon Jul  9 12:53:29 2012
@@ -202,16 +202,15 @@ public class TextMarkerVarRefChecker imp
       // check assign types
       if (s instanceof TextMarkerAction) {
         TextMarkerAction tma = (TextMarkerAction) s;
-        
-        String actionName = 
currentFile.getSource().substring(tma.getNameStart(),
-                tma.getNameEnd());
+
+        String actionName = 
currentFile.getSource().substring(tma.getNameStart(), tma.getNameEnd());
         String[] keywords = 
TextMarkerKeywordsManager.getKeywords(ITextMarkerKeywords.ACTION);
         List<String> asList = Arrays.asList(keywords);
-        if(!"".equals(actionName) && !asList.contains(actionName)) {
+        if (!"".equals(actionName) && !"-".equals(actionName) && 
!asList.contains(actionName)) {
           IProblem problem = problemFactory.createUnknownActionProblem(tma);
           rep.reportProblem(problem);
         }
-        
+
         if (tma.getKind() == TMActionConstants.A_ASSIGN) {
           List<?> childs = tma.getChilds();
           try {
@@ -236,8 +235,7 @@ public class TextMarkerVarRefChecker imp
           Expression struct = sa.getStructure();
           String structure = null;
           if (struct != null) {
-            structure = currentFile.getSource().substring(struct.sourceStart(),
-                    struct.sourceEnd());
+            structure = 
currentFile.getSource().substring(struct.sourceStart(), struct.sourceEnd());
           }
           Map<Expression, Expression> assignments = sa.getAssignments();
           // hotfix... correct name in ast
@@ -263,11 +261,12 @@ public class TextMarkerVarRefChecker imp
                 cond.getNameEnd());
         String[] keywords = 
TextMarkerKeywordsManager.getKeywords(ITextMarkerKeywords.CONDITION);
         List<String> asList = Arrays.asList(keywords);
-        if(!"".equals(conditionName) && !asList.contains(conditionName)) {
+        if (!"".equals(conditionName) && !"-".equals(conditionName)
+                && !asList.contains(conditionName)) {
           IProblem problem = 
problemFactory.createUnknownConditionProblem(cond);
           rep.reportProblem(problem);
         }
-        
+
         if (conditionName.equals("FEATURE")) {
           if (matchedType != null) {
             List<?> args = cond.getChilds();


Reply via email to