[ofbiz-framework] branch trunk updated: Improved: Remove unused ‘ComponentContainer#retrieveComponentConfig’ argument

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Remove unused ‘ComponentContainer#retrieveComponentConfig’ argument

mthl
This is an automated email from the ASF dual-hosted git repository.

mthl pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 583f926  Improved: Remove unused ‘ComponentContainer#retrieveComponentConfig’ argument
583f926 is described below

commit 583f926e0491480b98c29f41a74bad765067dbfc
Author: Mathieu Lirzin <[hidden email]>
AuthorDate: Fri Jan 3 15:10:29 2020 +0100

    Improved: Remove unused ‘ComponentContainer#retrieveComponentConfig’ argument
   
    No functional change.
---
 .../apache/ofbiz/base/container/ComponentContainer.java   | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java b/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java
index 621d690..febfa27 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/container/ComponentContainer.java
@@ -101,7 +101,7 @@ public class ComponentContainer implements Container {
             loadComponentDirectory(location);
             break;
         case SINGLE_COMPONENT:
-            retrieveComponentConfig(null, location);
+            retrieveComponentConfig(location);
             break;
         }
     }
@@ -167,26 +167,25 @@ public class ComponentContainer implements Container {
                     .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;
     }