deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject deltaspike git commit: DELTASPIKE-819 fallback to avoid a producer-exception
Date Mon, 12 Jan 2015 14:29:41 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master f158ab62a -> dbc9a6518


DELTASPIKE-819 fallback to avoid a producer-exception


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

Branch: refs/heads/master
Commit: dbc9a65182f143635abe80ea12c0ee0164bc2160
Parents: f158ab6
Author: gpetracek <gpetracek@apache.org>
Authored: Mon Jan 12 15:24:49 2015 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Mon Jan 12 15:29:27 2015 +0100

----------------------------------------------------------------------
 .../config/view/ViewConfigResolverProducer.java | 24 ++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/dbc9a651/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigResolverProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigResolverProducer.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigResolverProducer.java
index 1392e2e..d4fd4a8 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigResolverProducer.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigResolverProducer.java
@@ -27,10 +27,13 @@ import javax.inject.Inject;
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.logging.Logger;
 
 @ApplicationScoped
 public class ViewConfigResolverProducer
 {
+    private static final Logger LOG = Logger.getLogger(ViewConfigResolverProducer.class.getName());
+
     @Inject
     private ViewConfigExtension viewConfigExtension;
 
@@ -49,15 +52,28 @@ public class ViewConfigResolverProducer
     {
         if (!viewConfigExtension.isActivated())
         {
-            return new DefaultViewConfigResolver(
-                new FolderConfigNode(
-                    null, null, new HashSet<Annotation>()), null, null, new ArrayList<ConfigDescriptorValidator>());
+            return createEmptyDefaultViewConfigResolver();
         }
 
         if (!viewConfigExtension.isTransformed()) //esp. for easier unit-tests
         {
             viewConfigExtension.transformMetaDataTree();
         }
-        return viewConfigExtension.getViewConfigResolver();
+        ViewConfigResolver viewConfigResolver = viewConfigExtension.getViewConfigResolver();
+
+        if (viewConfigResolver == null)
+        {
+            LOG.warning("It wasn't possible to create a ViewConfigResolver");
+            viewConfigResolver = createEmptyDefaultViewConfigResolver();
+        }
+
+        return viewConfigResolver;
+    }
+
+    private DefaultViewConfigResolver createEmptyDefaultViewConfigResolver()
+    {
+        return new DefaultViewConfigResolver(
+            new FolderConfigNode(
+                null, null, new HashSet<Annotation>()), null, null, new ArrayList<ConfigDescriptorValidator>());
     }
 }


Mime
View raw message