Skip to content

Commit

Permalink
load services using ServiceLocator if allInstances is empty (#5143)
Browse files Browse the repository at this point in the history
  • Loading branch information
yairogen committed Nov 1, 2023
1 parent 3398416 commit fa9c488
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ public synchronized void register(T plugin) {
protected synchronized Collection<T> findAllInstances() {
if (this.allInstances == null) {
this.allInstances = new ArrayList<>();
}

if (this.allInstances.isEmpty()) {
ServiceLocator serviceLocator = Scope.getCurrentScope().getServiceLocator();
this.allInstances.addAll(serviceLocator.findInstances(getPluginClass()));
}
Expand Down

0 comments on commit fa9c488

Please sign in to comment.