devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From re...@apache.org
Subject svn commit: r1693945 - in /devicemap/trunk/clients/2.0/reference: README src/Pattern.java
Date Mon, 03 Aug 2015 17:44:43 GMT
Author: rezan
Date: Mon Aug  3 17:44:42 2015
New Revision: 1693945

URL: http://svn.apache.org/r1693945
Log:
patterntoken count check

Modified:
    devicemap/trunk/clients/2.0/reference/README
    devicemap/trunk/clients/2.0/reference/src/Pattern.java

Modified: devicemap/trunk/clients/2.0/reference/README
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/README?rev=1693945&r1=1693944&r2=1693945&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/README (original)
+++ devicemap/trunk/clients/2.0/reference/README Mon Aug  3 17:44:42 2015
@@ -17,4 +17,3 @@ To compile:
 TODO
 
 move transformer parameters to parent
-error if And pattern type has 1 token

Modified: devicemap/trunk/clients/2.0/reference/src/Pattern.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/Pattern.java?rev=1693945&r1=1693944&r2=1693945&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/Pattern.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/Pattern.java Mon Aug  3 17:44:42 2015
@@ -85,6 +85,11 @@ public class Pattern {
 
       patternTokens.add(patternToken.asText());
     }
+
+    if(patternTokens.size() < 2 && (patternType.equals(PatternType.SimpleAnd)
||
+        patternType.equals(PatternType.SimpleOrderedAnd))) {
+      throw new Exception("patternType " + patternType + " requires more than 1 patternToken:
" + patternTokens);
+    }
   }
 
   //IS PATTERN VALID FOR MATCHED TOKENS



Mime
View raw message