You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2006/06/12 00:00:53 UTC
svn commit: r413541 -
/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
Author: stevel
Date: Sun Jun 11 15:00:52 2006
New Revision: 413541
URL: http://svn.apache.org/viewvc?rev=413541&view=rev
Log:
change policy of PropertyResource to return the actual dereferenced value.
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java?rev=413541&r1=413540&r2=413541&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java Sun Jun 11 15:00:52 2006
@@ -107,8 +107,7 @@
if (isReference()) {
return getCheckedRef().toString();
}
- return getName()!=null?("${"+getName()+"}")
- :"null";
+ return String.valueOf(getValue());
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: svn commit: r413541 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
Posted by Matt Benson <gu...@yahoo.com>.
--- Steve Loughran <st...@apache.org> wrote:
> Matt Benson wrote:
> > --- stevel@apache.org wrote:
> >
>
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
> >> Sun Jun 11 15:00:52 2006
> >> @@ -107,8 +107,7 @@
> >> if (isReference()) {
> >> return getCheckedRef().toString();
> >> }
> >> - return
> getName()!=null?("${"+getName()+"}")
> >> - :"null";
> >> + return String.valueOf(getValue());
> >> }
> >
> > What if we make PropertyResource's toString()
> > contingent on whether the property is set. An
> unset
> > property might evaluate to something like "${" +
> > getName() + "} (unset)" and a set (immutable)
> property
> > to getValue() ?
> >
>
> that would be even cooler :)
>
> there is also a toLongString() operation that I
> havent gone near yet; I
> was just tweaking the various resources so that
> toString() was
> meaningful in them.
>
Oh, yeah... having written that, you'd hope I'd
remember toLongString()... ;)
-Matt
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: svn commit: r413541 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
Posted by Steve Loughran <st...@apache.org>.
Matt Benson wrote:
> --- stevel@apache.org wrote:
> ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
>> Sun Jun 11 15:00:52 2006
>> @@ -107,8 +107,7 @@
>> if (isReference()) {
>> return getCheckedRef().toString();
>> }
>> - return getName()!=null?("${"+getName()+"}")
>> - :"null";
>> + return String.valueOf(getValue());
>> }
>
> What if we make PropertyResource's toString()
> contingent on whether the property is set. An unset
> property might evaluate to something like "${" +
> getName() + "} (unset)" and a set (immutable) property
> to getValue() ?
>
that would be even cooler :)
there is also a toLongString() operation that I havent gone near yet; I
was just tweaking the various resources so that toString() was
meaningful in them.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: svn commit: r413541 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
Posted by Matt Benson <gu...@yahoo.com>.
--- stevel@apache.org wrote:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java
> Sun Jun 11 15:00:52 2006
> @@ -107,8 +107,7 @@
> if (isReference()) {
> return getCheckedRef().toString();
> }
> - return getName()!=null?("${"+getName()+"}")
> - :"null";
> + return String.valueOf(getValue());
> }
What if we make PropertyResource's toString()
contingent on whether the property is set. An unset
property might evaluate to something like "${" +
getName() + "} (unset)" and a set (immutable) property
to getValue() ?
-Matt
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org