From 68069dc6982f3a2c87690eb9171f5820064ebbab Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sat, 5 Jan 2013 11:03:58 +0100 Subject: fix #2328: Have a wrapper around Matcher to avoid String related memory issues --- main/src/cgeo/geocaching/LogEntry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/src/cgeo/geocaching/LogEntry.java') diff --git a/main/src/cgeo/geocaching/LogEntry.java b/main/src/cgeo/geocaching/LogEntry.java index b625bb5..1cb3de3 100644 --- a/main/src/cgeo/geocaching/LogEntry.java +++ b/main/src/cgeo/geocaching/LogEntry.java @@ -2,6 +2,7 @@ package cgeo.geocaching; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.utils.DateUtils; +import cgeo.geocaching.utils.MatcherWrapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -10,7 +11,6 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.List; -import java.util.regex.Matcher; import java.util.regex.Pattern; public final class LogEntry { @@ -107,7 +107,7 @@ public final class LogEntry { */ public String getDisplayText() { if (Settings.getPlainLogs()) { - Matcher matcher = PATTERN_REMOVE_COLORS.matcher(log); + MatcherWrapper matcher = new MatcherWrapper(PATTERN_REMOVE_COLORS, log); return matcher.replaceAll(""); } return log; -- cgit v1.1