From: Decebal Suiu Date: Mon, 5 Feb 2024 23:37:52 +0000 (+0200) Subject: Ignore fire plugin state event without state change X-Git-Tag: release-3.11.0~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e4e6b37818d00e685863c0eb3e40d47e6c7de90;p=pf4j.git Ignore fire plugin state event without state change --- diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java index af7c106..2f0d210 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java @@ -861,6 +861,11 @@ public abstract class AbstractPluginManager implements PluginManager { * @param event the plugin state event */ protected synchronized void firePluginStateEvent(PluginStateEvent event) { + if (event.getPluginState() == event.getOldState()) { + // ignore events without state change + return; + } + for (PluginStateListener listener : pluginStateListeners) { log.trace("Fire '{}' to '{}'", event, listener); listener.pluginStateChanged(event);