Results 1 to 5 of 5

Thread: Bug in ActionStateAction

  1. #1
    Join Date
    May 2005
    Posts
    12

    Default Bug in ActionStateAction

    Not sure if this where bugs are to be reported for WebFlows, but...

    In ActionStateAction, when using the constructor signature ActionStateAction( Action, Properties) or ActionStateAction( ActionState, Action, Properties ), the passed properties are set into the properties member via :

    Code:
    this.properties = new Properties( passedProperties );
    That is fine, except that you must use Properties.getProperty method (and not the Properties.get method) for the Properties object to cascade into its wrapped Properties object.

    So the method ActionStateAction.getProperty needs to be changed from this :

    Code:
    return (String)getProperties().get( propertyName );
    to

    Code:
    return getProperties().getProperty( propertyName );
    this will ensure that the properties are propertly retrieved.

    Another thing to note is that the ActionStateAction.containsProperty has a similar issue as the Properties.containsKey method does not cascade the cehck to its wrapped Properties instance, so calling it when you you have used one of the constructors mentioned above will always return false for any properties located in the Properties object passed in.

    Example :

    Code:
    Proprties props = new Properties();
    props.setProperty( ActionStateAction.METHOD_PROPERTY, "cancelAction" );
    
    Action action = new SomeActionClass();
    
    ActionStateAction asa  = new ActionStateAction( action, properties );
    
    asa.setProperty( "MODE", "A" );
    
    assert( "A".equals( asa.getProperty("MODE") ) ); // Assert passes
    assert( asa.containsKey( "MODE" ) ); // Assert passes
    
    assert( "cancelAction".equals( asa.getProperty("MODE") ) ); // Assert fails
    assert( asa.containsKey( "MODE" ) ); // Assert fails

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Please upgrade to PR3. that class is now obsolete.
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    May 2005
    Posts
    12

    Default

    Thx. The response does beg the question...

    How stable is api? And when is the eta of it to be stable?

  4. #4
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    Last edited by robyn; May 16th, 2006 at 04:29 AM.

  5. #5
    Join Date
    May 2005
    Posts
    12

    Default

    Thx for the timely reponses )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •