From: Marko Luukkainen Date: Thu, 18 Jul 2019 14:55:34 +0000 (+0300) Subject: IAdaptable interface / Class is parameterised X-Git-Tag: v1.43.0~240 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=306be20c0ee1c48baff61e18847dd93a947c9353;p=simantics%2F3d.git IAdaptable interface / Class is parameterised gitlab #16 Change-Id: I4f8c25790d3d0dc39726efda82abe8734552e0d1 --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinGeometryProvider.java b/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinGeometryProvider.java index 5250cc9e..25630e18 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinGeometryProvider.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinGeometryProvider.java @@ -14,10 +14,11 @@ public abstract class BuiltinGeometryProvider implements ParametricSolidModelPro this.resource = resource; } + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class adapter) { + public T getAdapter(Class adapter) { if (Resource.class == adapter) - return resource; + return (T)resource; return null; } diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinMeshProvider.java b/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinMeshProvider.java index ccfb5281..64ba4aa7 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinMeshProvider.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/geometry/BuiltinMeshProvider.java @@ -14,10 +14,11 @@ public abstract class BuiltinMeshProvider implements ParametricMeshProvider, IAd this.resource = resource; } + @SuppressWarnings("unchecked") @Override - public Object getAdapter(Class adapter) { + public T getAdapter(Class adapter) { if (Resource.class == adapter) - return resource; + return (T)resource; return null; }