Ignore:
Timestamp:
2016-12-03T18:16:10+01:00 (7 years ago)
Author:
Don-vip
Message:

findbugs - SIC_INNER_SHOULD_BE_STATIC_ANON

File:
1 edited

Legend:

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

    r10663 r11357  
    2020/**
    2121 * Command that replaces the key of one or several objects
    22  *
     22 * @since 3669
    2323 */
    2424public class ChangePropertyKeyCommand extends Command {
     25    final class SinglePrimitivePseudoCommand implements PseudoCommand {
     26        private final String name;
     27        private final OsmPrimitive osm;
     28        private final Icon icon;
     29
     30        SinglePrimitivePseudoCommand(String name, OsmPrimitive osm, Icon icon) {
     31            this.name = name;
     32            this.osm = osm;
     33            this.icon = icon;
     34        }
     35
     36        @Override
     37        public String getDescriptionText() {
     38            return name;
     39        }
     40
     41        @Override
     42        public Icon getDescriptionIcon() {
     43            return icon;
     44        }
     45
     46        @Override
     47        public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
     48            return Collections.singleton(osm);
     49        }
     50    }
     51
    2552    /**
    2653     * All primitives, that are affected with this command.
     
    108135        for (final OsmPrimitive osm : objects) {
    109136            osm.accept(v);
    110             final String name = v.name;
    111             final Icon icon = v.icon;
    112             children.add(new PseudoCommand() {
    113                 @Override
    114                 public String getDescriptionText() {
    115                     return name;
    116                 }
    117 
    118                 @Override
    119                 public Icon getDescriptionIcon() {
    120                     return icon;
    121                 }
    122 
    123                 @Override
    124                 public Collection<? extends OsmPrimitive> getParticipatingPrimitives() {
    125                     return Collections.singleton(osm);
    126                 }
    127             });
     137            children.add(new SinglePrimitivePseudoCommand(v.name, osm, v.icon));
    128138        }
    129139        return children;
Note: See TracChangeset for help on using the changeset viewer.