deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-439 detection of invalid view-configs
Date Sat, 02 Nov 2013 22:11:38 GMT
Updated Branches:
  refs/heads/master 2f6d6ea62 -> 80720cf4c


DELTASPIKE-439 detection of invalid view-configs


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

Branch: refs/heads/master
Commit: 80720cf4c4b2148b2626a330aca96a4662d0f7eb
Parents: 2f6d6ea
Author: gpetracek <gpetracek@apache.org>
Authored: Sat Nov 2 23:10:45 2013 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Sat Nov 2 23:10:45 2013 +0100

----------------------------------------------------------------------
 .../jsf/impl/config/view/ViewConfigExtension.java        | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/80720cf4/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigExtension.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigExtension.java
index 4620262..000f570 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigExtension.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/config/view/ViewConfigExtension.java
@@ -171,6 +171,17 @@ public class ViewConfigExtension implements Extension, Deactivatable
 
     protected void addConfigClass(Class viewConfigClass, Set<Annotation> viewConfigAnnotations)
     {
+        String className = viewConfigClass.getName();
+        if (!className.contains("."))
+        {
+            if (className.contains("$"))
+            {
+                className = className.substring(0, className.indexOf("$"));
+            }
+
+            throw new IllegalStateException("Please move the class '" + className + "' to
a package!");
+        }
+
         for (Annotation annotation : viewConfigAnnotations)
         {
             if (annotation.annotationType().equals(ViewConfigRoot.class))


Mime
View raw message