ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@seessle.de>
Subject Re: Possible bug in code??
Date Fri, 06 Oct 2000 18:46:46 GMT
----- Original Message -----
From: "Jay Glanville" <dickon@nortelnetworks.com>
To: "Ant-Dev (text)" <ant-dev@jakarta.apache.org>
Sent: Friday, October 06, 2000 6:51 PM
Subject: Possible bug in code??


> Please excuse my ignorance, but I have a question about the Path class.
>
> There is a two-parameter constructor that goes like this:
>     public Path(Project p, String path)

>         this(p);
>         createPathElement().setPath(path);
>     }
> and there is a method called setPath that goes like this:
>     public void setPath(String path) throws BuildException {
>         if (isReference()) {
>             throw tooManyAttributes();
>         }
>         createPathElement().setPath(path);
>     }
>
> My question is this:  if someone uses the two-parameter constructor, then
> createPathElement() will be called twice.  Is this the desired action?  It
> appears to my naive eye that the path would be added twice.
>
Hmm. I don't think so if I understand you correctly. setPath is called on
the return-value of createPathElement() (which is an instance of the nested
class PathElement).

Nico



Mime
View raw message