Ignore:
Timestamp:
2015-11-25T01:21:14+01:00 (9 years ago)
Author:
Don-vip
Message:

Sonar - squid:S1941 - Variables should not be declared before they are relevant

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

Legend:

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

    r8855 r9062  
    374374            return null;
    375375
    376         Collection<Way> waysToBeChanged = new HashSet<>();
    377 
    378376        if (alsoDeleteNodesInWay) {
    379377            // delete untagged nodes only referenced by primitives in primitivesToDelete, too
     
    386384            return null;
    387385
    388         waysToBeChanged.addAll(OsmPrimitive.getFilteredSet(OsmPrimitive.getReferrer(primitivesToDelete), Way.class));
     386        Collection<Way> waysToBeChanged = new HashSet<>(OsmPrimitive.getFilteredSet(OsmPrimitive.getReferrer(primitivesToDelete), Way.class));
    389387
    390388        Collection<Command> cmds = new LinkedList<>();
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r8931 r9062  
    200200        @SuppressWarnings({ "unchecked", "rawtypes" })
    201201        Set<Relation> inR = (Set) in;
    202         Set<Relation> childlessR = new HashSet<>();
    203         List<Relation> outR = new ArrayList<>(inR.size());
    204202
    205203        Map<Relation, Integer> numChilds = new HashMap<>();
     
    219217            }
    220218        }
     219        Set<Relation> childlessR = new HashSet<>();
    221220        for (Relation r : inR) {
    222221            if (numChilds.get(r).equals(0)) {
     
    225224        }
    226225
     226        List<Relation> outR = new ArrayList<>(inR.size());
    227227        while (!childlessR.isEmpty()) {
    228228            // Identify one childless Relation and
Note: See TracChangeset for help on using the changeset viewer.