You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devicemap.apache.org by re...@apache.org on 2015/08/04 01:17:13 UTC

svn commit: r1693981 - /devicemap/trunk/clients/2.0/reference/src/Attributes.java

Author: rezan
Date: Mon Aug  3 23:17:13 2015
New Revision: 1693981

URL: http://svn.apache.org/r1693981
Log:
json checks

Modified:
    devicemap/trunk/clients/2.0/reference/src/Attributes.java

Modified: devicemap/trunk/clients/2.0/reference/src/Attributes.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/Attributes.java?rev=1693981&r1=1693980&r2=1693981&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/Attributes.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/Attributes.java Mon Aug  3 23:17:13 2015
@@ -55,6 +55,19 @@ public class Attributes {
           throw new Exception("Empty attribute name not allowed for " + patternId);
         }
 
+        if(key.equals("patternId")) {
+          throw new Exception("patternId is a reserved attribute name");
+        }
+
+        if(key.endsWith("_error")) {
+          String ekey = key.substring(0, key.length() - 6);
+          if(attributeMap.containsKey(ekey)) {
+            throw new Exception("This attribute is reserved: " + key);
+          }
+        } else if(attributeMap.containsKey(key + "_error")) {
+          throw new Exception("This attribute is reserved: " + key + "_error");
+        }
+
         attributeMap.put(key, value);
       }
     }