Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 18481 invoked from network); 21 Aug 2009 11:59:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Aug 2009 11:59:15 -0000 Received: (qmail 89403 invoked by uid 500); 21 Aug 2009 11:59:36 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 89317 invoked by uid 500); 21 Aug 2009 11:59: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 89309 invoked by uid 99); 21 Aug 2009 11:59: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 11:59: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 11:59:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C9807234C004 for ; Fri, 21 Aug 2009 04:59:14 -0700 (PDT) Message-ID: <1859651480.1250855954811.JavaMail.jira@brutus> Date: Fri, 21 Aug 2009 04:59:14 -0700 (PDT) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-1825) AttributeSource.getAttribute() should throw better IllegalArgumentException In-Reply-To: <1040997826.1250783654807.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-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-1825: ---------------------------------- Attachment: BaseTokenStreamTestCase.java Here is my idea for testing both apis of TokenStreams. All testcases that should tests both the backwards layer using Token instances and only the new API (this are *all* analyzer tests, TestIndexWriter, highlighter and query parser test and a few more), should subclass this class instead of LuceneTestCase. > AttributeSource.getAttribute() should throw better IllegalArgumentException > --------------------------------------------------------------------------- > > Key: LUCENE-1825 > URL: https://issues.apache.org/jira/browse/LUCENE-1825 > Project: Lucene - Java > Issue Type: Improvement > Components: Analysis > Affects Versions: 2.9 > Reporter: Tim Smith > Assignee: Uwe Schindler > Priority: Minor > Fix For: 2.9 > > Attachments: BaseTokenStreamTestCase.java, LUCENE-1825.patch, LUCENE-1825.patch > > > when seting "use only new API" for TokenStream, i received the following exception: > {code} > [junit] Caused by: java.lang.IllegalArgumentException: This AttributeSource does not have the attribute 'interface org.apache.lucene.analysis.tokenattributes.TermAttribute'. > [junit] at org.apache.lucene.util.AttributeSource.getAttribute(AttributeSource.java:249) > [junit] at org.apache.lucene.index.TermsHashPerField.start(TermsHashPerField.java:252) > [junit] at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:145) > [junit] at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244) > [junit] at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772) > [junit] at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755) > [junit] at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2613) > {code} > However, i can't actually see the culprit that caused this exception > suggest that the IllegalArgumentException include "getClass().getName()" in order to be able to identify which TokenStream implementation actually caused this -- 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