X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.objmap2%2Fsrc%2Forg%2Fsimantics%2Fobjmap%2Fgraph%2Fschema%2FDynamicSimpleLinkType.java;h=0abd423c9213bc49ab288db9fb2b7130cbc8e5da;hb=refs%2Fchanges%2F58%2F3658%2F1;hp=e7da15a5dc0476331f66522ce9da31a8a35ec68e;hpb=87b3241ec277ba3d8e414b26186a032c9cdcaeed;p=simantics%2F3d.git diff --git a/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java b/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java index e7da15a5..0abd423c 100644 --- a/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java +++ b/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/DynamicSimpleLinkType.java @@ -1,3 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.objmap.graph.schema; import java.lang.reflect.InvocationTargetException; @@ -58,7 +69,7 @@ public class DynamicSimpleLinkType extends SimpleLinkType{ public Resource createDomainElement(WriteGraph g, Range rangeElement) throws MappingException { try { - String typeUri = (String)typeGetter.invoke(rangeElement, null); + String typeUri = (String)typeGetter.invoke(rangeElement, (Object[]) null); if(LOGGER.isInfoEnabled()) LOGGER.info("SimpleLinkType.createDomainElement " + rangeElement.toString() @@ -75,11 +86,12 @@ public class DynamicSimpleLinkType extends SimpleLinkType{ } catch (IllegalAccessException e) { throw new MappingException(e); } catch (InvocationTargetException e) { - throw new MappingException(e); + throw new MappingException(e.getCause()); } } - @Override + @SuppressWarnings("unchecked") + @Override public Range createRangeElement(ReadGraph g, Resource domainElement) throws MappingException { try { @@ -105,7 +117,7 @@ public class DynamicSimpleLinkType extends SimpleLinkType{ } catch (IllegalArgumentException e) { throw new MappingException(e); } catch (InvocationTargetException e) { - throw new MappingException(e); + throw new MappingException(e.getCause()); } }