]> source.dussan.org Git - pf4j.git/commitdiff
Ignore fire plugin state event without state change
authorDecebal Suiu <decebal.suiu@gmail.com>
Mon, 5 Feb 2024 23:37:52 +0000 (01:37 +0200)
committerDecebal Suiu <decebal.suiu@gmail.com>
Mon, 5 Feb 2024 23:37:52 +0000 (01:37 +0200)
pf4j/src/main/java/org/pf4j/AbstractPluginManager.java

index af7c1069e56238148b8ec6f66a11daa05962dc80..2f0d2109996d243538f16bb0f462b3573d22b9a3 100644 (file)
@@ -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);