X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FStandardGraphPropertyVariable.java;h=582277c905bbcbd19a2a1308021f5f71c66510f6;hb=refs%2Fchanges%2F00%2F1900%2F1;hp=13977a0e5a4397be7e2a063c75fe9b77aba9aa7c;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git 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 13977a0e5..582277c90 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 @@ -15,7 +15,6 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener; -import org.simantics.db.common.utils.Logger; import org.simantics.db.common.validation.L0Validations; import org.simantics.db.exception.DatabaseException; import org.simantics.db.exception.ValidationException; @@ -29,9 +28,12 @@ import org.simantics.db.layer0.util.Layer0Utils; import org.simantics.layer0.Layer0; import org.simantics.utils.Development; import org.simantics.utils.datastructures.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StandardGraphPropertyVariable extends AbstractPropertyVariable { - + private static final Logger LOGGER = LoggerFactory.getLogger(StandardGraphPropertyVariable.class); + protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null, false, Collections. emptySet(), null, null, null, null, null, null, Collections.> emptyMap(), @@ -119,7 +121,7 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { if(Development.DEVELOPMENT) { String error = L0Validations.checkValueType(graph, parentResource, property.predicate); if(error != null) { - Logger.defaultLogError(new ValidationException(error)); + LOGGER.error(error); //throw new ValidationException(error); } } @@ -138,7 +140,7 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { if(Development.DEVELOPMENT) { String error = L0Validations.checkValueType(graph, parentResource, property.predicate); if(error != null) { - Logger.defaultLogError(new ValidationException(error)); + LOGGER.error(error); throw new ValidationException(error); } } @@ -175,7 +177,7 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { if(Development.DEVELOPMENT) { String error = L0Validations.checkValueType(graph, parentResource, property.predicate); if(error != null) { - Logger.defaultLogError(new ValidationException(error)); + LOGGER.error(error); //throw new ValidationException(error); } } @@ -190,7 +192,7 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { if(Development.DEVELOPMENT) { String error = L0Validations.checkValueType(graph, parentResource, property.predicate); if(error != null) { - Logger.defaultLogError(new ValidationException(error)); + LOGGER.error(error); throw new ValidationException(error); } } @@ -304,8 +306,8 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { return valueMap.getVariable(graph, this, name); } catch (DatabaseException e) { return null; - } catch (Throwable t) { - System.err.println("err: " + getURI(graph) + " # " + name); + } catch (Exception t) { + LOGGER.error("getPossibleDomainProperty is implemented incorrectly, but returns null on Exception for backward compatibility. URI="+getURI(graph)+", name="+name+".", t); return null; } @@ -401,7 +403,9 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable { protected VariableMap getPossibleChildVariableMap(ReadGraph graph) throws DatabaseException { if(represents == null) return All.standardPropertyDomainChildren; - return graph.getPossibleRelatedValue2(represents, Layer0.getInstance(graph).domainChildren, this); + Resource domainChildren = Layer0.getInstance(graph).domainChildren; + return graph.getPossibleRelatedValue2(represents, domainChildren, + new StandardGraphPropertyVariable(graph, this, domainChildren)); } protected VariableMap getPossiblePropertyVariableMap(ReadGraph graph) throws DatabaseException {