From 5e4829d315dac254f7921873a10fa360017d1c8a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 20 Feb 2021 02:01:24 +0100 Subject: [PATCH] Improved code. --- .../metrics/http/HttpAccessLogAnalyzer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLogAnalyzer.java index 396bb8e..8ec0008 100644 --- a/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/http/HttpAccessLogAnalyzer.java @@ -222,13 +222,11 @@ public class HttpAccessLogAnalyzer * the line * @return the http log */ - public static HttpAccessLog parseLog(final String line, final String pattern) + public static HttpAccessLog parseLog(final String line, final Pattern pattern) { HttpAccessLog result; - Pattern combined = Pattern.compile(pattern); - - Matcher matcher = combined.matcher(line); + Matcher matcher = pattern.matcher(line); if (matcher.matches()) { result = new HttpAccessLog(); @@ -266,7 +264,9 @@ public class HttpAccessLogAnalyzer // '"$http_referer" "$http_user_agent"'; String combinedPattern = "^(?[a-zA-F0-9\\\\:\\\\.]+) - (?\\S+) \\[(?