From dd53fc1c2a3f63f3ec1e5ae57516019c61249caf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:30:38 +0100 Subject: [PATCH] [private-bamoe-issues#1326] Avoid duplicate timer execution with long running timers and async nodes (#2373) (#2376) * [private-bamoe-issues#1326] Avoid duplicate timer execution with long running timers and async nodes * [private-bamoe-issues#1326] Simplify the equals/hashCode methods Co-authored-by: Martin Weiler --- .../core/timer/impl/GlobalTimerService.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java b/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java index d8ccb574de..2c90e10e2d 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/GlobalTimerService.java @@ -375,6 +375,20 @@ public String getUuid() { return null; } + @Override + public int hashCode() { + return (int)getId(); + } + + @Override + public boolean equals(Object obj) { + if ( this == obj ) return true; + if (obj == null || !obj.getClass().equals(getClass())) { + return false; + } + return getId() == ((DefaultJobHandle)obj).getId(); + } + } public static class DisposableCommandService implements InternalLocalRunner {