From fbc48e510896082b579ab08245c2667c418a6098 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ilpo=20J=C3=A4rvinen?= <ilpo.jarvinen@helsinki.fi>
Date: Sat, 17 Dec 2011 23:59:38 +0200
Subject: [PATCH 1/2] Followline didn't stop when the way became closed

If the follower meets its first node, the followline happily
continues for a second lap. Instead, make the followline to
terminate when the way becomes closed.
---
 .../josm/actions/FollowLineAction.java             |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/org/openstreetmap/josm/actions/FollowLineAction.java b/src/org/openstreetmap/josm/actions/FollowLineAction.java
index cb5378e..58fe454 100644
--- a/src/org/openstreetmap/josm/actions/FollowLineAction.java
+++ b/src/org/openstreetmap/josm/actions/FollowLineAction.java
@@ -71,6 +71,8 @@ public class FollowLineAction extends JosmAction {
         if (last == null)
             return;
         Way follower = selectedLines.iterator().next();
+        if (follower.isClosed())    /* Don't loop until OOM */
+            return;
         Node prev = follower.getNode(1);
         boolean reversed = true;
         if (follower.lastNode().equals(last)) {
-- 
1.7.2.5

