Return-Path: X-Original-To: apmail-uima-user-archive@www.apache.org Delivered-To: apmail-uima-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0230D17A51 for ; Sat, 1 Aug 2015 22:10:04 +0000 (UTC) Received: (qmail 19449 invoked by uid 500); 1 Aug 2015 22:10:03 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 19409 invoked by uid 500); 1 Aug 2015 22:10:03 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 19394 invoked by uid 99); 1 Aug 2015 22:10:03 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Aug 2015 22:10:03 +0000 Received: from [10.0.1.12] (ip-178-203-23-159.hsi10.unitymediagroup.de [178.203.23.159]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 738C01A012E; Sat, 1 Aug 2015 22:10:02 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Question on JCasUtil's selectCovered(...) From: Richard Eckart de Castilho In-Reply-To: <04AE2318-23A0-4BB0-966E-7E693751884B@gmx.net> Date: Sun, 2 Aug 2015 00:09:57 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3068CEC8-F7B4-4745-B46F-CE96CDB6EA9A@apache.org> References: <86AA3201-17E2-4BE3-B403-D022166ABF70@apache.org> <04AE2318-23A0-4BB0-966E-7E693751884B@gmx.net> To: user@uima.apache.org X-Mailer: Apple Mail (2.1878.6) On 01.08.2015, at 23:06, Martin Wunderlich wrote: > Yes, I think you might be right, Richard, and that the problem is with = the use of Generics.=20 >=20 > This would be the concrete FE class:=20 >=20 > public class StartingPositionOfPremiseUFE extends = StartingPositionOfPropositionUFE { >=20 > public static String FN_STARTINGPOSITIONOFPROPOSITION =3D = "StartingPositionOfPremise"; >=20 > @Override > List getPropositions(JCas jcas, int start, int end) { > return JCasUtil.selectCovered(jcas, Premise.class, = start, end); > } > } I don't see why you would define here on the subclass. You = would either define a type variable on the subclass or bind a type = variable on the superclass, so: public class StartingPositionOfPremiseUFE extends = StartingPositionOfPropositionUFE > The call to selectCovered(=85) gives the described error. The method = getPropositions(=85) is defined as abstract in the super-class, which = looks like this:=20 >=20 >=20 > abstract public class StartingPositionOfPropositionUFE extends FeatureExtractorResource_ImplBase implements = ClassificationUnitFeatureExtractor{ > ... > public List extract(JCas jcas, TextClassificationUnit = classificationUnit) { > List props =3D (List) getPropositions(jcas, start, end); Instead of , I think you should be using . > if( props !=3D null && props.size() > 0) { > Proposition firstProposition =3D props.get(0); > startingPos =3D firstProposition.getBegin(); > } >=20 > List featList =3D new ArrayList(); > featList.add(new Feature(FN_STARTINGPOSITIONOFPROPOSITION, = startingPos)); >=20 > return featList; > } >=20 > abstract List getPropositions(JCas jcas, int start, int end); Again, instead of I think you should be using . > } >=20 > I=92ve removed the irrelevant bits to make it more concise.=20 I still don't see why you would get that error though.=20 Are you sure that "Premise.class" resolves to the right class here and = not to another class which accidentally has the same name? -- Richard=