ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: cvs commit: ant/src/testcases/org/apache/tools/ant DirectoryScannerTest.java
Date Mon, 07 Mar 2005 15:45:01 GMT
--- Dominique Devienne <DDevienne@lgc.com> wrote:

> > From: mbenson@apache.org
> [mailto:mbenson@apache.org]
> >   By popular demand:  Do not scan directories if
> their contents are
> >   excluded. Changed scannedDirs from a cache to a
> result and added
> >   a gettor method with a warning in the Javadoc
> that it was a testing
> >   method only.
> 
> 
> Cool! Should be a boon to some builds. Thanks Matt.
>  
> >        /**
> >   +     * This method is of interest for testing
> purposes.  The
> returned
> >   +     * Set is live and should not be modified.
> >   +     * @return the Set of relative directory
> names that have been
> >   +     * scanned.
> >   +     */
> >   +    public Set getScannedDirs() {
> >   +        return scannedDirs;
> >   +    }
> 
> How about returning
> Collections.unmodifiableSet(scannedDirs)
> instead just to be on the safe side?

Could do it, sure.  Shouldn't  impact performance
since the method should only get called during
testing.
> 
> Or better yet, make getScannedDirs() package
> private, since
> DirectoryScannerTest can still access it since in
> the same
> package no? (albeit in a different directory.) --DD

That's what I thought, but the test got:

[junit] java.lang.IllegalAccessError: tried to access
method org.apache.tools
.ant.DirectoryScanner.getScannedDirs()Ljava/util/Set;
from class org.apache.tools.ant.DirectoryScannerTest

So I gave up & made it public.  Does anyone know what
(if anything) I did wrong?

Thanks,
Matt
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

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


Mime
View raw message