aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/Geocache.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-24 15:52:45 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-24 15:52:45 +0200
commitfdb050bc8b2e4c5aa98a49a1f8a48727cc07194c (patch)
treeaca4332454b1885734aac65c164ee198634305a7 /main/src/cgeo/geocaching/Geocache.java
parentd48b4a67639202e6fdc8599740ad68619034a2b4 (diff)
downloadcgeo-fdb050bc8b2e4c5aa98a49a1f8a48727cc07194c.zip
cgeo-fdb050bc8b2e4c5aa98a49a1f8a48727cc07194c.tar.gz
cgeo-fdb050bc8b2e4c5aa98a49a1f8a48727cc07194c.tar.bz2
Local spoilers are not real spoilers
They should not be returned by getSpoilers() as they would be stored again.
Diffstat (limited to 'main/src/cgeo/geocaching/Geocache.java')
-rw-r--r--main/src/cgeo/geocaching/Geocache.java6
1 files changed, 3 insertions, 3 deletions
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<Image> getSpoilers() {
- final List<Image> allSpoilers = new LinkedList<Image>(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<Image> getImages() {
final LinkedList<Image> result = new LinkedList<Image>();
result.addAll(getSpoilers());
+ addLocalSpoilersTo(result);
for (final LogEntry log : getLogs()) {
result.addAll(log.getLogImages());
}