jstrachan    2002/07/15 10:47:00

  Modified:    src/java/org/apache/maven/app GrantPropsHandler.java
                        MavenJellyContext.java
  Log:
  Patched the code to use the g/setVariable() methods rather than 
g/setScopedVariable(). Right now the g/setScopedVariable() methods are exactly the 
same as their g/setVariable() methods so I removed them from Jelly as a bit of spring 
cleaning.
  If in doubt there's always findVariable().
  
  Revision  Changes    Path
  1.3       +6 -9      
jakarta-turbine-maven/src/java/org/apache/maven/app/GrantPropsHandler.java
  
  Index: GrantPropsHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/GrantPropsHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GrantPropsHandler.java    24 Jun 2002 18:33:18 -0000      1.2
  +++ GrantPropsHandler.java    15 Jul 2002 17:47:00 -0000      1.3
  @@ -89,8 +89,7 @@
        */
       public void setProperty(String name, String value)
       {
  -        context.setScopedVariable(name,
  -                                  value);
  +        context.setVariable(name, value);
       }
   
       /** Retrieve an ant property.
  @@ -101,7 +100,7 @@
        */
       public String getProperty(String name)
       {
  -        Object value = context.getScopedVariable(name);
  +        Object value = context.getVariable(name);
   
           if (value == null)
           {
  @@ -125,10 +124,9 @@
        */
       public void setNewProperty(String name, String value)
       {
  -        if (context.getScopedVariable(name) == null)
  +        if (context.getVariable(name) == null)
           {
  -            context.setScopedVariable(name,
  -                                      value);
  +            context.setVariable(name, value);
           }
       }
   
  @@ -139,8 +137,7 @@
        */
       public void setUserProperty(String name, String value)
       {
  -        context.setScopedVariable(name,
  -                                  value);
  +        context.setVariable(name, value);
       }
   
       /** Retrieve an ant user property.
  @@ -151,7 +148,7 @@
        */
       public String getUserProperty(String name)
       {
  -        Object value = context.getScopedVariable(name);
  +        Object value = context.getVariable(name);
   
           if (value == null)
           {
  
  
  
  1.11      +0 -32     
jakarta-turbine-maven/src/java/org/apache/maven/app/MavenJellyContext.java
  
  Index: MavenJellyContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/MavenJellyContext.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MavenJellyContext.java    14 Jul 2002 15:58:42 -0000      1.10
  +++ MavenJellyContext.java    15 Jul 2002 17:47:00 -0000      1.11
  @@ -219,38 +219,6 @@
           return value;
       }
   
  -    /** Retrieve a scoped variable.
  -     *
  -     *  @param name The name of the variable.
  -     *
  -     *  @return The value of the variable, if set, otherwise
  -     *          <code>null</code>.
  -     */
  -    public Object getScopedVariable(String name)
  -    {
  -        Object value = this.props.get(name);
  -        // Object value = super.getScopedVariable(name);
  -        
  -        if (value == null)
  -        {
  -            value = super.getScopedVariable(name);
  -            // value = this.props.get(name);
  -        }
  -
  -        if (value instanceof String)
  -        {
  -            value = ProjectHelper.replaceProperties(getAntProject(),
  -                                                    (String) value,
  -                                                    this.asProps);
  -        }
  -        else if (value instanceof Expression)
  -        {
  -            value = ((Expression) value).evaluate(this);
  -        }
  -        
  -        return value;
  -    }
  -
       /** Retrieve this context as a <code>Hashtable</code>.
        *
        *  @return This context as a <code>Hashtable</code>.
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to