You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pa...@apache.org on 2016/05/29 07:54:36 UTC

[2/2] [lang] LANG-1225: Add RandomStringUtils#randomGraph and #randomPrint which match corresponding regular expression class

LANG-1225: Add RandomStringUtils#randomGraph and #randomPrint which match corresponding regular expression class

improve javadoc

add changes.xml entry


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/f26f04dc
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/f26f04dc
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/f26f04dc

Branch: refs/heads/master
Commit: f26f04dc6eccc8b4f6497e7e1a9b718f41870b32
Parents: 1a002c6
Author: pascalschumacher <pa...@gmx.net>
Authored: Sun May 29 09:54:23 2016 +0200
Committer: pascalschumacher <pa...@gmx.net>
Committed: Sun May 29 09:54:23 2016 +0200

----------------------------------------------------------------------
 src/changes/changes.xml                                   |  1 +
 .../java/org/apache/commons/lang3/RandomStringUtils.java  | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/f26f04dc/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5299260..bd03520 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -22,6 +22,7 @@
   <body>
 
   <release version="3.5" date="tba" description="tba">
+    <action issue="LANG-1225" type="add" dev="pschumacher" due-to="Caleb Cushing">Add RandomStringUtils#randomGraph and #randomPrint which match corresponding regular expression class</action>
     <action issue="LANG-901" type="fix" dev="pschumacher" due-to="Matthew Bartenschlag">StringUtils#startsWithAny/endsWithAny is case sensitive - documented as case insensitive</action>
     <action issue="LANG-1223" type="add" dev="pschumacher" due-to="Nick Manley">Add StopWatch#getTime(TimeUnit)</action>
     <action issue="LANG-781" type="add" dev="pschumacher" due-to="Krzysztof Wolny">Add methods to ObjectUtils class to check for null elements in the array</action>

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/f26f04dc/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
index 662249f..3db461f 100644
--- a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java
@@ -113,10 +113,13 @@ public class RandomStringUtils {
     /**
      * <p>Creates a random string whose length is the number of characters specified.</p>
      *
-     * <p>Characters will be chosen from the set of characters which match the POSIX [:graph:] regular expression.</p>
+     * <p>Characters will be chosen from the set of characters which match the POSIX [:graph:]
+     * regular expression character class. This class contains all visible ASCII characters 
+     * (i.e. anything except spaces and control characters).</p>
      *
      * @param count  the length of random string to create
      * @return the random string
+     * @since 3.5
      */
     public static String randomGraph(final int count) {
         return random(count, 33, 126, false, false);
@@ -139,10 +142,13 @@ public class RandomStringUtils {
     /**
      * <p>Creates a random string whose length is the number of characters specified.</p>
      *
-     * <p>Characters will be chosen from the set of characters which match the POSIX [:print:] regular expression.</p>
+     * <p>Characters will be chosen from the set of characters which match the POSIX [:print:]
+     * regular expression character class. This class includes all visible ASCII characters and spaces
+     * (i.e. anything except control characters).</p>
      *
      * @param count  the length of random string to create
      * @return the random string
+     * @since 3.5
      */
     public static String randomPrint(final int count) {
         return random(count, 32, 126, false, false);