[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...

Gavin King gavin.king at jboss.com
Sat Dec 16 09:06:57 EST 2006


  User: gavin   
  Date: 06/12/16 09:06:57

  Modified:    src/main/org/jboss/seam  Component.java
  Log:
  better handling of empty string
  JBSEAM-570, @Observer(create=false)
  
  Revision  Changes    Path
  1.222     +4 -3      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.221
  retrieving revision 1.222
  diff -u -b -r1.221 -r1.222
  --- Component.java	16 Dec 2006 02:58:10 -0000	1.221
  +++ Component.java	16 Dec 2006 14:06:57 -0000	1.222
  @@ -122,7 +122,7 @@
    *
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
    * @author Gavin King
  - * @version $Revision: 1.221 $
  + * @version $Revision: 1.222 $
    */
   @Scope(ScopeType.APPLICATION)
   @SuppressWarnings("deprecation")
  @@ -474,10 +474,11 @@
               if ( method.isAnnotationPresent(Observer.class) )
               {
                  Init init = (Init) applicationContext.get( Seam.getComponentName(Init.class) ); //can't use Init.instance() here 'cos of unit tests
  -               for ( String eventType : method.getAnnotation(Observer.class).value() )
  +               Observer observer = method.getAnnotation(Observer.class);
  +               for ( String eventType : observer.value() )
                  {
                     if ( eventType.length()==0 ) eventType = method.getName(); //TODO: new defaulting rule to map @Observer onFooEvent() -> event type "fooEvent"
  -                  init.addObserverMethod(eventType, method, this);
  +                  init.addObserverMethod( eventType, method, this, observer.create() );
                  }
               }
               if ( method.isAnnotationPresent(RequestParameter.class) )
  
  
  



More information about the jboss-cvs-commits mailing list