You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by ho...@apache.org on 2002/05/30 00:43:01 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java

holtdl      02/05/29 15:43:01

  Modified:    src/main/org/apache/tools/ant/taskdefs UpToDate.java
  Log:
  Avoid getting an NPE by making sure the property attr is set.
  
  Revision  Changes    Path
  1.20      +4 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
  
  Index: UpToDate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- UpToDate.java	15 Apr 2002 15:33:09 -0000	1.19
  +++ UpToDate.java	29 May 2002 22:43:01 -0000	1.20
  @@ -223,6 +223,10 @@
        * than (each of) the corresponding source file(s).
        */
       public void execute() throws BuildException {
  +        if (_property == null) {
  +            throw new BuildException("property attribute is required.", 
  +                                     location);
  +        }
           boolean upToDate = eval();
           if (upToDate) {
               this.project.setNewProperty(_property, getValue());
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
----- Original Message -----
From: "Diane Holt" <ho...@yahoo.com>

> Nope. <available> works the same way. Didn't grope through it all, but I
> assume <condition> takes care of setting the 'property' attribute and so
> fulfills the requirement (besides, I did hand-test the little puppy before
> I put it through).

Ok, cool.  I'm glad I was wrong on this, actually.   There is a Condition
test, actually, so our test cases would likely catch something bad anyway.
:))




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 29 May 2002, Diane Holt <ho...@yahoo.com> wrote:

> Didn't grope through it all, but I assume <condition> takes care of
> setting the 'property' attribute and so fulfills the requirement

Nope, <condition> doesn't call execute but eval 8-)

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java

Posted by Diane Holt <ho...@yahoo.com>.
--- Erik Hatcher <ja...@ehatchersolutions.com> wrote:
> Two issues:
> 
> 1) if this is a bug fix, why not make it on the 1.5 branch?

Oh crud! -- I thought I updated it to the branch revision -- shoot! Thanks
for catching that.

> 2) I'm pretty sure you just broke <condition> and a nested <uptodate>. 
> No?

Nope. <available> works the same way. Didn't grope through it all, but I
assume <condition> takes care of setting the 'property' attribute and so
fulfills the requirement (besides, I did hand-test the little puppy before
I put it through).

Actually, the NPE scared the hell out of me, since I sure never expected
trusty old <uptodate> to do that. That's probably why I forgot to do the
update -- too shook up :)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Two issues:

1) if this is a bug fix, why not make it on the 1.5 branch?

2) I'm pretty sure you just broke <condition> and a nested <uptodate>.  No?
(I should try before saying this, but what the heck, I've put my foot in my
mouth before, why not again?! :)

    Erik


----- Original Message -----
From: <ho...@apache.org>
To: <ja...@apache.org>
Sent: Wednesday, May 29, 2002 6:43 PM
Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs
UpToDate.java


> holtdl      02/05/29 15:43:01
>
>   Modified:    src/main/org/apache/tools/ant/taskdefs UpToDate.java
>   Log:
>   Avoid getting an NPE by making sure the property attr is set.
>
>   Revision  Changes    Path
>   1.20      +4 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
>
>   Index: UpToDate.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v
>   retrieving revision 1.19
>   retrieving revision 1.20
>   diff -u -r1.19 -r1.20
>   --- UpToDate.java 15 Apr 2002 15:33:09 -0000 1.19
>   +++ UpToDate.java 29 May 2002 22:43:01 -0000 1.20
>   @@ -223,6 +223,10 @@
>         * than (each of) the corresponding source file(s).
>         */
>        public void execute() throws BuildException {
>   +        if (_property == null) {
>   +            throw new BuildException("property attribute is required.",
>   +                                     location);
>   +        }
>            boolean upToDate = eval();
>            if (upToDate) {
>                this.project.setNewProperty(_property, getValue());
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>