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 2904B10B05 for ; Mon, 31 Mar 2014 14:00:44 +0000 (UTC) Received: (qmail 3976 invoked by uid 500); 31 Mar 2014 14:00:41 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 3554 invoked by uid 500); 31 Mar 2014 14:00:40 -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 3546 invoked by uid 99); 31 Mar 2014 14:00:40 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2014 14:00:40 +0000 Date: Mon, 31 Mar 2014 14:00:40 +0000 (UTC) From: "Uwe Schindler (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (LUCENE-5562) LuceneSuggester does not work on Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-5562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955184#comment-13955184 ] Uwe Schindler edited comment on LUCENE-5562 at 3/31/14 2:00 PM: ---------------------------------------------------------------- This is not a bug in Lucene. The Java Closeable interface is idempotent, as its documentation states in [http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html#close()]: bq. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. If the implementation on Android does not implement this correctly, it is not a problem of Lucene. Just to check if there is no other problem: Can you post the exact stack trace of the Exception on Android? P.S.: Please note: Android is not Java compatible, so Lucene does not gurantee that it work correctly with Android. We also don't test on Android. Lucene 4.8 will require Java 7, so it is unlikely that it will work on Android anymore. was (Author: thetaphi): This is not a bug in Lucene. The Java Closeable interface states in [http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html#close()]: bq. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. If the implementation on Android does not implement this correctly, it is not a problem of Lucene. > LuceneSuggester does not work on Android > ---------------------------------------- > > Key: LUCENE-5562 > URL: https://issues.apache.org/jira/browse/LUCENE-5562 > Project: Lucene - Core > Issue Type: Bug > Affects Versions: 4.7 > Environment: Android 4.4.2 > Reporter: Giovanni Cuccu > Priority: Minor > Attachments: AnalyzingSuggester.java, Sort.java > > > I'm developing an application on android and I'm using lucene for indexing and searching. When I try to use AnalyzingSuggester (even the Fuzzy version) I got an Exception the BufferedOutputStream is already closed. > I tracked the problem and it seems that in > org.apache.lucene.search.suggest.Sort > and in org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester > the outputstream is closed twice hence the exception on android. > The same code on windows runs without a problem. > It seems that the Android jvm does some additional checks. I attach two patche files, the classes close the output stream once. (check for writerClosed in the code to see what I did) -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org