+/*******************************************************************************\r
+ * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.objmap.graph.schema;\r
\r
import java.lang.reflect.InvocationTargetException;\r
public Resource createDomainElement(WriteGraph g, Range rangeElement)\r
throws MappingException {\r
try {\r
- String typeUri = (String)typeGetter.invoke(rangeElement, null);\r
+ String typeUri = (String)typeGetter.invoke(rangeElement, (Object[]) null);\r
if(LOGGER.isInfoEnabled())\r
LOGGER.info("SimpleLinkType.createDomainElement " +\r
rangeElement.toString()\r
} catch (IllegalAccessException e) {\r
throw new MappingException(e);\r
} catch (InvocationTargetException e) {\r
- throw new MappingException(e);\r
+ throw new MappingException(e.getCause());\r
}\r
}\r
\r
- @Override\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
public Range createRangeElement(ReadGraph g, Resource domainElement)\r
throws MappingException {\r
try {\r
} catch (IllegalArgumentException e) {\r
throw new MappingException(e);\r
} catch (InvocationTargetException e) {\r
- throw new MappingException(e);\r
+ throw new MappingException(e.getCause());\r
} \r
}\r
\r