You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by mg...@apache.org on 2016/03/25 15:11:11 UTC

[35/50] isis git commit: ISIS-1287: whitespace reformatting and trivial refactor in IsisWebAppBootstrapper.

ISIS-1287: whitespace reformatting and trivial refactor in IsisWebAppBootstrapper.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0892c17c
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0892c17c
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0892c17c

Branch: refs/heads/ISIS-1223-upgrade-to-wicket-7
Commit: 0892c17c4aa660111bf5580321d0dd8f31bc73ce
Parents: 2efa413
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Thu Mar 24 16:33:00 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Mar 25 06:35:58 2016 +0000

----------------------------------------------------------------------
 .../core/webapp/IsisWebAppBootstrapper.java     | 25 ++++++++++----------
 1 file changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/0892c17c/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java b/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
index 5886a3f..e989fb4 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
@@ -130,7 +130,10 @@ public class IsisWebAppBootstrapper implements ServletContextListener {
         LOG.info("server started");
     }
 
-    private Injector createGuiceInjector(final IsisConfigurationBuilder isisConfigurationBuilder, final DeploymentType deploymentType, final InstallerLookup installerLookup) {
+    private Injector createGuiceInjector(
+            final IsisConfigurationBuilder isisConfigurationBuilder,
+            final DeploymentType deploymentType,
+            final InstallerLookup installerLookup) {
         final IsisInjectModule isisModule = new IsisInjectModule(deploymentType, isisConfigurationBuilder, installerLookup);
         return Guice.createInjector(isisModule);
     }
@@ -161,8 +164,7 @@ public class IsisWebAppBootstrapper implements ServletContextListener {
      * If no setting is found, defaults to {@link WebAppConstants#DEPLOYMENT_TYPE_DEFAULT}.
      */
     private DeploymentType determineDeploymentType(final IsisConfigurationBuilder isisConfigurationBuilder, final ServletContext servletContext) {
-        String deploymentTypeStr = null;
-        deploymentTypeStr = servletContext.getInitParameter(WebAppConstants.DEPLOYMENT_TYPE_KEY);
+        String deploymentTypeStr = servletContext.getInitParameter(WebAppConstants.DEPLOYMENT_TYPE_KEY);
         if (deploymentTypeStr == null) {
             deploymentTypeStr = servletContext.getInitParameter(SystemConstants.DEPLOYMENT_TYPE_KEY);
         }
@@ -175,17 +177,16 @@ public class IsisWebAppBootstrapper implements ServletContextListener {
         return DeploymentType.lookup(deploymentTypeStr);
     }
 
-    private void addConfigurationResourcesForDeploymentType(final IsisConfigurationBuilder configurationLoader, final DeploymentType deploymentType) {
-        final String type = deploymentType.name().toLowerCase();
-        configurationLoader.addConfigurationResource(type + ".properties", NotFoundPolicy.CONTINUE);
+    private static void addConfigurationResourcesForDeploymentType(
+            final IsisConfigurationBuilder configurationLoader,
+            final DeploymentType deploymentType) {
+        final String resourceName = deploymentType.name().toLowerCase() + ".properties";
+        configurationLoader.addConfigurationResource(resourceName, NotFoundPolicy.CONTINUE);
     }
 
-    private void addConfigurationResourcesForWebApps(final IsisConfigurationBuilder configurationLoader) {
-        for (final String config : (new String[] { "web.properties", "war.properties" })) {
-            if (config != null) {
-                configurationLoader.addConfigurationResource(config, NotFoundPolicy.CONTINUE);
-            }
-        }
+    private static void addConfigurationResourcesForWebApps(final IsisConfigurationBuilder configurationLoader) {
+        configurationLoader.addConfigurationResource("web.properties", NotFoundPolicy.CONTINUE);
+        configurationLoader.addConfigurationResource("war.properties", NotFoundPolicy.CONTINUE);
     }
 
     // /////////////////////////////////////////////////////