lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LUCENE-5562) LuceneSuggester does not work on Android
Date Mon, 31 Mar 2014 14:00:40 GMT

    [ 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


Mime
View raw message