Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 25536 invoked from network); 21 Aug 2009 12:13:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Aug 2009 12:13:18 -0000 Received: (qmail 10578 invoked by uid 500); 21 Aug 2009 12:13:39 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 10516 invoked by uid 500); 21 Aug 2009 12:13:39 -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 10508 invoked by uid 99); 21 Aug 2009 12:13:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 12:13:38 +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 12:13:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E13FB234C1EA for ; Fri, 21 Aug 2009 05:13:14 -0700 (PDT) Message-ID: <1846709495.1250856794921.JavaMail.jira@brutus> Date: Fri, 21 Aug 2009 05:13:14 -0700 (PDT) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Resolved: (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 resolved LUCENE-1835. ----------------------------------- Resolution: Fixed Committed revision: 806523 > 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, 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: > {code} > TermAttribute termAtt = addAttribute(TermAttribute.class); > {code} > The signature to do this is: > {code} > public T addAttribute(Class) > {code} > The attached patch applies the mentioned change to the signature (without generic, only returning Attribute). No other code changes 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