You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Stephen McConnell <mc...@osm.net> on 2002/06/15 08:51:30 UTC

org.apache.excalibur.extension.DefaultPackageRepository

Pete:

The DefaultPackageRepository class contains the method 
cacheOptionalPackage which contains the following statement:

   final Extension extension =
     optionalPackage.getAvailableExtensions()[ 0 ];

I have a situation where the getAvailableExtensions is returning a 0 
length array which in turn is throwing an out of bounds exception.  I 
checked in the OptionalPackage class and it's just returning the 
m_available state member. So, should OptionalPackage be allowing a 0 
length array, or should validation of the available packages array 
length be undertaken in the cacheOptionalPackage methhod?

Cheers, Steve.


-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net


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


Re: org.apache.excalibur.extension.DefaultPackageRepository

Posted by Peter Donald <pe...@apache.org>.
At 08:51 AM 6/15/2002 +0200, you wrote:

>Pete:
>
>The DefaultPackageRepository class contains the method 
>cacheOptionalPackage which contains the following statement:
>
>   final Extension extension =
>     optionalPackage.getAvailableExtensions()[ 0 ];
>
>I have a situation where the getAvailableExtensions is returning a 0 
>length array which in turn is throwing an out of bounds exception.  I 
>checked in the OptionalPackage class and it's just returning the 
>m_available state member. So, should OptionalPackage be allowing a 0 
>length array,

yep.

>or should validation of the available packages array length be undertaken 
>in the cacheOptionalPackage methhod?

If it is 0 length then it probably does not need to be cached. I will try 
to have a look at it on tuesday.



Cheers,

Peter Donald
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Faced with the choice between changing one's mind,
and proving that there is no need to do so - almost
everyone gets busy on the proof."
              - John Kenneth Galbraith
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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