aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2024-02-06 01:37:52 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2024-02-06 01:37:52 +0200
commit6e4e6b37818d00e685863c0eb3e40d47e6c7de90 (patch)
treed6e503d4ca5f4124608837321f0c06994ab93ca0
parentcc959309bd71236c19691db4a29ab48888e6a1c3 (diff)
downloadpf4j-6e4e6b37818d00e685863c0eb3e40d47e6c7de90.tar.gz
pf4j-6e4e6b37818d00e685863c0eb3e40d47e6c7de90.zip
Ignore fire plugin state event without state change
-rw-r--r--pf4j/src/main/java/org/pf4j/AbstractPluginManager.java5
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);