on 10/4/2000 12:41 PM, "Diethelm Guallar, Gonzalo"
<[EMAIL PROTECTED]> wrote:
> This in fact modifies the vector held in TurbineResources
> (this is news to me, and different to the way the STL works
> in C++, where the vector returned would NOT be a reference),
> so each time this code is called, the vector size increases
> by one. This is especially so in JavaBaseFactory::getAssembler(),
> which is called many times. I'm not sure why, but this later
> makes the loop iterate over all packages in the vector.
Java != C++
> Quick solution: would it be Ok to replace that code with
>
> Vector packages = TurbineResources.getVector("module.packages");
> String basePackage = GenericLoader.getBasePackage();
> if (! vector.contains(basePackage))
> packages.addElement( basePackage );
>
> everywhere? If yes, would this be a candidate for a utility
> function, and where (what class)?
That is totally the right way to do it. Send a patch. :-)
-jon
--
http://scarab.tigris.org/ | http://noodle.tigris.org/
http://java.apache.org/ | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/ | http://www.sourcexchange.com/
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]