From: Tuukka Lehtonen Date: Thu, 18 Oct 2018 10:34:23 +0000 (+0000) Subject: Merge "Removed extra modules OntologyModule imported to namespace" X-Git-Tag: v1.43.0~136^2~325 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=93a80604794a5a80666f965abde2abf0b10ccb9c;hp=74c5277934cfba504e5b9569c1524a977d343a9d Merge "Removed extra modules OntologyModule imported to namespace" --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelRule.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelRule.java index e0bff0fe1..243ef4d36 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelRule.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelRule.java @@ -14,8 +14,11 @@ import org.simantics.db.layer0.variable.Variables; import org.simantics.modeling.ModelingResources; import org.simantics.scl.runtime.SCLContext; import org.simantics.scl.runtime.function.Function1; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SCLLabelRule implements LabelRule { + private static final Logger LOGGER = LoggerFactory.getLogger(SCLLabelRule.class); private Resource rule; @@ -35,7 +38,10 @@ public class SCLLabelRule implements LabelRule { Variable ruleVariable = Variables.getVariable(graph, rule); Function1> getLabels = ruleVariable.getPossiblePropertyValue(graph, MOD.SCLLabelRule_getLabels); - if(getLabels == null) return Collections.emptyMap(); + if(getLabels == null) { + LOGGER.warn("Didn't find value for subject={}, predicate={}.", rule, ModelingResources.URIs.SCLLabelRule_getLabels); + return Collections.emptyMap(); + } SCLContext sclContext = SCLContext.getCurrent(); Object oldGraph = sclContext.get("graph"); @@ -48,6 +54,7 @@ public class SCLLabelRule implements LabelRule { } return result; } catch (Throwable t) { + LOGGER.error("Calculating label failed.", t); throw new DatabaseException(t); } finally { sclContext.put("graph", oldGraph); diff --git a/bundles/org.simantics.viewpoint.ontology/graph/Viewpoint.pgraph b/bundles/org.simantics.viewpoint.ontology/graph/Viewpoint.pgraph index e7cfd1e93..e345d6798 100644 --- a/bundles/org.simantics.viewpoint.ontology/graph/Viewpoint.pgraph +++ b/bundles/org.simantics.viewpoint.ontology/graph/Viewpoint.pgraph @@ -130,7 +130,7 @@ VP.VariableLabelModifierRule : VP.ModifierRule VP.ImageRule