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
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 8459)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 8460)
@@ -441,7 +441,6 @@
             return delete(layer, Collections.singleton(ws.way), false);
 
-        if (ws.way.firstNode() == ws.way.lastNode()) {
-            // If the way is circular (first and last nodes are the same),
-            // the way shouldn't be splitted
+        if (ws.way.isClosed()) {
+            // If the way is circular (first and last nodes are the same), the way shouldn't be splitted
 
             List<Node> n = new ArrayList<>();
@@ -456,5 +455,6 @@
         }
 
-        List<Node> n1 = new ArrayList<>(), n2 = new ArrayList<>();
+        List<Node> n1 = new ArrayList<>();
+        List<Node> n2 = new ArrayList<>();
 
         n1.addAll(ws.way.getNodes().subList(0, ws.lowerIndex + 1));
Index: trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 8459)
+++ trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 8460)
@@ -391,5 +391,5 @@
         boolean locked = writeLock();
         try {
-            boolean closed = lastNode() == firstNode() && selection.contains(lastNode());
+            boolean closed = isClosed() && selection.contains(lastNode());
             List<Node> copy = new ArrayList<>();
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java	(revision 8459)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java	(revision 8460)
@@ -34,5 +34,5 @@
                 w.getNode(1) != null &&
                 w.getNode(2) != null &&
-                w.firstNode() == w.lastNode()) {
+                w.isClosed()) {
             /** do some simple determinant / cross pruduct test on the first 3 nodes
                 to see, if the roundabout goes clock wise or ccw */
