You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2004/05/11 11:44:16 UTC

cvs commit: maven/src/java/org/apache/maven/jelly JellyPropsHandler.java

brett       2004/05/11 02:44:16

  Modified:    src/java/org/apache/maven/jelly Tag: MAVEN-1_0-BRANCH
                        JellyPropsHandler.java
  Log:
  PR: MAVEN-1275
  Submitted by:	Henning Schmiedehausen
  Reviewed by:	Brett Porter
  Evaluate context variables before inserting them into the ant properties
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.7.4.4   +13 -5     maven/src/java/org/apache/maven/jelly/JellyPropsHandler.java
  
  Index: JellyPropsHandler.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/JellyPropsHandler.java,v
  retrieving revision 1.7.4.3
  retrieving revision 1.7.4.4
  diff -u -r1.7.4.3 -r1.7.4.4
  --- JellyPropsHandler.java	28 Mar 2004 21:27:27 -0000	1.7.4.3
  +++ JellyPropsHandler.java	11 May 2004 09:44:16 -0000	1.7.4.4
  @@ -19,6 +19,7 @@
   
   import org.apache.commons.grant.DefaultPropsHandler;
   import org.apache.commons.jelly.JellyContext;
  +import org.apache.commons.jelly.expression.Expression;
   
   import java.util.Hashtable;
   import java.util.Iterator;
  @@ -78,7 +79,14 @@
           }
           else
           {
  -            return value.toString();
  +            if ( value instanceof Expression )
  +            {
  +                return ( ( Expression ) value ).evaluateAsString( context );
  +            }
  +            else
  +            {
  +                return value.toString();
  +            }
           }
       }
   
  @@ -92,11 +100,11 @@
           Hashtable h = new Hashtable();
           for ( Iterator i = this.context.getVariableNames(); i.hasNext();)
           {
  -            String name = (String) i.next();
  -            Object value = this.context.getVariable( name );
  -            if ( value != null && value.toString() != null )
  +            String name = ( String ) i.next();
  +            String value = getProperty( name );
  +            if ( value != null )
               {
  -                h.put( name, value.toString() );
  +                h.put( name, value );
               }
           }
           return h;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org