Index: trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java	(revision 8459)
+++ trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java	(revision 8460)
@@ -147,5 +147,5 @@
         }
 
-        if (ways.size() == 1 && ways.get(0).firstNode() != ways.get(0).lastNode()) {
+        if (ways.size() == 1 && !ways.get(0).isClosed()) {
             // Case 1
             Way w = ways.get(0);
@@ -379,10 +379,10 @@
     protected static boolean checkWaysArePolygon(Collection<Way> ways) {
         // For each way, nodes strictly between first and last should't be reference by an other way
-        for(Way way: ways) {
-            for(Node node: way.getNodes()) {
-                if(node == way.firstNode() || node == way.lastNode()) continue;
-                for(Way wayOther: ways) {
-                    if(way == wayOther) continue;
-                    if(node.getReferrers().contains(wayOther)) return false;
+        for (Way way: ways) {
+            for (Node node: way.getNodes()) {
+                if (way.isFirstLastNode(node)) continue;
+                for (Way wayOther: ways) {
+                    if (way == wayOther) continue;
+                    if (node.getReferrers().contains(wayOther)) return false;
                 }
             }
@@ -392,10 +392,10 @@
         Node startNode = null, endNode = null;
         int used = 0;
-        while(true) {
+        while (true) {
             Way nextWay = null;
-            for(Way w: ways) {
-                if(w.firstNode() == w.lastNode()) return ways.size() == 1;
-                if(w == currentWay) continue;
-                if(currentWay == null) {
+            for (Way w: ways) {
+                if (w.isClosed()) return ways.size() == 1;
+                if (w == currentWay) continue;
+                if (currentWay == null) {
                     nextWay = w;
                     startNode = w.firstNode();
@@ -403,10 +403,10 @@
                     break;
                 }
-                if(w.firstNode() == endNode) {
+                if (w.firstNode() == endNode) {
                     nextWay = w;
                     endNode = w.lastNode();
                     break;
                 }
-                if(w.lastNode() == endNode) {
+                if (w.lastNode() == endNode) {
                     nextWay = w;
                     endNode = w.firstNode();
@@ -414,8 +414,8 @@
                 }
             }
-            if(nextWay == null) return false;
+            if (nextWay == null) return false;
             used += 1;
             currentWay = nextWay;
-            if(endNode == startNode) return used == ways.size();
+            if (endNode == startNode) return used == ways.size();
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java	(revision 8459)
+++ trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java	(revision 8460)
@@ -235,6 +235,6 @@
         Set<Node> nodes = new HashSet<>();
         Map<Way, Line> lines = new HashMap<>();
-        for(Way w: ways) {
-            if(w.firstNode() == w.lastNode())
+        for (Way w: ways) {
+            if (w.isClosed())
                 throw new InvalidSelection(tr("Can not align a polygon. Abort."));
             nodes.addAll(w.getNodes());
@@ -243,14 +243,14 @@
         Collection<Command> cmds = new ArrayList<>(nodes.size());
         List<Way> referers = new ArrayList<>(ways.size());
-        for(Node n: nodes) {
+        for (Node n: nodes) {
             referers.clear();
-            for(OsmPrimitive o: n.getReferrers())
-                if(ways.contains(o))
+            for (OsmPrimitive o: n.getReferrers())
+                if (ways.contains(o))
                     referers.add((Way) o);
-            if(referers.size() == 1) {
+            if (referers.size() == 1) {
                 Way way = referers.get(0);
-                if(n == way.firstNode() || n == way.lastNode()) continue;
+                if (way.isFirstLastNode(n)) continue;
                 cmds.add(lines.get(way).projectionCommand(n));
-            } else if(referers.size() == 2) {
+            } else if (referers.size() == 2) {
                 Command cmd = lines.get(referers.get(0)).intersectionCommand(n, lines.get(referers.get(1)));
                 cmds.add(cmd);
Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 8459)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 8460)
@@ -1070,6 +1070,6 @@
         // Remove all of these way to make the next work.
         List<WayInPolygon> cleanMultigonWays = new ArrayList<>();
-        for(WayInPolygon way: multigonWays)
-            if(way.way.getNodesCount() == 2 && way.way.firstNode() == way.way.lastNode())
+        for (WayInPolygon way: multigonWays)
+            if (way.way.getNodesCount() == 2 && way.way.isClosed())
                 discardedWays.add(way);
             else
