lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3259) need to clarify/change D&Penum api for hasPayload/getPayload
Date Thu, 30 Jun 2011 03:03:31 GMT


Robert Muir commented on LUCENE-3259:

If D&PEnum says getPayload() returns null if there is no payload, then why do you say
it's not defined? I don't mind if we change the contract to hasPayload() first, then getPayload().

Let me rephrase what I mean: currently if you call getPayload(), and there is no payload,
it does not actually always return null :) So its "defined" but does not work as defined.

The only safe thing at the moment to do if you are not sure if there is a payload, is to check
hasPayload() first, and if this returns false, do not mess with getPayload().

If you are sure there is a payload, you don't need to do anything with hasPayload().

> need to clarify/change D&Penum api for hasPayload/getPayload
> ------------------------------------------------------------
>                 Key: LUCENE-3259
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Robert Muir
> We encountered this bug while integrating the faceting module:
> * D&PEnum says getPayload() will return null if there is no payload.
> * however, in some cases this is not what happens.
> * things do work (with no exceptions), if you always check hasPayload() first.
> The easiest fix could be to correct the javadocs, and say that you should always check
hasPayload() first... otherwise getPayload() is not defined.

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message