[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...
Norman Richards
norman.richards at jboss.com
Mon Jul 23 20:54:34 EDT 2007
User: nrichards
Date: 07/07/23 20:54:34
Modified: src/main/org/jboss/seam Component.java
Log:
JBSEAM-1593
Revision Changes Path
1.277 +8 -4 jboss-seam/src/main/org/jboss/seam/Component.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Component.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -b -r1.276 -r1.277
--- Component.java 23 Jul 2007 23:59:18 -0000 1.276
+++ Component.java 24 Jul 2007 00:54:34 -0000 1.277
@@ -595,13 +595,16 @@
if ( method.isAnnotationPresent(REMOVE) )
{
removeMethods.put( method.getName(), method );
- if ( method.getParameterTypes().length==0 )
+ if (method.getParameterTypes().length==0 )
{
+ // use the first no-arg remove method unless a later one is marked as the destroy method
+ if (defaultRemoveMethod == null || method.isAnnotationPresent(Destroy.class)) {
defaultRemoveMethod = method;
+ }
lifecycleMethods.add(method);
}
}
- if ( method.isAnnotationPresent(Destroy.class) && method!=getDefaultRemoveMethod() )
+ if ( method.isAnnotationPresent(Destroy.class))
{
/*if ( method.getParameterTypes().length>0 ) and it doesnt take a Component paramater
{
@@ -615,7 +618,8 @@
{
throw new IllegalStateException("component has two @Destroy methods: " + name);
}
- if (destroyMethod==null)
+
+ if (destroyMethod==null && method!=getDefaultRemoveMethod())
{
destroyMethod = method;
lifecycleMethods.add(method);
More information about the jboss-cvs-commits
mailing list