It's deprecated, so don't use it.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2795 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
karma@deadmoose.com
2010-07-13 00:38:02 +00:00
parent 591211a399
commit 83bfe030d8
6 changed files with 25 additions and 27 deletions
+3 -3
View File
@@ -221,8 +221,8 @@ public class JDBCUtil
*/
public static String escape (String text)
{
text = StringUtil.replace(text, "\\", "\\\\");
return "'" + StringUtil.replace(text, "'", "\\'") + "'";
text = text.replace("\\", "\\\\");
return "'" + text.replace("'", "\\'") + "'";
}
/**
@@ -284,7 +284,7 @@ public class JDBCUtil
*/
public static String safeJigger (String text)
{
return StringUtil.replace(jigger(text), "'", "\\'");
return jigger(text).replace("'", "\\'");
}
/**
@@ -214,7 +214,7 @@ public class UserManager
if (user == null) {
// first construct the redirect URL
String eurl = RequestUtils.getLocationEncoded(req);
String target = StringUtil.replace(_loginURL, "%R", eurl);
String target = _loginURL.replace("%R", eurl);
if (USERMGR_DEBUG) {
log.info("No user found in require, redirecting", "to", target);
}
@@ -24,8 +24,6 @@ import java.io.*;
import java.util.*;
import com.samskivert.util.ConfigUtil;
import com.samskivert.util.StringUtil;
import static com.samskivert.Log.log;
/**
@@ -150,7 +148,7 @@ public class ExceptionMap
break;
}
}
return StringUtil.replace(msg, MESSAGE_MARKER, ex.getMessage());
return msg.replace(MESSAGE_MARKER, ex.getMessage());
}
protected static List<Class<?>> _keys;
@@ -46,14 +46,14 @@ public class HTMLUtil
// (first we turn the entified versions normal so that if text is
// repeatedly run through this it doesn't keep changing successive
// &'s into "&amp;".
text = StringUtil.replace(text, "&quot;", "\"");
text = StringUtil.replace(text, "&gt;", ">");
text = StringUtil.replace(text, "&lt;", "<");
text = StringUtil.replace(text, "&amp;", "&");
text = StringUtil.replace(text, "&", "&amp;");
text = StringUtil.replace(text, "<", "&lt;");
text = StringUtil.replace(text, ">", "&gt;");
text = StringUtil.replace(text, "\"", "&quot;");
text = text.replace("&quot;", "\"");
text = text.replace("&gt;", ">");
text = text.replace("&lt;", "<");
text = text.replace("&amp;", "&");
text = text.replace("&", "&amp;");
text = text.replace("<", "&lt;");
text = text.replace(">", "&gt;");
text = text.replace("\"", "&quot;");
return text;
}
@@ -66,8 +66,8 @@ public class HTMLUtil
return text;
}
// handle both line ending formats
text = StringUtil.replace(text, "\n\n", "\n<p>\n");
text = StringUtil.replace(text, "\r\n\r\n", "\r\n<p>\r\n");
text = text.replace("\n\n", "\n<p>\n");
text = text.replace("\r\n\r\n", "\r\n<p>\r\n");
return text;
}
@@ -80,7 +80,7 @@ public class HTMLUtil
return text;
}
// handle both line ending formats
text = StringUtil.replace(text, "\n", "<br>\n");
text = text.replace("\n", "<br>\n");
return text;
}
@@ -113,9 +113,9 @@ public class HTMLUtil
StringBuilder lbuf = new StringBuilder();
boolean inpara = false, inlist = false;
for (int ii = 0; ii < lines.length; ii++) {
String line = lines[ii];
if (StringUtil.isBlank(lines[ii])) {
for (String line2 : lines) {
String line = line2;
if (StringUtil.isBlank(line2)) {
if (inlist) {
lbuf.append("</ul>");
inlist = false;
@@ -212,8 +212,8 @@ public class HTMLUtil
ArrayList<String> list = new ArrayList<String>();
list.add(src);
for (int ii=0, nn = regexes.length; ii < nn; ii++) {
Pattern p = Pattern.compile(regexes[ii], Pattern.CASE_INSENSITIVE);
for (String regexe : regexes) {
Pattern p = Pattern.compile(regexe, Pattern.CASE_INSENSITIVE);
for (int jj=0; jj < list.size(); jj += 2) {
String piece = list.get(jj);
Matcher m = p.matcher(piece);
@@ -231,8 +231,8 @@ public class HTMLUtil
for (int jj=0, nn = list.size(); jj < nn; jj++) {
String s = list.get(jj);
if (jj % 2 == 0) {
s = StringUtil.replace(s, "<", "&lt;");
s = StringUtil.replace(s, ">", "&gt;");
s = s.replace("<", "&lt;");
s = s.replace(">", "&gt;");
}
buf.append(s);
}
+1 -1
View File
@@ -55,7 +55,7 @@ public class GenUtil
} else {
Package pkg = clazz.getPackage();
int offset = (pkg == null) ? 0 : pkg.getName().length()+1;
return StringUtil.replace(clazz.getName().substring(offset), "$", ".");
return clazz.getName().substring(offset).replace("$", ".");
}
} else if (type instanceof ParameterizedType) {
@@ -301,7 +301,7 @@ public class Application
path = path.substring(0, ldidx);
}
// convert slashes to dots
path = StringUtil.replace(path, "/", ".");
path.replace("/", ".");
// prepend the base logic package and we're all set
return _logicPkg + path;
}