You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Yaniv Kunda (JIRA)" <ji...@apache.org> on 2012/06/17 11:28:45 UTC
[jira] [Created] (IO-337) ByteOrderMark can be refactored as an
enum
Yaniv Kunda created IO-337:
------------------------------
Summary: ByteOrderMark can be refactored as an enum
Key: IO-337
URL: https://issues.apache.org/jira/browse/IO-337
Project: Commons IO
Issue Type: New Feature
Reporter: Yaniv Kunda
Priority: Minor
Attachments: ByteOrderMark-enum.patch
ByteOrderMark is used primarily for encapsulating the data regarding to Unicode BOMs. Since those are fixed, it would make sense to make it an enum, instead of a public class.
I have attached a patch that only covers ByteOrderMark itself, including an additional getCharset() utility method, and toString() simplification.
This patch does not cover:
1) Its incorrect use (per its perceived purpose) in XmlStreamReader.XML_GUESS_BYTES
2) The now-unnecessary tests
--
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
Re: [jira] [Commented] (IO-337) ByteOrderMark can be refactored as
an enum
Posted by Gary Gregory <GG...@rocketsoftware.com>.
An Enum sounds good but it has to work with all of the current code. We can then deprecate the current one. What would be the name of this Enum? Maybe this is a change we should wait to introduce if and when we break BC in the future.
Gary
On Jun 17, 2012, at 8:00, "Sebb (JIRA)" <ji...@apache.org> wrote:
>
> [ https://issues.apache.org/jira/browse/IO-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13393532#comment-13393532 ]
>
> Sebb commented on IO-337:
> -------------------------
>
> Nice idea, but this will break compatibility.
>
> It might be possible to introduce a new class for the enum, and deprecate the old class and methods that use it.
>
>> ByteOrderMark can be refactored as an enum
>> ------------------------------------------
>>
>> Key: IO-337
>> URL: https://issues.apache.org/jira/browse/IO-337
>> Project: Commons IO
>> Issue Type: New Feature
>> Reporter: Yaniv Kunda
>> Priority: Minor
>> Attachments: ByteOrderMark-enum.patch
>>
>>
>> ByteOrderMark is used primarily for encapsulating the data regarding to Unicode BOMs. Since those are fixed, it would make sense to make it an enum, instead of a public class.
>> I have attached a patch that only covers ByteOrderMark itself, including an additional getCharset() utility method, and toString() simplification.
>> This patch does not cover:
>> 1) Its incorrect use (per its perceived purpose) in XmlStreamReader.XML_GUESS_BYTES
>> 2) The now-unnecessary tests
>
> --
> 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
>
>
[jira] [Commented] (IO-337) ByteOrderMark can be refactored as an
enum
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13393532#comment-13393532 ]
Sebb commented on IO-337:
-------------------------
Nice idea, but this will break compatibility.
It might be possible to introduce a new class for the enum, and deprecate the old class and methods that use it.
> ByteOrderMark can be refactored as an enum
> ------------------------------------------
>
> Key: IO-337
> URL: https://issues.apache.org/jira/browse/IO-337
> Project: Commons IO
> Issue Type: New Feature
> Reporter: Yaniv Kunda
> Priority: Minor
> Attachments: ByteOrderMark-enum.patch
>
>
> ByteOrderMark is used primarily for encapsulating the data regarding to Unicode BOMs. Since those are fixed, it would make sense to make it an enum, instead of a public class.
> I have attached a patch that only covers ByteOrderMark itself, including an additional getCharset() utility method, and toString() simplification.
> This patch does not cover:
> 1) Its incorrect use (per its perceived purpose) in XmlStreamReader.XML_GUESS_BYTES
> 2) The now-unnecessary tests
--
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
[jira] [Updated] (IO-337) ByteOrderMark can be refactored as an
enum
Posted by "Yaniv Kunda (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IO-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yaniv Kunda updated IO-337:
---------------------------
Attachment: ByteOrderMark-enum.patch
partial patch for my suggestion
> ByteOrderMark can be refactored as an enum
> ------------------------------------------
>
> Key: IO-337
> URL: https://issues.apache.org/jira/browse/IO-337
> Project: Commons IO
> Issue Type: New Feature
> Reporter: Yaniv Kunda
> Priority: Minor
> Attachments: ByteOrderMark-enum.patch
>
>
> ByteOrderMark is used primarily for encapsulating the data regarding to Unicode BOMs. Since those are fixed, it would make sense to make it an enum, instead of a public class.
> I have attached a patch that only covers ByteOrderMark itself, including an additional getCharset() utility method, and toString() simplification.
> This patch does not cover:
> 1) Its incorrect use (per its perceived purpose) in XmlStreamReader.XML_GUESS_BYTES
> 2) The now-unnecessary tests
--
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