You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Grant Ingersoll (JIRA)" <ji...@apache.org> on 2008/01/18 22:18:34 UTC

[jira] Issue Comment Edited: (LUCENE-1140) NPE in StopFilter caused by StandardAnalyzer(boolean replaceInvalidAcronym) constructor

    [ https://issues.apache.org/jira/browse/LUCENE-1140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560546#action_12560546 ] 

gsingers edited comment on LUCENE-1140 at 1/18/08 1:17 PM:
------------------------------------------------------------------

Try this one.  I will commit to trunk and 2.3 branch shortly. (and I'll fix the CHANGES offset issue to be right, despite what is in the patch.)

      was (Author: gsingers):
    Try this one.  I will commit to trunk and 2.3 branch shortly.
  
> NPE in StopFilter caused by StandardAnalyzer(boolean replaceInvalidAcronym) constructor
> ---------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1140
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1140
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis
>    Affects Versions: 2.3
>            Reporter: Alexei Dets
>            Assignee: Grant Ingersoll
>            Priority: Blocker
>             Fix For: 2.3
>
>         Attachments: LUCENE-1140.patch
>
>
> I think that I found a problem with the new code (https://issues.apache.org/jira/browse/LUCENE-1068).
> Usage of the new constructor StandardAnalyzer(boolean replaceInvalidAcronym) causes NPE in
> StopFilter:
> java.lang.NullPointerException
>         at org.apache.lucene.analysis.StopFilter.<init>(StopFilter.java:74)
>         at org.apache.lucene.analysis.StopFilter.<init>(StopFilter.java:86)
>         at
> org.apache.lucene.analysis.standard.StandardAnalyzer.tokenStream(StandardAnalyzer.java:151)
>         at
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:452)
>         at
> org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1133)
>         at
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1020)
>         at
> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:948)
>         at
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1024)
>         at
> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:948)
>         at
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:937)
>         at
> org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:147)
> The reason is that new constructor forgets to initialize the stopSet field:
>   public StandardAnalyzer(boolean replaceInvalidAcronym) {
>     this.replaceInvalidAcronym = replaceInvalidAcronym;
>   }
> I guess this should be changed to something like this:
>   public StandardAnalyzer(boolean replaceInvalidAcronym) {
>     this(STOP_WORDS);
>     this.replaceInvalidAcronym = replaceInvalidAcronym;
>   }
> The bug is present in RC3. Fix is one line, it'll be great to have it in 2.3
> release.

-- 
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