Ignore:
Timestamp:
2023-07-24T15:55:23+02:00 (21 months ago)
Author:
taylor.smock
Message:

reltoolbox: Clean up a bunch of lint warnings

Location:
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/AssociatedStreetFixer.java

    r33708 r36102  
    155155         */
    156156        // return results
    157         if (commandList.size() == 0)
     157        if (commandList.isEmpty()) {
    158158            return null;
    159         if (commandList.size() == 1)
    160             return commandList.get(0);
    161         return new SequenceCommand(tr("fix associatedStreet relation"), commandList);
     159        }
     160        return SequenceCommand.wrapIfNeeded(tr("fix associatedStreet relation"), commandList);
    162161    }
    163162}
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java

    r34095 r36102  
    1212import org.openstreetmap.josm.gui.MainApplication;
    1313
    14 
    1514/**
    16  * @see https://wiki.openstreetmap.org/wiki/Relation:boundary
     15 * Fix multipolygon boundaries
     16 * @see <a href="https://wiki.openstreetmap.org/wiki/Relation:boundary">osmwiki:Relation:boundary</a>
    1717 */
    1818public class BoundaryFixer extends MultipolygonFixer {
     
    2525     * For boundary relations both "boundary" and "multipolygon" types are applicable, but
    2626     * it should also have key boundary=administrative to be fully boundary.
    27      * @see https://wiki.openstreetmap.org/wiki/Relation:boundary
     27     * @see <a href="https://wiki.openstreetmap.org/wiki/Relation:boundary">osmwiki:Relation:boundary</a>
    2828     */
    2929    @Override
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/MultipolygonFixer.java

    r34095 r36102  
    2020
    2121/**
    22  * @see https://wiki.openstreetmap.org/wiki/Relation:multipolygon
     22 * @see <a href="https://wiki.openstreetmap.org/wiki/Relation:multipolygon">osmwiki:Relation:multipolygon</a>
    2323 */
    2424public class MultipolygonFixer extends RelationFixer {
     
    6969        Set<Way> outerWays = new HashSet<>();
    7070        for (MultipolygonBuilder.JoinedPolygon poly : mpc.outerWays) {
    71             for (Way w : poly.ways) {
    72                 outerWays.add(w);
    73             }
     71            outerWays.addAll(poly.ways);
    7472        }
    7573        Set<Way> innerWays = new HashSet<>();
    7674        for (MultipolygonBuilder.JoinedPolygon poly : mpc.innerWays) {
    77             for (Way w : poly.ways) {
    78                 innerWays.add(w);
    79             }
     75            innerWays.addAll(poly.ways);
    8076        }
    8177        for (int i = 0; i < r.getMembersCount(); i++) {
    8278            RelationMember m = r.getMember(i);
    8379            if (m.isWay()) {
     80                final Way way = m.getWay();
    8481                String role = null;
    85                 if (outerWays.contains(m.getMember())) {
     82                if (outerWays.contains(way)) {
    8683                    role = "outer";
    87                 } else if (innerWays.contains(m.getMember())) {
     84                } else if (innerWays.contains(way)) {
    8885                    role = "inner";
    8986                }
    9087                if (role != null && !role.equals(m.getRole())) {
    91                     r.setMember(i, new RelationMember(role, m.getMember()));
     88                    r.setMember(i, new RelationMember(role, way));
    9289                    fixed = true;
    9390                }
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/PublicTransportFixer.java

    r34095 r36102  
    1414
    1515/**
    16  * @see https://wiki.openstreetmap.org/wiki/Key:public_transport
    17  */
    18 
    19 /**
    2016 * Helper function for determinate role in public_transport relation
    2117 * @author freeExec
     18 * @see <a href="https://wiki.openstreetmap.org/wiki/Key:public_transport">osmwiki:Key:public_transport</a>
    2219 */
    2320public class PublicTransportFixer extends RelationFixer {
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/RelationFixer.java

    r34551 r36102  
    1717public abstract class RelationFixer {
    1818
    19     private List<String> applicableTypes;
     19    private final List<String> applicableTypes;
    2020    private SortAndFixAction sortAndFixAction;
    2121
Note: See TracChangeset for help on using the changeset viewer.