On 4/20/11 1:13 PM, Thilo Götz wrote:
On 4/20/2011 11:57, Jörn Kottmann wrote:
> Hello all,
>
> the Cas Editor needs to create feataure structures. To detect
> that a FS is an array Type.isArray is called. If it returns true
> an if-else-if statement is used to create the array.
>
> For some reason this code fails for a certain type, but I do not know which,
> would be nice if you could have a look here:
>
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/editview/EditViewPage.java?view=markup
>
>
> The if-else-if-else statement is at line 387 to 408. For one type the else is
> executed and
> logs the error message.
Maybe this has to do with array's type parameter? I think it's part
of the array's type name, like ArrayFS<AnnotationFS>, or something like
that.
For me it looks like it is not possible to write ArrayFS<AnnotationFS>,
because the ArrayFS interface
does not define a type parameter, right?
For me it looks like that Type.isArray returns true for a type which has
a different
name then the array type names in this list. The isArray method seems to use
some low-level methods to figure out if a type is an array type or not.
Is it possible to define a new array type?
Jörn