test fix#3758

This commit is contained in:
PavelRatushny 2017-05-25 18:50:11 +03:00
parent 5f9663ef31
commit 0aec9362a3
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()) { for (String k : n.getTagKeySet()) {
String val = n.getTag(k); String val = n.getTag(k);
if (val.length() == 0 || k.length() == 0 || EditPoiData.POI_TYPE_TAG.equals(k) || boolean valLengthZero = val.length() == 0;
k.startsWith(EditPoiData.REMOVE_TAG_PREFIX) || n.getTag(EditPoiData.REMOVE_TAG_PREFIX + k) != null) 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; continue;
ser.startTag(null, "tag"); //$NON-NLS-1$ ser.startTag(null, "tag"); //$NON-NLS-1$
ser.attribute(null, "k", k); //$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.lang.reflect.Type;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -539,7 +540,9 @@ public class AddPOIAction extends QuickAction {
} }
private void setTagsIntoParams(Map<String, String> tags) { private void setTagsIntoParams(Map<String, String> tags) {
HashMap<String, String> padrams = getParams();
getParams().put(KEY_TAG, new Gson().toJson(tags)); getParams().put(KEY_TAG, new Gson().toJson(tags));
padrams = getParams();
} }
private void putTagIntoParams(String tag, String value) { private void putTagIntoParams(String tag, String value) {