Ignore:
Timestamp:
2010-01-29T22:26:58+01:00 (14 years ago)
Author:
mjulius
Message:

remove OsmPrimitive.entrySet()
using keySet()/get() or getKeys() instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java

    r2641 r2906  
    55import java.util.Collection;
    66import java.util.Collections;
    7 import java.util.Map.Entry;
    87
    98import javax.swing.JOptionPane;
     
    5049    private boolean checkMaxNodes(Collection<OsmPrimitive> primitives, long maxNodes) {
    5150        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) {
    5454                    if (osmPrimitive.isDeleted()) {
    5555                        // if OsmPrimitive is going to be deleted we automatically shorten the
     
    5757                        System.out.println(
    5858                                tr("Warning: automatically truncating value of tag ''{0}'' on deleted object {1}",
    59                                         e.getKey(),
     59                                        key,
    6060                                        Long.toString(osmPrimitive.getId())
    6161                                )
    6262                        );
    63                         osmPrimitive.put(e.getKey(), e.getValue().substring(0, 255));
     63                        osmPrimitive.put(key, value.substring(0, 255));
    6464                        continue;
    6565                    }
    6666                    JOptionPane.showMessageDialog(Main.parent,
    6767                            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()
    6969                            ),
    7070                            tr("Precondition Violation"),
Note: See TracChangeset for help on using the changeset viewer.