From 516838c30d7700148288ebd008af074ca817f8f0 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Fri, 8 Jan 2021 15:33:42 -0800 Subject: [PATCH] Simplify access to service callback This also works around the problem of assigning to an 'incompatible type', but looks much cleaner. Signed-off-by: Jacob Perron --- .../src/main/java/org/ros2/rcljava/service/ServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rcljava/src/main/java/org/ros2/rcljava/service/ServiceImpl.java b/rcljava/src/main/java/org/ros2/rcljava/service/ServiceImpl.java index e45d06ec..8d7a3254 100644 --- a/rcljava/src/main/java/org/ros2/rcljava/service/ServiceImpl.java +++ b/rcljava/src/main/java/org/ros2/rcljava/service/ServiceImpl.java @@ -100,9 +100,7 @@ public final long getHandle() { public void executeCallback( RMWRequestId rmwRequestId, MessageDefinition request, MessageDefinition response) { - TriConsumer callback = - ((ServiceImpl) this).callback; - + TriConsumer callback = this.callback; callback.accept(rmwRequestId, request, response); }