Changeset 16463 in josm for trunk


Ignore:
Timestamp:
2020-05-19T06:46:41+02:00 (4 years ago)
Author:
GerdP
Message:

remove dead deprecated code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r16364 r16463  
    33
    44import java.awt.geom.Area;
    5 import java.util.Collection;
    65import java.util.List;
    76import java.util.Objects;
    87import java.util.Set;
    9 import java.util.TreeSet;
    10 import java.util.function.Predicate;
    118import java.util.stream.Collectors;
    129
     
    1815import org.openstreetmap.josm.data.projection.Projecting;
    1916import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    20 import org.openstreetmap.josm.tools.CheckParameterUtil;
    2117
    2218/**
     
    350346    }
    351347
    352     /**
    353      * Tests whether {@code this} node is connected to {@code otherNode} via at most {@code hops} nodes
    354      * matching the {@code predicate} (which may be {@code null} to consider all nodes).
    355      * @param otherNodes other nodes
    356      * @param hops number of hops
    357      * @param predicate predicate to match
    358      * @return {@code true} if {@code this} node mets the conditions
    359      * @deprecated Was used by UnconnectedWays test
    360      */
    361     @Deprecated
    362     public boolean isConnectedTo(final Collection<Node> otherNodes, final int hops, Predicate<Node> predicate) {
    363         CheckParameterUtil.ensureParameterNotNull(otherNodes);
    364         CheckParameterUtil.ensureThat(!otherNodes.isEmpty(), "otherNodes must not be empty!");
    365         CheckParameterUtil.ensureThat(hops >= 0, "hops must be non-negative!");
    366         return hops == 0
    367                 ? isConnectedTo(otherNodes, hops, predicate, null)
    368                 : isConnectedTo(otherNodes, hops, predicate, new TreeSet<>());
    369     }
    370 
    371     @Deprecated
    372     private boolean isConnectedTo(final Collection<Node> otherNodes, final int hops, Predicate<Node> predicate, Set<Node> visited) {
    373         if (otherNodes.contains(this)) {
    374             return true;
    375         }
    376         if (hops > 0 && visited != null) {
    377             visited.add(this);
    378             for (final Way w : getParentWays()) {
    379                 for (final Node n : w.getNodes()) {
    380                     final boolean containsN = visited.contains(n);
    381                     if (!containsN && (predicate == null || predicate.test(n))
    382                             && n.isConnectedTo(otherNodes, hops - 1, predicate, visited)) {
    383                         return true;
    384                     }
    385                 }
    386             }
    387         }
    388         return false;
    389     }
    390 
    391348    @Override
    392349    public boolean isOutsideDownloadArea() {
Note: See TracChangeset for help on using the changeset viewer.