Skip to content
Permalink
Browse files

Improved: Refactor ‘ContainerConfig’ class

(OFBIZ-11256)

This removes some code duplication, make things immutable and add some javadoc.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1868601 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Oct 18, 2019
1 parent 5363a77 commit 7e7ccba7b3046308a73222c6a9d882ea5c671373
@@ -307,7 +307,7 @@ checkstyle {
// the sum of errors that were present before introducing the
// ‘checkstyle’ tool present in the framework and in the official
// plugins.
maxErrors = 37967
maxErrors = 37947
// 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.ContainerConfig.Configuration;
import org.apache.ofbiz.base.container.ContainerException;
import org.apache.ofbiz.base.location.FlexibleLocation;
import org.apache.ofbiz.base.util.Assert;
@@ -431,8 +430,7 @@ private ComponentConfig(String globalName, String rootLocation) throws Component
Collectors.toMap(rli -> rli.name, rli -> rli),
Collections::unmodifiableMap));
try {
Collection<Configuration> configurations = ContainerConfig.getConfigurations(xmlUrl);
this.configurations = Collections.unmodifiableList(new ArrayList<>(configurations));
configurations = ContainerConfig.getConfigurations(componentElement);
} catch (ContainerException ce) {
throw new ComponentException("Error reading container configurations for component: " + this.globalName, ce);
}

0 comments on commit 7e7ccba

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