From 3d2a6984ec0f0382fbf9080a51359285ede2886f Mon Sep 17 00:00:00 2001 From: Simon Kaufmann Date: Fri, 9 Feb 2018 13:46:31 +0100 Subject: [PATCH] corrected generic types Signed-off-by: Simon Kaufmann --- .../smarthome/core/internal/common/SafeCallerImplTest.java | 2 +- .../main/java/org/eclipse/smarthome/core/common/SafeCaller.java | 2 +- .../eclipse/smarthome/core/internal/common/SafeCallerImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/core/org.eclipse.smarthome.core.test/src/test/java/org/eclipse/smarthome/core/internal/common/SafeCallerImplTest.java b/bundles/core/org.eclipse.smarthome.core.test/src/test/java/org/eclipse/smarthome/core/internal/common/SafeCallerImplTest.java index 4839023fb12..c197e8e3543 100644 --- a/bundles/core/org.eclipse.smarthome.core.test/src/test/java/org/eclipse/smarthome/core/internal/common/SafeCallerImplTest.java +++ b/bundles/core/org.eclipse.smarthome.core.test/src/test/java/org/eclipse/smarthome/core/internal/common/SafeCallerImplTest.java @@ -357,7 +357,7 @@ public void testLambdas() throws Exception { thingHandler.method(); }, Runnable.class).build().run(); - String res = safeCaller.create((Function) name -> { + Object res = safeCaller.create((Function) name -> { return "Hello " + name + "!"; }, Function.class).build().apply("World"); assertThat(res, is("Hello World!")); diff --git a/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/common/SafeCaller.java b/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/common/SafeCaller.java index 492ea685bd8..aea74ea3b2d 100644 --- a/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/common/SafeCaller.java +++ b/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/common/SafeCaller.java @@ -39,6 +39,6 @@ public interface SafeCaller { * @param interfaceType the interface which defines the relevant methods * @return a safe call builder instance. */ - SafeCallerBuilder create(T target, Class interfaceType); + SafeCallerBuilder create(T target, Class interfaceType); } diff --git a/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/internal/common/SafeCallerImpl.java b/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/internal/common/SafeCallerImpl.java index a4ace6c6f84..a835ead8c41 100644 --- a/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/internal/common/SafeCallerImpl.java +++ b/bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/internal/common/SafeCallerImpl.java @@ -71,7 +71,7 @@ public void deactivate() { } @Override - public SafeCallerBuilder create(T target, Class interfaceType) { + public SafeCallerBuilder create(T target, Class interfaceType) { return new SafeCallerBuilderImpl(target, new Class[] { interfaceType }, manager); }