From 7c94b3fee8879f1d90743e10a3006d315d3bce1d Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Thu, 29 Jun 2017 08:09:43 +0300 Subject: [PATCH] Layer0Utils.claimAdaptedValue does not support type adapting refs #7336 Change-Id: I31cf518661eaf30dd1484bdba812c4c3b0d9db4d --- .../src/org/simantics/db/layer0/util/Layer0Utils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); } -- 2.47.1