From: jsimomaa Date: Thu, 29 Jun 2017 05:09:43 +0000 (+0300) Subject: Layer0Utils.claimAdaptedValue does not support type adapting X-Git-Tag: v1.31.0~290 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F662%2F1;p=simantics%2Fplatform.git Layer0Utils.claimAdaptedValue does not support type adapting refs #7336 Change-Id: I31cf518661eaf30dd1484bdba812c4c3b0d9db4d --- diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java index 198ee41b7..936eb5812 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java @@ -569,16 +569,16 @@ public class Layer0Utils { } - public static void claimAdaptedValue(WriteGraph graph, Resource objectResource, Object value, Binding binding, Datatype datatype) throws DatabaseException { + public static void claimAdaptedValue(WriteGraph graph, Resource objectResource, Object value, Binding binding, Datatype targetDatatype) throws DatabaseException { try { - Datatype source = binding.type(); - if(source.equals(datatype)) { + Datatype sourceDatatype = binding.type(); + if(sourceDatatype.equals(targetDatatype)) { graph.claimValue(objectResource, value, binding); } else { - Binding target = Bindings.getBinding(datatype); - Adapter adapter = Bindings.getAdapter(binding, target); + Binding target = Bindings.getBinding(targetDatatype); + Adapter adapter = Bindings.getTypeAdapter(binding, target); graph.claimValue(objectResource, adapter.adapt(value), target); }