Skip to content

Commit

Permalink
Reduce our exposure to wildfly-common
Browse files Browse the repository at this point in the history
Ideally we would only rely on SmallRye Common when we can but:

- We have JBoss Threads depending on wildfly-common anyway
- We use Locks and Flags which don't have an equivalent in SmallRye
  Common
  • Loading branch information
gsmet committed Jan 21, 2025
1 parent 5e20a60 commit 9900734
Show file tree
Hide file tree
Showing 68 changed files with 276 additions and 212 deletions.
4 changes: 4 additions & 0 deletions core/builder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-constraint</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.ServiceLoader;
import java.util.Set;

import org.wildfly.common.Assert;
import io.smallrye.common.constraint.Assert;

/**
* A build chain.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.BuildItem;
import io.smallrye.common.constraint.Assert;

/**
* A build chain builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.wildfly.common.Assert;

import io.quarkus.builder.diag.Diagnostic;
import io.quarkus.builder.item.BuildItem;
import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.builder.item.SimpleBuildItem;
import io.quarkus.builder.location.Location;
import io.smallrye.common.constraint.Assert;

/**
* The context passed to a deployer's operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import java.util.Collections;
import java.util.List;

import org.wildfly.common.Assert;

import io.quarkus.builder.diag.Diagnostic;
import io.smallrye.common.constraint.Assert;

/**
* @author <a href="mailto:[email protected]">David M. Lloyd</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import java.util.List;
import java.util.Map;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.BuildItem;
import io.smallrye.common.constraint.Assert;

/**
* A builder for a deployer execution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import java.util.Set;
import java.util.function.BooleanSupplier;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.BuildItem;
import io.smallrye.common.constraint.Assert;

/**
* A builder for build step instances within a chain. A build step can consume and produce items. It may also register
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.quarkus.builder;

import org.wildfly.common.Assert;
import org.wildfly.common.flags.Flags;

import io.smallrye.common.constraint.Assert;

/**
* Flags which can be set on consume declarations.
*/
Expand Down
3 changes: 1 addition & 2 deletions core/builder/src/main/java/io/quarkus/builder/ItemId.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import java.util.Objects;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.BuildItem;
import io.quarkus.builder.item.MultiBuildItem;
import io.smallrye.common.constraint.Assert;

final class ItemId {
private final Class<? extends BuildItem> itemType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.quarkus.builder;

import org.wildfly.common.Assert;
import org.wildfly.common.flags.Flags;

import io.smallrye.common.constraint.Assert;

/**
* Flags which can be set on consume declarations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import java.io.StringWriter;
import java.io.Writer;

import org.wildfly.common.Assert;

import io.quarkus.builder.location.Location;
import io.smallrye.common.constraint.Assert;

public final class Diagnostic {
private final Level level;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.Objects;

import org.eclipse.microprofile.config.Config;
import org.wildfly.common.annotation.NotNull;

import io.quarkus.bootstrap.model.ApplicationModel;
import io.quarkus.bootstrap.prebuild.CodeGenException;
Expand All @@ -18,7 +17,6 @@ public interface CodeGenProvider {
/**
* @return unique name of the code gen provider, will correspond to the directory in <code>generated-sources</code>
*/
@NotNull
String providerId();

/**
Expand All @@ -37,7 +35,6 @@ default String inputExtension() {
*
* @return file extensions
*/
@NotNull
default String[] inputExtensions() {
if (inputExtension() != null) {
return new String[] { inputExtension() };
Expand All @@ -53,7 +50,6 @@ default String[] inputExtensions() {
*
* @return the input directory
*/
@NotNull
String inputDirectory();

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.quarkus.deployment.builditem;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.smallrye.common.constraint.Assert;

/**
* The configuration type build item. Every configuration type should be registered using this build item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import java.util.logging.Level;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.smallrye.common.constraint.Assert;

/**
* Establish the default log level of a log category.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Optional;
import java.util.logging.Formatter;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* The log console format build item. Producing this item will cause the logging subsystem to disregard its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Optional;
import java.util.logging.Formatter;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* The log file format build item. Producing this item will cause the logging subsystem to disregard its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Optional;
import java.util.logging.Handler;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* A build item for adding additional logging handlers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Optional;
import java.util.logging.Formatter;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* The socket format build item. Producing this item will cause the logging subsystem to disregard its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Optional;
import java.util.logging.Formatter;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* The syslog format build item. Producing this item will cause the logging subsystem to disregard its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Map;
import java.util.logging.Handler;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* A build item for adding additional named logging handlers.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package io.quarkus.deployment.builditem;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.annotations.ConfigItem;
import io.smallrye.common.constraint.Assert;

/**
* A build item which specifies a configuration default value for run time, which is used to establish a default other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import java.util.Optional;
import java.util.logging.Handler;

import org.wildfly.common.Assert;

import io.quarkus.builder.item.SimpleBuildItem;
import io.quarkus.runtime.RuntimeValue;
import io.smallrye.common.constraint.Assert;

/**
* A build item for adding the dev stream log via mutiny.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.eclipse.microprofile.config.spi.ConfigSource;
import org.eclipse.microprofile.config.spi.Converter;
import org.jboss.logging.Logger;
import org.wildfly.common.Assert;

import io.quarkus.deployment.configuration.definition.ClassDefinition;
import io.quarkus.deployment.configuration.definition.ClassDefinition.ClassMember;
Expand Down Expand Up @@ -72,6 +71,7 @@
import io.quarkus.runtime.configuration.HyphenateEnumConverter;
import io.quarkus.runtime.configuration.NameIterator;
import io.quarkus.runtime.configuration.PropertiesUtil;
import io.smallrye.common.constraint.Assert;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.ConfigMappings;
import io.smallrye.config.ConfigMappings.ConfigClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.eclipse.microprofile.config.spi.ConfigBuilder;
import org.eclipse.microprofile.config.spi.Converter;
import org.objectweb.asm.Opcodes;
import org.wildfly.common.Assert;

import io.quarkus.deployment.AccessorFinder;
import io.quarkus.deployment.configuration.definition.ClassDefinition;
Expand Down Expand Up @@ -64,6 +63,7 @@
import io.quarkus.runtime.configuration.NameIterator;
import io.quarkus.runtime.configuration.PropertiesUtil;
import io.quarkus.runtime.configuration.QuarkusConfigFactory;
import io.smallrye.common.constraint.Assert;
import io.smallrye.config.ConfigMappings;
import io.smallrye.config.ConfigMappings.ConfigClass;
import io.smallrye.config.Converters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import java.util.LinkedHashMap;
import java.util.Map;

import org.wildfly.common.Assert;

import io.quarkus.gizmo.FieldDescriptor;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.util.StringUtil;
import io.smallrye.common.constraint.Assert;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@

import java.util.List;

import org.wildfly.common.Assert;

import io.quarkus.gizmo.FieldDescriptor;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.smallrye.common.constraint.Assert;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import java.util.TreeMap;
import java.util.function.BiFunction;

import org.wildfly.common.Assert;

import io.quarkus.runtime.configuration.NameIterator;
import io.smallrye.common.constraint.Assert;

/**
* A pattern-matching mapping of configuration key pattern to value.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package io.quarkus.deployment.configuration.matching;

import org.wildfly.common.Assert;

import io.quarkus.deployment.configuration.definition.ClassDefinition;
import io.quarkus.deployment.configuration.definition.RootDefinition;
import io.smallrye.common.constraint.Assert;

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.quarkus.deployment.configuration.matching;

import org.wildfly.common.Assert;

import io.quarkus.deployment.configuration.definition.ClassDefinition;
import io.smallrye.common.constraint.Assert;

/**
* A map container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.MethodInfo;
import org.jboss.jandex.Type;
import org.wildfly.common.Assert;

import io.quarkus.deployment.proxy.ProxyConfiguration;
import io.quarkus.deployment.proxy.ProxyFactory;
Expand All @@ -76,6 +75,7 @@
import io.quarkus.runtime.types.GenericArrayTypeImpl;
import io.quarkus.runtime.types.ParameterizedTypeImpl;
import io.quarkus.runtime.types.WildcardTypeImpl;
import io.smallrye.common.constraint.Assert;

/**
* A class that can be used to record invocations to bytecode so they can be replayed later. This is done through the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
import org.jboss.logging.Logger;
import org.wildfly.common.Assert;
import org.wildfly.common.lock.Locks;

import io.quarkus.bootstrap.runner.Timing;
import io.quarkus.dev.appstate.ApplicationStateNotification;
import io.quarkus.runtime.shutdown.ShutdownRecorder;
import io.smallrye.common.constraint.Assert;

/**
* The application base class, which is extended and implemented by a generated class which implements the application
Expand Down
Loading

0 comments on commit 9900734

Please sign in to comment.