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;h=refs%2Fchanges%2F33%2F3033%2F1;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; }