You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Duncan Jones (JIRA)" <ji...@apache.org> on 2015/04/11 08:10:12 UTC

[jira] [Resolved] (LANG-1069) CharSet.getInstance documentation does not clearly explain how to include negation character in set

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

Duncan Jones resolved LANG-1069.
--------------------------------
       Resolution: Fixed
    Fix Version/s:     (was: Review Patch)
                   3.5
         Assignee: Duncan Jones

Thanks for the patch. I edited it a little and have now committed it:

Author: djones
Date: Sat Apr 11 06:02:34 2015
New Revision: 1672833

URL: http://svn.apache.org/r1672833
Log:
Update for LANG-1069: CharSet.getInstance documentation does not clearly explain how to include negation character in set. Javadoc expanded and unit tests added to match examples. Based on patch by Arno Noordover.

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/CharSet.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/CharSetTest.java

> 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
>            Assignee: Duncan Jones
>            Priority: Minor
>             Fix For: 3.5
>
>         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)