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 D839E181B3 for ; Sun, 2 Aug 2015 07:34:00 +0000 (UTC) Received: (qmail 35473 invoked by uid 500); 2 Aug 2015 07:34:00 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 35437 invoked by uid 500); 2 Aug 2015 07:34:00 -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 35413 invoked by uid 99); 2 Aug 2015 07:34:00 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Aug 2015 07:34:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 92C9E1979D8 for ; Sun, 2 Aug 2015 07:33:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.119 X-Spam-Level: X-Spam-Status: No, score=-1.119 tagged_above=-999 required=6.31 tests=[RCVD_IN_MSPIKE_H2=-1.108, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id EN_jQGq3_3ba for ; Sun, 2 Aug 2015 07:33:58 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 0FAEB43CCD for ; Sun, 2 Aug 2015 07:33:58 +0000 (UTC) Received: from [10.176.49.164] ([138.246.2.61]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MJmcS-1ZKhJa39Wu-001B5T for ; Sun, 02 Aug 2015 09:33:50 +0200 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: Question on JCasUtil's selectCovered(...) From: Martin Wunderlich In-Reply-To: <3068CEC8-F7B4-4745-B46F-CE96CDB6EA9A@apache.org> Date: Sun, 2 Aug 2015 09:33:48 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <5F69701A-A267-41D3-8C7E-F9074201E747@gmx.net> References: <86AA3201-17E2-4BE3-B403-D022166ABF70@apache.org> <04AE2318-23A0-4BB0-966E-7E693751884B@gmx.net> <3068CEC8-F7B4-4745-B46F-CE96CDB6EA9A@apache.org> To: user@uima.apache.org X-Mailer: Apple Mail (2.2102) X-Provags-ID: V03:K0:spCOdbrLXTFshp+hH4WCEgYx8AsPEMUZKDRMuoxcG0Zi2Ao9aqc 9v7fDSiRbWLp+Gam7zm31P/hi1P8vS5iyAvjHIrB6e4vsrPU5hWME9Lyzs2Ziy/GMdQloZi aThhthwSvVoqLzUj2U5u2OOToaKYGl4mBt2UMhUVeD3exlMVP1zUV5yy66+YpUd4vfSG7Zc tPkGB/+Cvw8KAmdsA8Tgg== X-UI-Out-Filterresults: notjunk:1;V01:K0:YkC3NWz7p3o=:4f0iocSfAowprLU4XOW0Lv iZbBVvVp3JX7z5rs6DtLDrCF5Zmb7Qq/v5U2ISr2v+iNWs39Zhp6emARKl+1Qls060VFJbYnU md//8vsim4EQmUfLW7dgzH8UyIMfanloPdtM/xpY8msnSP5+maasXXRtXpHh1LySRj0R5XdRC ZDs8g3lQ5hUYrn7iphK3Rn/90WRJcS+dW3ouWJ/ZSqHTVUJ7tIk5PNlCbGyHSgAHx/y3Iy4VT fzJEdf0D2v4bsqnkovZZNpvah+sAmTMQzAem/uMLvjgo6j+Y8tnvZK9tvHLkgBv5kwCDJzIW6 LxzysFwKv/KNIT357qrV69s4tl53CmdRr576/qFZK+vV9lD9pAWxxUqEPuTvHSbBCbK1XFGsm InLBgFdQ4eJ0UNzrOjPIB82tniDZWY3sAu/cuvIU0+PpCJnodE2C/H95fwkH0ASkhwUs6EOyF aN5YtrF0ugrlNrgKAJGcdCnPmqUq49neyfuuqBttzdICDdxaFdojW2GhPcQpAWvKECPdzqHKG PKIGyPv0cxKF97Smwu10r4X+LbMl0m1bJyBNTQJ1RpgJF1rzZlmI2IztJNQMvahUQJEXrmeq4 JqIr358Lwrz1HyvlaERdHfbkRVGU5ChMKlif7RQO+8Sca8upzQmGgTsU2GSwTwhjMwa/tbjYC SvlCX+4mMmq9Ecn4ill5S5tZGUvf19Kb2kMvc+VfUnh3QPmohxx8d7N9TjpOpTs0/lRg= Thanks a lot, Richard. It is working fine now after making the changes = suggested by you. Looks like I need to read up on Generics a bit... Cheers,=20 Martin =20 > Am 02.08.2015 um 00:09 schrieb Richard Eckart de Castilho = : >=20 >=20 > On 01.08.2015, at 23:06, Martin Wunderlich wrote: >=20 >> 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); >> } >> } >=20 > 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: >=20 > public class StartingPositionOfPremiseUFE extends = StartingPositionOfPropositionUFE >=20 >> 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); >=20 > Instead of , I think you should be using . >=20 >> 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); >=20 > Again, instead of I think you should be using . >=20 >> } >>=20 >> I=92ve removed the irrelevant bits to make it more concise.=20 >=20 > I still don't see why you would get that error though.=20 >=20 > Are you sure that "Premise.class" resolves to the right class here and = not to another class which accidentally has the same name? >=20 > -- Richard