uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörn Kottmann (JIRA) <uima-...@incubator.apache.org>
Subject [jira] Reopened: (UIMA-1489) Generify FSIndexRepository
Date Mon, 24 Aug 2009 07:32:59 GMT

     [ https://issues.apache.org/jira/browse/UIMA-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jörn Kottmann reopened UIMA-1489:
---------------------------------


Marshall Schor:

"After generification of iterators, this line in Lucas doesn't compile:

In src/main/java, org.apache.uima.lucas.indexer.analysis,
the class: AnnotationTokenStream
line 340:

    annotationIterator =
Iterators.filter(jCas.getAnnotationIndex(annotationType).iterator(),
            new NotNullPredicate<Annotation>());

gives message:

The method filter(Iterator<T>, Predicate<? super T>) in the type
Iterators is not applicable for the arguments (FSIterator<AnnotationFS>,
AnnotationTokenStream.NotNullPredicate<Annotation>)


I observe that if I change
            new NotNullPredicate<Annotation>());  // to
            new NotNullPredicate<AnnotationFS>());

that the error goes away, but is replaced with another error:

Type mismatch: cannot convert from Iterator<AnnotationFS> to
Iterator<Annotation>

I think the original form assigns to T the value AnnotationFS.  This
makes the assignment of the predicate NotNullPredicate<X> have the type
X be a super type of AnnotationFS.  But Annotation is a subtype, not a
supertype.  So it fails.

I think the JCas version of
getAnnotationIndex(annotationType).iterator() should end up returning an
iterator over Annotation, not AnnotationFS.  This would fix this, I think."

> Generify FSIndexRepository
> --------------------------
>
>                 Key: UIMA-1489
>                 URL: https://issues.apache.org/jira/browse/UIMA-1489
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Core Java Framework
>            Reporter: Jörn Kottmann
>            Assignee: Jörn Kottmann
>             Fix For: 2.3
>
>
> Add generics to the FSIndexRepository interface.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message