Ignore:
Timestamp:
2017-04-17T19:27:17+02:00 (8 years ago)
Author:
donvip
Message:

fix #josm14386 - StackOverflowError

Location:
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java

    r32398 r33265  
    202202     * I admit, some of it was copypasted from {@link org.openstreetmap.josm.gui.dialogs.RelationListDialog.RelationListModel}.
    203203     */
    204     protected class FindRelationListModel extends AbstractListModel<Relation> {
     204    protected static class FindRelationListModel extends AbstractListModel<Relation> {
    205205        private final ArrayList<Relation> relations = new ArrayList<>();
    206206        private DefaultListSelectionModel selectionModel;
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java

    r33060 r33265  
    9090        for (JoinedPolygon p : mpc.outerWays) {
    9191
    92             ArrayList<JoinedPolygon> myInnerWays = new ArrayList<JoinedPolygon>();
     92            ArrayList<JoinedPolygon> myInnerWays = new ArrayList<>();
    9393            for (JoinedPolygon i : mpc.innerWays) {
    9494                // if the first point of any inner ring is contained in this
    95                 // outer ring, then this inner ring belongs to us. This 
     95                // outer ring, then this inner ring belongs to us. This
    9696                // assumption only works if multipolygons have valid geometries
    9797                EastNorth en = i.ways.get(0).firstNode().getEastNorth();
     
    102102
    103103            if (!myInnerWays.isEmpty()) {
    104                 // this ring has inner rings, so we leave a multipolygon in 
    105                 // place and don't reconstruct the rings. 
     104                // this ring has inner rings, so we leave a multipolygon in
     105                // place and don't reconstruct the rings.
    106106                Relation n = null;
    107107                if (relationReused) {
     
    131131
    132132            // move all tags from relation and common tags from ways
    133             // start with all tags from first way but only if area tags are
    134             // present
     133            // start with all tags from first way but only if area tags are present
    135134            Map<String, String> tags = p.ways.get(0).getKeys();
    136135            if (!p.ways.get(0).hasAreaTags()) {
     
    209208        if (newRelation == null || !"multipolygon".equals(newRelation.get("type")) || newRelation.getMembersCount() == 0)
    210209            return false;
    211         else {
     210        else
    212211            return true;
    213         }
    214212    }
    215213}
Note: See TracChangeset for help on using the changeset viewer.