From bb8b6f4b0c54f25024b17d1f2abcd4bb98289983 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Tue, 25 Mar 2008 07:37:12 +0000 Subject: [PATCH] Fixing the javadoc for endsWithIgnoreCase as per LANG-418, and adding some javadoc to test the novel javadoc examples git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@640727 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/lang/StringUtils.java | 9 +++++---- .../commons/lang/StringUtilsStartsEndsWithTest.java | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java index 91aa135f6..c6ab922d1 100644 --- a/src/java/org/apache/commons/lang/StringUtils.java +++ b/src/java/org/apache/commons/lang/StringUtils.java @@ -5922,10 +5922,11 @@ public static boolean endsWith(String str, String suffix) { * *
      * StringUtils.endsWithIgnoreCase(null, null)      = true
-     * StringUtils.endsWithIgnoreCase(null, "abcdef")  = false
-     * StringUtils.endsWithIgnoreCase("def", null)     = false
-     * StringUtils.endsWithIgnoreCase("def", "abcdef") = true
-     * StringUtils.endsWithIgnoreCase("def", "ABCDEF") = false
+     * StringUtils.endsWithIgnoreCase("abcdef", null)  = false
+     * StringUtils.endsWithIgnoreCase(null, "def")     = false
+     * StringUtils.endsWithIgnoreCase("abcdef", "def") = true
+     * StringUtils.endsWithIgnoreCase("ABCDEF", "def") = true
+     * StringUtils.endsWithIgnoreCase("ABCDEF", "cde") = false
      * 
* * @see java.lang.String#endsWith(String) diff --git a/src/test/org/apache/commons/lang/StringUtilsStartsEndsWithTest.java b/src/test/org/apache/commons/lang/StringUtilsStartsEndsWithTest.java index 1c7fdeef5..6d1e48f4d 100644 --- a/src/test/org/apache/commons/lang/StringUtilsStartsEndsWithTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsStartsEndsWithTest.java @@ -149,6 +149,11 @@ public void testEndsWithIgnoreCase() { assertTrue("endsWithIgnoreCase(FOOBAR, BAR)", StringUtils.endsWithIgnoreCase(FOOBAR, BAR)); assertTrue("endsWithIgnoreCase(foobar, BAR)", StringUtils.endsWithIgnoreCase(foobar, BAR)); assertTrue("endsWithIgnoreCase(FOOBAR, bar)", StringUtils.endsWithIgnoreCase(FOOBAR, bar)); + + // javadoc + assertTrue(StringUtils.endsWithIgnoreCase("abcdef", "def")); + assertTrue(StringUtils.endsWithIgnoreCase("ABCDEF", "def")); + assertFalse(StringUtils.endsWithIgnoreCase("ABCDEF", "cde")); } }