From b2f340e60f0c9378fb1d4af1399a06568a5ae774 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Sun, 14 Dec 2008 17:56:56 +0000 Subject: [PATCH] Reverting changes for SOLR-913 -- Expensive Pattern object made static in SnapPuller per discussion on solr-dev git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@726505 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/solr/handler/SnapPuller.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/solr/handler/SnapPuller.java b/src/java/org/apache/solr/handler/SnapPuller.java index 5ab3a86b438..e69bf766719 100644 --- a/src/java/org/apache/solr/handler/SnapPuller.java +++ b/src/java/org/apache/solr/handler/SnapPuller.java @@ -947,11 +947,12 @@ 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 = INTERVAL_PATTERN.matcher(interval.trim()); + Matcher m = pattern.matcher(interval.trim()); if (m.find()) { String hr = m.group(1); String min = m.group(2); @@ -1003,5 +1004,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 Pattern INTERVAL_PATTERN = Pattern.compile("(\\d*?):(\\d*?):(\\d*)"); + private static final String INTERVAL_PATTERN = "(\\d*?):(\\d*?):(\\d*)"; }