From c66f0171844217828724fe90f88f3ca24283bcd5 Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Tue, 26 Nov 2024 11:59:22 -0800 Subject: [PATCH] [WFCORE-7074] Use the ModuleIdentifier.fromString() where a slot may be used in a string module name. https://issues.redhat.com/browse/WFCORE-7074 Signed-off-by: James R. Perkins --- .../jboss/as/server/deployment/module/ModuleDependency.java | 6 +++--- .../as/server/deployment/module/ModuleSpecProcessor.java | 2 +- .../as/server/deployment/module/ModuleSpecification.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleDependency.java b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleDependency.java index 58c08587c3f..832c2e9aab9 100644 --- a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleDependency.java +++ b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleDependency.java @@ -38,7 +38,7 @@ public static Builder of(ModuleLoader moduleLoader, String moduleName) { private Builder(ModuleLoader moduleLoader, String moduleName) { this.moduleLoader = moduleLoader; //noinspection deprecation - this.identifier = ModuleIdentifier.create(moduleName); + this.identifier = ModuleIdentifier.fromString(moduleName); } /** @@ -149,7 +149,7 @@ public String toString() { * @param userSpecified {@code true} if this dependency was specified by the user, {@code false} if it was automatically added */ public ModuleDependency(final ModuleLoader moduleLoader, final String identifier, final boolean optional, final boolean export, final boolean importServices, final boolean userSpecified) { - this(moduleLoader, ModuleIdentifier.create(identifier), optional, export, importServices, userSpecified, null); + this(moduleLoader, ModuleIdentifier.fromString(identifier), optional, export, importServices, userSpecified, null); } /** @@ -167,7 +167,7 @@ public ModuleDependency(final ModuleLoader moduleLoader, final String identifier */ @Deprecated(forRemoval = true) public ModuleDependency(final ModuleLoader moduleLoader, final String identifier, final boolean optional, final boolean export, final boolean importServices, final boolean userSpecified, String reason) { - this(moduleLoader, ModuleIdentifier.create(identifier), optional, export, importServices, userSpecified, reason); + this(moduleLoader, ModuleIdentifier.fromString(identifier), optional, export, importServices, userSpecified, reason); } /** diff --git a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecProcessor.java b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecProcessor.java index 9995f6e5a9d..0fb3412c7cc 100644 --- a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecProcessor.java +++ b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecProcessor.java @@ -281,7 +281,7 @@ private void installAliases(final ModuleSpecification moduleSpecification, final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER); for (final String aliasName : moduleSpecification.getModuleAliases()) { - final ModuleIdentifier alias = ModuleIdentifier.create(aliasName); + final ModuleIdentifier alias = ModuleIdentifier.fromString(aliasName); final ServiceName moduleSpecServiceName = ServiceModuleLoader.moduleSpecServiceName(alias); final ModuleSpec spec = ModuleSpec.buildAlias(aliasName, moduleIdentifier.getName()).create(); diff --git a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java index 2ebc253b7b5..6ae0f0782db 100644 --- a/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java +++ b/server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java @@ -402,7 +402,7 @@ public void addAliases(final Collection moduleIdentifiers) { */ @Deprecated(forRemoval = true) public List getAliases() { - return aliases.stream().map(ModuleIdentifier::create).collect(Collectors.toList()); + return aliases.stream().map(ModuleIdentifier::fromString).collect(Collectors.toList()); } /** @@ -461,7 +461,7 @@ public List getPermissionFactories() { */ @Deprecated(forRemoval = true) public Set getNonexistentExcludedDependencies() { - return getFictitiousExcludedDependencies().stream().map(ModuleIdentifier::create).collect(Collectors.toSet()); + return getFictitiousExcludedDependencies().stream().map(ModuleIdentifier::fromString).collect(Collectors.toSet()); } /**