From ba57d261f1dfa1926e6bea34726e396865b0411c Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Tue, 12 Sep 2006 15:29:31 +0000 Subject: [PATCH] Fixing javadoc example and adding a unit test to prove the example; as reported in #LANG-278 git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@442618 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/lang/StringUtils.java | 2 +- src/test/org/apache/commons/lang/StringUtilsTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java index 89d0a0962..0a806acf1 100644 --- a/src/java/org/apache/commons/lang/StringUtils.java +++ b/src/java/org/apache/commons/lang/StringUtils.java @@ -2795,7 +2795,7 @@ public class StringUtils { * StringUtils.removeEnd(null, *) = null * StringUtils.removeEnd("", *) = "" * StringUtils.removeEnd(*, null) = * - * StringUtils.removeEnd("www.domain.com", ".com.") = "www,domain" + * StringUtils.removeEnd("www.domain.com", ".com.") = "www.domain.com." * StringUtils.removeEnd("www.domain.com", ".com") = "www.domain" * StringUtils.removeEnd("www.domain.com", "domain") = "www.domain.com" * StringUtils.removeEnd("abc", "") = "abc" diff --git a/src/test/org/apache/commons/lang/StringUtilsTest.java b/src/test/org/apache/commons/lang/StringUtilsTest.java index dac3843bb..c1595dfd6 100644 --- a/src/test/org/apache/commons/lang/StringUtilsTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsTest.java @@ -1482,6 +1482,7 @@ public class StringUtilsTest extends TestCase { assertEquals(StringUtils.removeEnd("", "a"), ""); // All others: + assertEquals(StringUtils.removeEnd("www.domain.com.", ".com"), "www.domain.com."); assertEquals(StringUtils.removeEnd("www.domain.com", ".com"), "www.domain"); assertEquals(StringUtils.removeEnd("www.domain", ".com"), "www.domain"); assertEquals(StringUtils.removeEnd("domain.com", ""), "domain.com");