LANG-1071: Fix wrong examples in JavaDoc of StringUtils.replaceEachRepeatedly(...), StringUtils.replaceEach(...). Thanks to Arno Noordover.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1648067 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2014-12-27 16:45:42 +00:00
parent 5cb1ae6024
commit c5332828bd
2 changed files with 27 additions and 26 deletions

View File

@ -22,6 +22,7 @@
<body> <body>
<release version="3.4" date="tba" description="tba"> <release version="3.4" date="tba" description="tba">
<action issue="LANG-1071" type="update" dev="britter" due-to="Arno Noordover">Fix wrong examples in JavaDoc of StringUtils.replaceEachRepeatedly(...), StringUtils.replaceEach(...)</action>
<action issue="LANG-883" type="add" dev="britter" due-to="Daniel Stewart">Add StringUtils.containsAny(CharSequence, CharSequence...) method</action> <action issue="LANG-883" type="add" dev="britter" due-to="Daniel Stewart">Add StringUtils.containsAny(CharSequence, CharSequence...) method</action>
<action issue="LANG-1073" type="fix" dev="kinow" due-to="haiyang li">Read wrong component type of array in add in ArrayUtils</action> <action issue="LANG-1073" type="fix" dev="kinow" due-to="haiyang li">Read wrong component type of array in add in ArrayUtils</action>
<action issue="LANG-1077" type="fix" dev="kinow" due-to="haiyang li">StringUtils.ordinalIndexOf("aaaaaa", "aa", 2) != 3 in StringUtils</action> <action issue="LANG-1077" type="fix" dev="kinow" due-to="haiyang li">StringUtils.ordinalIndexOf("aaaaaa", "aa", 2) != 3 in StringUtils</action>

View File

@ -4620,20 +4620,18 @@ public static String replaceEach(final String text, final String[] searchList, f
* </p> * </p>
* *
* <pre> * <pre>
* StringUtils.replaceEach(null, *, *, *) = null * StringUtils.replaceEachRepeatedly(null, *, *) = null
* StringUtils.replaceEach("", *, *, *) = "" * StringUtils.replaceEachRepeatedly("", *, *) = ""
* StringUtils.replaceEach("aba", null, null, *) = "aba" * StringUtils.replaceEachRepeatedly("aba", null, null) = "aba"
* StringUtils.replaceEach("aba", new String[0], null, *) = "aba" * StringUtils.replaceEachRepeatedly("aba", new String[0], null) = "aba"
* StringUtils.replaceEach("aba", null, new String[0], *) = "aba" * StringUtils.replaceEachRepeatedly("aba", null, new String[0]) = "aba"
* StringUtils.replaceEach("aba", new String[]{"a"}, null, *) = "aba" * StringUtils.replaceEachRepeatedly("aba", new String[]{"a"}, null) = "aba"
* StringUtils.replaceEach("aba", new String[]{"a"}, new String[]{""}, *) = "b" * StringUtils.replaceEachRepeatedly("aba", new String[]{"a"}, new String[]{""}) = "b"
* StringUtils.replaceEach("aba", new String[]{null}, new String[]{"a"}, *) = "aba" * StringUtils.replaceEachRepeatedly("aba", new String[]{null}, new String[]{"a"}) = "aba"
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"w", "t"}, *) = "wcte" * StringUtils.replaceEachRepeatedly("abcde", new String[]{"ab", "d"}, new String[]{"w", "t"}) = "wcte"
* (example of how it repeats) * (example of how it repeats)
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}, false) = "dcte" * StringUtils.replaceEachRepeatedly("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}) = "tcte"
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}, true) = "tcte" * StringUtils.replaceEachRepeatedly("abcde", new String[]{"ab", "d"}, new String[]{"d", "ab"}) = IllegalStateException
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "ab"}, true) = IllegalStateException
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "ab"}, false) = "dcabe"
* </pre> * </pre>
* *
* @param text * @param text
@ -4661,7 +4659,9 @@ public static String replaceEachRepeatedly(final String text, final String[] sea
/** /**
* <p> * <p>
* Replaces all occurrences of Strings within another String. * Replace all occurrences of Strings within another String.
* This is a private recursive helper method for {@link #replaceEachRepeatedly(String, String[], String[])} and
* {@link #replaceEach(String, String[], String[])}
* </p> * </p>
* *
* <p> * <p>
@ -4671,19 +4671,19 @@ public static String replaceEachRepeatedly(final String text, final String[] sea
* </p> * </p>
* *
* <pre> * <pre>
* StringUtils.replaceEach(null, *, *, *) = null * StringUtils.replaceEach(null, *, *, *, *) = null
* StringUtils.replaceEach("", *, *, *) = "" * StringUtils.replaceEach("", *, *, *, *) = ""
* StringUtils.replaceEach("aba", null, null, *) = "aba" * StringUtils.replaceEach("aba", null, null, *, *) = "aba"
* StringUtils.replaceEach("aba", new String[0], null, *) = "aba" * StringUtils.replaceEach("aba", new String[0], null, *, *) = "aba"
* StringUtils.replaceEach("aba", null, new String[0], *) = "aba" * StringUtils.replaceEach("aba", null, new String[0], *, *) = "aba"
* StringUtils.replaceEach("aba", new String[]{"a"}, null, *) = "aba" * StringUtils.replaceEach("aba", new String[]{"a"}, null, *, *) = "aba"
* StringUtils.replaceEach("aba", new String[]{"a"}, new String[]{""}, *) = "b" * StringUtils.replaceEach("aba", new String[]{"a"}, new String[]{""}, *, >=0) = "b"
* StringUtils.replaceEach("aba", new String[]{null}, new String[]{"a"}, *) = "aba" * StringUtils.replaceEach("aba", new String[]{null}, new String[]{"a"}, *, >=0) = "aba"
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"w", "t"}, *) = "wcte" * StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"w", "t"}, *, >=0) = "wcte"
* (example of how it repeats) * (example of how it repeats)
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}, false) = "dcte" * StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}, false, >=0) = "dcte"
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}, true) = "tcte" * StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "t"}, true, >=2) = "tcte"
* StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "ab"}, *) = IllegalStateException * StringUtils.replaceEach("abcde", new String[]{"ab", "d"}, new String[]{"d", "ab"}, *, *) = IllegalStateException
* </pre> * </pre>
* *
* @param text * @param text