lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3589) BytesRef copy short missed the length setting
Date Thu, 24 Nov 2011 13:56:39 GMT


Robert Muir commented on LUCENE-3589:

We really cannot just let BytesRef pile up into some mega API.
When we add things to the public API, we have to eventually support this stuff in future releases.

If we are hell-bent to keep the api, we must fix the bogosities about it, otherwise its unmaintainable,
and should be removed:
* the fact it is copy(short) is wrong, if i delete the copy(short) and copy(int) methods everything
compiles as normal, leading me to believe they are unused. this is because anything using
thse gets promoted to copy(long). So the methods must be renamed to copyShort, copyInt, etc
to prevent these types of mistakes.
* why do we reset the offset to 0?

In general i'm just wondering why this is needed in bytesref itself... do people know about
ByteArrayDataInput and ByteArrayDataOutput?

Separately, I'm still going to remove all unused bytesref methods at the current moment...
i'll leave this one be though.

> BytesRef copy short missed the length setting
> ---------------------------------------------
>                 Key: LUCENE-3589
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/other
>    Affects Versions: 4.0
>         Environment: linux 64bit jdk 6
>            Reporter: peter chang
>            Assignee: Robert Muir
>              Labels: patch
>             Fix For: 4.0
>         Attachments: BytesRef_bug_lucene3589.patch
> when storing a short type integer to BytesRef, BytesRef missed the length setting. then
it will cause the storage size is ZERO if no continuous options on this BytesRef

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message