[seam-commits] Seam SVN: r8999 - trunk/src/main/org/jboss/seam.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Sep 15 23:25:29 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-09-15 23:25:29 -0400 (Mon, 15 Sep 2008)
New Revision: 8999

Modified:
   trunk/src/main/org/jboss/seam/Component.java
Log:
JBSEAM-808

Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java	2008-09-16 03:08:11 UTC (rev 8998)
+++ trunk/src/main/org/jboss/seam/Component.java	2008-09-16 03:25:29 UTC (rev 8999)
@@ -702,6 +702,12 @@
          //can't use Init.instance() here because of unit tests
          Init init = (Init) applicationContext.get(Seam.getComponentName(Init.class));
          String contextVariable = toName( method.getAnnotation(org.jboss.seam.annotations.Factory.class).value(), method );
+         
+         if ( contextVariable.equals(name) )
+         {
+            throw new IllegalStateException("@Factory method can not share name with its containing component: " + contextVariable);
+         }
+         
          init.addFactoryMethod(contextVariable, method, this);
          if ( method.getAnnotation(org.jboss.seam.annotations.Factory.class).autoCreate() )
          {




More information about the seam-commits mailing list