You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Matt Benson <gu...@gmail.com> on 2010/04/12 16:44:04 UTC

Re: svn commit: r933177 - /ant/antlibs/props/trunk/src/main/org/apache/ant/props/NestedPropertyExpander.java

Good catch; I was afraid there might be similar issues lurking  
there.  ;)

-Matt

On Apr 12, 2010, at 5:25 AM, bodewig@apache.org wrote:

> Author: bodewig
> Date: Mon Apr 12 10:25:46 2010
> New Revision: 933177
>
> URL: http://svn.apache.org/viewvc?rev=933177&view=rev
> Log:
> remove costly indexOf - see revision 932588 of core's PropertyHelper
>
> Modified:
>     ant/antlibs/props/trunk/src/main/org/apache/ant/props/ 
> NestedPropertyExpander.java
>
> Modified: ant/antlibs/props/trunk/src/main/org/apache/ant/props/ 
> NestedPropertyExpander.java
> URL: http://svn.apache.org/viewvc/ant/antlibs/props/trunk/src/main/ 
> org/apache/ant/props/NestedPropertyExpander.java? 
> rev=933177&r1=933176&r2=933177&view=diff
> ====================================================================== 
> ========
> --- ant/antlibs/props/trunk/src/main/org/apache/ant/props/ 
> NestedPropertyExpander.java (original)
> +++ ant/antlibs/props/trunk/src/main/org/apache/ant/props/ 
> NestedPropertyExpander.java Mon Apr 12 10:25:46 2010
> @@ -39,7 +39,8 @@ public class NestedPropertyExpander impl
>      public String parsePropertyName(String value, ParsePosition pos,
>              ParseNextProperty parseNextProperty) {
>          int start = pos.getIndex();
> -        if (value.indexOf("${", start) == start) {
> +        if (value.length() - start >= 3
> +            && '$' == value.charAt(start) && '{' == value.charAt 
> (start + 1)) {
>              parseNextProperty.getProject().log("Attempting nested  
> property processing",
>                      Project.MSG_DEBUG);
>              pos.setIndex(start + 2);
>
>


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