Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB1059C39 for ; Fri, 30 Mar 2012 21:32:00 +0000 (UTC) Received: (qmail 89218 invoked by uid 500); 30 Mar 2012 21:31:59 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 89138 invoked by uid 500); 30 Mar 2012 21:31:59 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 89131 invoked by uid 99); 30 Mar 2012 21:31:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 21:31:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 21:31:48 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2DAEF34FF5E for ; Fri, 30 Mar 2012 21:31:27 +0000 (UTC) Date: Fri, 30 Mar 2012 21:31:27 +0000 (UTC) From: "SHIN HWEI TAN (Created) (JIRA)" To: dev@lucene.apache.org Message-ID: <561260135.40066.1333143087188.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (LUCENE-3939) ClassCastException thrown in the map(String,int,TermVectorOffsetInfo[],int[]) method in org.apache.lucene.index.SortedTermVectorMapper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 ClassCastException thrown in the map(String,int,TermVectorOffsetInfo[],int[]) method in org.apache.lucene.index.SortedTermVectorMapper -------------------------------------------------------------------------------------------------------------------------------------- Key: LUCENE-3939 URL: https://issues.apache.org/jira/browse/LUCENE-3939 Project: Lucene - Java Issue Type: Bug Components: core/index Affects Versions: 3.5, 3.4, 3.1, 3.0.2 Reporter: SHIN HWEI TAN The method "map" in the "SortedTermVectorMapper" class does not check the parameter "term" for the valid values. It throws ClassCastException when called with a invalid string for the parameter "term" (i.e., "var3.map("*", (-1), null, null)"). The exception thrown is due to an explict cast(i.e., casting the return value of termToTVE.get(term) to type "TermVectorEntry"). Suggested Fixes: Replace the beginning of the method body for the class "SortedTermVectorMapper" by changing it like this: public void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions) { if(termToTVE.get(term) instanceof TermVectorEntry){ TermVectorEntry entry = (TermVectorEntry) termToTVE.get(term); ... } } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org