You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael Busch (JIRA)" <ji...@apache.org> on 2009/08/21 18:14:14 UTC
[jira] Assigned: (LUCENE-1832) minor/nitpick TermInfoReader bug ?
[ https://issues.apache.org/jira/browse/LUCENE-1832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Busch reassigned LUCENE-1832:
-------------------------------------
Assignee: Michael Busch
> minor/nitpick TermInfoReader bug ?
> ----------------------------------
>
> Key: LUCENE-1832
> URL: https://issues.apache.org/jira/browse/LUCENE-1832
> Project: Lucene - Java
> Issue Type: Bug
> Reporter: Mark Miller
> Assignee: Michael Busch
> Priority: Trivial
> Fix For: 2.9
>
>
> Some code flagged by a bytecode static analyzer - I guess a nitpick, but we should just drop the null check in the if? If its null it will fall to the below code and then throw a NullPointer exception anyway. Keeping the nullpointer check implies we expect its possible - but then we don't handle it correctly.
> {code}
> /** Returns the nth term in the set. */
> final Term get(int position) throws IOException {
> if (size == 0) return null;
> SegmentTermEnum enumerator = getThreadResources().termEnum;
> if (enumerator != null && enumerator.term() != null &&
> position >= enumerator.position &&
> position < (enumerator.position + totalIndexInterval))
> return scanEnum(enumerator, position); // can avoid seek
> seekEnum(enumerator, position/totalIndexInterval); // must seek
> return scanEnum(enumerator, position);
> }
> {code}
--
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