[seam-commits] Seam SVN: r12740 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/init.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon May 17 08:43:31 EDT 2010


Author: manaRH
Date: 2010-05-17 08:43:30 -0400 (Mon, 17 May 2010)
New Revision: 12740

Modified:
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/init/Initialization.java
Log:
JBPAPP-4317 - ignoring duplicate Seam components in init

Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/init/Initialization.java	2010-05-17 12:22:35 UTC (rev 12739)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/init/Initialization.java	2010-05-17 12:43:30 UTC (rev 12740)
@@ -599,10 +599,16 @@
             }
          }
          
-         throw new IllegalStateException("Two components with the same name and precedence - " +
-               "component name: " + name + ", component classes: " + 
-               descriptor.getComponentClass().getName() + ", " +
-               (other != null ? other.getComponentClass().getName() : "<unknown>"));
+         // for the same component name and the same class in classpath don't throw exception,
+         // use the first in classpath as standard order - JBSEAM-3996 
+         Class clazz = descriptor.getComponentClass();         
+         if (!clazz.getName().equals(other.getComponentClass().getName())) 
+         {         
+            throw new IllegalStateException("Two components with the same name and precedence - " +
+                  "component name: " + name + ", component classes: " + 
+                  descriptor.getComponentClass().getName() + ", " +
+                  (other != null ? other.getComponentClass().getName() : "<unknown>"));
+         }
       }
    }
 



More information about the seam-commits mailing list