polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [2/4] zest-qi4j git commit: Seems like one refactoring was lost in previous commit somehow.
Date Sat, 11 Jul 2015 12:19:21 GMT
Seems like one refactoring was lost in previous commit somehow.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/c28df396
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/c28df396
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/c28df396

Branch: refs/heads/develop
Commit: c28df39608c7fbcdb9064ab8ab3481f68e1f1a13
Parents: d6dadb2
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Sat Jul 11 14:24:28 2015 +0300
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Sat Jul 11 14:24:28 2015 +0300

----------------------------------------------------------------------
 .../layered/LayeredLayerAssembler.java          | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c28df396/core/bootstrap/src/main/java/org/qi4j/bootstrap/layered/LayeredLayerAssembler.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/layered/LayeredLayerAssembler.java
b/core/bootstrap/src/main/java/org/qi4j/bootstrap/layered/LayeredLayerAssembler.java
index e220c53..def4a46 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/layered/LayeredLayerAssembler.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/layered/LayeredLayerAssembler.java
@@ -33,13 +33,9 @@ public abstract class LayeredLayerAssembler
         try
         {
             ModuleAssembler moduleAssembler = instantiateAssembler( layer, modulerAssemblerClass
);
-            String classname = modulerAssemblerClass.getSimpleName();
-            if( classname.endsWith( "Module" ) )
-            {
-                classname = classname.substring( 0, classname.length() - 6 ) + " Module";
-            }
-            LayeredApplicationAssembler.setNameIfPresent( modulerAssemblerClass, classname
);
-            ModuleAssembly module = layer.module( classname );
+            String moduleName = createModuleName( modulerAssemblerClass );
+            LayeredApplicationAssembler.setNameIfPresent( modulerAssemblerClass, moduleName
);
+            ModuleAssembly module = layer.module( moduleName );
             assemblers.put( modulerAssemblerClass, moduleAssembler );
             ModuleAssembly assembly = moduleAssembler.assemble( layer, module );
             if( assembly == null )
@@ -54,6 +50,16 @@ public abstract class LayeredLayerAssembler
         }
     }
 
+    protected String createModuleName( Class<? extends ModuleAssembler> modulerAssemblerClass
)
+    {
+        String moduleName = modulerAssemblerClass.getSimpleName();
+        if( moduleName.endsWith( "Module" ) )
+        {
+            moduleName = moduleName.substring( 0, moduleName.length() - 6 ) + " Module";
+        }
+        return moduleName;
+    }
+
     private ModuleAssembler instantiateAssembler( LayerAssembly layer,
                                                   Class<? extends ModuleAssembler>
modulerAssemblerClass
     )


Mime
View raw message