Skip to content

Commit b3dc473

Browse files
authored
Merge pull request #6407 from yersan/WFCORE-7185
[WFCORE-7185] Remove deprecated ModuleIdentifier
2 parents fec7527 + fcf0da7 commit b3dc473

File tree

16 files changed

+10
-462
lines changed

16 files changed

+10
-462
lines changed

security-manager/src/main/java/org/wildfly/extension/security/manager/deployment/PermissionsParser.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import javax.xml.stream.XMLStreamException;
1818
import javax.xml.stream.XMLStreamReader;
1919

20-
import org.jboss.modules.ModuleIdentifier;
2120
import org.jboss.modules.ModuleLoader;
2221
import org.jboss.modules.security.PermissionFactory;
2322
import org.wildfly.extension.security.manager.DeferredPermissionFactory;
@@ -31,16 +30,6 @@
3130
*/
3231
public class PermissionsParser {
3332

34-
// TODO remove this as soon as the full WF testsuite use of it is updated to use the string variant
35-
/**
36-
* @deprecated use {@link #parse(XMLStreamReader, ModuleLoader, String)}
37-
*/
38-
@Deprecated(forRemoval = true)
39-
public static List<PermissionFactory> parse(final XMLStreamReader reader, final ModuleLoader loader, final ModuleIdentifier identifier)
40-
throws XMLStreamException {
41-
return parse(reader,loader, identifier.toString());
42-
}
43-
4433
/**
4534
* Parse the contents exposed by a reader into a list of {@link PermissionFactory} instances.
4635
* @param reader reader of a {@code permissions.xml} or {@code jboss-permissions.xml} descriptor. Cannot be {@code null}.

server/src/main/java/org/jboss/as/server/deployment/Attachments.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.jboss.as.server.moduleservice.ServiceModuleLoader;
3131
import org.jboss.jandex.Index;
3232
import org.jboss.modules.Module;
33-
import org.jboss.modules.ModuleIdentifier;
3433
import org.jboss.msc.service.ServiceName;
3534
import org.jboss.msc.service.ServiceTarget;
3635
import org.jboss.vfs.VirtualFile;
@@ -236,14 +235,6 @@ public final class Attachments {
236235
//
237236
// CONFIGURE
238237
//
239-
/**
240-
* The module identifier.
241-
*
242-
* @deprecated use {@link #MODULE_NAME}
243-
*/
244-
@Deprecated(forRemoval = true)
245-
public static final AttachmentKey<ModuleIdentifier> MODULE_IDENTIFIER = AttachmentKey.create(ModuleIdentifier.class);
246-
247238
/**
248239
* The canonical name of the module.
249240
*/

server/src/main/java/org/jboss/as/server/deployment/module/ModuleAliasChecker.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import org.jboss.as.server.logging.ServerLogger;
1111
import org.jboss.modules.Module;
12-
import org.jboss.modules.ModuleIdentifier;
1312
import org.jboss.modules.ModuleLoadException;
1413
import org.jboss.modules.ModuleLoader;
1514

@@ -71,22 +70,6 @@ public static void checkModuleAliasesForDependencies(List<ModuleDependency> depe
7170
}
7271
}
7372

74-
/**
75-
* Check whether the identifier passed as an argument represents an Alias and if so, log a warning describing that the alias
76-
* can be replaced with its target module.
77-
*
78-
* @param identifiers List of identifiers we want to verify.
79-
* @param context The context to use in the log message to give more information about from where this module identifier has
80-
* @param deploymentName Deployment name where the dependencies are meant to be.
81-
* @deprecated Iterate over all the identifiers and call {@link #checkModuleAliasesForExclusion(String, MessageContext, String)}
82-
*/
83-
@Deprecated(forRemoval = true, since = "28.0.0")
84-
public static void checkModuleAliasesForExclusions(List<ModuleIdentifier> identifiers, MessageContext context, String deploymentName) {
85-
for (ModuleIdentifier identifier : identifiers) {
86-
checkModuleAlias(context, deploymentName, identifier.toString(), true);
87-
}
88-
}
89-
9073
/**
9174
* Check whether the module identifier passed as an argument represents an exclusion Alias and if so, log a warning describing that the alias
9275
* can be replaced with its target module.

server/src/main/java/org/jboss/as/server/deployment/module/ModuleDependency.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import java.util.Optional;
1313

1414
import org.jboss.as.controller.ModuleIdentifierUtil;
15-
import org.jboss.modules.ModuleIdentifier;
1615
import org.jboss.modules.ModuleLoader;
1716
import org.jboss.modules.filter.PathFilter;
1817

@@ -169,41 +168,6 @@ public ModuleDependency(final ModuleLoader moduleLoader, final String identifier
169168
this(moduleLoader, ModuleIdentifierUtil.parseCanonicalModuleIdentifier(identifier), reason, optional, export, importServices, userSpecified);
170169
}
171170

172-
/**
173-
* Construct a new instance.
174-
*
175-
* @param moduleLoader the module loader of the dependency (if {@code null}, then use the default server module loader)
176-
* @param identifier the module identifier
177-
* @param optional {@code true} if this is an optional dependency
178-
* @param export {@code true} if resources should be exported by default
179-
* @param importServices {@code true} if the dependent module should be able to load services from the dependency
180-
* @param userSpecified {@code true} if this dependency was specified by the user, {@code false} if it was automatically added
181-
*
182-
* @deprecated Use a {@link Builder} or {@link ModuleDependency(ModuleLoader, String, boolean, boolean, boolean, boolean)}
183-
*/
184-
@Deprecated(forRemoval = true)
185-
public ModuleDependency(final ModuleLoader moduleLoader, final ModuleIdentifier identifier, final boolean optional, final boolean export, final boolean importServices, final boolean userSpecified) {
186-
this(moduleLoader, identifier, optional, export, importServices, userSpecified, null);
187-
}
188-
189-
/**
190-
* Construct a new instance.
191-
*
192-
* @param moduleLoader the module loader of the dependency (if {@code null}, then use the default server module loader)
193-
* @param identifier the module identifier
194-
* @param optional {@code true} if this is an optional dependency
195-
* @param export {@code true} if resources should be exported by default
196-
* @param importServices {@code true} if the dependent module should be able to load services from the dependency
197-
* @param userSpecified {@code true} if this dependency was specified by the user, {@code false} if it was automatically added
198-
* @param reason reason for adding implicit module dependency
199-
*
200-
* @deprecated Use a {@link Builder}
201-
*/
202-
@Deprecated(forRemoval = true)
203-
public ModuleDependency(final ModuleLoader moduleLoader, final ModuleIdentifier identifier, final boolean optional, final boolean export, final boolean importServices, final boolean userSpecified, String reason) {
204-
this(moduleLoader, identifier.toString(), reason, optional, export, importServices, userSpecified);
205-
}
206-
207171
private ModuleDependency(final ModuleLoader moduleLoader, final String identifier, String reason, final boolean optional, final boolean export, final boolean importServices, final boolean userSpecified) {
208172
this.identifier = identifier;
209173
this.optional = optional;
@@ -218,12 +182,6 @@ public ModuleLoader getModuleLoader() {
218182
return moduleLoader;
219183
}
220184

221-
/** @deprecated use {@link #getDependencyModule()} */
222-
@Deprecated(forRemoval = true)
223-
public ModuleIdentifier getIdentifier() {
224-
return ModuleIdentifier.fromString(identifier);
225-
}
226-
227185
/**
228186
* Gets the name of the module upon which there is a dependency.
229187
*

server/src/main/java/org/jboss/as/server/deployment/module/ModuleIdentifierProcessor.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
1111
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
1212
import org.jboss.as.server.moduleservice.ServiceModuleLoader;
13-
import org.jboss.modules.ModuleIdentifier;
1413
import org.jboss.vfs.VirtualFile;
1514

1615
/**
@@ -31,22 +30,6 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
3130
deploymentUnit.putAttachment(Attachments.MODULE_NAME, moduleIdentifier);
3231
}
3332

34-
/**
35-
* Create a module identifier for the deployment.
36-
*
37-
* @param deploymentUnitName The name of the deployment unit
38-
* @param deploymentRoot The deployment root
39-
* @param topLevelDeployment The top level deployment
40-
* @param toplevelRoot The top level root
41-
* @param topLevel {@code true} if the deployment is a top level deployment, {@code false} otherwise
42-
* @return the module identifier that represents the deployment
43-
* @deprecated Use {@link #createModuleIdentifierAsString(String, ResourceRoot, DeploymentUnit, VirtualFile, boolean)} instead
44-
*/
45-
@Deprecated(forRemoval = true, since = "28.0.0")
46-
public static ModuleIdentifier createModuleIdentifier(final String deploymentUnitName, final ResourceRoot deploymentRoot, final DeploymentUnit topLevelDeployment, final VirtualFile toplevelRoot, final boolean topLevel) {
47-
return ModuleIdentifier.create(createModuleIdentifierAsString(deploymentUnitName, deploymentRoot, topLevelDeployment, toplevelRoot, topLevel));
48-
}
49-
5033
/**
5134
* Create a module identifier for the deployment.
5235
*

server/src/main/java/org/jboss/as/server/deployment/module/ModuleSpecification.java

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
import java.util.Set;
1717
import java.util.concurrent.CopyOnWriteArraySet;
1818
import java.util.function.Predicate;
19-
import java.util.stream.Collectors;
2019

2120
import org.jboss.as.server.deployment.SimpleAttachable;
2221
import org.jboss.modules.DependencySpec;
23-
import org.jboss.modules.ModuleIdentifier;
2422
import org.jboss.modules.ResourceLoaderSpec;
2523
import org.jboss.modules.security.PermissionFactory;
2624

@@ -204,17 +202,6 @@ public Set<ModuleDependency> getSystemDependenciesSet() {
204202
return Collections.unmodifiableSet(systemDependenciesSet);
205203
}
206204

207-
/**
208-
* Records that a module with the given identifier should be excluded from use as a system or local dependency.
209-
* @param exclusion the module to exclude. Cannot be {@code null}
210-
*
211-
* @deprecated use {@link #addModuleExclusion(String)}
212-
*/
213-
@Deprecated(forRemoval = true)
214-
public void addExclusion(final ModuleIdentifier exclusion) {
215-
addModuleExclusion(exclusion.toString());
216-
}
217-
218205
/**
219206
* Records that a module with the given name should be excluded from use as a system or local dependency.
220207
* @param exclusion the module to exclude. Cannot be {@code null}
@@ -249,20 +236,6 @@ public void addModuleExclusion(final String exclusion) {
249236
}
250237
}
251238

252-
/**
253-
* Records a collection of modules as being {@link #addModuleExclusion(String) excluded}.
254-
* @param exclusions the identifiers of the modules to exclude. Cannot be {@code null}
255-
*
256-
* @deprecated iterate over the exclusions and call {@link #addModuleExclusion(String)}
257-
*/
258-
@Deprecated(forRemoval = true)
259-
public void addExclusions(final Iterable<ModuleIdentifier> exclusions) {
260-
for (final ModuleIdentifier exclusion : exclusions) {
261-
addExclusion(exclusion);
262-
}
263-
}
264-
265-
266239
/**
267240
* Local dependencies are dependencies on other parts of the deployment, such as a class-path entry
268241
*
@@ -368,18 +341,6 @@ public void setLocalLast(final boolean localLast) {
368341
this.localLast = localLast;
369342
}
370343

371-
/**
372-
* Record that another module is an alias for this module.
373-
* @param moduleIdentifier the identifier of the alias module. Cannot be {@code null}
374-
*
375-
* @deprecated use {@link #addModuleAlias(String)}
376-
*/
377-
@Deprecated(forRemoval = true)
378-
@SuppressWarnings("unused")
379-
public void addAlias(final ModuleIdentifier moduleIdentifier) {
380-
addModuleAlias(moduleIdentifier.toString());
381-
}
382-
383344
/**
384345
* Record that another module is an alias for this module.
385346
* @param moduleIdentifier the identifier of the alias module. Cannot be {@code null}
@@ -388,30 +349,6 @@ public void addModuleAlias(final String moduleIdentifier) {
388349
aliases.add(moduleIdentifier);
389350
}
390351

391-
/**
392-
* Record that a collection of other modules are aliases for this module.
393-
* @param moduleIdentifiers the identifiers of the alias modules. Cannot be {@code null}
394-
*
395-
* @deprecated iterate over the identifiers and call {@link #addModuleAlias(String)}
396-
*/
397-
@Deprecated(forRemoval = true)
398-
public void addAliases(final Collection<ModuleIdentifier> moduleIdentifiers) {
399-
for (ModuleIdentifier id : moduleIdentifiers) {
400-
addModuleAlias(id.toString());
401-
}
402-
}
403-
404-
/**
405-
* Gets the identifiers of modules that are aliases for this module.
406-
* @return the identifiers. Will not return {@code null}
407-
*
408-
* @deprecated use {@link #getModuleAliases()}
409-
*/
410-
@Deprecated(forRemoval = true)
411-
public List<ModuleIdentifier> getAliases() {
412-
return aliases.stream().map(ModuleIdentifier::fromString).collect(Collectors.toList());
413-
}
414-
415352
/**
416353
* Gets the names of modules that are aliases for this module.
417354
* @return the names. Will not return {@code null}
@@ -458,19 +395,6 @@ public List<PermissionFactory> getPermissionFactories() {
458395
return permissionFactories;
459396
}
460397

461-
/**
462-
* Gets the identifiers of dependencies that {@link #addModuleExclusion(String) were meant to be excluded} but which were
463-
* never recorded as a dependency.
464-
*
465-
* @return the names. Will not return {@code null}
466-
*
467-
* @deprecated use {@link #getFictitiousExcludedDependencies()}
468-
*/
469-
@Deprecated(forRemoval = true)
470-
public Set<ModuleIdentifier> getNonexistentExcludedDependencies() {
471-
return getFictitiousExcludedDependencies().stream().map(ModuleIdentifier::fromString).collect(Collectors.toSet());
472-
}
473-
474398
/**
475399
* Gets the names of dependencies that {@link #addModuleExclusion(String) were meant to be excluded} but which were
476400
* never recorded as a dependency.

server/src/main/java/org/jboss/as/server/deployment/module/descriptor/ModuleStructureSpec.java

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.jboss.as.server.deployment.module.ModuleDependency;
1616
import org.jboss.as.server.deployment.module.ResourceRoot;
1717
import org.jboss.modules.DependencySpec;
18-
import org.jboss.modules.ModuleIdentifier;
1918

2019
/**
2120
* @author Stuart Douglas
@@ -27,7 +26,7 @@ class ModuleStructureSpec {
2726
private final List<DependencySpec> systemDependencies = new ArrayList<>();
2827
private final List<ResourceRoot> resourceRoots = new ArrayList<>();
2928
private final List<FilterSpecification> exportFilters = new ArrayList<>();
30-
private final List<ModuleIdentifier> exclusions = new ArrayList<>();
29+
private final List<String> exclusions = new ArrayList<>();
3130
private final List<String> classTransformers = new ArrayList<>();
3231
private final List<String> aliases = new ArrayList<>();
3332
private final List<String> annotationModules = new ArrayList<>();
@@ -76,17 +75,6 @@ public List<DependencySpec> getSystemDependencies() {
7675
return Collections.unmodifiableList(systemDependencies);
7776
}
7877

79-
/**
80-
* Adds an alias to the module structure spec.
81-
*
82-
* @param dependency the alias identifier
83-
* @deprecated use {@link #addAlias(String)} instead
84-
*/
85-
@Deprecated(forRemoval = true, since = "28.0.0")
86-
public void addAlias(final ModuleIdentifier dependency) {
87-
aliases.add(dependency.toString());
88-
}
89-
9078
/**
9179
* Adds an alias to the module structure spec.
9280
*
@@ -96,16 +84,6 @@ public void addAlias(final String dependency) {
9684
aliases.add(dependency);
9785
}
9886

99-
/**
100-
* Returns the aliases of this module spec.
101-
* @return an unmodifiable list with the aliases of this module spec
102-
* @deprecated use {@link #getAliasesList()} instead
103-
*/
104-
@Deprecated(forRemoval = true, since = "28.0.0")
105-
public List<ModuleIdentifier> getAliases() {
106-
return aliases.stream().map(ModuleIdentifier::fromString).collect(Collectors.toUnmodifiableList());
107-
}
108-
10987
/**
11088
* Returns the aliases of this module spec.
11189
* @return an unmodifiable list with the aliases of this module spec
@@ -122,26 +100,16 @@ public List<String> getAnnotationModules() {
122100
return Collections.unmodifiableList(annotationModules);
123101
}
124102

125-
/**
126-
* Returns list of exclusions.
127-
* @return the exclusions
128-
* @deprecated use {@link #getExclusionsList()} instead
129-
*/
130-
@Deprecated(forRemoval = true, since = "28.0.0")
131-
public List<ModuleIdentifier> getExclusions() {
132-
return exclusions;
133-
}
134-
135103
/**
136104
* Returns the exclusions of this module spec. Use {@link #addExclusion(String)} to add new exclusions.
137105
* @return an unmodifiable list with the exclusions of this module spec.
138106
*/
139107
public List<String> getExclusionsList() {
140-
return exclusions.stream().map(ModuleIdentifier::toString).collect(Collectors.toUnmodifiableList());
108+
return exclusions.stream().collect(Collectors.toUnmodifiableList());
141109
}
142110

143111
public void addExclusion(String identifier) {
144-
this.exclusions.add(ModuleIdentifier.fromString(identifier));
112+
this.exclusions.add(identifier);
145113
}
146114

147115
public List<FilterSpecification> getExportFilters() {

0 commit comments

Comments
 (0)