From edf86bdfec7bcc7cb3943b58cee8090f128bde19 Mon Sep 17 00:00:00 2001 From: "ray.j.greenwell" Date: Tue, 20 Apr 2010 01:43:56 +0000 Subject: [PATCH] I won't deprecate replace() outright, but it's in String now. (Although, the implementation builds a Pattern object, which seems rather wasteful if the match sequence isn't found..) git-svn-id: https://samskivert.googlecode.com/svn/trunk@2781 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/StringUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/java/com/samskivert/util/StringUtil.java b/src/java/com/samskivert/util/StringUtil.java index 34f4ca34..383785c8 100644 --- a/src/java/com/samskivert/util/StringUtil.java +++ b/src/java/com/samskivert/util/StringUtil.java @@ -47,6 +47,8 @@ import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.samskivert.annotation.ReplacedBy; + /** * String related utility functions. */ @@ -124,6 +126,7 @@ public class StringUtil /** * Returns the string if it is non-blank (see {@link #isBlank}), the default value otherwise. */ + @ReplacedBy("com.google.common.base.Object.firstNonNull()") public static String getOr (String value, String defval) { return isBlank(value) ? defval : value; @@ -226,6 +229,7 @@ public class StringUtil * Returns a new string based on source with all instances of before * replaced with after. */ + @ReplacedBy(value="java.lang.String.replace()", reason="since 1.5") public static String replace (String source, String before, String after) { int pos = source.indexOf(before);