- Timestamp:
- 2014-12-10T22:07:39+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
r7005 r7783 80 80 String v = Tag.removeWhiteSpaces(e.getValue()); 81 81 String k = Tag.removeWhiteSpaces(e.getKey()); 82 boolean drop = k.isEmpty() || v.isEmpty(); 82 83 if(!e.getKey().equals(k)) { 83 boolean drop = k.isEmpty() || v.isEmpty();84 84 if(drop || !keys.containsKey(k)) { 85 85 newKeys.remove(e.getKey()); … … 92 92 else 93 93 newKeys.put(k, v); 94 } else if (drop) { 95 newKeys.remove(e.getKey()); 94 96 } 95 97 } -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r7509 r7783 18 18 import java.util.concurrent.atomic.AtomicLong; 19 19 20 import org.openstreetmap.josm.tools.Utils; 21 20 22 /** 21 23 * Abstract class to represent common features of the datatypes primitives. … … 509 511 * removes the key and behaves like {@link #remove(String)}. 510 512 * 511 * @param key The key, for which the value is to be set. Can be null , does nothing in this case.513 * @param key The key, for which the value is to be set. Can be null or empty, does nothing in this case. 512 514 * @param value The value for the key. If null, removes the respective key/value pair. 513 515 * … … 517 519 public void put(String key, String value) { 518 520 Map<String, String> originalKeys = getKeys(); 519 if (key == null )521 if (key == null || Utils.strip(key).isEmpty()) 520 522 return; 521 523 else if (value == null) { -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r7005 r7783 204 204 // Format 205 205 // tag1\tval1\ntag2\tval2\n 206 tags = readTagsByRegexp(buf, "[\\r\\n]+", "( .*?)\\t(.*?)", false);206 tags = readTagsByRegexp(buf, "[\\r\\n]+", "([a-zA-Z0-9:_]+)\\t(.*?)", false); 207 207 // try "tag\tvalue\n" format 208 208 if (tags!=null) return tags; … … 213 213 // a = "b=c" is OK 214 214 // a = b=c - this method of parsing fails intentionally 215 tags = readTagsByRegexp(buf, "[\\n\\t\\r]+", "( .*?)=(.*?)", true);215 tags = readTagsByRegexp(buf, "[\\n\\t\\r]+", "([a-zA-Z0-9:_]+)=(.*?)", true); 216 216 // try format t1=v1\n t2=v2\n ... 217 217 if (tags!=null) return tags;
Note:
See TracChangeset
for help on using the changeset viewer.