Re: generics: CasPool

2009-08-18 Thread Jörn Kottmann

Adam Lally wrote:

On Mon, Aug 17, 2009 at 10:39 AM, Jörn Kottmannkottm...@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


generics: CasPool

2009-08-17 Thread Jörn Kottmann

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

2009-08-17 Thread Adam Lally
On Mon, Aug 17, 2009 at 10:39 AM, Jörn Kottmannkottm...@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