From ad82e934c895ac6e07c08be54e7ecf525604e195 Mon Sep 17 00:00:00 2001 From: Charl Brink Date: Thu, 8 Dec 2022 17:20:16 +0200 Subject: [PATCH] Issue 402 ConcurrentModificationException under load --- .../src/main/java/org/jeasy/rules/core/RuleProxy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easy-rules-core/src/main/java/org/jeasy/rules/core/RuleProxy.java b/easy-rules-core/src/main/java/org/jeasy/rules/core/RuleProxy.java index 399ef8ff..e71264bf 100644 --- a/easy-rules-core/src/main/java/org/jeasy/rules/core/RuleProxy.java +++ b/easy-rules-core/src/main/java/org/jeasy/rules/core/RuleProxy.java @@ -42,7 +42,7 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import java.util.TreeSet; +import java.util.concurrent.ConcurrentSkipListSet; import static java.lang.String.format; @@ -278,7 +278,7 @@ private Method getConditionMethod() { private Set getActionMethodBeans() { if (this.actionMethods == null) { - this.actionMethods = new TreeSet<>(); + this.actionMethods = new ConcurrentSkipListSet<>(); Method[] methods = getMethods(); for (Method method : methods) { if (method.isAnnotationPresent(Action.class)) {