aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Ilgner <mail@marcusilgner.com>2023-10-05 15:37:38 +0200
committerGitHub <noreply@github.com>2023-10-05 16:37:38 +0300
commit426a0d71ff843e28592ab0bbd989aa7fb274976c (patch)
tree7bca1a5250aede2edc5a1d5145a30599728fbaaa
parent4715257de1e0d49fca734698ca417c5e841248c5 (diff)
downloadpf4j-426a0d71ff843e28592ab0bbd989aa7fb274976c.tar.gz
pf4j-426a0d71ff843e28592ab0bbd989aa7fb274976c.zip
Write empty extensions descriptor even if no extensions are found
-rw-r--r--pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java b/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java
index 66293f8..582414b 100644
--- a/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java
+++ b/pf4j/src/main/java/org/pf4j/processor/ExtensionAnnotationProcessor.java
@@ -130,10 +130,10 @@ public class ExtensionAnnotationProcessor extends AbstractProcessor {
}
}
- // write extensions
- if (extensions.size() > 0) {
- storage.write(extensions);
- }
+ // Even an empty extensions descriptor is semantically correct and should be
+ // written to prevent classloaders from falling back to extension descriptor
+ // resources from dependencies of the plugin being processed.
+ storage.write(extensions);
return false;
}