From 306be20c0ee1c48baff61e18847dd93a947c9353 Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Thu, 18 Jul 2019 17:55:34 +0300 Subject: [PATCH] IAdaptable interface / Class is parameterised gitlab #16 Change-Id: I4f8c25790d3d0dc39726efda82abe8734552e0d1 --- .../simantics/plant3d/geometry/BuiltinGeometryProvider.java | 5 +++-- .../org/simantics/plant3d/geometry/BuiltinMeshProvider.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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; } -- 2.47.1