commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arno Noordover (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-1069) CharSet.getInstance documentation does not clearly explain how to include negation character in set
Date Tue, 30 Dec 2014 19:28:13 GMT

     [ https://issues.apache.org/jira/browse/LANG-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Arno Noordover updated LANG-1069:
---------------------------------
    Attachment: CharSet-1069.patch

Tried to explain corner-case usage of negating character and added unittest.
* CharSet.getInstance("^^a-d")
* CharSet.getInstance("a-d^")

> CharSet.getInstance documentation does not clearly explain how to include negation character
in set
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LANG-1069
>                 URL: https://issues.apache.org/jira/browse/LANG-1069
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.3.2
>            Reporter: Duncan Jones
>            Priority: Minor
>             Fix For: Patch Needed
>
>         Attachments: CharSet-1069.patch
>
>
> As discussed in [this Stack Overflow question|http://stackoverflow.com/questions/27070515/how-can-i-include-the-caret-character-in-an-apache-commons-charset],
the documentation for {{CharSet.getInstance()}} don't explain clearly how to include the negation
character ({{^}}) as a literal character.
> The two solutions suggested in the SO question are:
> {code:java}
> // Add the '^' on its own
> CharSet.getInstance("^", "otherlettershere");
> // Add the '^' as the last character
> CharSet.getInstance("otherlettershere^")
> {code}
> If those are the best options, we should add a line to the Javadoc to indicate this.
If there is a better way, clearly that should be documented instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message