You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Nelson Carpentier (JIRA)" <ji...@apache.org> on 2011/07/19 03:40:57 UTC
[jira] [Created] (LANG-730) EnumSet -> BitVector
EnumSet -> BitVector
--------------------
Key: LANG-730
URL: https://issues.apache.org/jira/browse/LANG-730
Project: Commons Lang
Issue Type: Improvement
Components: lang.*
Affects Versions: 3.0
Reporter: Nelson Carpentier
Priority: Minor
Fix For: 3.0
I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-730) EnumSet -> BitVector
Posted by "Nelson Carpentier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068091#comment-13068091 ]
Nelson Carpentier commented on LANG-730:
----------------------------------------
Also, FYI, I looked at the BitField class for about 5 minutes (Hey, it's busy here at work. ;-) and I can honestly make neither heads nor tails of it... I even looked at the unit tests and they do nothing for my comprehension of what it accomplishes.
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.x
>
> Attachments: EnumUtils_bitVector.txt, EnumUtils_bitVector_take2.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-730) EnumSet -> BitVector
Posted by "Nelson Carpentier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nelson Carpentier updated LANG-730:
-----------------------------------
Attachment: EnumUtils_bitVector.txt
This is my proposed change, including the unit tests! ;-)
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.0
>
> Attachments: EnumUtils_bitVector.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (LANG-730) EnumSet -> BitVector
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell closed LANG-730.
------------------------------
Resolution: Fixed
Fix Version/s: (was: 3.x)
3.0.1
Patch applied in r1149058 - thanks Nelson :)
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.0.1
>
> Attachments: EnumUtils_bitVector.txt, EnumUtils_bitVector_take2.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-730) EnumSet -> BitVector
Posted by "Nelson Carpentier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067559#comment-13067559 ]
Nelson Carpentier commented on LANG-730:
----------------------------------------
1) The impetus comes directly from a real-life use case at my work. We want to store a bit vector in the database, rather than a set of entities for each enum value. I chose long to maximize the effective size of an enum that could be represented (64 for long, as opposed to 32 for int.)
2) Actually, I hadn't really seen the BitField class before you mentioned it. I'll ruminate on it...
3) I agree. (Tomorrow) I can submit a patch with the suggested exception included.
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.x
>
> Attachments: EnumUtils_bitVector.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-730) EnumSet -> BitVector
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067484#comment-13067484 ]
Henri Yandell commented on LANG-730:
------------------------------------
A few questions:
* What's the use case for this method? Why store in a long bit vector?
* Have you looked at the BitField class?
* Perhaps throw an exception when there are more than 64 values in the Enum?
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.x
>
> Attachments: EnumUtils_bitVector.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-730) EnumSet -> BitVector
Posted by "Nelson Carpentier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nelson Carpentier updated LANG-730:
-----------------------------------
Attachment: EnumUtils_bitVector_take2.txt
Here is my revised submission, now including the policy of throwing an exception if the enum being used is too long to be stored in a 64-bit long value.
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.x
>
> Attachments: EnumUtils_bitVector.txt, EnumUtils_bitVector_take2.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-730) EnumSet -> BitVector
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068157#comment-13068157 ]
Henri Yandell commented on LANG-730:
------------------------------------
Damn - you too? It's been in there for eons and I've always had a suspicion that no one uses it :)
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.x
>
> Attachments: EnumUtils_bitVector.txt, EnumUtils_bitVector_take2.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-730) EnumSet -> BitVector
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell updated LANG-730:
-------------------------------
Fix Version/s: (was: 3.0)
3.x
> EnumSet -> BitVector
> --------------------
>
> Key: LANG-730
> URL: https://issues.apache.org/jira/browse/LANG-730
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.0
> Reporter: Nelson Carpentier
> Priority: Minor
> Fix For: 3.x
>
> Attachments: EnumUtils_bitVector.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I have attached a proposed change for two methods that will convert an EnumSet into a (long) bit vector, and the inverse method that will convert a (long) bit vector.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira