lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (LUCENE-819) NullPointerException in Term.compareTo()
Date Wed, 28 Feb 2007 18:49:56 GMT


Yonik Seeley commented on LUCENE-819:

I really don't see a need to change any code.  People aren't making mistakes constructing
Terms, this just sounds like a buggy analyzer.

Personally I'd rather not even add a check for null in the constructor for Term... it's unnecessary
extra code that precludes one from creating a Term with a null value as an application specific
marker, or a template (for Term.createTerm()).

> Empty string or null would be the same thing from the point of view of our application.
I think the correct place to fix this is your application.
If null and "" are synonymous to you, just fix your application to use "".

If we ever were to explicitly support "null" for termText, it seems like "no value" would
make more sense than "zero length value".  (AFAIK, Lucene supports zero length terms)

> NullPointerException in Term.compareTo()
> ----------------------------------------
>                 Key: LUCENE-819
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>         Environment: JDK 1.4 on MacOS
>            Reporter: Dan Zivkovic
>         Attachments: lucene-819.patch, lucene-819.patch,
>  java.lang.NullPointerException
>  	at org.apache.lucene.index.Term.compareTo(
>  	at org.apache.lucene.index.TermInfosReader.getIndexOffset(
>  	at org.apache.lucene.index.TermInfosReader.get(
>  	at org.apache.lucene.index.SegmentReader.docFreq(
>  	at
>  	at
>  	at$TermWeight.<init>(
>  	at
>  	at$BooleanWeight.<init>(
>  	at$BooleanWeight2.<init>(
>  	at
>  	at
>  	at<init>(
>  	at
>         ...

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:
For additional commands, e-mail:

View raw message