]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java
Move debugging options under DevelopmentKeys
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / ReadGraphImpl.java
index 79fe974642d2a71e66054fe6de5d00a60424b7bf..cffbba51c75f852e44b215747e94efafa099e296 100644 (file)
@@ -6181,11 +6181,12 @@ public class ReadGraphImpl implements AsyncReadGraph {
     @Override
     public <T> T getRelatedValue2(Resource subject, Resource relation, Object context) throws DatabaseException {
                if(Development.DEVELOPMENT) {
-                       String error = L0Validations.checkValueType(this, subject, relation);
-                       if(error != null) {
-                               Logger.defaultLogError(new ValidationException(error));
-                               //throw new ValidationException(error);
-                               new ValidationException(error).printStackTrace();
+                       if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+                               String error = L0Validations.checkValueType(this, subject, relation);
+                               if(error != null) {
+                                       Logger.defaultLogError(new ValidationException(error));
+                                       throw new ValidationException(error);
+                               }
                        }
                }
         return getValue2(getSingleObject(subject, relation), context);
@@ -6194,12 +6195,13 @@ public class ReadGraphImpl implements AsyncReadGraph {
     @Override
     public Variant getRelatedVariantValue2(Resource subject, Resource relation, Object context) throws DatabaseException {
         if(Development.DEVELOPMENT) {
-            String error = L0Validations.checkValueType(this, subject, relation);
-            if(error != null) {
-                Logger.defaultLogError(new ValidationException(error));
-                //throw new ValidationException(error);
-                new ValidationException(error).printStackTrace();
-            }
+                       if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+                               String error = L0Validations.checkValueType(this, subject, relation);
+                               if(error != null) {
+                                       Logger.defaultLogError(new ValidationException(error));
+                                       throw new ValidationException(error);
+                               }
+                       }
         }
         return getVariantValue2(getSingleObject(subject, relation), context);
     }