提交 d1303928 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use String.replace(char, char) instead of StringUtils.replaceAll(String, String) where possible

上级 731abc26
......@@ -314,9 +314,9 @@ public class WebApp {
value = space + value;
}
key = StringUtils.urlEncode(key);
key = StringUtils.replaceAll(key, "+", " ");
key = key.replace('+', ' ');
value = StringUtils.urlEncode(value);
value = StringUtils.replaceAll(value, "+", " ");
value = value.replace('+', ' ');
list.add(type + "#" + key + "#" + value);
}
Collections.sort(list);
......
......@@ -247,7 +247,7 @@ class Database {
String key = (String) k;
if (key.startsWith(databaseType + ".")) {
String pattern = key.substring(databaseType.length() + 1);
pattern = StringUtils.replaceAll(pattern, "_", " ");
pattern = pattern.replace('_', ' ');
pattern = StringUtils.toUpperEnglish(pattern);
String replacement = prop.getProperty(key);
replace.add(new String[]{pattern, replacement});
......
......@@ -402,7 +402,7 @@ public class TestCsv extends TestBase {
InputStreamReader reader = new InputStreamReader(
FileUtils.newInputStream(fileName));
String text = IOUtils.readStringAndClose(reader, -1).trim();
text = StringUtils.replaceAll(text, "\n", " ");
text = text.replace('\n', ' ');
assertEquals("ID|NAME 1|Hello", text);
ResultSet rs = stat.executeQuery("select * from csvread('" +
fileName + "', null, null, '|', '')");
......
......@@ -176,9 +176,9 @@ public class GenerateDoc {
}
String link = topic.toLowerCase();
link = StringUtils.replaceAll(link, " ", "_");
link = link.replace(' ', '_');
// link = StringUtils.replaceAll(link, "_", "");
link = StringUtils.replaceAll(link, "@", "_");
link = link.replace('@', '_');
map.put("link", StringUtils.urlEncode(link));
list.add(map);
......
......@@ -109,9 +109,9 @@ public class Railroads {
}
String link = topic.toLowerCase();
link = StringUtils.replaceAll(link, " ", "_");
link = link.replace(' ', '_');
// link = StringUtils.replaceAll(link, "_", "");
link = StringUtils.replaceAll(link, "@", "_");
link = link.replace('@', '_');
map.put("link", StringUtils.urlEncode(link));
list.add(map);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论