Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (11 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

File:
1 edited

Legend:

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

    r8419 r8510  
    4747            @Override
    4848            public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) {
    49                 if(osm instanceof Relation && "multipolygon".equals(keys.get("type")) && "administrative".equals(keys.get("boundary"))) {
     49                if (osm instanceof Relation && "multipolygon".equals(keys.get("type")) && "administrative".equals(keys.get("boundary"))) {
    5050                    keys.put("type", "boundary");
    5151                    return true;
     
    8181                String k = Tag.removeWhiteSpaces(e.getKey());
    8282                boolean drop = k.isEmpty() || v.isEmpty();
    83                 if(!e.getKey().equals(k)) {
    84                     if(drop || !keys.containsKey(k)) {
     83                if (!e.getKey().equals(k)) {
     84                    if (drop || !keys.containsKey(k)) {
    8585                        newKeys.put(e.getKey(), null);
    86                         if(!drop)
     86                        if (!drop)
    8787                            newKeys.put(k, v);
    8888                    }
    89                 } else if(!e.getValue().equals(v)) {
     89                } else if (!e.getValue().equals(v)) {
    9090                    newKeys.put(k, v.isEmpty() ? null : v);
    9191                } else if (drop) {
     
    124124        @Override
    125125        public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) {
    126             if(keys.containsKey(oldKey) && !keys.containsKey(newKey)) {
     126            if (keys.containsKey(oldKey) && !keys.containsKey(newKey)) {
    127127                keys.put(newKey, keys.get(oldKey));
    128128                keys.put(oldKey, null);
    129129                return true;
    130             } else if(keys.containsKey(oldKey) && keys.containsKey(newKey) && keys.get(oldKey).equals(keys.get(newKey))) {
     130            } else if (keys.containsKey(oldKey) && keys.containsKey(newKey) && keys.get(oldKey).equals(keys.get(newKey))) {
    131131                keys.put(oldKey, null);
    132132                return true;
     
    166166        @Override
    167167        public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) {
    168             if(oldValue.equals(keys.get(oldKey)) && (newKey.equals(oldKey)
     168            if (oldValue.equals(keys.get(oldKey)) && (newKey.equals(oldKey)
    169169            || !keys.containsKey(newKey) || keys.get(newKey).equals(newValue))) {
    170170                keys.put(newKey, newValue);
    171                 if(!newKey.equals(oldKey))
     171                if (!newKey.equals(oldKey))
    172172                    keys.put(oldKey, null);
    173173                return true;
     
    183183    @Override
    184184    public boolean checkUpload(APIDataSet apiDataSet) {
    185         if(!Main.pref.getBoolean("fix.data.on.upload", true))
     185        if (!Main.pref.getBoolean("fix.data.on.upload", true))
    186186            return true;
    187187
     
    191191        for (OsmPrimitive osm : objectsToUpload) {
    192192            Map<String, String> keys = new HashMap<>(osm.getKeys());
    193             if(!keys.isEmpty()) {
     193            if (!keys.isEmpty()) {
    194194                boolean modified = false;
    195195                for (FixData fix : deprecated) {
    196                     if(fix.fixKeys(keys, osm))
     196                    if (fix.fixKeys(keys, osm))
    197197                        modified = true;
    198198                }
    199                 if(modified)
     199                if (modified)
    200200                    cmds.add(new ChangePropertyCommand(Collections.singleton(osm), keys));
    201201            }
    202202        }
    203203
    204         if(!cmds.isEmpty())
     204        if (!cmds.isEmpty())
    205205            Main.main.undoRedo.add(new SequenceCommand(tr("Fix deprecated tags"), cmds));
    206206        return true;
Note: See TracChangeset for help on using the changeset viewer.