Skip to content

Commit

Permalink
Improved: Remove unused ‘ComponentContainer#retrieveComponentConfig’ …
Browse files Browse the repository at this point in the history
…argument

No functional change.
  • Loading branch information
mthl committed Jan 3, 2020
1 parent 20e0bbe commit 583f926
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void loadComponent(Path dir, ComponentDef component) throws IOException
loadComponentDirectory(location);
break;
case SINGLE_COMPONENT:
retrieveComponentConfig(null, location);
retrieveComponentConfig(location);
break;
}
}
Expand Down Expand Up @@ -167,26 +167,25 @@ private static void loadComponentsInDirectory(Path directoryPath) throws IOExcep
.map(cmpnt -> directoryPath.resolve(cmpnt).toAbsolutePath().normalize())
.filter(Files::isDirectory)
.filter(dir -> Files.exists(dir.resolve(ComponentConfig.OFBIZ_COMPONENT_XML_FILENAME)))
.forEach(componentDir -> retrieveComponentConfig(null, componentDir));
.forEach(componentDir -> retrieveComponentConfig(componentDir));
}
}

/**
* Fetch the <code>ComponentConfig</code> for a certain component
*
* @param name component name
* @param location directory location of the component which can be {@code null}
* @param location directory location of the component which cannot be {@code null}
* @return The component configuration
*/
private static ComponentConfig retrieveComponentConfig(String name, Path location) {
private static ComponentConfig retrieveComponentConfig(Path location) {
ComponentConfig config = null;
try {
config = ComponentConfig.getComponentConfig(name, (location == null) ? null : location.toString());
config = ComponentConfig.getComponentConfig(null, location.toString());
} catch (ComponentException e) {
Debug.logError("Cannot load component : " + name + " @ " + location + " : " + e.getMessage(), module);
Debug.logError("Cannot load component: " + location + " : " + e.getMessage(), module);
}
if (config == null) {
Debug.logError("Cannot load component : " + name + " @ " + location, module);
Debug.logError("Cannot load component: " + location, module);
}
return config;
}
Expand Down

0 comments on commit 583f926

Please sign in to comment.