ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: Possible bug fix for LoadFile.java
Date Wed, 29 May 2002 18:36:54 GMT
What if crh.readFully(...) returns null?

**************************************************
*  Opportunist: A person who starts taking bath  *
*  if he accidentally falls into a river.        *
**************************************************
----- Original Message ----- 
From: "Diane Holt" <holtdl@yahoo.com>
To: <ant-dev@jakarta.apache.org>
Sent: Wednesday, May 29, 2002 2:33 PM
Subject: Possible bug fix for LoadFile.java


> Because of this line, which sets the "text" var:
> 
>                String text = "";
> 
> I've made the following change to LoadFile.java:
> 
>   @@ -194,7 +194,7 @@
>                    text = crh.readFully(instream);
>                }
> 
>   -            if (text != null) {
>   +            if (text.length() > 0) {
>                    project.setNewProperty(property, text);
>                    log("loaded " + text.length() + " characters",
>                        Project.MSG_VERBOSE);
> 
> since a) I don't see "text" ever being null, and b) the way it is now,
> it'll set the property to the empty string, which makes it useless for
> using the property in 'if' on a target (since the property is set).
> 
> Or am I missing something?
> 
> Diane
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
> 


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


Mime
View raw message