X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FStandardGraphPropertyVariable.java;h=ed58556c7e570814bd4ce25e5473a6821f2c33bc;hp=9b0befc78442fa47d02022ca9e8863f01d1b5647;hb=6839744ff43f5adaa2fc38121952dba846690558;hpb=e2f997281a0eb7c0108000e5462659f5906d3e23 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphPropertyVariable.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphPropertyVariable.java index 9b0befc78..ed58556c7 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphPropertyVariable.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphPropertyVariable.java @@ -11,6 +11,7 @@ import org.simantics.databoard.accessor.reference.ChildReference; import org.simantics.databoard.binding.Binding; import org.simantics.databoard.binding.impl.ObjectVariantBinding; import org.simantics.databoard.type.Datatype; +import org.simantics.db.DevelopmentKeys; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; @@ -19,7 +20,6 @@ import org.simantics.db.common.validation.L0Validations; import org.simantics.db.exception.DatabaseException; import org.simantics.db.exception.DatatypeNotFoundException; import org.simantics.db.exception.ValidationException; -import org.simantics.db.exception.VariableException; import org.simantics.db.layer0.exception.InvalidVariableException; import org.simantics.db.layer0.exception.MissingVariableValueException; import org.simantics.db.layer0.exception.PendingVariableException; @@ -122,10 +122,12 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { public T getValue(ReadGraph graph) throws DatabaseException { if(Development.DEVELOPMENT) { - String error = L0Validations.checkValueType(graph, parentResource, property.predicate); - if(error != null) { - LOGGER.error(error); - //throw new ValidationException(error); + if(Development.getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) { + String error = L0Validations.checkValueType(graph, parentResource, property.predicate); + if(error != null) { + LOGGER.error(error); + throw new ValidationException(error); + } } } @@ -141,10 +143,12 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { return getValue(graph); if(Development.DEVELOPMENT) { - String error = L0Validations.checkValueType(graph, parentResource, property.predicate); - if(error != null) { - LOGGER.error(error); - throw new ValidationException(error); + if(Development.getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) { + String error = L0Validations.checkValueType(graph, parentResource, property.predicate); + if(error != null) { + LOGGER.error(error); + throw new ValidationException(error); + } } } @@ -180,10 +184,12 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException { if(Development.DEVELOPMENT) { - String error = L0Validations.checkValueType(graph, parentResource, property.predicate); - if(error != null) { - LOGGER.error(error); - //throw new ValidationException(error); + if(Development.getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) { + String error = L0Validations.checkValueType(graph, parentResource, property.predicate); + if(error != null) { + LOGGER.error(error); + throw new ValidationException(error); + } } } @@ -195,10 +201,12 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { public void setValue(WriteGraph graph, Object value) throws DatabaseException { if(Development.DEVELOPMENT) { - String error = L0Validations.checkValueType(graph, parentResource, property.predicate); - if(error != null) { - LOGGER.error(error); - throw new ValidationException(error); + if(Development.getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) { + String error = L0Validations.checkValueType(graph, parentResource, property.predicate); + if(error != null) { + LOGGER.error(error); + throw new ValidationException(error); + } } }