You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/12/31 18:06:46 UTC

groovy git commit: Rename `startsWith` and `endsWith` to `startsWithAny` and `endsWithAny`

Repository: groovy
Updated Branches:
  refs/heads/master ff220c6e2 -> 3c91bc1fd


Rename `startsWith` and `endsWith` to `startsWithAny` and `endsWithAny`


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/3c91bc1f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/3c91bc1f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/3c91bc1f

Branch: refs/heads/master
Commit: 3c91bc1fd5651a15a0435a31fac2d6b98246016c
Parents: ff220c6
Author: Daniel Sun <re...@hotmail.com>
Authored: Mon Jan 1 02:06:39 2018 +0800
Committer: Daniel Sun <re...@hotmail.com>
Committed: Mon Jan 1 02:06:39 2018 +0800

----------------------------------------------------------------------
 .../codehaus/groovy/runtime/StringGroovyMethods.java    |  4 ++--
 .../groovy/runtime/StringGroovyMethodsTest.java         | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3c91bc1f/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
index 1738695..4a8eafc 100644
--- a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
@@ -3804,7 +3804,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @return  {@code true} if this string starts with any specified prefixes.
      * @since   2.4.14
      */
-    public static boolean startsWith(String self, String... prefixes) {
+    public static boolean startsWithAny(String self, String... prefixes) {
         for (String prefix : prefixes) {
             if (self.startsWith(prefix)) {
                 return true;
@@ -3821,7 +3821,7 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @return  {@code true} if this string ends with any specified suffixes
      * @since   2.4.14
      */
-    public static boolean endsWith(String self, String... suffixes) {
+    public static boolean endsWithAny(String self, String... suffixes) {
         for (String suffix : suffixes) {
             if (self.endsWith(suffix)) {
                 return true;

http://git-wip-us.apache.org/repos/asf/groovy/blob/3c91bc1f/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java b/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
index bd0812d..6bfbac0 100644
--- a/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
+++ b/src/test/org/codehaus/groovy/runtime/StringGroovyMethodsTest.java
@@ -92,13 +92,13 @@ public class StringGroovyMethodsTest extends GroovyTestCase {
         assertFalse(StringGroovyMethods.isNumber(nonNumberStr));
     }
 
-    public void testStartsWith() {
-        assertTrue(StringGroovyMethods.startsWith("abcd", "ab", "ef"));
-        assertFalse(StringGroovyMethods.startsWith("abcd", "ef", "gh"));
+    public void testStartsWithAny() {
+        assertTrue(StringGroovyMethods.startsWithAny("abcd", "ab", "ef"));
+        assertFalse(StringGroovyMethods.startsWithAny("abcd", "ef", "gh"));
     }
 
-    public void testEndsWith() {
-        assertTrue(StringGroovyMethods.endsWith("abcd", "cd", "ef"));
-        assertFalse(StringGroovyMethods.endsWith("abcd", "ef", "gh"));
+    public void testEndsWithAny() {
+        assertTrue(StringGroovyMethods.endsWithAny("abcd", "cd", "ef"));
+        assertFalse(StringGroovyMethods.endsWithAny("abcd", "ef", "gh"));
     }
 }