You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Jörn Kottmann <ko...@gmail.com> on 2009/08/17 16:39:43 UTC
generics: CasPool
The CasPool has a constructor
CasPool(int aNumInstances, Collection aComponentDescriptionsOrMetaData,
Properties aPerformanceTuningSettings, ResourceManager
aResourceManager)
where aComponentDescriptionsOrMetaData is a collection which can contain
according
to javadoc "AnalysisEngineDescription, CollectionReaderDescription,
CasConsumerDescription or ProcessingResourceMetaData objects"
A reference of the Collection is passed to fillPool which passes the
Collection
to a CasDefinition constructor which then casts everything to
ProcessingResourceMetaData,
which will result in a ClassCastException in the case of
AnalysisEngineDescription,
CollectionReaderDescription and CasConsumerDescription objects.
Well, when we use generics we get an error.
Jörn
Re: generics: CasPool
Posted by Jörn Kottmann <ko...@gmail.com>.
Adam Lally wrote:
> On Mon, Aug 17, 2009 at 10:39 AM, Jörn Kottmann<ko...@gmail.com> wrote:
>
>> The CasPool has a constructor
>>
>> CasPool(int aNumInstances, Collection aComponentDescriptionsOrMetaData,
>> Properties aPerformanceTuningSettings, ResourceManager
>> aResourceManager)
>>
>> where aComponentDescriptionsOrMetaData is a collection which can contain
>> according
>> to javadoc "AnalysisEngineDescription, CollectionReaderDescription,
>> CasConsumerDescription or ProcessingResourceMetaData objects"
>>
>> A reference of the Collection is passed to fillPool which passes the
>> Collection
>> to a CasDefinition constructor which then casts everything to
>> ProcessingResourceMetaData,
>> which will result in a ClassCastException in the case of
>> AnalysisEngineDescription,
>> CollectionReaderDescription and CasConsumerDescription objects.
>>
>> Well, when we use generics we get an error.
>>
>>
>
> Good catch, that javadoc does seem to be wrong. I wonder if it was
> correct at some point in the past and the code has changed?
>
Maybe, at least it was not changed through the generics.
Jörn
Re: generics: CasPool
Posted by Adam Lally <al...@alum.rpi.edu>.
On Mon, Aug 17, 2009 at 10:39 AM, Jörn Kottmann<ko...@gmail.com> wrote:
> The CasPool has a constructor
>
> CasPool(int aNumInstances, Collection aComponentDescriptionsOrMetaData,
> Properties aPerformanceTuningSettings, ResourceManager
> aResourceManager)
>
> where aComponentDescriptionsOrMetaData is a collection which can contain
> according
> to javadoc "AnalysisEngineDescription, CollectionReaderDescription,
> CasConsumerDescription or ProcessingResourceMetaData objects"
>
> A reference of the Collection is passed to fillPool which passes the
> Collection
> to a CasDefinition constructor which then casts everything to
> ProcessingResourceMetaData,
> which will result in a ClassCastException in the case of
> AnalysisEngineDescription,
> CollectionReaderDescription and CasConsumerDescription objects.
>
> Well, when we use generics we get an error.
>
Good catch, that javadoc does seem to be wrong. I wonder if it was
correct at some point in the past and the code has changed?
-Adam