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

danhaywood pushed a commit to branch maint-1.16.1
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b892b97f026a0f83c984b8a1fce8e8a434ea3ecd
Author: Dan Haywood <d...@haywood-associates.co.uk>
AuthorDate: Tue Feb 13 16:50:14 2018 +0000

    ISIS-1829: extracts methods to make flow easier to follow
---
 .../apache/isis/applib/AppManifestAbstract.java    | 37 +++++++++++++---------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git 
a/core/applib/src/main/java/org/apache/isis/applib/AppManifestAbstract.java 
b/core/applib/src/main/java/org/apache/isis/applib/AppManifestAbstract.java
index f74223a..6649cbd 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/AppManifestAbstract.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/AppManifestAbstract.java
@@ -64,29 +64,36 @@ public abstract class AppManifestAbstract implements 
AppManifest {
         if (overriddenAuthMechanism != null) {
             return overriddenAuthMechanism;
         } else {
-            if(builder instanceof AppManifestAbstract.Builder) {
-                return ((AppManifestAbstract.Builder) builder).authMechanism;
-            } else if(builder instanceof AppManifestAbstract2.Builder) {
-                return ((AppManifestAbstract2.Builder) builder).authMechanism;
-            } else {
-                return null;
-            }
+            return obtainAuthMechanismFrom(builder);
         }
     }
 
     private List<Class<? extends FixtureScript>> determineFixtures(final 
ModuleOrBuilderAbstract<?> builder) {
-        final List<Class<? extends FixtureScript>> builderFixtures;
-        if(builder instanceof AppManifestAbstract.Builder) {
-            builderFixtures = ((AppManifestAbstract.Builder) builder).fixtures;
-        } else if(builder instanceof AppManifestAbstract2.Builder) {
-            builderFixtures = ((AppManifestAbstract2.Builder) 
builder).fixtures;
-        } else {
-            builderFixtures = Lists.newArrayList();
-        }
+        final List<Class<? extends FixtureScript>> builderFixtures = 
obtainBuilderFixturesFrom(builder);
         overrideFixtures(builderFixtures);
         return builderFixtures;
     }
 
+    private static String obtainAuthMechanismFrom(final 
ModuleOrBuilderAbstract<?> builder) {
+        if(builder instanceof Builder) {
+            return ((Builder) builder).authMechanism;
+        }
+        if(builder instanceof AppManifestAbstract2.Builder) {
+            return ((AppManifestAbstract2.Builder) builder).authMechanism;
+        }
+        return null;
+    }
+
+    private static List<Class<? extends FixtureScript>> 
obtainBuilderFixturesFrom(final ModuleOrBuilderAbstract<?> builder) {
+        if(builder instanceof Builder) {
+            return ((Builder) builder).fixtures;
+        }
+        if(builder instanceof AppManifestAbstract2.Builder) {
+            return ((AppManifestAbstract2.Builder) builder).fixtures;
+        }
+        return Lists.newArrayList();
+    }
+
     private Map<String, String> createConfigurationProperties(
             final List<PropertyResource> propertyResources,
             final Map<String,String> individualConfigProps,

-- 
To stop receiving notification emails like this one, please contact
danhayw...@apache.org.

Reply via email to