This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch release/2.25.4
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 59bd6b35f0a7bf4821fa20efb5c64fa6251ca2a3
Author: Liam Miller-Cushon <[email protected]>
AuthorDate: Mon Mar 16 10:37:39 2026 +0100

    Avoid referring to `PluginBuilderAttribute.class` in `PluginProcessor` 
(#4041)
    
    This makes it easier to build `PluginProcessor` by itself
    separately from the rest of `log4j-core`, and then include
    that processor when building the rest of core, instead of
    having to compile all of core twice.
---
 .../log4j/core/config/plugins/processor/PluginProcessor.java       | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
index cf268c22dd..1cafba337f 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
@@ -53,7 +53,6 @@ import javax.tools.FileObject;
 import javax.tools.StandardLocation;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
 import org.apache.logging.log4j.core.config.plugins.PluginAliases;
-import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
 import org.apache.logging.log4j.util.Strings;
 
 /**
@@ -84,9 +83,13 @@ public class PluginProcessor extends AbstractProcessor {
         return SourceVersion.latest();
     }
 
+    private static final String PLUGIN_BUILDER_ATTRIBUTE_ANNOTATION =
+            
"org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute";
+
     @Override
     public boolean process(final Set<? extends TypeElement> annotations, final 
RoundEnvironment roundEnv) {
         final Messager messager = processingEnv.getMessager();
+        final Elements elementUtils = processingEnv.getElementUtils();
         // Process the elements for this round
         if (!annotations.isEmpty()) {
             final Set<? extends Element> elements = 
roundEnv.getElementsAnnotatedWith(Plugin.class);
@@ -95,7 +98,7 @@ public class PluginProcessor extends AbstractProcessor {
 
             // process plugin builder Attributes
             final Set<? extends Element> pluginAttributeBuilderElements =
-                    
roundEnv.getElementsAnnotatedWith(PluginBuilderAttribute.class);
+                    
roundEnv.getElementsAnnotatedWith(elementUtils.getTypeElement(PLUGIN_BUILDER_ATTRIBUTE_ANNOTATION));
             processBuilderAttribute(pluginAttributeBuilderElements);
             processedElements.addAll(pluginAttributeBuilderElements);
         }

Reply via email to