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

checkstyle: enable relevant whitespace checks and fix them

Location:
trunk/src/org/openstreetmap/josm/command
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/AddCommand.java

    r8456 r8510  
    5252        if (osm instanceof Way) {
    5353            // Fix #10557 - node icon not updated after undoing/redoing addition of a way
    54             ((Way)osm).clearCachedNodeStyles();
     54            ((Way) osm).clearCachedNodeStyles();
    5555        }
    5656    }
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r8456 r8510  
    6969    }
    7070
    71     @Override public boolean executeCommand() {
     71    @Override
     72    public boolean executeCommand() {
    7273        Collection<OsmPrimitive> primitivesToSelect;
    7374        if (createdPrimitives == null) { // first time execution
     
    9495
    9596            // Then load ways and relations
    96             for (int i=0; i<newPrimitives.size(); i++) {
     97            for (int i = 0; i < newPrimitives.size(); i++) {
    9798                if (!(newPrimitives.get(i) instanceof Node)) {
    9899                    newPrimitives.get(i).load(data.get(i));
  • trunk/src/org/openstreetmap/josm/command/ChangeCommand.java

    r8456 r8510  
    5454        CheckParameterUtil.ensureParameterNotNull(osm, "osm");
    5555        CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm");
    56         if (newOsm instanceof Way && ((Way)newOsm).getNodesCount() == 0) {
     56        if (newOsm instanceof Way && ((Way) newOsm).getNodesCount() == 0) {
    5757            // Do not allow to create empty ways (see #7465)
    5858            throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm));
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java

    r8456 r8510  
    8888            text += " "+tr(v.className)+" "+v.name;
    8989        } else {
    90             text += " "+objects.size()+" "+trn("object","objects",objects.size());
     90            text += " "+objects.size()+" "+trn("object", "objects", objects.size());
    9191        }
    9292        return text;
     
    112112                    return v.name;
    113113                }
     114
    114115                @Override
    115116                public Icon getDescriptionIcon() {
    116117                    return v.icon;
    117118                }
     119
    118120                @Override
    119121                public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
  • trunk/src/org/openstreetmap/josm/command/Command.java

    r8447 r8510  
    4545            orig.put(n, n.save());
    4646        }
     47
    4748        @Override
    4849        public void visit(Way w) {
    4950            orig.put(w, w.save());
    5051        }
     52
    5153        @Override
    5254        public void visit(Relation e) {
     
    6870         * @param node The node whose state has to be remembered
    6971         */
    70         public OldNodeState(Node node){
     72        public OldNodeState(Node node) {
    7173            latlon = node.getCoor();
    7274            eastNorth = node.getEastNorth();
     
    280282                    JOptionPane.QUESTION_MESSAGE,
    281283                    JOptionPane.YES_OPTION);
    282             if(!answer)
     284            if (!answer)
    283285                return false;
    284286        }
     
    294296                    JOptionPane.QUESTION_MESSAGE,
    295297                    JOptionPane.YES_OPTION);
    296             if(!answer)
     298            if (!answer)
    297299                return false;
    298300        }
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r8469 r8510  
    259259        if (!silent && !checkAndConfirmOutlyingDelete(parents, null))
    260260            return null;
    261         return new DeleteCommand(layer,parents);
     261        return new DeleteCommand(layer, parents);
    262262    }
    263263
     
    405405            Set<RelationToChildReference> references = RelationToChildReference.getRelationToChildReferences(primitivesToDelete);
    406406            Iterator<RelationToChildReference> it = references.iterator();
    407             while(it.hasNext()) {
     407            while (it.hasNext()) {
    408408                RelationToChildReference ref = it.next();
    409409                if (ref.getParent().isDeleted()) {
     
    431431        //
    432432        if (!primitivesToDelete.isEmpty()) {
    433             cmds.add(new DeleteCommand(layer,primitivesToDelete));
     433            cmds.add(new DeleteCommand(layer, primitivesToDelete));
    434434        }
    435435
     
    473473            chunks.add(n1);
    474474            chunks.add(n2);
    475             return SplitWayAction.splitWay(layer,ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand();
     475            return SplitWayAction.splitWay(layer, ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand();
    476476        }
    477477    }
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r8509 r8510  
    8484             * Loop from back to front to keep referential integrity.
    8585             */
    86             for (int i=toPurge.size()-1; i>=0; --i) {
     86            for (int i = toPurge.size()-1; i >= 0; --i) {
    8787                OsmPrimitive osm = toPurge.get(i);
    8888                if (makeIncompleteDataByPrimId.containsKey(osm)) {
     
    214214                Integer i = numChilds.get(parent);
    215215                if (i != null) {
    216                     numChilds.put((Relation)parent, i+1);
     216                    numChilds.put((Relation) parent, i+1);
    217217                }
    218218            }
  • trunk/src/org/openstreetmap/josm/command/SequenceCommand.java

    r8456 r8510  
    5050
    5151    @Override public boolean executeCommand() {
    52         for (int i=0; i < sequence.length; i++) {
     52        for (int i = 0; i < sequence.length; i++) {
    5353            boolean result = sequence[i].executeCommand();
    5454            if (!result && !continueOnError) {
  • trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java

    r8456 r8510  
    130130     */
    131131    public EastNorth getNodesCenter() {
    132         EastNorth sum = new EastNorth(0,0);
     132        EastNorth sum = new EastNorth(0, 0);
    133133
    134134        for (Node n : nodes) {
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java

    r8456 r8510  
    5252        try {
    5353            getLayer().getConflicts().add(conflict);
    54         } catch(IllegalStateException e) {
     54        } catch (IllegalStateException e) {
    5555            Main.error(e);
    5656            warnBecauseOfDoubleConflict();
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java

    r8456 r8510  
    5757    protected void reconstituteConflicts() {
    5858        OsmDataLayer editLayer = getLayer();
    59         for(Conflict<?> c : resolvedConflicts) {
     59        for (Conflict<?> c : resolvedConflicts) {
    6060            if (!editLayer.getConflicts().hasConflictForMy(c.getMy())) {
    6161                editLayer.getConflicts().add(c);
  • trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java

    r8456 r8510  
    4949    @Override
    5050    public boolean executeCommand() {
    51         // remember the current state of modified primitives, i.e. of
    52         // OSM primitive 'my'
    53         //
     51        // remember the current state of modified primitives, i.e. of OSM primitive 'my'
    5452        super.executeCommand();
    5553
     
    5755            // do nothing
    5856        } else if (decision.equals(MergeDecisionType.KEEP_THEIR)) {
    59             Node my = (Node)conflict.getMy();
    60             Node their = (Node)conflict.getTheir();
     57            Node my = (Node) conflict.getMy();
     58            Node their = (Node) conflict.getTheir();
    6159            my.setCoor(their.getCoor());
    6260        } else
     
    6563
    6664        // remember the layer this command was applied to
    67         //
    6865        rememberConflict(conflict);
    6966
  • trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java

    r8456 r8510  
    4040        case RELATION: msg = marktr("Set the ''modified'' flag for relation {0}"); break;
    4141        }
    42         return tr(msg,conflict.getMy().getId());
     42        return tr(msg, conflict.getMy().getId());
    4343    }
    4444
  • trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java

    r8456 r8510  
    9292        //
    9393        if (!editLayer.getConflicts().hasConflictForMy(my)) {
    94             editLayer.getConflicts().add(my,their);
     94            editLayer.getConflicts().add(my, their);
    9595        }
    9696    }
  • trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java

    r8456 r8510  
    5656            conflict.getMy().setOsmId(
    5757                    conflict.getMy().getId(),
    58                     (int)Math.max(myVersion, theirVersion)
     58                    (int) Math.max(myVersion, theirVersion)
    5959            );
    6060            // update visiblity state
Note: See TracChangeset for help on using the changeset viewer.