[Git][java-team/jboss-logmanager][master] 7 commits: Update debian/watch

Markus Koschany (@apo) gitlab at salsa.debian.org
Wed Sep 8 12:11:35 BST 2021



Markus Koschany pushed to branch master at Debian Java Maintainers / jboss-logmanager


Commits:
6b798125 by Markus Koschany at 2021-09-08T12:59:22+02:00
Update debian/watch

- - - - -
5887c688 by Markus Koschany at 2021-09-08T13:00:50+02:00
New upstream version 2.1.18
- - - - -
63febf19 by Markus Koschany at 2021-09-08T13:00:55+02:00
Update upstream source from tag 'upstream/2.1.18'

Update to upstream version '2.1.18'
with Debian dir a7f12cd927c27cb64f3d93cd5197772c51a03cf2
- - - - -
24ccdd78 by Markus Koschany at 2021-09-08T13:01:37+02:00
Switch to debhelper-compat = 13.

- - - - -
46edf3a1 by Markus Koschany at 2021-09-08T13:01:52+02:00
Declare compliance with Debian Policy 4.6.0.

- - - - -
98a15b4a by Markus Koschany at 2021-09-08T13:02:41+02:00
Update changelog

- - - - -
316b184a by Markus Koschany at 2021-09-08T13:06:32+02:00
Update copyright years

- - - - -


21 changed files:

- debian/changelog
- debian/control
- debian/copyright
- debian/watch
- pom.xml
- src/main/java/org/jboss/logmanager/config/AbstractPropertyConfiguration.java
- src/main/java/org/jboss/logmanager/config/HandlerConfigurationImpl.java
- src/main/java/org/jboss/logmanager/config/LoggerConfigurationImpl.java
- + src/main/java/org/jboss/logmanager/config/WrappedAction.java
- src/main/java/org/jboss/logmanager/formatters/StackTraceFormatter.java
- src/main/java/org/jboss/logmanager/handlers/PeriodicRotatingFileHandler.java
- src/main/java/org/jboss/logmanager/handlers/PeriodicSizeRotatingFileHandler.java
- + src/main/java/org/jboss/logmanager/handlers/SecurityActions.java
- src/main/java/org/jboss/logmanager/handlers/SizeRotatingFileHandler.java
- src/main/java/org/jboss/logmanager/handlers/SuffixRotator.java
- src/main/java9/org/jboss/logmanager/formatters/StackTraceFormatter.java
- src/test/java/org/jboss/logmanager/formatters/PatternFormatterTests.java
- src/test/resources/client-keystore.jks
- src/test/resources/client.cer
- src/test/resources/server-keystore.jks
- src/test/resources/server.cer


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+jboss-logmanager (2.1.18-1) unstable; urgency=medium
+
+  * New upstream version 2.1.18.
+  * Switch to debhelper-compat = 13.
+  * Declare compliance with Debian Policy 4.6.0.
+
+ -- Markus Koschany <apo at debian.org>  Wed, 08 Sep 2021 13:02:21 +0200
+
 jboss-logmanager (2.1.15-1) unstable; urgency=medium
 
   * New upstream version 2.1.15.


=====================================
debian/control
=====================================
@@ -5,7 +5,7 @@ Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.or
 Uploaders:
  Markus Koschany <apo at debian.org>
 Build-Depends:
- debhelper-compat (= 12),
+ debhelper-compat (= 13),
  default-jdk,
  default-jdk-doc,
  junit4,
@@ -18,7 +18,7 @@ Build-Depends:
  libmaven-source-plugin-java,
  libwildfly-common-java,
  maven-debian-helper (>= 1.5)
-Standards-Version: 4.5.0
+Standards-Version: 4.6.0
 Vcs-Git: https://salsa.debian.org/java-team/jboss-logmanager.git
 Vcs-Browser: https://salsa.debian.org/java-team/jboss-logmanager
 Homepage: https://github.com/jboss-logging/jboss-logmanager


=====================================
debian/copyright
=====================================
@@ -3,11 +3,11 @@ Upstream-Name: JBoss Log Manager
 Source: https://github.com/jboss-logging/jboss-logmanager
 
 Files: *
-Copyright: 2014-2020, Red Hat, Inc.
+Copyright: 2014-2021, Red Hat, Inc.
 License: Apache-2.0
 
 Files: debian/*
-Copyright: 2015-2020, Markus Koschany <apo at debian.org>
+Copyright: 2015-2021, Markus Koschany <apo at debian.org>
 License: Apache-2.0
 
 License: Apache-2.0


=====================================
debian/watch
=====================================
@@ -1,4 +1,4 @@
 version=4
-opts=dversionmangle=s/(\da?)[\+\.\-~](?:dfsg|debian|ds|repack|repacked)\.?\d*$/$1/,uversionmangle=s/_/./g;s/\.Beta/~beta/;s/\.Final// \
+opts=dversionmangle=s/(\da?)[\+\.\-~](?:dfsg|debian|ds|repack|repacked)\.?\d*$/$1/,uversionmangle=s/_/./g;s/\.Beta/~beta/;s/.Alpha/~Alpha/;s/\.Final// \
 https://github.com/jboss-logging/jboss-logmanager/tags \
-.*/archive/(?:upstream/)?(?:v||version-|release-|X|R|r)(\d\S*)\.tar\.gz
+.*/@ANY_VERSION@@ARCHIVE_EXT@


=====================================
pom.xml
=====================================
@@ -28,7 +28,7 @@
     <groupId>org.jboss.logmanager</groupId>
     <artifactId>jboss-logmanager</artifactId>
     <packaging>jar</packaging>
-    <version>2.1.15.Final</version>
+    <version>2.1.18.Final</version>
 
     <parent>
         <groupId>org.jboss</groupId>
@@ -58,8 +58,8 @@
         <org.jboss.test.port>4560</org.jboss.test.port>
         <org.jboss.test.alt.port>14560</org.jboss.test.alt.port>
 
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
 
         <jdk.min.version>9</jdk.min.version>
     </properties>
@@ -220,6 +220,7 @@
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>
                     <doclint>none</doclint>
+                    <javadocExecutable>${java.home}${file.separator}bin</javadocExecutable>
                 </configuration>
             </plugin>
             <plugin>


=====================================
src/main/java/org/jboss/logmanager/config/AbstractPropertyConfiguration.java
=====================================
@@ -44,6 +44,7 @@ import org.jboss.modules.ModuleLoader;
  */
 abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfiguration<T, C>> extends AbstractBasicConfiguration<T, C> implements ObjectConfigurable<T>, PropertyConfigurable {
     private final Class<? extends T> actualClass;
+    private final ClassLoader classLoader;
     private final String moduleName;
     private final String className;
     private final String[] constructorProperties;
@@ -61,11 +62,13 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
         final ClassLoader classLoader;
         if (moduleName != null) try {
             classLoader = ModuleFinder.getClassLoader(moduleName);
+            this.classLoader = classLoader;
         } catch (Throwable e) {
             throw new IllegalArgumentException(String.format("Failed to load module \"%s\" for %s \"%s\"", moduleName, getDescription(), name), e);
         }
         else {
             classLoader = getClass().getClassLoader();
+            this.classLoader = null;
         }
         final Class<? extends T> actualClass;
         try {
@@ -89,18 +92,19 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
             final Class<?>[] paramTypes = new Class<?>[length];
             for (int i = 0; i < length; i++) {
                 final String property = constructorProperties[i];
-                final Class<?> type = getConstructorPropertyType(actualClass, property);
+                final Class<?> type = WrappedAction.execute(() -> getConstructorPropertyType(actualClass, property), classLoader);
                 if (type == null) {
                     throw new IllegalArgumentException(String.format("No property named \"%s\" for %s \"%s\"", property, getDescription(), getName()));
                 }
                 paramTypes[i] = type;
             }
-            final Constructor<? extends T> constructor;
-            try {
-                constructor = actualClass.getConstructor(paramTypes);
-            } catch (Exception e) {
-                throw new IllegalArgumentException(String.format("Failed to locate constructor in class \"%s\" for %s \"%s\"", className, getDescription(), getName()), e);
-            }
+            final Constructor<? extends T> constructor = WrappedAction.execute(() -> {
+                try {
+                    return actualClass.getConstructor(paramTypes);
+                } catch (Exception e) {
+                    throw new IllegalArgumentException(String.format("Failed to locate constructor in class \"%s\" for %s \"%s\"", className, getDescription(), getName()), e);
+                }
+            }, classLoader);
             final Object[] params = new Object[length];
             for (int i = 0; i < length; i++) {
                 final String property = constructorProperties[i];
@@ -111,11 +115,13 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
                 final Object value = getConfiguration().getValue(actualClass, property, paramTypes[i], valueExpression, true).getObject();
                 params[i] = value;
             }
-            try {
-                return constructor.newInstance(params);
-            } catch (Exception e) {
-                throw new IllegalArgumentException(String.format("Failed to instantiate class \"%s\" for %s \"%s\"", className, getDescription(), getName()), e);
-            }
+            return WrappedAction.execute(() -> {
+                try {
+                    return constructor.newInstance(params);
+                } catch (Exception e) {
+                    throw new IllegalArgumentException(String.format("Failed to instantiate class \"%s\" for %s \"%s\"", className, getDescription(), getName()), e);
+                }
+            }, classLoader);
         }
 
         public void applyPreCreate(final T param) {
@@ -189,7 +195,7 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
     private void setPropertyValueExpression(final String propertyName, final ValueExpression<String> expression) {
         final boolean replacement = properties.containsKey(propertyName);
         final boolean constructorProp = contains(constructorProperties, propertyName);
-        final Method setter = getPropertySetter(actualClass, propertyName);
+        final Method setter = WrappedAction.execute(() -> getPropertySetter(actualClass, propertyName), classLoader);
         if (setter == null && ! constructorProp) {
             throw new IllegalArgumentException(String.format("No property \"%s\" setter found for %s \"%s\"", propertyName, getDescription(), getName()));
         }
@@ -199,11 +205,13 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
                 if (setter == null) {
                     return ObjectProducer.NULL_PRODUCER;
                 }
-                final Class<?> propertyType = getPropertyType(actualClass, propertyName);
-                if (propertyType == null) {
-                    throw new IllegalArgumentException(String.format("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName()));
-                }
-                return getConfiguration().getValue(actualClass, propertyName, propertyType, expression, false);
+                return WrappedAction.execute(() -> {
+                    final Class<?> propertyType = getPropertyType(actualClass, propertyName);
+                    if (propertyType == null) {
+                        throw new IllegalArgumentException(String.format("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName()));
+                    }
+                    return getConfiguration().getValue(actualClass, propertyName, propertyType, expression, false);
+                }, classLoader);
             }
 
             public void applyPreCreate(final ObjectProducer param) {
@@ -212,44 +220,48 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
 
             public void applyPostCreate(final ObjectProducer param) {
                 if (setter != null) {
-                    final T instance = getRefs().get(getName());
-                    try {
-                        setter.invoke(instance, param.getObject());
-                    } catch (Throwable e) {
-                        StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), param.getObject());
-                    }
+                    WrappedAction.execute(() -> {
+                        final T instance = getRefs().get(getName());
+                        try {
+                            setter.invoke(instance, param.getObject());
+                        } catch (Throwable e) {
+                            StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), param.getObject());
+                        }
+                    }, classLoader);
                 }
             }
 
             public void rollback() {
-                final Class<?> propertyType = getPropertyType(actualClass, propertyName);
-                if (propertyType == null) {
-                    // We don't want the rest of the rollback to fail so we'll just log a message
-                    StandardOutputStreams.printError("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName());
-                    return;
-                }
-                final ObjectProducer producer;
-                if (replacement) {
-                    properties.put(propertyName, oldValue);
-                    producer = getConfiguration().getValue(actualClass, propertyName, propertyType, oldValue, true);
-                } else {
-                    properties.remove(propertyName);
-                    producer = getDefaultValue(propertyType);
-                }
-                if (setter != null) {
-                    // Get the reference instance, the old value and reset to the old value
-                    final T instance = getRefs().get(getName());
-                    if (instance != null) {
-                        try {
-                            setter.invoke(instance, producer.getObject());
-                        } catch (Throwable e) {
-                            StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), producer.getObject());
-                        }
+                WrappedAction.execute(() -> {
+                    final Class<?> propertyType = getPropertyType(actualClass, propertyName);
+                    if (propertyType == null) {
+                        // We don't want the rest of the rollback to fail so we'll just log a message
+                        StandardOutputStreams.printError("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName());
+                        return;
+                    }
+                    final ObjectProducer producer;
+                    if (replacement) {
+                        properties.put(propertyName, oldValue);
+                        producer = getConfiguration().getValue(actualClass, propertyName, propertyType, oldValue, true);
                     } else {
-                        // If the instance is not available don't keep the property
                         properties.remove(propertyName);
+                        producer = getDefaultValue(propertyType);
                     }
-                }
+                    if (setter != null) {
+                        // Get the reference instance, the old value and reset to the old value
+                        final T instance = getRefs().get(getName());
+                        if (instance != null) {
+                            try {
+                                setter.invoke(instance, producer.getObject());
+                            } catch (Throwable e) {
+                                StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), producer.getObject());
+                            }
+                        } else {
+                            // If the instance is not available don't keep the property
+                            properties.remove(propertyName);
+                        }
+                    }
+                }, classLoader);
             }
         });
     }
@@ -262,7 +274,7 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
         if (isRemoved()) {
             throw new IllegalArgumentException(String.format("Cannot remove property \"%s\" on %s \"%s\" (removed)", propertyName, getDescription(), getName()));
         }
-        final Method setter = getPropertySetter(actualClass, propertyName);
+        final Method setter = WrappedAction.execute(() -> getPropertySetter(actualClass, propertyName), classLoader);
         if (setter == null) {
             throw new IllegalArgumentException(String.format("No property \"%s\" setter found for %s \"%s\"", propertyName, getDescription(), getName()));
         }
@@ -270,11 +282,13 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
         if (oldValue != null) {
             getConfiguration().addAction(new ConfigAction<ObjectProducer>() {
                 public ObjectProducer validate() throws IllegalArgumentException {
-                    final Class<?> propertyType = getPropertyType(actualClass, propertyName);
-                    if (propertyType == null) {
-                        throw new IllegalArgumentException(String.format("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName()));
-                    }
-                    return getDefaultValue(propertyType);
+                    return WrappedAction.execute(() -> {
+                        final Class<?> propertyType = getPropertyType(actualClass, propertyName);
+                        if (propertyType == null) {
+                            throw new IllegalArgumentException(String.format("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName()));
+                        }
+                        return getDefaultValue(propertyType);
+                    }, classLoader);
                 }
 
                 public void applyPreCreate(final ObjectProducer param) {
@@ -282,30 +296,34 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
                 }
 
                 public void applyPostCreate(final ObjectProducer param) {
-                    final T instance = getRefs().get(getName());
-                    try {
-                        setter.invoke(instance, param.getObject());
-                    } catch (Throwable e) {
-                        StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), param.getObject());
-                    }
+                    WrappedAction.execute(() -> {
+                        final T instance = getRefs().get(getName());
+                        try {
+                            setter.invoke(instance, param.getObject());
+                        } catch (Throwable e) {
+                            StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), param.getObject());
+                        }
+                    }, classLoader);
                 }
 
                 public void rollback() {
-                    // We need to once again determine the property type
-                    final Class<?> propertyType = getPropertyType(actualClass, propertyName);
-                    if (propertyType == null) {
-                        // We don't want the rest of the rollback to fail so we'll just log a message
-                        StandardOutputStreams.printError("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName());
-                        return;
-                    }
-                    // Get the reference instance, the old value and reset to the old value
-                    final T instance = getRefs().get(getName());
-                    final ObjectProducer producer = getConfiguration().getValue(actualClass, propertyName, propertyType, oldValue, true);
-                    try {
-                        setter.invoke(instance, producer.getObject());
-                    } catch (Throwable e) {
-                        StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), producer.getObject());
-                    }
+                    WrappedAction.execute(() -> {
+                        // We need to once again determine the property type
+                        final Class<?> propertyType = getPropertyType(actualClass, propertyName);
+                        if (propertyType == null) {
+                            // We don't want the rest of the rollback to fail so we'll just log a message
+                            StandardOutputStreams.printError("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName());
+                            return;
+                        }
+                        // Get the reference instance, the old value and reset to the old value
+                        final T instance = getRefs().get(getName());
+                        final ObjectProducer producer = getConfiguration().getValue(actualClass, propertyName, propertyType, oldValue, true);
+                        try {
+                            setter.invoke(instance, producer.getObject());
+                        } catch (Throwable e) {
+                            StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), producer.getObject());
+                        }
+                    }, classLoader);
                 }
             });
             return true;
@@ -339,11 +357,13 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
         }
         configuration.addAction(new ConfigAction<Method>() {
             public Method validate() throws IllegalArgumentException {
-                try {
-                    return actualClass.getMethod(methodName);
-                } catch (NoSuchMethodException e) {
-                    throw new IllegalArgumentException(String.format("Method '%s' not found on '%s'", methodName, actualClass.getName()));
-                }
+                return WrappedAction.execute(() -> {
+                    try {
+                        return actualClass.getMethod(methodName);
+                    } catch (NoSuchMethodException e) {
+                        throw new IllegalArgumentException(String.format("Method '%s' not found on '%s'", methodName, actualClass.getName()));
+                    }
+                }, classLoader);
             }
 
             public void applyPreCreate(final Method param) {
@@ -383,12 +403,13 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
             public Map<String, Method> validate() throws IllegalArgumentException {
                 final Map<String, Method> result = new LinkedHashMap<String, Method>();
                 for (String methodName : names) {
-                    try {
-                        result.put(methodName, actualClass.getMethod(methodName));
-                    } catch (NoSuchMethodException e) {
-                        throw new IllegalArgumentException(String.format("Method '%s' not found on '%s'", methodName, actualClass.getName()));
-                    }
-
+                    WrappedAction.execute(() -> {
+                        try {
+                            result.put(methodName, actualClass.getMethod(methodName));
+                        } catch (NoSuchMethodException e) {
+                            throw new IllegalArgumentException(String.format("Method '%s' not found on '%s'", methodName, actualClass.getName()));
+                        }
+                    }, classLoader);
                 }
                 return result;
             }
@@ -471,12 +492,14 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
                 }
 
                 public void applyPostCreate(final Method param) {
-                    final T instance = getRefs().get(getName());
-                    try {
-                        param.invoke(instance);
-                    } catch (Throwable e) {
-                        StandardOutputStreams.printError(e, "Failed to invoke method %s%n.", param.getName());
-                    }
+                    WrappedAction.execute(() -> {
+                        final T instance = getRefs().get(getName());
+                        try {
+                            param.invoke(instance);
+                        } catch (Throwable e) {
+                            StandardOutputStreams.printError(e, "Failed to invoke method %s%n.", param.getName());
+                        }
+                    }, classLoader);
                 }
 
                 public void rollback() {
@@ -493,17 +516,17 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
         return getConfiguration().removePostConfigurationActions(name);
     }
 
-    static Class<?> getPropertyType(Class<?> clazz, String propertyName) {
+    private static Class<?> getPropertyType(Class<?> clazz, String propertyName) {
         final Method setter = getPropertySetter(clazz, propertyName);
         return setter != null ? setter.getParameterTypes()[0] : null;
     }
 
-    static Class<?> getConstructorPropertyType(Class<?> clazz, String propertyName) {
+   private static Class<?> getConstructorPropertyType(Class<?> clazz, String propertyName) {
         final Method getter = getPropertyGetter(clazz, propertyName);
         return getter != null ? getter.getReturnType() : getPropertyType(clazz, propertyName);
     }
 
-    static Method getPropertySetter(Class<?> clazz, String propertyName) {
+    private static Method getPropertySetter(Class<?> clazz, String propertyName) {
         final String upperPropertyName = Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1);
         final String set = "set" + upperPropertyName;
         for (Method method : clazz.getMethods()) {
@@ -514,7 +537,7 @@ abstract class AbstractPropertyConfiguration<T, C extends AbstractPropertyConfig
         return null;
     }
 
-    static Method getPropertyGetter(Class<?> clazz, String propertyName) {
+    private static Method getPropertyGetter(Class<?> clazz, String propertyName) {
         final String upperPropertyName = Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1);
         final Pattern pattern = Pattern.compile("(get|has|is)(" + Pattern.quote(upperPropertyName) + ")");
         for (Method method : clazz.getMethods()) {


=====================================
src/main/java/org/jboss/logmanager/config/HandlerConfigurationImpl.java
=====================================
@@ -375,19 +375,20 @@ final class HandlerConfigurationImpl extends AbstractPropertyConfiguration<Handl
         }
         final int index = handlerNames.indexOf(name);
         handlerNames.remove(index);
-        configuration.addAction(new ConfigAction<Void>() {
-            public Void validate() throws IllegalArgumentException {
-                return null;
+        configuration.addAction(new ConfigAction<Handler>() {
+            public Handler validate() throws IllegalArgumentException {
+                final Map<String, Handler> handlerRefs = configuration.getHandlerRefs();
+                return handlerRefs.get(name);
             }
 
-            public void applyPreCreate(final Void param) {
+            public void applyPreCreate(final Handler param) {
                 addPostConfigurationActions();
             }
 
-            public void applyPostCreate(final Void param) {
+            public void applyPostCreate(final Handler param) {
                 final Map<String, Handler> handlerRefs = configuration.getHandlerRefs();
                 final ExtHandler handler = (ExtHandler) handlerRefs.get(getName());
-                handler.removeHandler(handlerRefs.get(name));
+                handler.removeHandler(param);
             }
 
             public void rollback() {


=====================================
src/main/java/org/jboss/logmanager/config/LoggerConfigurationImpl.java
=====================================
@@ -310,19 +310,19 @@ final class LoggerConfigurationImpl extends AbstractBasicConfiguration<Logger, L
         }
         final int index = handlerNames.indexOf(name);
         handlerNames.remove(index);
-        configuration.addAction(new ConfigAction<Void>() {
-            public Void validate() throws IllegalArgumentException {
-                return null;
+        configuration.addAction(new ConfigAction<Handler>() {
+            public Handler validate() throws IllegalArgumentException {
+                final Map<String, Handler> handlerRefs = configuration.getHandlerRefs();
+                return handlerRefs.get(name);
             }
 
-            public void applyPreCreate(final Void param) {
+            public void applyPreCreate(final Handler param) {
             }
 
-            public void applyPostCreate(final Void param) {
-                final Map<String, Handler> handlerRefs = configuration.getHandlerRefs();
+            public void applyPostCreate(final Handler param) {
                 final Map<String, Logger> loggerRefs = configuration.getLoggerRefs();
-                final Logger logger = (Logger) loggerRefs.get(getName());
-                logger.removeHandler(handlerRefs.get(name));
+                final Logger logger = loggerRefs.get(getName());
+                logger.removeHandler(param);
             }
 
             public void rollback() {


=====================================
src/main/java/org/jboss/logmanager/config/WrappedAction.java
=====================================
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * Copyright 2021 Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags.
+ *
+ * Licensed 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.jboss.logmanager.config;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.function.Supplier;
+
+/**
+ * @author <a href="mailto:jperkins at redhat.com">James R. Perkins</a>
+ */
+class WrappedAction {
+
+    /**
+     * Executes the action with the {@linkplain Thread#getContextClassLoader() TCCL} set to the class loader of the type.
+     *
+     * @param action the action to run
+     * @param cl     the class loader to use for the TCCL
+     * @param <R>    the return type
+     *
+     * @return the value from the action
+     */
+    static <R> R execute(final Supplier<R> action, final ClassLoader cl) {
+        if (cl == null) {
+            return action.get();
+        }
+        final ClassLoader current = getTccl();
+        try {
+            setTccl(cl);
+            return action.get();
+        } finally {
+            setTccl(current);
+        }
+    }
+
+    /**
+     * Executes the action with the {@linkplain Thread#getContextClassLoader() TCCL} set to the class loader of the type.
+     *
+     * @param action the action to run
+     * @param cl     the class loader to use for the TCCL
+     */
+    static void execute(final Runnable action, final ClassLoader cl) {
+        if (cl == null) {
+            action.run();
+        } else {
+            final ClassLoader current = getTccl();
+            try {
+                setTccl(cl);
+                action.run();
+            } finally {
+                setTccl(current);
+            }
+        }
+    }
+
+    private static ClassLoader getTccl() {
+        if (System.getSecurityManager() == null) {
+            return Thread.currentThread().getContextClassLoader();
+        }
+        return AccessController.doPrivileged((PrivilegedAction<ClassLoader>) () -> Thread.currentThread().getContextClassLoader());
+    }
+
+    private static void setTccl(final ClassLoader cl) {
+        if (System.getSecurityManager() == null) {
+            Thread.currentThread().setContextClassLoader(cl);
+        } else {
+            AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
+                Thread.currentThread().setContextClassLoader(cl);
+                return null;
+            });
+        }
+    }
+}


=====================================
src/main/java/org/jboss/logmanager/formatters/StackTraceFormatter.java
=====================================
@@ -106,7 +106,9 @@ class StackTraceFormatter {
 
     private void renderStackTrace(final StackTraceElement[] parentStack, final Throwable child, final String caption, final String prefix) {
         if (seen.contains(child)) {
-            builder.append("\t[CIRCULAR REFERENCE:")
+            builder.append(prefix)
+                    .append(caption)
+                    .append("[CIRCULAR REFERENCE: ")
                     .append(child)
                     .append(']');
             newLine();


=====================================
src/main/java/org/jboss/logmanager/handlers/PeriodicRotatingFileHandler.java
=====================================
@@ -22,6 +22,10 @@ package org.jboss.logmanager.handlers;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
@@ -36,6 +40,7 @@ import org.jboss.logmanager.ExtLogRecord;
  */
 public class PeriodicRotatingFileHandler extends FileHandler {
 
+    private final AccessControlContext acc = AccessController.getContext();
     private SimpleDateFormat format;
     private String nextSuffix;
     private Period period = Period.NEVER;
@@ -128,7 +133,7 @@ public class PeriodicRotatingFileHandler extends FileHandler {
      * @throws IllegalArgumentException if the suffix is not valid
      */
     public void setSuffix(String suffix) throws IllegalArgumentException {
-        final SuffixRotator suffixRotator = SuffixRotator.parse(suffix);
+        final SuffixRotator suffixRotator = SuffixRotator.parse(acc, suffix);
         final String dateSuffix = suffixRotator.getDatePattern();
         final SimpleDateFormat format = new SimpleDateFormat(dateSuffix);
         format.setTimeZone(timeZone);
@@ -191,12 +196,16 @@ public class PeriodicRotatingFileHandler extends FileHandler {
     private void rollOver() {
         try {
             final File file = getFile();
+            if (file == null) {
+                // no file is set; a direct output stream or writer was specified
+                return;
+            }
             // first, close the original file (some OSes won't let you move/rename a file that is open)
-            setFile(null);
+            setFileInternal(null);
             // next, rotate it
-            suffixRotator.rotate(getErrorManager(), file.toPath(), nextSuffix);
+            suffixRotator.rotate(SecurityActions.getErrorManager(acc, this), file.toPath(), nextSuffix);
             // start new file
-            setFile(file);
+            setFileInternal(file);
         } catch (IOException e) {
             reportError("Unable to rotate log file", e, ErrorManager.OPEN_FAILURE);
         }
@@ -292,6 +301,22 @@ public class PeriodicRotatingFileHandler extends FileHandler {
         this.timeZone = timeZone;
     }
 
+    private void setFileInternal(final File file) throws FileNotFoundException {
+        // At this point we should have already checked the security required
+        if (System.getSecurityManager() == null) {
+            super.setFile(file);
+        } else {
+            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                try {
+                    super.setFile(file);
+                } catch (FileNotFoundException e) {
+                    throw new UncheckedIOException(e);
+                }
+                return null;
+            }, acc);
+        }
+    }
+
     private static <T extends Comparable<? super T>> T min(T a, T b) {
         return a.compareTo(b) <= 0 ? a : b;
     }


=====================================
src/main/java/org/jboss/logmanager/handlers/PeriodicSizeRotatingFileHandler.java
=====================================
@@ -23,6 +23,10 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.io.UncheckedIOException;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.ErrorManager;
 
 import org.jboss.logmanager.ExtLogRecord;
@@ -38,6 +42,7 @@ import org.jboss.logmanager.ExtLogRecord;
  * @author <a href="mailto:jperkins at redhat.com">James R. Perkins</a>
  */
 public class PeriodicSizeRotatingFileHandler extends PeriodicRotatingFileHandler {
+    private final AccessControlContext acc = AccessController.getContext();
     // by default, rotate at 10MB
     private long rotateSize = 0xa0000L;
     private int maxBackupIndex = 1;
@@ -148,6 +153,7 @@ public class PeriodicSizeRotatingFileHandler extends PeriodicRotatingFileHandler
      */
     @Override
     public void setFile(final File file) throws FileNotFoundException {
+        checkAccess(this);
         synchronized (outputLock) {
             // Check for a rotate
             if (rotateOnBoot && maxBackupIndex > 0 && file != null && file.exists() && file.length() > 0L) {
@@ -155,11 +161,12 @@ public class PeriodicSizeRotatingFileHandler extends PeriodicRotatingFileHandler
                 final SuffixRotator suffixRotator = getSuffixRotator();
                 if (suffixRotator != SuffixRotator.EMPTY && suffix != null) {
                     // Make sure any previous files are closed before we attempt to rotate
-                    setFileInternal(null);
+                    setFileInternal(null, false);
+                    // Previous actions have already performed
                     suffixRotator.rotate(getErrorManager(), file.toPath(), suffix, maxBackupIndex);
                 }
             }
-            setFileInternal(file);
+            setFileInternal(file, false);
         }
     }
 
@@ -224,19 +231,34 @@ public class PeriodicSizeRotatingFileHandler extends PeriodicRotatingFileHandler
                     return;
                 }
                 // close the old file.
-                setFileInternal(null);
-                getSuffixRotator().rotate(getErrorManager(), file.toPath(), getNextSuffix(), maxBackupIndex);
+                setFileInternal(null, true);
+                getSuffixRotator().rotate(SecurityActions.getErrorManager(acc, this), file.toPath(), getNextSuffix(), maxBackupIndex);
                 // start with new file.
-                setFileInternal(file);
+                setFileInternal(file, true);
             } catch (IOException e) {
                 reportError("Unable to rotate log file", e, ErrorManager.OPEN_FAILURE);
             }
         }
     }
 
-    private void setFileInternal(final File file) throws FileNotFoundException {
-        super.setFile(file);
-        if (outputStream != null)
-            outputStream.currentSize = file == null ? 0L : file.length();
+    private void setFileInternal(final File file, final boolean doPrivileged) throws FileNotFoundException {
+        if (System.getSecurityManager() == null || !doPrivileged) {
+            super.setFile(file);
+            if (outputStream != null) {
+                outputStream.currentSize = file == null ? 0L : file.length();
+            }
+        } else {
+            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                try {
+                    super.setFile(file);
+                    if (outputStream != null) {
+                        outputStream.currentSize = file == null ? 0L : file.length();
+                    }
+                } catch (FileNotFoundException e) {
+                    throw new UncheckedIOException(e);
+                }
+                return null;
+            }, acc);
+        }
     }
 }


=====================================
src/main/java/org/jboss/logmanager/handlers/SecurityActions.java
=====================================
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * Copyright 2020 Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags.
+ *
+ * Licensed 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.jboss.logmanager.handlers;
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.function.Supplier;
+import java.util.logging.ErrorManager;
+import java.util.logging.Handler;
+
+/**
+ * @author <a href="mailto:jperkins at redhat.com">James R. Perkins</a>
+ */
+class SecurityActions {
+
+    static ErrorManager getErrorManager(final AccessControlContext acc, final Handler handler) {
+        Supplier<ErrorManager> supplier = () -> {
+            if (System.getSecurityManager() == null) {
+                return handler.getErrorManager();
+            }
+            return AccessController.doPrivileged((PrivilegedAction<ErrorManager>) handler::getErrorManager, acc);
+        };
+        return new LazyErrorManager(supplier);
+    }
+
+    private static class LazyErrorManager extends ErrorManager {
+        private final Supplier<ErrorManager> supplier;
+        private volatile ErrorManager delegate;
+
+        private LazyErrorManager(final Supplier<ErrorManager> supplier) {
+            this.supplier = supplier;
+        }
+
+        @Override
+        public synchronized void error(final String msg, final Exception ex, final int code) {
+            getDelegate().error(msg, ex, code);
+        }
+
+        private ErrorManager getDelegate() {
+            if (delegate == null) {
+                synchronized (this) {
+                    if (delegate == null) {
+                        delegate = supplier.get();
+                    }
+                }
+            }
+            return delegate;
+        }
+    }
+}


=====================================
src/main/java/org/jboss/logmanager/handlers/SizeRotatingFileHandler.java
=====================================
@@ -25,9 +25,14 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import org.jboss.logmanager.ExtLogRecord;
 
+import java.io.UncheckedIOException;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.logging.ErrorManager;
 
 public class SizeRotatingFileHandler extends FileHandler {
+    private final AccessControlContext acc = AccessController.getContext();
     // by default, rotate at 10MB
     private long rotateSize = 0xa0000L;
     private int maxBackupIndex = 1;
@@ -136,14 +141,15 @@ public class SizeRotatingFileHandler extends FileHandler {
      * @throws RuntimeException if there is an attempt to rotate file and the rotation fails
      */
     public void setFile(final File file) throws FileNotFoundException {
+        checkAccess(this);
         synchronized (outputLock) {
             // Check for a rotate
             if (rotateOnBoot && maxBackupIndex > 0 && file != null && file.exists() && file.length() > 0L) {
                 // Make sure any previous files are closed before we attempt to rotate
-                setFileInternal(null);
+                setFileInternal(null, false);
                 suffixRotator.rotate(getErrorManager(), file.toPath(), maxBackupIndex);
             }
-            setFileInternal(file);
+            setFileInternal(file, false);
         }
     }
 
@@ -228,7 +234,7 @@ public class SizeRotatingFileHandler extends FileHandler {
     public void setSuffix(final String suffix) {
         checkAccess(this);
         synchronized (outputLock) {
-            this.suffixRotator = SuffixRotator.parse(suffix);
+            this.suffixRotator = SuffixRotator.parse(acc, suffix);
         }
     }
 
@@ -244,19 +250,34 @@ public class SizeRotatingFileHandler extends FileHandler {
                     return;
                 }
                 // close the old file.
-                setFileInternal(null);
-                suffixRotator.rotate(getErrorManager(), file.toPath(), maxBackupIndex);
+                setFileInternal(null, true);
+                suffixRotator.rotate(SecurityActions.getErrorManager(acc, this), file.toPath(), maxBackupIndex);
                 // start with new file.
-                setFileInternal(file);
+                setFileInternal(file, true);
             } catch (IOException e) {
                 reportError("Unable to rotate log file", e, ErrorManager.OPEN_FAILURE);
             }
         }
     }
 
-    private void setFileInternal(final File file) throws FileNotFoundException {
-        super.setFile(file);
-        if (outputStream != null)
-            outputStream.currentSize = file == null ? 0L : file.length();
+    private void setFileInternal(final File file, final boolean doPrivileged) throws FileNotFoundException {
+        if (System.getSecurityManager() == null || !doPrivileged) {
+            super.setFile(file);
+            if (outputStream != null) {
+                outputStream.currentSize = file == null ? 0L : file.length();
+            }
+        } else {
+            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+                try {
+                    super.setFile(file);
+                    if (outputStream != null) {
+                        outputStream.currentSize = file == null ? 0L : file.length();
+                    }
+                } catch (FileNotFoundException e) {
+                    throw new UncheckedIOException(e);
+                }
+                return null;
+            }, acc);
+        }
     }
 }


=====================================
src/main/java/org/jboss/logmanager/handlers/SuffixRotator.java
=====================================
@@ -21,11 +21,16 @@ package org.jboss.logmanager.handlers;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UncheckedIOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Locale;
@@ -53,15 +58,18 @@ class SuffixRotator {
     /**
      * An empty rotation suffix.
      */
-    static final SuffixRotator EMPTY = new SuffixRotator("", "", "", CompressionType.NONE);
+    static final SuffixRotator EMPTY = new SuffixRotator(AccessController.getContext(), "", "", "", CompressionType.NONE);
 
+    private final AccessControlContext acc;
     private final String originalSuffix;
     private final String datePattern;
     private final SimpleDateFormat formatter;
     private final String compressionSuffix;
     private final CompressionType compressionType;
 
-    private SuffixRotator(final String originalSuffix, final String datePattern, final String compressionSuffix, final CompressionType compressionType) {
+    private SuffixRotator(final AccessControlContext acc, final String originalSuffix, final String datePattern,
+                          final String compressionSuffix, final CompressionType compressionType) {
+        this.acc = acc;
         this.originalSuffix = originalSuffix;
         this.datePattern = datePattern;
         this.compressionSuffix = compressionSuffix;
@@ -80,7 +88,7 @@ class SuffixRotator {
      *
      * @return the file rotator used to determine the suffix parts and rotate the file.
      */
-    static SuffixRotator parse(final String suffix) {
+    static SuffixRotator parse(final AccessControlContext acc, final String suffix) {
         if (suffix == null || suffix.isEmpty()) {
             return EMPTY;
         }
@@ -103,9 +111,9 @@ class SuffixRotator {
             }
         }
         if (compressionSuffix.isEmpty() && datePattern.isEmpty()) {
-            return new SuffixRotator(suffix, suffix, "", CompressionType.NONE);
+            return new SuffixRotator(acc, suffix, suffix, "", CompressionType.NONE);
         }
-        return new SuffixRotator(suffix, datePattern, compressionSuffix, compressionType);
+        return new SuffixRotator(acc, suffix, datePattern, compressionSuffix, compressionType);
     }
 
     /**
@@ -156,7 +164,7 @@ class SuffixRotator {
             try {
                 archiveGzip(source, target);
                 // Delete the file after it's archived to behave like a file move or rename
-                Files.delete(source);
+                deleteFile(source);
             } catch (Exception e) {
                 errorManager.error(String.format("Failed to compress %s to %s. Compressed file may be left on the " +
                         "filesystem corrupted.", source, target), e, ErrorManager.WRITE_FAILURE);
@@ -165,7 +173,7 @@ class SuffixRotator {
             try {
                 archiveZip(source, target);
                 // Delete the file after it's archived to behave like a file move or rename
-                Files.delete(source);
+                deleteFile(source);
             } catch (Exception e) {
                 errorManager.error(String.format("Failed to compress %s to %s. Compressed file may be left on the " +
                         "filesystem corrupted.", source, target), e, ErrorManager.WRITE_FAILURE);
@@ -219,13 +227,13 @@ class SuffixRotator {
             final String fileWithSuffix = source.toAbsolutePath() + rotationSuffix;
             final Path lastFile = Paths.get(fileWithSuffix + "." + maxBackupIndex + compressionSuffix);
             try {
-                Files.deleteIfExists(lastFile);
+                deleteFile(lastFile);
             } catch (Exception e) {
                 errorManager.error(String.format("Failed to delete file %s", lastFile), e, ErrorManager.GENERIC_FAILURE);
             }
             for (int i = maxBackupIndex - 1; i >= 1; i--) {
                 final Path src = Paths.get(fileWithSuffix + "." + i + compressionSuffix);
-                if (Files.exists(src)) {
+                if (fileExists(src)) {
                     final Path target = Paths.get(fileWithSuffix + "." + (i + 1) + compressionSuffix);
                     move(errorManager, src, target);
                 }
@@ -242,19 +250,23 @@ class SuffixRotator {
     }
 
     private void move(final ErrorManager errorManager, final Path src, final Path target) {
-        try {
-            Files.move(src, target, StandardCopyOption.REPLACE_EXISTING);
-        } catch (Exception e) {
-            // Report the error, but allow the rotation to continue
-            errorManager.error(String.format("Failed to move file %s to %s.", src, target), e, ErrorManager.GENERIC_FAILURE);
+        if (System.getSecurityManager() == null) {
+            try {
+                Files.move(src, target, StandardCopyOption.REPLACE_EXISTING);
+            } catch (Exception e) {
+                // Report the error, but allow the rotation to continue
+                errorManager.error(String.format("Failed to move file %s to %s.", src, target), e, ErrorManager.GENERIC_FAILURE);
+            }
+        } else {
+            AccessController.doPrivileged(new MoveFileAction(errorManager, src, target), acc);
         }
     }
 
 
-    private static void archiveGzip(final Path source, final Path target) throws IOException {
+    private void archiveGzip(final Path source, final Path target) throws IOException {
         final byte[] buff = new byte[512];
-        try (final GZIPOutputStream out = new GZIPOutputStream(Files.newOutputStream(target), true)) {
-            try (final InputStream in = Files.newInputStream(source)) {
+        try (final GZIPOutputStream out = new GZIPOutputStream(newOutputStream(target), true)) {
+            try (final InputStream in = newInputStream(source)) {
                 int len;
                 while ((len = in.read(buff)) != -1) {
                     out.write(buff, 0, len);
@@ -264,12 +276,12 @@ class SuffixRotator {
         }
     }
 
-    private static void archiveZip(final Path source, final Path target) throws IOException {
+    private void archiveZip(final Path source, final Path target) throws IOException {
         final byte[] buff = new byte[512];
-        try (final ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(target), StandardCharsets.UTF_8)) {
+        try (final ZipOutputStream out = new ZipOutputStream(newOutputStream(target), StandardCharsets.UTF_8)) {
             final ZipEntry entry = new ZipEntry(source.getFileName().toString());
             out.putNextEntry(entry);
-            try (final InputStream in = Files.newInputStream(source)) {
+            try (final InputStream in = newInputStream(source)) {
                 int len;
                 while ((len = in.read(buff)) != -1) {
                     out.write(buff, 0, len);
@@ -278,4 +290,120 @@ class SuffixRotator {
             out.closeEntry();
         }
     }
+
+    @SuppressWarnings("UnusedReturnValue")
+    private boolean deleteFile(final Path path) throws IOException {
+        if (System.getSecurityManager() == null) {
+            return Files.deleteIfExists(path);
+        }
+        return AccessController.doPrivileged(new DeleteFileAction(path), acc);
+    }
+
+    private boolean fileExists(final Path file) {
+        if (System.getSecurityManager() == null) {
+            return Files.exists(file);
+        }
+        return AccessController.doPrivileged(new FileExistsAction(file), acc);
+    }
+
+    private InputStream newInputStream(final Path file) throws IOException {
+        if (System.getSecurityManager() == null) {
+            return Files.newInputStream(file);
+        }
+        return AccessController.doPrivileged(new InputStreamAction(file), acc);
+    }
+
+    private OutputStream newOutputStream(final Path file) throws IOException {
+        if (System.getSecurityManager() == null) {
+            return Files.newOutputStream(file);
+        }
+        return AccessController.doPrivileged(new OutputStreamAction(file), acc);
+    }
+
+    private static class DeleteFileAction implements PrivilegedAction<Boolean> {
+        private final Path file;
+
+        private DeleteFileAction(final Path file) {
+            this.file = file;
+        }
+
+        @Override
+        public Boolean run() {
+            try {
+                return Files.deleteIfExists(file);
+            } catch (IOException e) {
+                throw new UncheckedIOException(e);
+            }
+        }
+    }
+
+    private static class MoveFileAction implements PrivilegedAction<Path> {
+        private final ErrorManager errorManager;
+        private final Path source;
+        private final Path target;
+
+        private MoveFileAction(final ErrorManager errorManager, final Path source, final Path target) {
+            this.errorManager = errorManager;
+            this.source = source;
+            this.target = target;
+        }
+
+        @Override
+        public Path run() {
+            try {
+                return Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
+            } catch (Exception e) {
+                // Report the error, but allow the rotation to continue
+                errorManager.error(String.format("Failed to move file %s to %s.", source, target), e, ErrorManager.GENERIC_FAILURE);
+            }
+            return null;
+        }
+    }
+
+    private static class FileExistsAction implements PrivilegedAction<Boolean> {
+        private final Path file;
+
+        private FileExistsAction(final Path file) {
+            this.file = file;
+        }
+
+        @Override
+        public Boolean run() {
+            return Files.exists(file);
+        }
+    }
+
+    private static class InputStreamAction implements PrivilegedAction<InputStream> {
+        private final Path file;
+
+        private InputStreamAction(final Path file) {
+            this.file = file;
+        }
+
+        @Override
+        public InputStream run() {
+            try {
+                return Files.newInputStream(file);
+            } catch (IOException e) {
+                throw new UncheckedIOException(e);
+            }
+        }
+    }
+
+    private static class OutputStreamAction implements PrivilegedAction<OutputStream> {
+        private final Path file;
+
+        private OutputStreamAction(final Path file) {
+            this.file = file;
+        }
+
+        @Override
+        public OutputStream run() {
+            try {
+                return Files.newOutputStream(file);
+            } catch (IOException e) {
+                throw new UncheckedIOException(e);
+            }
+        }
+    }
 }


=====================================
src/main/java9/org/jboss/logmanager/formatters/StackTraceFormatter.java
=====================================
@@ -84,7 +84,9 @@ class StackTraceFormatter {
 
     private void renderStackTrace(final StackTraceElement[] parentStack, final Throwable child, final String caption, final String prefix) {
         if (seen.contains(child)) {
-            builder.append("\t[CIRCULAR REFERENCE:")
+            builder.append(prefix)
+                    .append(caption)
+                    .append("[CIRCULAR REFERENCE: ")
                     .append(child)
                     .append(']');
             newLine();


=====================================
src/test/java/org/jboss/logmanager/formatters/PatternFormatterTests.java
=====================================
@@ -245,7 +245,7 @@ public class PatternFormatterTests {
         formatter = new PatternFormatter("%e");
         cause.addSuppressed(suppressedLevel1);
         formatted = formatter.format(record);
-        Assert.assertTrue(formatted.contains("CIRCULAR REFERENCE:java.lang.IllegalStateException: suppressedLevel1"));
+        Assert.assertTrue(formatted.contains("CIRCULAR REFERENCE: java.lang.IllegalStateException: suppressedLevel1"));
     }
 
     @Test


=====================================
src/test/resources/client-keystore.jks
=====================================
Binary files a/src/test/resources/client-keystore.jks and b/src/test/resources/client-keystore.jks differ


=====================================
src/test/resources/client.cer
=====================================
Binary files a/src/test/resources/client.cer and b/src/test/resources/client.cer differ


=====================================
src/test/resources/server-keystore.jks
=====================================
Binary files a/src/test/resources/server-keystore.jks and b/src/test/resources/server-keystore.jks differ


=====================================
src/test/resources/server.cer
=====================================
Binary files a/src/test/resources/server.cer and b/src/test/resources/server.cer differ



View it on GitLab: https://salsa.debian.org/java-team/jboss-logmanager/-/compare/0da5431072602bd908dd20a98bf28e8124fc34c0...316b184ab80915520d81e8f0d63e696786da5602

-- 
View it on GitLab: https://salsa.debian.org/java-team/jboss-logmanager/-/compare/0da5431072602bd908dd20a98bf28e8124fc34c0...316b184ab80915520d81e8f0d63e696786da5602
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20210908/28beda74/attachment.htm>


More information about the pkg-java-commits mailing list