Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 26856 invoked from network); 21 Aug 2009 08:38:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Aug 2009 08:38:15 -0000 Received: (qmail 13351 invoked by uid 500); 21 Aug 2009 08:38:36 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 13283 invoked by uid 500); 21 Aug 2009 08:38:36 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 13275 invoked by uid 99); 21 Aug 2009 08:38:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 08:38:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 08:38:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D6A79234C044 for ; Fri, 21 Aug 2009 01:38:14 -0700 (PDT) Message-ID: <846094967.1250843894878.JavaMail.jira@brutus> Date: Fri, 21 Aug 2009 01:38:14 -0700 (PDT) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-1835) Signature changes in AttributeSource for better Generics support of AddAttribute/getAttribute In-Reply-To: <2115775466.1250843894784.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-1835: ---------------------------------- Attachment: LUCENE-1835.patch > Signature changes in AttributeSource for better Generics support of AddAttribute/getAttribute > --------------------------------------------------------------------------------------------- > > Key: LUCENE-1835 > URL: https://issues.apache.org/jira/browse/LUCENE-1835 > Project: Lucene - Java > Issue Type: Task > Components: Analysis > Affects Versions: 2.9 > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Fix For: 2.9 > > Attachments: LUCENE-1835.patch > > > The last update of Attribute API using AttributeImpl as implementation oif Attributes changed the API a little bit. This change leads to the fact, that in Java 1.5 using generics we are no longer able to add Attributes without casting. addAttribute and getAttribute should return the Attribute interface because the implementation of the attribute is not interesting to the caller. By that in 1.5 using generics, one could add a TermAttribute without casting using: > > TermAttribute termAtt = addAttribute(TermAttribute.class); > > The signature to do this is: > > public K addAttribute(Class) > > The attached patch applies the mentioned change to the signature (without generic, only returning Attribute). No other code cahnges are needed, as current code always casts the result to the requested interface. I also added the 1.5 method signature for all these methods to the javadocs. > All tests pass. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org