From 0069ba30b0942ce1a2bf51c414ca0b700be8ccbb Mon Sep 17 00:00:00 2001 From: Brian Stansberry Date: Sun, 22 Dec 2024 14:59:07 -0500 Subject: [PATCH] [WFCORE-7114] Deprecate use of ModuleIdentifier in ModuleDefinition --- .../as/server/moduleservice/ModuleDefinition.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/src/main/java/org/jboss/as/server/moduleservice/ModuleDefinition.java b/server/src/main/java/org/jboss/as/server/moduleservice/ModuleDefinition.java index 5681c94e389..98a53e04beb 100644 --- a/server/src/main/java/org/jboss/as/server/moduleservice/ModuleDefinition.java +++ b/server/src/main/java/org/jboss/as/server/moduleservice/ModuleDefinition.java @@ -25,16 +25,31 @@ public class ModuleDefinition { private final Set dependencies; private final ModuleSpec moduleSpec; + + /** @deprecated use {@link #ModuleDefinition(String, Set, ModuleSpec)} */ + @Deprecated(forRemoval = true) public ModuleDefinition(final ModuleIdentifier moduleIdentifier, final Set dependencies, final ModuleSpec moduleSpec) { this.moduleIdentifier = moduleIdentifier; this.dependencies = dependencies; this.moduleSpec = moduleSpec; } + public ModuleDefinition(final String moduleIdentifier, final Set dependencies, final ModuleSpec moduleSpec) { + this.moduleIdentifier = ModuleIdentifier.fromString(moduleIdentifier); // inefficient but this is unused. When we switch the use to this we'll store the string. + this.dependencies = dependencies; + this.moduleSpec = moduleSpec; + } + + /** @deprecated use {@link #getModuleName()} */ + @Deprecated(forRemoval = true) public ModuleIdentifier getModuleIdentifier() { return moduleIdentifier; } + public String getModuleName() { + return moduleIdentifier.toString(); // inefficient but this is unused. When we switch the use to this we'll store the string. + } + public ModuleSpec getModuleSpec() { return moduleSpec; }