From 0aec9362a3880900cfc3188f050f666a973edc8f Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Thu, 25 May 2017 18:50:11 +0300 Subject: [PATCH] test fix#3758 --- .../osmand/plus/osmedit/OpenstreetmapRemoteUtil.java | 10 ++++++++-- .../osmand/plus/quickaction/actions/AddPOIAction.java | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index e69ce85bde..b682ceed0d 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -222,8 +222,14 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { for (String k : n.getTagKeySet()) { String val = n.getTag(k); - if (val.length() == 0 || k.length() == 0 || EditPoiData.POI_TYPE_TAG.equals(k) || - k.startsWith(EditPoiData.REMOVE_TAG_PREFIX) || n.getTag(EditPoiData.REMOVE_TAG_PREFIX + k) != null) + boolean valLengthZero = val.length() == 0; + boolean kLengthZero = k.length() == 0; + boolean poiTypeTag = EditPoiData.POI_TYPE_TAG.equals(k); + boolean kStartsWithRemoveTagPrefix = k.startsWith(EditPoiData.REMOVE_TAG_PREFIX); + String removeTagPrefixK = EditPoiData.REMOVE_TAG_PREFIX + k; +// boolean tagWithRemoveTagPrefix = n.getTag(EditPoiData.REMOVE_TAG_PREFIX + k) != null; + boolean tagWithRemoveTagPrefix = k.contains(EditPoiData.REMOVE_TAG_PREFIX); + if (valLengthZero || kLengthZero || poiTypeTag || kStartsWithRemoveTagPrefix || tagWithRemoveTagPrefix) continue; ser.startTag(null, "tag"); //$NON-NLS-1$ ser.attribute(null, "k", k); //$NON-NLS-1$ diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java index a892b7d987..3ad79ad9eb 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/AddPOIAction.java @@ -54,6 +54,7 @@ import net.osmand.util.Algorithms; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; @@ -539,7 +540,9 @@ public class AddPOIAction extends QuickAction { } private void setTagsIntoParams(Map tags) { + HashMap padrams = getParams(); getParams().put(KEY_TAG, new Gson().toJson(tags)); + padrams = getParams(); } private void putTagIntoParams(String tag, String value) {