You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (Created) (JIRA)" <ji...@apache.org> on 2011/11/24 15:20:39 UTC

[jira] [Created] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

minimize bytesref to be a ref to a byte[]
-----------------------------------------

                 Key: LUCENE-3590
                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
             Project: Lucene - Java
          Issue Type: Bug
            Reporter: Robert Muir
            Priority: Blocker




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157138#comment-13157138 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

Uwe: i totally disagree, I'm sorry.

Instead all these stupid ctors and deep-copying should be removed, and this class should be simplified to be a simple Ref API.

Then @lucene.internal should be removed from the class, because its totally broken to call something "internal" but pass it around in every API, e.g. its required to use the terms/postings apis.

Thats why I marked this issue blocker.

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Yonik Seeley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156746#comment-13156746 ] 

Yonik Seeley commented on LUCENE-3590:
--------------------------------------

bq. BytesRef copy = BytesRef.copyOf(original);

+1

While we're at it, can we get rid of the final that prevents subclassing?
Mainly I want to be able to change how hashCode works (either the hash itself, or be able to cache like String does).

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

          Description: 
Setting this as blocker for 4.0, as this class is used in every API there.

Currently this API is a little of a everything, sometimes its like a stringbuffer, it
does numeric conversions, all kinds of stuff.

We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.
    Affects Version/s: 4.0
    
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Yonik Seeley (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156782#comment-13156782 ] 

Yonik Seeley commented on LUCENE-3590:
--------------------------------------

bq. If so then I'd remove copying entirely then and leave a covariant ByteRef clone() (as in: clone the reference only).

Make clone() a shallow copy?  I don't think we should support shallow copying at all - it's normally not going to be what a user really wants.  One can still do a shallow copy by directly setting the members.

Is there even any code in Lucene or Solr that creates a shallow copy?
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157143#comment-13157143 ] 

Uwe Schindler commented on LUCENE-3590:
---------------------------------------

You should also fix this in 3.x as BytesRef appeared there, too (I have no idea why it is there, but it is). The problem is we already released but as @lucene.internal, so we can still change.

About your disagreement, I am fine with that, but then please remove *all* deep copying, also the new static methods :-) On the other hand not supplying at least one simple deepCopy function makes it hard to use e.g. in MTQ when you put away terms.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156728#comment-13156728 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

First step is to remove the ctor BytesRef(BytesRef other), which is not intuitive
since it looks like a copy constructor, but doesn't copy the ref, it creates 
a brand new byte array pointing to a complete copy of 'other's bytes, and then
creates a pointer to that.

I think its not obvious from the code either when i see new BytesRef(otherBytesRef).
Instead we should do:

{copy}
BytesRef copy = new BytesRef();
copy.copyBytes(otherBytesRef);
{copy}

This makes it totally clear exactly what is going on. I'll work up a patch
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156802#comment-13156802 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

{quote}
All I know is this class is abused because there was/is a need for bits and pieces that ByteBuffers don't fully address – you cannot change the underlying array (must rewrap) and you cannot fiddle with hash code, for example. I like access to internals sometimes.
{quote}

Right, the abuse exists... we have to accept this is just the case and deal with it appropriately, step 1 being to make sure the 'abuse use case' and the 'ordinary use case' can be clearly separated. But having a broken API that is sometimes shallow, sometimes deep, trying to support both use cases in whichever way we feel is 'natural' is unacceptable.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157924#comment-13157924 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

BytesRef.copyBytes and equivalents are also heavily broken if offset != 0, and the javadoc is non-intuitive:

{noformat}
   * NOTE: this method resets the offset to 0 and resizes the reference array
   * if needed.
{noformat}

This is ambiguous, its not obvious that it will reset offset to 0 *always* and then copy, resizing if needed. 

This is in comparison to e.g. append(), which is less broken because it at least tries to append to the 
existing offset, and if it needs to resize it resets offset to 0, but thats fine as its a new byte[].

The former will overwrite unrelated data if bytesrefs are pointing to different slices of the same array.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156868#comment-13156868 ] 

Uwe Schindler commented on LUCENE-3590:
---------------------------------------

In my opinion, those classes should have no ctors at all (and they don't need as they are final - so make the ctor private). I would make all methods creating new instances of XxxRefs static and named with what they do: BytesRef.newEmptyInstance(), BytesRef.deepCopyOf(), BytesRef.newInstanceFromRef(), BytesRef.copyOf(otherType),...
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156773#comment-13156773 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

But thats my whole problem with BytesRef, its not supposed to be a StringBuilder, or an array (which are holder classes that you manipulate).

Its a ref to a byte[]... thus the name. If i have a reference or a pointer to something, and i copy that reference, its unexpected to copy what it refers to as well.

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590_with_clone.patch

updated patch, changing clone() to be shallow as well.

if consumers want a deep copy they can just call deepCopy explicitly.

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156734#comment-13156734 ] 

Dawid Weiss commented on LUCENE-3590:
-------------------------------------

How about:
{code}
BytesRef copy = BytesRef.copyOf(original);
{code}
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156766#comment-13156766 ] 

Dawid Weiss commented on LUCENE-3590:
-------------------------------------

Maybe, although this clearly corresponds with Arrays.copyOf(). If you make the contract clear in JavaDocs then I see no problem. People will always make mistakes, no matter how explicitly you name methods and deepCopyOf sounds verbose to me (even if only by 4 keystrokes).
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590_equals_init.patch

patch fixes broken equals() methods and broken ctors in IntsRef and CharsRef.

IntsRef never set ints = EMPTY_INTS in its no-arg ctor, so ints would just be null.

IntsRef and CharsRef never handled the case that 'other == null' in equals().

CharsRef had other brokenness in its equals() method where it would return equals = true sometimes to other CharSequences that are not actually CharsRefs.

This breaks the contract of equals because its not symmetric, there is no guarantee of this in charsequence.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156792#comment-13156792 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

I don't think we should be supporting deep copying at all, thats why i opened this issue.

This class is *NOT* a stringbuilder class!


                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590_offsets.patch

here's a patch fixing the copyBytes() issue, but copyChars and in general unicodeutil methods are still broken in the same way.

I also clarified some javadocs and other cleanups, trying to get this thing to the point we can remove @experimental (not there yet).

Need to fix IntsRef and CharsRef in the same way.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_offsets.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156761#comment-13156761 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

{quote}
While we're at it, can we get rid of the final that prevents subclassing?
Mainly I want to be able to change how hashCode works (either the hash itself, or be able to cache like String does).
{quote}

I think if we clean up the API this would be a safe thing to do. Maybe instead of
the whole class being final, only a few methods really need to be final (or maybe none at all).

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590_deprecate_comparators.patch

i want to deprecate the utf8InUtf16Order and utf16InUtf8Order comparators. maybe these will get refactored out of bytesref itself and into better places like preflex codec

especially since the one in bytesref has some funkiness particular to the surrogates dance implementation (it reserves some unassigned bytes).
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157146#comment-13157146 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

Don't worry, i will fix in 3.x too. Its good that its internal for now, because the api needs cleanup.

i would like to remove deep copying, but again, as i said at least 2 times before here, the first step is to clearly mark what is deep copying and what is normal use.

This way the uses are not intermixed confusingly in the source code. This makes it at least possible to fix.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590_copyCtor.patch

Attached is a patch for FoosRef, where Foo = { Byte, Int, Char } that removes FoosRef(FoosRef other), instead adding FoosRef.deepCopyOf(FoosRef other).

Also renames FoosRef.copy(FoosRefOther) to FoosRef.copyFoos(FoosRefOther) to make it more obvious that its copying the underlying data in, not just the reference.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156780#comment-13156780 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

well here i'm just trying to prevent BytesRef/IntsRef/CharsRef from being crazy classes where its confusing what the methods do... oh wait, its too late.

I think the key issue is sometimes they are used like array/stringbuilder, but other times they are used like bytebuffer?

I'm not going to push the issue so far to say we should remove BytesRef entirely and just use ByteBuffer but i also don't think that should be totally out of the question?

For now, since we support being a ByteBuffer and also a ByteArrayBuilder, i want to first just distinguish the deep copying from the shallow copying before trying to unbreak stuff. 
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156760#comment-13156760 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

{quote}
BytesRef copy = BytesRef.copyOf(original);
{quote}

I still think this is slightly confusing, because in my opinion this method should do:

{noformat}
BytesRef copy = new BytesRef();
copy.bytes = other.bytes;
copy.length = other.length;
copy.offset = other.offset;
{noformat}

I think we should clearly separate these 'deep copies', e.g. deepCopyOf would be better.

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156803#comment-13156803 ] 

Robert Muir commented on LUCENE-3590:
-------------------------------------

{quote}
Make clone() a shallow copy? I don't think we should support shallow copying at all - it's normally not going to be what a user really wants. One can still do a shallow copy by directly setting the members.
{quote}

No, abusers of the reference API can create a deep copy directly by setting the members. The onus is on abusers to have these extra lines of code, not for correct users of the API.

{quote}
Is there even any code in Lucene or Solr that creates a shallow copy?
{quote}

Yes, and its uglier because of the problems above.

                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590_equals_init.patch

updated patch with instanceof checks in the equals, and removing the broken asserts in TestUnicodeUtil that called equals() on charsequence (which is undefined by definition)
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156794#comment-13156794 ] 

Dawid Weiss commented on LUCENE-3590:
-------------------------------------

bq.  it's normally not going to be what a user really wants

You're right, this would be even more confusing.

All I know is this class is abused because there was/is a need for bits and pieces that ByteBuffers don't fully address -- you cannot change the underlying array (must rewrap) and you cannot fiddle with hash code, for example. I like access to internals sometimes.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-3590:
--------------------------------

    Attachment: LUCENE-3590.patch

Here's a patch with tests to improve most of the remaining issues:
* bugs in copy/append when offset !=0 (AIOOBE)
* off-by-one in charsequence.subsequence, this just happened to be previously untested.
* obey charsequence api completely (including exceptions stated in the spec)
* assert offset == 0 in grow(), as it doesnt make sense otherwise.

I'd like to backport these bugfixes to 3.6.1 as well.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>         Attachments: LUCENE-3590.patch, LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_offsets.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156775#comment-13156775 ] 

Dawid Weiss commented on LUCENE-3590:
-------------------------------------

If so then I'd remove copying entirely then and leave a covariant ByteRef clone() (as in: clone the reference only). Although I also admit I did abuse BytesRef as a byte manipulation buffer slightly, my bad.
                
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Resolved] (LUCENE-3590) minimize bytesref to be a ref to a byte[]

Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir resolved LUCENE-3590.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 3.6.1
                   4.0
    
> minimize bytesref to be a ref to a byte[]
> -----------------------------------------
>
>                 Key: LUCENE-3590
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3590
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Priority: Blocker
>             Fix For: 4.0, 3.6.1
>
>         Attachments: LUCENE-3590.patch, LUCENE-3590_copyCtor.patch, LUCENE-3590_deprecate_comparators.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_equals_init.patch, LUCENE-3590_offsets.patch, LUCENE-3590_with_clone.patch
>
>
> Setting this as blocker for 4.0, as this class is used in every API there.
> Currently this API is a little of a everything, sometimes its like a stringbuffer, it
> does numeric conversions, all kinds of stuff.
> We need this to be a ref to a byte[], nothing else. This other stuff can go somewhere else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org