Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.container.
Thanks Dennis Balkir for reporting and providing the patch.
@@ -46,7 +46,7 @@ public class ContainerLoader implements StartupLoader {
public static final String module = ContainerLoader.class.getName();
- private final List<Container> loadedContainers = new LinkedList<Container>();
+ private final List<Container> loadedContainers = new LinkedList<>();
/**
* @see org.apache.ofbiz.base.start.StartupLoader#load(Config, List)
@@ -82,7 +82,7 @@ public class ContainerLoader implements StartupLoader {
}
private List<ContainerConfig.Configuration> filterContainersHavingMatchingLoaders(List<String> loaders,
- Collection<ContainerConfig.Configuration> containerConfigs) throws StartupException {
+ Collection<ContainerConfig.Configuration> containerConfigs) {
return containerConfigs.stream()
.filter(containerCfg ->
UtilValidate.isEmpty(containerCfg.loaders) &&
@@ -94,7 +94,7 @@ public class ContainerLoader implements StartupLoader {
private List<Container> loadContainersFromConfigurations(List<ContainerConfig.Configuration> containerConfigs,
Config config, List<StartupCommand> ofbizCommands) throws StartupException {
- List<Container> loadContainers = new ArrayList<Container>();
+ List<Container> loadContainers = new ArrayList<>();
for (ContainerConfig.Configuration containerCfg : containerConfigs) {
Debug.logInfo("Loading container: " + containerCfg.name, module);
Container tmpContainer = loadContainer(config.containerConfig, containerCfg, ofbizCommands);
@@ -160,7 +160,7 @@ public class ContainerLoader implements StartupLoader {
public synchronized void unload() throws StartupException {
Debug.logInfo("Shutting down containers", module);
- List<Container> reversedContainerList = new ArrayList<Container>(loadedContainers);
+ List<Container> reversedContainerList = new ArrayList<>(loadedContainers);
Collections.reverse(reversedContainerList);
for(Container loadedContainer : reversedContainerList) {
