SOLR-913 -- Expensive Pattern object made static in SnapPuller

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@726504 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2008-12-14 17:46:21 +00:00
parent de702ae19a
commit 44758ae090
1 changed files with 2 additions and 3 deletions

View File

@ -947,12 +947,11 @@ public class SnapPuller {
}
static Integer readInterval(String interval) {
Pattern pattern = Pattern.compile(INTERVAL_PATTERN);
if (interval == null)
return null;
int result = 0;
if (interval != null) {
Matcher m = pattern.matcher(interval.trim());
Matcher m = INTERVAL_PATTERN.matcher(interval.trim());
if (m.find()) {
String hr = m.group(1);
String min = m.group(2);
@ -1004,5 +1003,5 @@ public class SnapPuller {
public static final String INTERVAL_ERR_MSG = "The " + POLL_INTERVAL + " must be in this format 'HH:mm:ss'";
private static final String INTERVAL_PATTERN = "(\\d*?):(\\d*?):(\\d*)";
private static final Pattern INTERVAL_PATTERN = Pattern.compile("(\\d*?):(\\d*?):(\\d*)");
}