This is an automated email from the ASF dual-hosted git repository.
mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new 9503911 Remove duplicate setAccessible invocation
9503911 is described below
commit 95039112d7ca04c139b0d8f0b9009d00fcc49c62
Author: Matt Sicker <[email protected]>
AuthorDate: Sat Jan 1 22:51:51 2022 -0600
Remove duplicate setAccessible invocation
Signed-off-by: Matt Sicker <[email protected]>
---
.../apache/logging/log4j/core/config/plugins/util/PluginBuilder.java | 2 --
1 file changed, 2 deletions(-)
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
index dd98827..3292998 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
@@ -36,7 +36,6 @@ import org.apache.logging.log4j.util.ReflectionUtil;
import org.apache.logging.log4j.util.StringBuilders;
import java.lang.annotation.Annotation;
-import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -171,7 +170,6 @@ public class PluginBuilder implements Builder<Object> {
private Object injectBuilder(final Builder<?> builder) {
final Object target = builder instanceof BuilderWrapper ?
((BuilderWrapper) builder).getBuilder() : builder;
final List<Field> fields =
TypeUtil.getAllDeclaredFields(target.getClass());
- AccessibleObject.setAccessible(fields.toArray(new Field[0]), true);
final StringBuilder log = new StringBuilder();
// TODO: collect OptionBindingExceptions into a composite error
message (ConfigurationException?)
for (final Field field : fields) {