Changeset 2906 in josm for trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
- Timestamp:
- 2010-01-29T22:26:58+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r2641 r2906 5 5 import java.util.Collection; 6 6 import java.util.Collections; 7 import java.util.Map.Entry;8 7 9 8 import javax.swing.JOptionPane; … … 50 49 private boolean checkMaxNodes(Collection<OsmPrimitive> primitives, long maxNodes) { 51 50 for (OsmPrimitive osmPrimitive : primitives) { 52 for (Entry<String,String> e : osmPrimitive.entrySet()) { 53 if(e.getValue().length() > 255) { 51 for (String key: osmPrimitive.keySet()) { 52 String value = osmPrimitive.get(key); 53 if(key.length() > 255) { 54 54 if (osmPrimitive.isDeleted()) { 55 55 // if OsmPrimitive is going to be deleted we automatically shorten the … … 57 57 System.out.println( 58 58 tr("Warning: automatically truncating value of tag ''{0}'' on deleted object {1}", 59 e.getKey(),59 key, 60 60 Long.toString(osmPrimitive.getId()) 61 61 ) 62 62 ); 63 osmPrimitive.put( e.getKey(), e.getValue().substring(0, 255));63 osmPrimitive.put(key, value.substring(0, 255)); 64 64 continue; 65 65 } 66 66 JOptionPane.showMessageDialog(Main.parent, 67 67 tr("Length of value for tag ''{0}'' on object {1} exceeds the max. allowed length {2}. Values length is {3}.", 68 e.getKey(), Long.toString(osmPrimitive.getId()), 255, e.getValue().length()68 key, Long.toString(osmPrimitive.getId()), 255, value.length() 69 69 ), 70 70 tr("Precondition Violation"),
Note:
See TracChangeset
for help on using the changeset viewer.