Now that I think more about this situation, I don't think it can be
considered a bug.  The reason I say this is because if you expand the second
line of the constructor, you would get something like this:
    createPathElement().void;
    setPath(path);
So, the path actually isn't being added twice.  However, the double call to
createPathElement() is adding a new empty PathElement to the elements list.
So, while this isn't a bug, it most likely isn't a desired feature.

Jay

PS: is answering my own question considered a vain attempt at looking
intelligent?  I hope not.

-----Original Message-----
From: Glanville, Jay [SKY:P068:EXCH] 
Sent: Friday, October 06, 2000 12:51 PM
To: Ant-Dev (text)
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.

What version am I talking about?  The above code snippets are cut-&-pastes
from the web interface to CVS.

Jay


----------------------------------------------------------------------------
-----
Jay Dickon Glanville
P068 - SiteManager Development, Nortel Networks
613-765-1144 (ESN 395-1144)
MS: 045/55/A05
E-Mail: [EMAIL PROTECTED]

Reply via email to