提交 4da16c45 编写于 作者: K kohsuke

we can now depend on JDK5.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6316 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ed431fe3
......@@ -195,7 +195,7 @@ public class MailSender<P extends AbstractProject<P, B>, B extends AbstractBuild
// workspaceDir will not normally end with one;
// workspaceDir.toURI() will end with '/' if and only if workspaceDir.exists() at time of call
wsPattern = Pattern.compile("(" +
quoteRegexp(ws.getRemote()) + "|" + quoteRegexp(ws.toURI().toString()) + ")[/\\\\]?([^:#\\s]*)");
Pattern.quote(ws.getRemote()) + "|" + Pattern.quote(ws.toURI().toString()) + ")[/\\\\]?([^:#\\s]*)");
}
for (String line : lines) {
if (wsPattern != null) {
......@@ -275,27 +275,6 @@ public class MailSender<P extends AbstractProject<P, B>, B extends AbstractBuild
return caption + build.getProject().getFullDisplayName() + " #" + build.getNumber();
}
/**
* Copied from JDK5, to avoid 5.0 dependency.
*/
private static String quoteRegexp(String s) {
int slashEIndex = s.indexOf("\\E");
if (slashEIndex == -1)
return "\\Q" + s + "\\E";
StringBuilder sb = new StringBuilder(s.length() * 2);
sb.append("\\Q");
int current = 0;
while ((slashEIndex = s.indexOf("\\E", current)) != -1) {
sb.append(s.substring(current, slashEIndex));
current = slashEIndex + 2;
sb.append("\\E\\\\E\\Q");
}
sb.append(s.substring(current, s.length()));
sb.append("\\E");
return sb.toString();
}
/**
* Check whether a path (/-separated) will be archived.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册