Skip to content

Commit

Permalink
Merge pull request #8877 from bstansberry/WFLY-6550
Browse files Browse the repository at this point in the history
[WFLY-6550] Use fromString instead of create when the text may includ…
  • Loading branch information
stuartwdouglas committed Jun 2, 2016
2 parents eb97b1e + 324d11b commit 8a513e1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected void recoverServices(OperationContext context, ModelNode operation, Mo
final ModuleIdentifier moduleId;
final Module module;
try {
moduleId = ModuleIdentifier.create(moduleName);
moduleId = ModuleIdentifier.fromString(moduleName);
module = Module.getCallerModuleLoader().loadModule(moduleId);
} catch (ModuleLoadException e) {
context.getFailureDescription().set(ConnectorLogger.ROOT_LOGGER.failedToLoadModuleDriver(moduleName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ private List<Class> unwrapClasses(List<ModelNode> classesModel) throws Operation
String className = classModel.get(NAME).asString();
String moduleName = classModel.get(MODULE).asString();
try {
ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName);
ModuleIdentifier moduleID = ModuleIdentifier.fromString(moduleName);
Module module = Module.getCallerModuleLoader().loadModule(moduleID);
Class<?> clazz = module.getClassLoader().loadClass(className);
classes.add(clazz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private JMSBridge createJMSBridge(OperationContext context, ModelNode model) thr
// if a module is specified, use it to instantiate the JMSBridge to ensure its ExecutorService
// will use the correct class loader to execute its threads
if (moduleName != null) {
ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName);
ModuleIdentifier moduleID = ModuleIdentifier.fromString(moduleName);
Module module = Module.getCallerModuleLoader().loadModule(moduleID);
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void run() {
public void startBridge() throws Exception {
final Module module;
if (moduleName != null) {
ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName);
ModuleIdentifier moduleID = ModuleIdentifier.fromString(moduleName);
module = Module.getContextModuleLoader().loadModule(moduleID);
} else {
module = Module.forClass(JMSBridgeService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class JPAStoreSubsystemConfiguration extends JPAIdentityStoreConfiguratio
ModuleLoader moduleLoader = Module.getBootModuleLoader();

try {
this.entityModule = moduleLoader.loadModule(ModuleIdentifier.create(entityModuleName));
this.entityModule = moduleLoader.loadModule(ModuleIdentifier.fromString(entityModuleName));
} catch (ModuleLoadException e) {
throw PicketLinkLogger.ROOT_LOGGER.idmJpaEntityModuleNotFound(entityModuleName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ private Module getModule(ModelNode moduleNode) {
if (moduleNode.isDefined()) {
ModuleLoader moduleLoader = Module.getBootModuleLoader();
try {
module = moduleLoader.loadModule(ModuleIdentifier.create(moduleNode.asString()));
module = moduleLoader.loadModule(ModuleIdentifier.fromString(moduleNode.asString()));
} catch (ModuleLoadException e) {
throw ROOT_LOGGER.moduleCouldNotLoad(moduleNode.asString(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected List<PermissionFactory> retrievePermissionSet(final OperationContext c
ClassLoader cl = WildFlySecurityManager.getClassLoaderPrivileged(this.getClass());
if(moduleName != null) {
try {
cl = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create(moduleName)).getClassLoader();
cl = Module.getBootModuleLoader().loadModule(ModuleIdentifier.fromString(moduleName)).getClassLoader();
} catch (ModuleLoadException e) {
throw new OperationFailedException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void handleJbossWebXml(DeploymentUnit deploymentUnit, Module module) thr
try {
ClassLoader cl = module.getClassLoader();
if (hander.getModule() != null) {
Module handlerModule = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER).loadModule(ModuleIdentifier.create(hander.getModule()));
Module handlerModule = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER).loadModule(ModuleIdentifier.fromString(hander.getModule()));
cl = handlerModule.getClassLoader();

}
Expand Down

0 comments on commit 8a513e1

Please sign in to comment.