jvz commented on a change in pull request #744:
URL: https://github.com/apache/logging-log4j2/pull/744#discussion_r801247382



##########
File path: 
log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/convert/CoreTypeConverters.java
##########
@@ -73,17 +73,6 @@ public BigInteger convert(final String s) {
         }
     }
 
-    /**
-     * Converts a {@link String} into a {@link Boolean}.
-     */
-    @Plugin(name = "Boolean", category = TypeConverters.CATEGORY)
-    public static class BooleanConverter implements TypeConverter<Boolean> {

Review comment:
       These are all moved into lambdas in `TypeConverterRegistry` for 
primitive types.

##########
File path: 
log4j-core/src/main/java/org/apache/logging/log4j/core/util/Builder.java
##########
@@ -32,7 +34,7 @@
  * @param <T> This builder creates instances of this class.
  * @deprecated Present only for compatibility with Log4j 2 2.x plugins. Use 
Builder from log4j-plugins.
  */
-public interface Builder<T> {
+public interface Builder<T> extends Supplier<T> {

Review comment:
       Now both `Builder` interfaces work through a common super interface. No 
more wrappers!

##########
File path: 
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/bind/ConfigurationBinder.java
##########
@@ -21,6 +21,7 @@
  * Strategy to bind and validate an {@linkplain 
org.apache.logging.log4j.plugins.inject.ConfigurationInjector injected
  * configuration value} to a {@linkplain 
org.apache.logging.log4j.plugins.PluginFactory plugin factory}.
  */
+@Deprecated

Review comment:
       Class will be deleted.

##########
File path: 
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/inject/PluginAttributeParser.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.plugins.inject;
+
+import org.apache.logging.log4j.plugins.Inject;
+import org.apache.logging.log4j.plugins.Node;
+import org.apache.logging.log4j.plugins.PluginAttribute;
+import org.apache.logging.log4j.plugins.convert.TypeConverters;
+import org.apache.logging.log4j.plugins.name.AnnotatedElementAliasesProvider;
+import org.apache.logging.log4j.plugins.name.AnnotatedElementNameProvider;
+
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Parameter;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.Map;
+import java.util.function.Function;
+
+public class PluginAttributeParser implements NodeParser<PluginAttribute> {
+    private static final Map<Type, Function<PluginAttribute, ?>> 
DEFAULT_VALUE_EXTRACTORS = Map.ofEntries(
+            Map.entry(int.class, PluginAttribute::defaultInt),
+            Map.entry(Integer.class, PluginAttribute::defaultInt),
+            Map.entry(long.class, PluginAttribute::defaultLong),
+            Map.entry(Long.class, PluginAttribute::defaultLong),
+            Map.entry(boolean.class, PluginAttribute::defaultBoolean),
+            Map.entry(Boolean.class, PluginAttribute::defaultBoolean),
+            Map.entry(float.class, PluginAttribute::defaultFloat),
+            Map.entry(Float.class, PluginAttribute::defaultFloat),
+            Map.entry(double.class, PluginAttribute::defaultDouble),
+            Map.entry(Double.class, PluginAttribute::defaultDouble),
+            Map.entry(byte.class, PluginAttribute::defaultByte),
+            Map.entry(Byte.class, PluginAttribute::defaultByte),
+            Map.entry(char.class, PluginAttribute::defaultChar),
+            Map.entry(Character.class, PluginAttribute::defaultChar),
+            Map.entry(short.class, PluginAttribute::defaultShort),
+            Map.entry(Short.class, PluginAttribute::defaultShort),
+            Map.entry(Class.class, PluginAttribute::defaultClass)
+    );
+
+    private final Function<String, String> stringSubstitutionStrategy;
+
+    @Inject

Review comment:
       Note how the parsing strategies for nodes can themselves be 
dependency-injected. In this case, we're using a `StrSubstitutor` function.

##########
File path: 
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/inject/ConfigurationInjector.java
##########
@@ -35,6 +35,7 @@
  * @param <Ann> plugin annotation this injector uses
  * @param <Cfg> configuration class
  */
+@Deprecated

Review comment:
       To be deleted.

##########
File path: 
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/processor/PluginEntry.java
##########
@@ -17,14 +17,10 @@
 
 package org.apache.logging.log4j.plugins.processor;
 
-import java.io.Serializable;
-
 /**
  * Memento object for storing a plugin entry to a cache file.
  */
-public class PluginEntry implements Serializable {

Review comment:
       https://issues.apache.org/jira/browse/LOG4J2-3228 for the full story

##########
File path: 
log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/inject/InjectorStrategy.java
##########
@@ -27,7 +27,7 @@
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.ANNOTATION_TYPE)
-// TODO: annotation processor to validate type matches (help avoid runtime 
errors)
+@Deprecated

Review comment:
       To be deleted.

##########
File path: log4j-plugin-processor/src/main/java9/module-info.java
##########
@@ -23,6 +23,5 @@
     requires transitive org.osgi.framework;
 
     provides javax.annotation.processing.Processor with
-            org.apache.logging.log4j.plugin.processor.PluginProcessor,
-            org.apache.logging.log4j.plugin.processor.BeanProcessor;

Review comment:
       No longer necessary to do additional annotation processing as plugin 
annotations are all that matters for pre-indexing.

##########
File path: 
log4j-plugins-test/src/main/java/org/apache/logging/log4j/plugins/test/validation/ValidatingPluginWithTypedBuilder.java
##########
@@ -39,12 +39,6 @@ public String getName() {
         return name;
     }
 
-    @PluginFactory

Review comment:
       Otherwise ignored factory method, false advertising.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to