Skip to content

Commit

Permalink
Use array list instead of a TreeSt for the service configurators
Browse files Browse the repository at this point in the history
Using a TreeSet leads to service configurators with the same priority to be ignored
  • Loading branch information
filiphr committed Oct 7, 2024
1 parent b21ab92 commit 24433c9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
*/
package org.flowable.common.engine.impl;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;

import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
import org.flowable.common.engine.api.delegate.event.FlowableEventListener;
Expand Down Expand Up @@ -75,7 +75,7 @@ public void setConfigurators(Collection<ServiceConfigurator<S>> configurators) {
initConfigurators();
this.configurators.clear();
if (configurators != null) {
this.configurators.addAll(configurators);
this.configurators.addAll(configurators.stream().sorted(Comparator.comparingInt(ServiceConfigurator::getPriority)).toList());
}
}

Expand All @@ -87,7 +87,7 @@ public AbstractServiceConfiguration<S> addConfigurator(ServiceConfigurator<S> co

protected void initConfigurators() {
if (this.configurators == null) {
this.configurators = new TreeSet<>(Comparator.comparingInt(ServiceConfigurator::getPriority));
this.configurators = new ArrayList<>();
}
}

Expand Down

0 comments on commit 24433c9

Please sign in to comment.