From fdb050bc8b2e4c5aa98a49a1f8a48727cc07194c Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 24 Apr 2014 15:52:45 +0200 Subject: Local spoilers are not real spoilers They should not be returned by getSpoilers() as they would be stored again. --- main/src/cgeo/geocaching/Geocache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main') diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index 35855f1..ea3c7b5 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -37,6 +37,7 @@ import cgeo.geocaching.utils.UncertainProperty; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.Predicate; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; @@ -781,9 +782,7 @@ public class Geocache implements ICache, IWaypoint { @Override public List getSpoilers() { - final List allSpoilers = new LinkedList(CollectionUtils.emptyIfNull(spoilers)); - addLocalSpoilersTo(allSpoilers); - return allSpoilers; + return ListUtils.unmodifiableList(ListUtils.emptyIfNull(spoilers)); } @Override @@ -1739,6 +1738,7 @@ public class Geocache implements ICache, IWaypoint { public Collection getImages() { final LinkedList result = new LinkedList(); result.addAll(getSpoilers()); + addLocalSpoilersTo(result); for (final LogEntry log : getLogs()) { result.addAll(log.getLogImages()); } -- cgit v1.1