From 4c0b2537552cc965bdfeccd2044eddb01cd317e2 Mon Sep 17 00:00:00 2001 From: Fabian Wolter Date: Fri, 29 May 2020 20:05:36 +0200 Subject: [PATCH] Remove unnecessary isCancelled() from code example Cancelling an already canceled task has no effect. IMHO this check is not necesssary and removal would simplify the code. I came to this because I saw this pattern in many bindings during reviewing. Signed-off-by: Fabian Wolter --- developers/bindings/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developers/bindings/index.md b/developers/bindings/index.md index 6700a37fc0..f4df0fd337 100644 --- a/developers/bindings/index.md +++ b/developers/bindings/index.md @@ -725,7 +725,7 @@ The following example shows the implementation of the above mentioned methods in @Override protected void stopBackgroundDiscovery() { logger.debug("Stop WeMo device background discovery"); - if (wemoDiscoveryJob != null && !wemoDiscoveryJob.isCancelled()) { + if (wemoDiscoveryJob != null) { wemoDiscoveryJob.cancel(true); wemoDiscoveryJob = null; }