From dbef1f601438f576055cb380976bf30d53e1254b Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Fri, 18 Mar 2022 10:53:26 -0500 Subject: [PATCH] Transition to smallrye-common, remove wildfly-common --- core/pom.xml | 22 +++++++++++++++++-- .../org/jboss/logmanager/ExtLogRecord.java | 9 ++++---- .../java/org/jboss/logmanager/LogContext.java | 6 ++--- .../java/org/jboss/logmanager/LogManager.java | 2 +- .../java/org/jboss/logmanager/Logger.java | 2 +- .../java/org/jboss/logmanager/LoggerNode.java | 8 +++---- .../errormanager/HandlerErrorManager.java | 2 +- .../handlers/DelayedHandlerTests.java | 2 +- ext/pom.xml | 8 +++++-- .../logmanager/ext/PropertyConfigurator.java | 4 ++-- .../logmanager/ext/handlers/QueueHandler.java | 2 +- .../ext/handlers/SyslogHandler.java | 3 +-- pom.xml | 10 +++++---- 13 files changed, 51 insertions(+), 29 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 6b4d95ae..7902d2e9 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -50,8 +50,20 @@ provided - org.wildfly.common - wildfly-common + io.smallrye.common + smallrye-common-constraint + + + io.smallrye.common + smallrye-common-net + + + io.smallrye.common + smallrye-common-os + + + io.smallrye.common + smallrye-common-ref @@ -62,6 +74,12 @@ jakarta.json-api test + + + io.smallrye.common + smallrye-common-cpu + test + org.glassfish diff --git a/core/src/main/java/org/jboss/logmanager/ExtLogRecord.java b/core/src/main/java/org/jboss/logmanager/ExtLogRecord.java index b086535d..77106ab6 100644 --- a/core/src/main/java/org/jboss/logmanager/ExtLogRecord.java +++ b/core/src/main/java/org/jboss/logmanager/ExtLogRecord.java @@ -19,6 +19,8 @@ package org.jboss.logmanager; +import io.smallrye.common.net.HostName; + import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -29,9 +31,6 @@ import java.util.logging.LogRecord; -import org.wildfly.common.net.HostName; -import org.wildfly.common.os.Process; - /** * An extended log record, which includes additional information including MDC/NDC and correct * caller location (even in the presence of a logging facade). @@ -85,8 +84,8 @@ public ExtLogRecord(final java.util.logging.Level level, final String msg, final ndc = NDC.get(); threadName = Thread.currentThread().getName(); hostName = HostName.getQualifiedHostName(); - processName = Process.getProcessName(); - processId = Process.getProcessId(); + processName = io.smallrye.common.os.Process.getProcessName(); + processId = io.smallrye.common.os.Process.getProcessId(); } /** diff --git a/core/src/main/java/org/jboss/logmanager/LogContext.java b/core/src/main/java/org/jboss/logmanager/LogContext.java index 98b1659e..b8c2b215 100644 --- a/core/src/main/java/org/jboss/logmanager/LogContext.java +++ b/core/src/main/java/org/jboss/logmanager/LogContext.java @@ -19,9 +19,9 @@ package org.jboss.logmanager; -import org.wildfly.common.Assert; -import org.wildfly.common.ref.Reference; -import org.wildfly.common.ref.References; +import io.smallrye.common.constraint.Assert; +import io.smallrye.common.ref.Reference; +import io.smallrye.common.ref.References; import java.security.AccessController; import java.security.Permission; diff --git a/core/src/main/java/org/jboss/logmanager/LogManager.java b/core/src/main/java/org/jboss/logmanager/LogManager.java index 6399c159..6e326a46 100644 --- a/core/src/main/java/org/jboss/logmanager/LogManager.java +++ b/core/src/main/java/org/jboss/logmanager/LogManager.java @@ -19,7 +19,7 @@ package org.jboss.logmanager; -import org.wildfly.common.Assert; +import io.smallrye.common.constraint.Assert; import java.beans.PropertyChangeListener; import java.io.IOException; diff --git a/core/src/main/java/org/jboss/logmanager/Logger.java b/core/src/main/java/org/jboss/logmanager/Logger.java index c783c4f6..aaaabed1 100644 --- a/core/src/main/java/org/jboss/logmanager/Logger.java +++ b/core/src/main/java/org/jboss/logmanager/Logger.java @@ -19,7 +19,7 @@ package org.jboss.logmanager; -import org.wildfly.common.Assert; +import io.smallrye.common.constraint.Assert; import java.io.ObjectStreamException; import java.io.Serializable; diff --git a/core/src/main/java/org/jboss/logmanager/LoggerNode.java b/core/src/main/java/org/jboss/logmanager/LoggerNode.java index c3b7c3c4..dd3ce1c3 100644 --- a/core/src/main/java/org/jboss/logmanager/LoggerNode.java +++ b/core/src/main/java/org/jboss/logmanager/LoggerNode.java @@ -19,10 +19,10 @@ package org.jboss.logmanager; -import org.wildfly.common.Assert; -import org.wildfly.common.ref.PhantomReference; -import org.wildfly.common.ref.Reaper; -import org.wildfly.common.ref.Reference; +import io.smallrye.common.constraint.Assert; +import io.smallrye.common.ref.PhantomReference; +import io.smallrye.common.ref.Reaper; +import io.smallrye.common.ref.Reference; import java.lang.reflect.UndeclaredThrowableException; import java.security.AccessController; diff --git a/core/src/main/java/org/jboss/logmanager/errormanager/HandlerErrorManager.java b/core/src/main/java/org/jboss/logmanager/errormanager/HandlerErrorManager.java index f12b0543..e13406a9 100644 --- a/core/src/main/java/org/jboss/logmanager/errormanager/HandlerErrorManager.java +++ b/core/src/main/java/org/jboss/logmanager/errormanager/HandlerErrorManager.java @@ -2,8 +2,8 @@ import java.util.logging.Handler; +import io.smallrye.common.constraint.Assert; import org.jboss.logmanager.ExtErrorManager; -import org.wildfly.common.Assert; /** * An error manager which publishes errors to a handler. diff --git a/core/src/test/java/org/jboss/logmanager/handlers/DelayedHandlerTests.java b/core/src/test/java/org/jboss/logmanager/handlers/DelayedHandlerTests.java index 0d817eaf..a600e080 100644 --- a/core/src/test/java/org/jboss/logmanager/handlers/DelayedHandlerTests.java +++ b/core/src/test/java/org/jboss/logmanager/handlers/DelayedHandlerTests.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import java.util.stream.Collectors; +import io.smallrye.common.cpu.ProcessorInfo; import org.jboss.logmanager.AssertingErrorManager; import org.jboss.logmanager.ExtHandler; import org.jboss.logmanager.ExtLogRecord; @@ -37,7 +38,6 @@ import org.junit.After; import org.junit.Assert; import org.junit.Test; -import org.wildfly.common.cpu.ProcessorInfo; /** * @author James R. Perkins diff --git a/ext/pom.xml b/ext/pom.xml index 1b0a88c0..087ed0a7 100644 --- a/ext/pom.xml +++ b/ext/pom.xml @@ -65,8 +65,12 @@ provided - org.wildfly.common - wildfly-common + io.smallrye.common + smallrye-common-constraint + + + io.smallrye.common + smallrye-common-expression diff --git a/ext/src/main/java/org/jboss/logmanager/ext/PropertyConfigurator.java b/ext/src/main/java/org/jboss/logmanager/ext/PropertyConfigurator.java index 12fd334a..7c07c348 100644 --- a/ext/src/main/java/org/jboss/logmanager/ext/PropertyConfigurator.java +++ b/ext/src/main/java/org/jboss/logmanager/ext/PropertyConfigurator.java @@ -34,13 +34,13 @@ import java.util.logging.Level; import java.util.logging.Logger; +import io.smallrye.common.constraint.Assert; +import io.smallrye.common.expression.Expression; import org.jboss.logmanager.LogContext; import org.jboss.logmanager.StandardOutputStreams; import org.jboss.logmanager.ext.filters.FilterExpressions; import org.jboss.logmanager.filters.AcceptAllFilter; import org.jboss.logmanager.filters.DenyAllFilter; -import org.wildfly.common.Assert; -import org.wildfly.common.expression.Expression; /** * A utility to parse a {@code logging.properties} file and configure a {@link LogContext}. diff --git a/ext/src/main/java/org/jboss/logmanager/ext/handlers/QueueHandler.java b/ext/src/main/java/org/jboss/logmanager/ext/handlers/QueueHandler.java index 2a3cd9e9..73ec3681 100644 --- a/ext/src/main/java/org/jboss/logmanager/ext/handlers/QueueHandler.java +++ b/ext/src/main/java/org/jboss/logmanager/ext/handlers/QueueHandler.java @@ -26,9 +26,9 @@ import java.util.logging.Handler; import java.util.logging.LogRecord; +import io.smallrye.common.constraint.Assert; import org.jboss.logmanager.ExtHandler; import org.jboss.logmanager.ExtLogRecord; -import org.wildfly.common.Assert; /** * A queue handler which retains the last few messages logged. The handler can be used as-is to remember recent diff --git a/ext/src/main/java/org/jboss/logmanager/ext/handlers/SyslogHandler.java b/ext/src/main/java/org/jboss/logmanager/ext/handlers/SyslogHandler.java index c596313a..5748cc09 100644 --- a/ext/src/main/java/org/jboss/logmanager/ext/handlers/SyslogHandler.java +++ b/ext/src/main/java/org/jboss/logmanager/ext/handlers/SyslogHandler.java @@ -43,7 +43,6 @@ import org.jboss.logmanager.ExtHandler; import org.jboss.logmanager.ExtLogRecord; -import org.wildfly.common.os.Process; import static java.time.temporal.ChronoField.*; @@ -471,7 +470,7 @@ public SyslogHandler(final InetAddress serverAddress, final int port, final Faci this.serverAddress = serverAddress; this.port = port; this.facility = facility; - final long pid = Process.getProcessId(); + final long pid = io.smallrye.common.os.Process.getProcessId(); this.pid = (pid != -1 ? Long.toString(pid) : null); this.appName = "java"; this.hostname = checkPrintableAscii("host name", hostname); diff --git a/pom.xml b/pom.xml index 03ba8ee6..b2f9bc0a 100644 --- a/pom.xml +++ b/pom.xml @@ -52,13 +52,13 @@ + 1.11.0 1.1.6 4.0.17 1.1.6 3.4.0.Final 1.10.1.Final 1.8 - 1.5.1.Final 4.13.2 @@ -98,9 +98,11 @@ provided - org.wildfly.common - wildfly-common - ${version.org.wildfly.common.wildfly-common} + io.smallrye.common + smallrye-common-bom + ${version.io.smallrye.common.smallrye-common} + pom + import