groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] branch master updated: minor refactor: remove some DGM methods that have been deprecated for almost 5 years
Date Thu, 09 May 2019 11:16:58 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 1192ac4  minor refactor: remove some DGM methods that have been deprecated for almost
5 years
1192ac4 is described below

commit 1192ac44d280204b9f09ce5cec5e489f2a153edf
Author: Paul King <paulk@asert.com.au>
AuthorDate: Thu May 9 21:16:36 2019 +1000

    minor refactor: remove some DGM methods that have been deprecated for almost 5 years
---
 .../groovy/runtime/StringGroovyMethods.java        | 702 ---------------------
 .../groovy/runtime/NewStaticMetaMethodTest.java    |   2 +-
 2 files changed, 1 insertion(+), 703 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
index 9e500d6..cface52 100644
--- a/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
+++ b/src/main/java/org/codehaus/groovy/runtime/StringGroovyMethods.java
@@ -209,15 +209,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #bitwiseNegate(CharSequence)
-     */
-    @Deprecated
-    public static Pattern bitwiseNegate(String self) {
-        return bitwiseNegate((CharSequence) self);
-    }
-
-    /**
      * Convenience method to uncapitalize the first letter of a CharSequence
      * (typically the first letter of a word). Example usage:
      * <pre class="groovyTestCase">
@@ -259,15 +250,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #capitalize(CharSequence)
-     */
-    @Deprecated
-    public static String capitalize(String self) {
-        return capitalize((CharSequence) self);
-    }
-
-    /**
      * Pad a CharSequence to a minimum length specified by <tt>numberOfChars</tt>
by adding the space character around it as many times as needed so that it remains centered.
      *
      * If the String is already the same size or bigger than the target <tt>numberOfChars</tt>,
then the original String is returned. An example:
@@ -329,24 +311,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #center(CharSequence, Number)
-     */
-    @Deprecated
-    public static String center(String self, Number numberOfChars) {
-        return center((CharSequence) self, numberOfChars);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #center(CharSequence, Number, CharSequence)
-     */
-    @Deprecated
-    public static String center(String self, Number numberOfChars, String padding) {
-        return center((CharSequence) self, numberOfChars, (CharSequence) padding);
-    }
-
-    /**
      * Provide an implementation of contains() like
      * {@link java.util.Collection#contains(Object)} to make CharSequences more polymorphic.
      *
@@ -361,15 +325,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #contains(CharSequence, CharSequence)
-     */
-    @Deprecated
-    public static boolean contains(String self, String text) {
-        return contains((CharSequence) self, (CharSequence) text);
-    }
-
-    /**
      * Count the number of occurrences of a sub CharSequence.
      *
      * @param self a CharSequence
@@ -390,15 +345,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #contains(CharSequence, CharSequence)
-     */
-    @Deprecated
-    public static int count(String self, String text) {
-        return count((CharSequence) self, (CharSequence) text);
-    }
-
-    /**
      * Return a CharSequence with lines (separated by LF, CR/LF, or CR)
      * terminated by the platform specific line separator.
      *
@@ -466,15 +412,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #denormalize(CharSequence)
-     */
-    @Deprecated
-    public static String denormalize(final String self) {
-        return denormalize((CharSequence) self);
-    }
-
-    /**
      * Drops the given number of chars from the head of this CharSequence
      * if they are available.
      * <pre class="groovyTestCase">
@@ -674,24 +611,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #eachLine(CharSequence, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static <T> T eachLine(String self, @ClosureParams(value=FromString.class,
options={"String","String,Integer"}) Closure<T> closure) throws IOException {
-        return eachLine((CharSequence) self, closure);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #eachLine(CharSequence, int, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static <T> T eachLine(String self, int firstLine, @ClosureParams(value=FromString.class,
options={"String","String,Integer"}) Closure<T> closure) throws IOException {
-        return eachLine((CharSequence) self, firstLine, closure);
-    }
-
-    /**
      * Iterate through this String a character at a time collecting either the
      * original character or a transformed replacement String. The {@code transform}
      * Closure should return {@code null} to indicate that no transformation is
@@ -840,24 +759,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #expand(CharSequence)
-     */
-    @Deprecated
-    public static String expand(String self) {
-        return expand((CharSequence) self);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #expand(CharSequence, int)
-     */
-    @Deprecated
-    public static String expand(String self, int tabStop) {
-        return expand((CharSequence) self, tabStop);
-    }
-
-    /**
      * Expands all tabs into spaces. Assumes the CharSequence represents a single line of
text.
      *
      * @param self A line to expand
@@ -879,15 +780,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #expand(CharSequence, int)
-     */
-    @Deprecated
-    public static String expandLine(String self, int tabStop) {
-        return expandLine((CharSequence) self, tabStop);
-    }
-
-    /**
      * Finds the first occurrence of a regular expression String within a String.
      * If the regex doesn't match, null will be returned.
      * <p>
@@ -1038,42 +930,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #find(CharSequence, java.util.regex.Pattern)
-     */
-    @Deprecated
-    public static String find(String self, Pattern pattern) {
-        return find((CharSequence) self, pattern);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #find(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static String find(String self, Pattern pattern, @ClosureParams(value=FromString.class,
options={"java.util.List<java.lang.String>","java.lang.String[]"}) Closure closure)
{
-        return find((CharSequence) self, pattern, closure);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #find(CharSequence, CharSequence)
-     */
-    @Deprecated
-    public static String find(String self, String regex) {
-        return find((CharSequence) self, (CharSequence) regex);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #find(CharSequence, CharSequence, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static String find(String self, String regex, @ClosureParams(value=FromString.class,
options={"java.util.List<java.lang.String>","java.lang.String[]"}) Closure closure)
{
-        return find((CharSequence) self, (CharSequence) regex, closure);
-    }
-
-    /**
      * Returns a (possibly empty) list of all occurrences of a regular expression (provided
as a CharSequence) found within a CharSequence.
      * <p>
      * For example, if the regex doesn't match, it returns an empty list:
@@ -1194,42 +1050,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
         return DefaultGroovyMethods.collect(matcher, closure);
     }
 
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #findAll(CharSequence, java.util.regex.Pattern)
-     */
-    @Deprecated
-    public static List<String> findAll(String self, Pattern pattern) {
-        return findAll((CharSequence) self, pattern);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #findAll(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static <T> List<T> findAll(String self, Pattern pattern, @ClosureParams(value=FromString.class,
options={"java.util.List<java.lang.String>","java.lang.String[]"}) Closure<T>
closure) {
-        return findAll((CharSequence) self, pattern, closure);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #findAll(CharSequence, CharSequence)
-     */
-    @Deprecated
-    public static List<String> findAll(String self, String regex) {
-        return findAll((CharSequence) self, (CharSequence) regex);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #findAll(CharSequence, CharSequence, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static <T> List<T> findAll(String self, String regex, @ClosureParams(value=FromString.class,
options={"java.util.List<java.lang.String>","java.lang.String[]"}) Closure<T>
closure) {
-        return findAll((CharSequence) self, (CharSequence) regex, closure);
-    }
-
     // TODO expose this for stream based scenarios?
     private static int findMinimumLeadingSpaces(String line, int count) {
         int length = line.length();
@@ -1471,24 +1291,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #getAt(CharSequence, java.util.Collection)
-     */
-    @Deprecated
-    public static String getAt(String self, Collection indices) {
-        return getAt((CharSequence) self, indices);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #getAt(CharSequence, groovy.lang.EmptyRange)
-     */
-    @Deprecated
-    public static String getAt(String text, EmptyRange range) {
-        return getAt((CharSequence) text, range);
-    }
-
-    /**
      * Support the subscript operator for String.
      *
      * @param text  a String
@@ -1542,15 +1344,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #getChars(CharSequence)
-     */
-    @Deprecated
-    public static char[] getChars(String self) {
-        return getChars((CharSequence) self);
-    }
-
-    /**
      * Find the number of Strings matched to the given Matcher.
      *
      * @param matcher a Matcher
@@ -1632,15 +1425,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isAllWhitespace(CharSequence)
-     */
-    @Deprecated
-    public static boolean isAllWhitespace(String self) {
-        return isAllWhitespace((CharSequence) self);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as a BigDecimal.
      *
      * @param self a CharSequence
@@ -1657,15 +1441,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isBigDecimal(CharSequence)
-     */
-    @Deprecated
-    public static boolean isBigDecimal(String self) {
-        return isBigDecimal((CharSequence) self);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as a BigInteger.
      *
      * @param self a CharSequence
@@ -1682,15 +1457,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isBigInteger(CharSequence)
-     */
-    @Deprecated
-    public static boolean isBigInteger(String self) {
-        return isBigInteger((CharSequence) self);
-    }
-
-    /**
      * 'Case' implementation for a CharSequence, which uses equals between the
      * toString() of the caseValue and the switchValue. This allows CharSequence
      * values to be used in switch statements. For example:
@@ -1716,15 +1482,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isCase(CharSequence, Object)
-     */
-    @Deprecated
-    public static boolean isCase(GString caseValue, Object switchValue) {
-        return isCase((CharSequence) caseValue, switchValue);
-    }
-
-    /**
      * 'Case' implementation for the {@link java.util.regex.Pattern} class, which allows
      * testing a String against a number of regular expressions.
      * For example:
@@ -1755,15 +1512,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isCase(CharSequence, Object)
-     */
-    @Deprecated
-    public static boolean isCase(String caseValue, Object switchValue) {
-        return isCase((CharSequence) caseValue, switchValue);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as a Double.
      *
      * @param self a CharSequence
@@ -1780,15 +1528,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isDouble(CharSequence)
-     */
-    @Deprecated
-    public static boolean isDouble(String self) {
-        return isDouble((CharSequence) self);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as a Float.
      *
      * @param self a CharSequence
@@ -1805,15 +1544,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isFloat(CharSequence)
-     */
-    @Deprecated
-    public static boolean isFloat(String self) {
-        return isFloat((CharSequence) self);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as an Integer.
      *
      * @param self a CharSequence
@@ -1830,15 +1560,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isInteger(CharSequence)
-     */
-    @Deprecated
-    public static boolean isInteger(String self) {
-        return isInteger((CharSequence) self);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as a Long.
      *
      * @param self a CharSequence
@@ -1855,15 +1576,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isLong(CharSequence)
-     */
-    @Deprecated
-    public static boolean isLong(String self) {
-        return isLong((CharSequence) self);
-    }
-
-    /**
      * Determine if a CharSequence can be parsed as a Number.
      * Synonym for 'isBigDecimal()'.
      *
@@ -1877,15 +1589,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #isNumber(CharSequence)
-     */
-    @Deprecated
-    public static boolean isNumber(String self) {
-        return isNumber((CharSequence) self);
-    }
-
-    /**
      * Returns an {@link java.util.Iterator} which traverses each match.
      *
      * @param matcher a Matcher object
@@ -2009,15 +1712,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #matches(CharSequence, Pattern)
-     */
-    @Deprecated
-    public static boolean matches(String self, Pattern pattern) {
-        return matches((CharSequence) self, pattern);
-    }
-
-    /**
      * Remove a part of a CharSequence by replacing the first occurrence
      * of target within self with '' and returns the result.
      *
@@ -2052,24 +1746,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #minus(CharSequence, java.util.regex.Pattern)
-     */
-    @Deprecated
-    public static String minus(String self, Pattern pattern) {
-        return minus((CharSequence) self, pattern);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #minus(CharSequence, Object)
-     */
-    @Deprecated
-    public static String minus(String self, Object target) {
-        return minus((CharSequence) self, target);
-    }
-
-    /**
      * Repeat a CharSequence a certain number of times.
      *
      * @param self   a CharSequence to be repeated
@@ -2093,15 +1769,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #multiply(CharSequence, Number)
-     */
-    @Deprecated
-    public static String multiply(String self, Number factor) {
-        return multiply((CharSequence) self, factor);
-    }
-
-    /**
      * This method is called by the ++ operator for the class CharSequence.
      * It increments the last character in the given CharSequence. If the last
      * character in the CharSequence is Character.MAX_VALUE a Character.MIN_VALUE
@@ -2130,15 +1797,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #next(CharSequence)
-     */
-    @Deprecated
-    public static String next(String self) {
-        return next((CharSequence) self);
-    }
-
-    /**
      * Return a String with linefeeds and carriage returns normalized to linefeeds.
      *
      * @param self a CharSequence object
@@ -2178,15 +1836,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #normalize(CharSequence)
-     */
-    @Deprecated
-    public static String normalize(final String self) {
-        return normalize((CharSequence) self);
-    }
-
-    /**
      * Pad a CharSequence to a minimum length specified by <tt>numberOfChars</tt>
by adding the space character
      * to the left as many times as needed.
      *
@@ -2254,24 +1903,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #padLeft(CharSequence, Number)
-     */
-    @Deprecated
-    public static String padLeft(String self, Number numberOfChars) {
-        return padLeft((CharSequence) self, numberOfChars);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #padLeft(CharSequence, Number, CharSequence)
-     */
-    @Deprecated
-    public static String padLeft(String self, Number numberOfChars, String padding) {
-        return padLeft((CharSequence) self, numberOfChars, (CharSequence) padding);
-    }
-
-    /**
      * Pad a CharSequence to a minimum length specified by <tt>numberOfChars</tt>
by adding the space
      * character to the right as many times as needed.
      *
@@ -2330,24 +1961,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #padRight(CharSequence, Number)
-     */
-    @Deprecated
-    public static String padRight(String self, Number numberOfChars) {
-        return padRight((CharSequence) self, numberOfChars, (CharSequence) " ");
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #padRight(CharSequence, Number, CharSequence)
-     */
-    @Deprecated
-    public static String padRight(String self, Number numberOfChars, String padding) {
-        return padRight((CharSequence) self, numberOfChars, (CharSequence) padding);
-    }
-
-    /**
      * Appends the String representation of the given operand to this CharSequence.
      *
      * @param left  a CharSequence
@@ -2372,15 +1985,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #plus(CharSequence, Object)
-     */
-    @Deprecated
-    public static String plus(String left, Object value) {
-        return plus((CharSequence) left, value);
-    }
-
-    /**
      * Appends the String representation of the given operand to this string.
      *
      * @param left  a String
@@ -2429,15 +2033,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #previous(CharSequence)
-     */
-    @Deprecated
-    public static String previous(String self) {
-        return previous((CharSequence) self);
-    }
-
-    /**
      * Support the range subscript operator for StringBuffer.
      *
      * @param self  a StringBuffer
@@ -2476,15 +2071,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #readLines(CharSequence)
-     */
-    @Deprecated
-    public static List<String> readLines(String self) {
-        return readLines((CharSequence) self);
-    }
-
-    /**
      * Replaces each substring of this CharSequence that matches the given
      * regular expression with the given replacement.
      *
@@ -2618,33 +2204,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #replaceAll(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static String replaceAll(final String self, final Pattern pattern, @ClosureParams(value=FromString.class,
options={"List<String>","String[]"}) final Closure closure) {
-        return replaceAll((CharSequence) self, pattern, closure);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #replaceAll(CharSequence, java.util.regex.Pattern, CharSequence)
-     */
-    @Deprecated
-    public static String replaceAll(String self, Pattern pattern, String replacement) {
-        return pattern.matcher(self).replaceAll(replacement);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #replaceAll(CharSequence, CharSequence, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static String replaceAll(final String self, final String regex, @ClosureParams(value=FromString.class,
options={"List<String>","String[]"}) final Closure closure) {
-        return replaceAll((CharSequence) self, (CharSequence) regex, closure);
-    }
-
-    /**
      * Replaces the first substring of this CharSequence that matches the given
      * regular expression with the given replacement.
      *
@@ -2741,33 +2300,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #replaceFirst(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static String replaceFirst(final String self, final Pattern pattern, @ClosureParams(value=FromString.class,
options={"List<String>","String[]"}) final Closure closure) {
-        return replaceFirst((CharSequence) self, pattern, closure);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #replaceFirst(CharSequence, java.util.regex.Pattern, CharSequence)
-     */
-    @Deprecated
-    public static String replaceFirst(String self, Pattern pattern, String replacement) {
-        return pattern.matcher(self).replaceFirst(replacement);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #replaceFirst(CharSequence, CharSequence, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static String replaceFirst(final String self, final String regex, @ClosureParams(value=FromString.class,
options={"List<String>","String[]"}) final Closure closure) {
-        return replaceFirst((CharSequence) self, (CharSequence) regex, closure);
-    }
-
-    /**
      * Helper class used by {@link #replace(CharSequence, Map)}
      */
     private static class ReplaceState {
@@ -2917,15 +2449,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #reverse(CharSequence)
-     */
-    @Deprecated
-    public static String reverse(String self) {
-        return reverse((CharSequence) self);
-    }
-
-    /**
      * Set the position of the given Matcher to the given index.
      *
      * @param matcher a Matcher
@@ -3015,24 +2538,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #split(CharSequence)
-     */
-    @Deprecated
-    public static String[] split(GString self) {
-        return split((CharSequence) self);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #split(CharSequence)
-     */
-    @Deprecated
-    public static String[] split(String self) {
-        return split((CharSequence) self);
-    }
-
-    /**
      * Iterates through the given CharSequence line by line, splitting each line using
      * the given regex delimiter.  The list of tokens for each line is then passed to
      * the given closure.
@@ -3071,24 +2576,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #splitEachLine(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static <T> T splitEachLine(String self, Pattern pattern, Closure<T>
closure) throws IOException {
-        return splitEachLine((CharSequence) self, pattern, closure);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #splitEachLine(CharSequence, java.util.regex.Pattern, groovy.lang.Closure)
-     */
-    @Deprecated
-    public static <T> T splitEachLine(String self, String regex, Closure<T> closure)
throws IOException {
-        return splitEachLine((CharSequence) self, (CharSequence) regex, closure);
-    }
-
-    /**
      * Strip leading spaces from every line in a CharSequence. The
      * line with the least number of leading spaces determines
      * the number to remove. Lines only containing whitespace are
@@ -3144,24 +2631,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
         return builder.toString();
     }
 
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #stripIndent(CharSequence)
-     */
-    @Deprecated
-    public static String stripIndent(String self) {
-        return stripIndent((CharSequence) self);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #stripIndent(CharSequence)
-     */
-    @Deprecated
-    public static String stripIndent(String self, int numChars) {
-        return stripIndent((CharSequence) self, numChars);
-    }
-
     // TODO expose this for stream based stripping?
     private static String stripIndentFromLine(String line, int numChars) {
         int length = line.length();
@@ -3230,33 +2699,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
         return stripMargin(self, mc.charAt(0));
     }
 
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #stripMargin(CharSequence)
-     */
-    @Deprecated
-    public static String stripMargin(String self) {
-        return stripMargin((CharSequence) self);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #stripMargin(CharSequence, char)
-     */
-    @Deprecated
-    public static String stripMargin(String self, char marginChar) {
-        return stripMargin((CharSequence) self, marginChar);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #stripMargin(CharSequence, char)
-     */
-    @Deprecated
-    public static String stripMargin(String self, String marginChar) {
-        return stripMargin((CharSequence) self, (CharSequence) marginChar);
-    }
-
     // TODO expose this for other usage scenarios, e.g. stream based stripping?
     private static String stripMarginFromLine(String line, char marginChar) {
         int length = line.length();
@@ -3371,15 +2813,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toBigDecimal(CharSequence)
-     */
-    @Deprecated
-    public static BigDecimal toBigDecimal(String self) {
-        return toBigDecimal((CharSequence) self);
-    }
-
-    /**
      * Parse a CharSequence into a BigInteger
      *
      * @param self a CharSequence
@@ -3391,15 +2824,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toBigInteger(CharSequence)
-     */
-    @Deprecated
-    public static BigInteger toBigInteger(String self) {
-        return toBigInteger((CharSequence) self);
-    }
-
-    /**
      * Converts the given string into a Boolean object.
      * If the trimmed string is "true", "y" or "1" (ignoring case)
      * then the result is true otherwise it is false.
@@ -3442,15 +2866,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toDouble(CharSequence)
-     */
-    @Deprecated
-    public static Double toDouble(String self) {
-        return toDouble((CharSequence) self);
-    }
-
-    /**
      * Parse a CharSequence into a Float
      *
      * @param self a CharSequence
@@ -3462,15 +2877,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toFloat(CharSequence)
-     */
-    @Deprecated
-    public static Float toFloat(String self) {
-        return toFloat((CharSequence) self);
-    }
-
-    /**
      * Parse a CharSequence into an Integer
      *
      * @param self a CharSequence
@@ -3482,15 +2888,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toInteger(CharSequence)
-     */
-    @Deprecated
-    public static Integer toInteger(String self) {
-        return toInteger((CharSequence) self);
-    }
-
-    /**
      * Tokenize a CharSequence (with a whitespace as the delimiter).
      *
      * @param self a CharSequence
@@ -3537,33 +2934,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #tokenize(CharSequence)
-     */
-    @Deprecated
-    public static List<String> tokenize(String self) {
-        return tokenize((CharSequence) self);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #tokenize(CharSequence, Character)
-     */
-    @Deprecated
-    public static List<String> tokenize(String self, Character delimiter) {
-        return tokenize((CharSequence) self, delimiter);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #tokenize(CharSequence, CharSequence)
-     */
-    @Deprecated
-    public static List<String> tokenize(String self, String delimiters) {
-        return tokenize((CharSequence) self, (CharSequence) delimiters);
-    }
-
-    /**
      * Converts the given CharSequence into a List of Strings of one character.
      *
      * @param self a CharSequence
@@ -3581,15 +2951,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toList(CharSequence)
-     */
-    @Deprecated
-    public static List<String> toList(String self) {
-        return toList((CharSequence) self);
-    }
-
-    /**
      * Parse a CharSequence into a Long
      *
      * @param self a CharSequence
@@ -3601,15 +2962,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toLong(CharSequence)
-     */
-    @Deprecated
-    public static Long toLong(String self) {
-        return toLong((CharSequence) self);
-    }
-
-    /**
      * Converts the given CharSequence into a Set of unique Strings of one character.
      *
      * @param self a CharSequence
@@ -3621,15 +2973,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toSet(CharSequence)
-     */
-    @Deprecated
-    public static Set<String> toSet(String self) {
-        return toSet((CharSequence) self);
-    }
-
-    /**
      * Parse a CharSequence into a Short
      *
      * @param self a CharSequence
@@ -3641,15 +2984,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #toShort(CharSequence)
-     */
-    @Deprecated
-    public static Short toShort(String self) {
-        return toShort((CharSequence) self);
-    }
-
-    /**
      * Translates a CharSequence by replacing characters from the sourceSet with characters
from replacementSet.
      * If the first character from sourceSet appears in the CharSequence, it will be replaced
with the first character from replacementSet.
      * If the second character from sourceSet appears in the CharSequence, it will be replaced
with the second character from replacementSet.
@@ -3695,15 +3029,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #tr(CharSequence, CharSequence, CharSequence)
-     */
-    @Deprecated
-    public static String tr(final String self, String sourceSet, String replacementSet) throws
ClassNotFoundException {
-        return tr((CharSequence) self, (CharSequence) sourceSet, (CharSequence) replacementSet);
-    }
-
-    /**
      * Replaces sequences of whitespaces with tabs using tabStops of size 8.
      *
      * @param self A CharSequence to unexpand
@@ -3737,24 +3062,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #unexpand(CharSequence)
-     */
-    @Deprecated
-    public static String unexpand(String self) {
-        return unexpand((CharSequence) self);
-    }
-
-    /**
-     * @deprecated Use the CharSequence version
-     * @see #unexpand(CharSequence, int)
-     */
-    @Deprecated
-    public static String unexpand(String self, int tabStop) {
-        return unexpand((CharSequence) self, tabStop);
-    }
-
-    /**
      * Replaces sequences of whitespaces with tabs within a line.
      *
      * @param self A line to unexpand
@@ -3784,15 +3091,6 @@ public class StringGroovyMethods extends DefaultGroovyMethodsSupport
{
     }
 
     /**
-     * @deprecated Use the CharSequence version
-     * @see #tokenize(CharSequence)
-     */
-    @Deprecated
-    public static String unexpandLine(String self, int tabStop) {
-        return unexpandLine((CharSequence) self, tabStop);
-    }
-
-    /**
      * Tests if this CharSequence starts with any specified prefixes.
      *
      * @param   prefixes   the prefixes.
diff --git a/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java b/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
index eca3d5e..3cdfede 100644
--- a/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
+++ b/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
@@ -39,7 +39,7 @@ public class NewStaticMetaMethodTest extends TestCase {
     }
 
     public void testInvokeDefaultGroovyMethod() throws Exception {
-        Method method = StringGroovyMethods.class.getMethod("plus", new Class[]{String.class,
Object.class});
+        Method method = StringGroovyMethods.class.getMethod("plus", new Class[]{CharSequence.class,
Object.class});
         assertTrue("Should have found a method", method != null);
 
         NewInstanceMetaMethod metaMethod = createNewMetaMethod(method);


Mime
View raw message