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/14 18:10:14 UTC

CasCreationUtils.getMetaDataList returns objects of wrong type ?

The javadoc says these methods return a List of 
ProcessingResourceMetaData objects.
Inside the private method getMetaDataList, objects which do not have the 
ProcessingResourceMetaData
type are added to the list. That can be seen in line 1749, there a 
CasInitializerDescription object is added
to the list.

Jörn

Re: CasCreationUtils.getMetaDataList returns objects of wrong type ?

Posted by Adam Lally <al...@alum.rpi.edu>.
On Fri, Aug 14, 2009 at 1:48 PM, Jörn Kottmann<ko...@gmail.com> wrote:
> Yes, I missed something, but getMetaData returns a ResourceMetaData object,
> is it safe to cast the clone of it to ProcessingResourceMetaData ?
>

I think so, but you could also change it to call
CasInitializer.getCasInitializerMetaData(), which does return a
ProcessingResourceMetaData (it just does the cast anyway, though, so
it's equivalent).  There are similar methods also for
CollectionReader, AnalysisEngine, etc.

  -Adam

Re: CasCreationUtils.getMetaDataList returns objects of wrong type ?

Posted by Jörn Kottmann <ko...@gmail.com>.
Adam Lally wrote:
> On Fri, Aug 14, 2009 at 12:10 PM, Jörn Kottmann<ko...@gmail.com> wrote:
>   
>> The javadoc says these methods return a List of ProcessingResourceMetaData
>> objects.
>> Inside the private method getMetaDataList, objects which do not have the
>> ProcessingResourceMetaData
>> type are added to the list. That can be seen in line 1749, there a
>> CasInitializerDescription object is added
>> to the list.
>>
>>     
> Linke 1749 is:
>         mdList.add(((CasInitializerDescription) current).getMetaData().clone());
>
> It doesn't add the CasInitializerDescription to the list - it adds the
> result of getMetaData(), which is of type ProcesingResourceMetaData.
>   
Yes, I missed something, but getMetaData returns a ResourceMetaData object,
is it safe to cast the clone of it to ProcessingResourceMetaData ?

Jörn

Re: CasCreationUtils.getMetaDataList returns objects of wrong type ?

Posted by Adam Lally <al...@alum.rpi.edu>.
On Fri, Aug 14, 2009 at 12:10 PM, Jörn Kottmann<ko...@gmail.com> wrote:
> The javadoc says these methods return a List of ProcessingResourceMetaData
> objects.
> Inside the private method getMetaDataList, objects which do not have the
> ProcessingResourceMetaData
> type are added to the list. That can be seen in line 1749, there a
> CasInitializerDescription object is added
> to the list.
>
Linke 1749 is:
        mdList.add(((CasInitializerDescription) current).getMetaData().clone());

It doesn't add the CasInitializerDescription to the list - it adds the
result of getMetaData(), which is of type ProcesingResourceMetaData.

 -Adam