test fix#3758

This commit is contained in:
PavelRatushny 2017-05-25 18:50:11 +03:00 committed by Alexey Kulish
parent d6a53c43c2
commit 92a11cf1b4
2 changed files with 11 additions and 2 deletions

View file

@ -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$

View file

@ -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<String, String> tags) {
HashMap<String, String> padrams = getParams();
getParams().put(KEY_TAG, new Gson().toJson(tags));
padrams = getParams();
}
private void putTagIntoParams(String tag, String value) {