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 2020/05/30 15:18:34 UTC

[groovy] 05/11: GROOVY-9335: DGM: use size(CharSequence) instead of size(String*)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit d469c3e4577099f324a6023b951021ba777ba230
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Thu May 28 12:56:59 2020 -0500

    GROOVY-9335: DGM: use size(CharSequence) instead of size(String*)
    
    (cherry picked from commit eca2f8c1d01d87cdb045d143876cd2e245b04902)
---
 src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java  | 6 ++++++
 .../org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
index 96fd2df..73faf6e 100644
--- a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
@@ -2620,7 +2620,10 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @return the length of the String
      *
      * @since 1.0
+     *
+     * @see #size(CharSequence)
      */
+    @Deprecated
     public static int size(final String self) {
         return self.length();
     }
@@ -2632,7 +2635,10 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport {
      * @return the length of the StringBuffer
      *
      * @since 1.0
+     *
+     * @see #size(CharSequence)
      */
+    @Deprecated
     public static int size(final StringBuffer self) {
         return self.length();
     }
diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java
index 994b272..3313211 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/PluginDefaultGroovyMethods.java
@@ -411,7 +411,10 @@ public class PluginDefaultGroovyMethods extends DefaultGroovyMethodsSupport {
      * @return the length of the StringBuilder
      *
      * @since 1.5.2
+     *
+     * @see org.codehaus.groovy.runtime.StringGroovyMethods#size(CharSequence)
      */
+    @Deprecated
     public static int size(final StringBuilder self) {
         return self.length();
     }