You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2009/07/11 09:43:14 UTC
[jira] Created: (LANG-514) CharRange constructor is hard to read
CharRange constructor is hard to read
-------------------------------------
Key: LANG-514
URL: https://issues.apache.org/jira/browse/LANG-514
Project: Commons Lang
Issue Type: Improvement
Reporter: Henri Yandell
Fix For: 3.0
Saying new CharRange("....", true) is a very painful way to negate the '...'. Both for cryptic, and because you'd expect true to mean positiveness and false to imply the 'not'.
Replace this with a static method:
CharRange.not("....").
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-514) CharRange constructor is hard to read
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741017#action_12741017 ]
Henri Yandell commented on LANG-514:
------------------------------------
Looks good - thanks Vincent.
I wonder if the constructor should become private. I'm also wondering if the other constructor should go away and we end up with:
CharRange.is(char)
CharRange.isNot(char)
CharRange.isIn(char, char)
CharRange.isNotIn(char, char)
Anyone with thoughts on that?
> CharRange constructor is hard to read
> -------------------------------------
>
> Key: LANG-514
> URL: https://issues.apache.org/jira/browse/LANG-514
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Henri Yandell
> Fix For: 3.0
>
> Attachments: LANG-514.patch
>
>
> Saying new CharRange("....", true) is a very painful way to negate the '...'. Both for cryptic, and because you'd expect true to mean positiveness and false to imply the 'not'.
> Replace this with a static method:
> CharRange.not("....").
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (LANG-514) CharRange constructor is hard to read
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell closed LANG-514.
------------------------------
Resolution: Fixed
svn ci -m "Applying patch from LANG-514. CharRange constructors removed and replaced with readable static builder methods"
Sending src/java/org/apache/commons/lang/CharRange.java
Sending src/java/org/apache/commons/lang/CharSet.java
Sending src/test/org/apache/commons/lang/CharRangeTest.java
Sending src/test/org/apache/commons/lang/CharSetTest.java
Transmitting file data ....
Committed revision 829282.
> CharRange constructor is hard to read
> -------------------------------------
>
> Key: LANG-514
> URL: https://issues.apache.org/jira/browse/LANG-514
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Henri Yandell
> Fix For: 3.0
>
> Attachments: LANG-514-private-ctor.patch, LANG-514.patch
>
>
> Saying new CharRange("....", true) is a very painful way to negate the '...'. Both for cryptic, and because you'd expect true to mean positiveness and false to imply the 'not'.
> Replace this with a static method:
> CharRange.not("....").
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-514) CharRange constructor is hard to read
Posted by "Vincent Ricard (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vincent Ricard updated LANG-514:
--------------------------------
Attachment: LANG-514-private-ctor.patch
Here is a version with a private constructor (i only let the 3 args constructor).
I cleaned up some test.
Maybe the constructor could be "protected" to enable the inheritance for some users.
> CharRange constructor is hard to read
> -------------------------------------
>
> Key: LANG-514
> URL: https://issues.apache.org/jira/browse/LANG-514
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Henri Yandell
> Fix For: 3.0
>
> Attachments: LANG-514-private-ctor.patch, LANG-514.patch
>
>
> Saying new CharRange("....", true) is a very painful way to negate the '...'. Both for cryptic, and because you'd expect true to mean positiveness and false to imply the 'not'.
> Replace this with a static method:
> CharRange.not("....").
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-514) CharRange constructor is hard to read
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated LANG-514:
---------------------------------
Fix Version/s: (was: 3.0)
2.5
> CharRange constructor is hard to read
> -------------------------------------
>
> Key: LANG-514
> URL: https://issues.apache.org/jira/browse/LANG-514
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Reporter: Henri Yandell
> Fix For: 2.5
>
> Attachments: LANG-514-private-ctor.patch, LANG-514.patch
>
>
> Saying new CharRange("....", true) is a very painful way to negate the '...'. Both for cryptic, and because you'd expect true to mean positiveness and false to imply the 'not'.
> Replace this with a static method:
> CharRange.not("....").
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-514) CharRange constructor is hard to read
Posted by "Vincent Ricard (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vincent Ricard updated LANG-514:
--------------------------------
Attachment: LANG-514.patch
Here is a patch
> CharRange constructor is hard to read
> -------------------------------------
>
> Key: LANG-514
> URL: https://issues.apache.org/jira/browse/LANG-514
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Henri Yandell
> Fix For: 3.0
>
> Attachments: LANG-514.patch
>
>
> Saying new CharRange("....", true) is a very painful way to negate the '...'. Both for cryptic, and because you'd expect true to mean positiveness and false to imply the 'not'.
> Replace this with a static method:
> CharRange.not("....").
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.