From 6505b2e6832974747119417f3dc2840d5299d676 Mon Sep 17 00:00:00 2001 From: offa Date: Fri, 8 Nov 2024 09:11:27 +0100 Subject: [PATCH] Modernize code --- .../plugins/workflow/queue/BlockPipelineQueueDispatcher.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/io/jhnc/jenkins/plugins/workflow/queue/BlockPipelineQueueDispatcher.java b/src/main/java/io/jhnc/jenkins/plugins/workflow/queue/BlockPipelineQueueDispatcher.java index 8751b3a..be32191 100644 --- a/src/main/java/io/jhnc/jenkins/plugins/workflow/queue/BlockPipelineQueueDispatcher.java +++ b/src/main/java/io/jhnc/jenkins/plugins/workflow/queue/BlockPipelineQueueDispatcher.java @@ -39,9 +39,7 @@ public class BlockPipelineQueueDispatcher extends QueueTaskDispatcher { @CheckForNull @Override public CauseOfBlockage canRun(Queue.Item item) { - if (item.task instanceof Job) { - final Job job = (Job) item.task; - + if (item.task instanceof Job job) { if (isBlocked(job)) { final ProjectBlockedProperty property = getProjectProperty(job); return new JobBlockedCause(property == null ? null : property.getMessage());