aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2013-01-03 13:41:43 +0100
committerrsudev <rasch@munin-soft.de>2013-01-03 13:41:43 +0100
commitb12be9146ef9610e0e970ac0f6e96e03e14d86f4 (patch)
tree5b2b565917a52c548de9de3ef68b0200fc610491 /main/src
parent3b08e226567148016ee26298835bb96bdf33d8bd (diff)
parent061e1e0f5ae1c7c19a84c80e60a3643556b25fc2 (diff)
downloadcgeo-b12be9146ef9610e0e970ac0f6e96e03e14d86f4.zip
cgeo-b12be9146ef9610e0e970ac0f6e96e03e14d86f4.tar.gz
cgeo-b12be9146ef9610e0e970ac0f6e96e03e14d86f4.tar.bz2
Merge remote-tracking branch 'upstream/release' into issue2319
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCParser.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java
index 44d634c..5243f18 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCParser.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java
@@ -539,15 +539,19 @@ public abstract class GCParser {
while (matcherSpoilersInside.find()) {
// the original spoiler URL (include .../display/... contains a low-resolution image
// if we shorten the URL we get the original-resolution image
- String url = matcherSpoilersInside.group(1).replace("/display", "");
+ //
+ // Create a new string to avoid referencing the whole page though the matcher (@see BaseUtils.getMatch())
+ String url = new String(matcherSpoilersInside.group(1).replace("/display", ""));
String title = null;
if (matcherSpoilersInside.group(3) != null) {
- title = matcherSpoilersInside.group(3);
+ // Create a new string to avoid referencing the whole page though the matcher (@see BaseUtils.getMatch())
+ title = new String(matcherSpoilersInside.group(3));
}
String description = null;
if (matcherSpoilersInside.group(4) != null) {
- description = matcherSpoilersInside.group(4);
+ // Create a new string to avoid referencing the whole page though the matcher (@see BaseUtils.getMatch())
+ description = new String(matcherSpoilersInside.group(4));
}
cache.addSpoiler(new cgImage(url, title, description));
}
@@ -575,8 +579,10 @@ public abstract class GCParser {
while (matcherInventoryInside.find()) {
if (matcherInventoryInside.groupCount() > 0) {
final cgTrackable inventoryItem = new cgTrackable();
- inventoryItem.setGuid(matcherInventoryInside.group(1));
- inventoryItem.setName(matcherInventoryInside.group(2));
+ // Create a new string to avoid referencing the whole page though the matcher (@see BaseUtils.getMatch())
+ inventoryItem.setGuid(new String(matcherInventoryInside.group(1)));
+ // Create a new string to avoid referencing the whole page though the matcher (@see BaseUtils.getMatch())
+ inventoryItem.setName(new String(matcherInventoryInside.group(2)));
cache.getInventory().add(inventoryItem);
cache.setInventoryItems(cache.getInventoryItems() + 1);