diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2024-02-06 01:37:52 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2024-02-06 01:37:52 +0200 |
commit | 6e4e6b37818d00e685863c0eb3e40d47e6c7de90 (patch) | |
tree | d6e503d4ca5f4124608837321f0c06994ab93ca0 /pf4j/src | |
parent | cc959309bd71236c19691db4a29ab48888e6a1c3 (diff) | |
download | pf4j-6e4e6b37818d00e685863c0eb3e40d47e6c7de90.tar.gz pf4j-6e4e6b37818d00e685863c0eb3e40d47e6c7de90.zip |
Ignore fire plugin state event without state change
Diffstat (limited to 'pf4j/src')
-rw-r--r-- | pf4j/src/main/java/org/pf4j/AbstractPluginManager.java | 5 |
1 files changed, 5 insertions, 0 deletions
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); |