Skip to content
Permalink
Browse files

Improved: Adapt ‘ContainerConfig#getConfigurations’

(OFBIZ-11256)

Remove unused declared ‘ContainerException’ in signature and fix the
javadoc to match the actual specification.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868630 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Oct 19, 2019
1 parent 29f814c commit 434a0160a2de399e49a096349a4d628905f475ba
@@ -308,7 +308,7 @@ checkstyle {
// the sum of errors that were present before introducing the
// ‘checkstyle’ tool present in the framework and in the official
// plugins.
maxErrors = 37930
maxErrors = 37929
// Currently there are a lot of errors so we need to temporarily
// hide them to avoid polluting the terminal output.
showViolations = false
@@ -37,7 +37,6 @@
import java.util.stream.Stream;

import org.apache.ofbiz.base.container.ContainerConfig;
import org.apache.ofbiz.base.container.ContainerException;
import org.apache.ofbiz.base.location.FlexibleLocation;
import org.apache.ofbiz.base.util.Assert;
import org.apache.ofbiz.base.util.Debug;
@@ -429,11 +428,7 @@ private ComponentConfig(String globalName, String rootLocation) throws Component
.collect(Collectors.collectingAndThen(
Collectors.toMap(rli -> rli.name, rli -> rli),
Collections::unmodifiableMap));
try {
configurations = ContainerConfig.getConfigurations(componentElement);
} catch (ContainerException ce) {
throw new ComponentException("Error reading container configurations for component: " + this.globalName, ce);
}
configurations = ContainerConfig.getConfigurations(componentElement);
if (Debug.verboseOn()) {
Debug.logVerbose("Read component config : [" + rootLocation + "]", module);
}
@@ -72,13 +72,12 @@ public static Configuration getConfiguration(String containerName) throws Contai
}

/**
* Finds the container configuration elements in a XML file.
* Finds the {@code <container>} configuration elements in a XML element.
*
* @param root the URL of the XML file which cannot be {@code null}
* @param root the XML element which cannot be {@code null}
* @return a list of container configuration
* @throws ContainerException when failing to read the XML document.
*/
public static List<Configuration> getConfigurations(Element root) throws ContainerException {
public static List<Configuration> getConfigurations(Element root) {
List<Configuration> res = UtilXml.childElementList(root, "container").stream()
.map(Configuration::new)
.collect(collectingAndThen(toList(), Collections::unmodifiableList));

0 comments on commit 434a016

Please sign in to comment.
You can’t perform that action at this time.