Index: /trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java	(revision 16119)
@@ -256,6 +256,8 @@
             if (w.isClosed())
                 throw new InvalidSelection(tr("Can not align a polygon. Abort."));
-            nodes.addAll(w.getNodes());
-            lines.put(w, new Line(w));
+            if (!w.isEmpty()) {
+                nodes.addAll(w.getNodes());
+                lines.put(w, new Line(w));
+            }
         }
         if (nodes.isEmpty()) {
Index: /trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java	(revision 16119)
@@ -200,6 +200,7 @@
                 nodeList.add((Node) p);
             } else if (p instanceof Way) {
-                if (!p.isIncomplete()) {
-                    wayDataList.add(new WayData(((Way) p).getNodes()));
+                Way w = (Way) p;
+                if (!w.isIncomplete() && !w.isEmpty()) {
+                    wayDataList.add(new WayData(w.getNodes()));
                 }
             } else {
Index: /trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java	(revision 16119)
@@ -117,5 +117,5 @@
 
         final Collection<Way> sel = new LinkedHashSet<>(ds.getSelectedWays());
-        sel.removeIf(Way::isIncomplete);
+        sel.removeIf(w -> w.isIncomplete() || w.isEmpty());
         if (sel.isEmpty()) {
             new Notification(
@@ -129,12 +129,12 @@
         Collection<Command> c = new LinkedList<>();
         for (Way w : sel) {
-            ReverseWayResult revResult;
             try {
-                revResult = reverseWay(w);
+                c.addAll(reverseWay(w).getCommands());
+            } catch (IllegalArgumentException ex) {
+                Logging.error(ex);
             } catch (UserCancelException ex) {
                 Logging.trace(ex);
                 return;
             }
-            c.addAll(revResult.getCommands());
         }
         UndoRedoHandler.getInstance().add(new SequenceCommand(tr("Reverse Ways"), c));
@@ -145,4 +145,5 @@
      * @param w the way
      * @return the reverse command and the tag correction commands
+     * @throws IllegalArgumentException if sanity checks fail
      * @throws UserCancelException if user cancels a reverse warning dialog
      */
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 16119)
@@ -504,5 +504,5 @@
             return false;
 
-        sourceWays.removeIf(w -> w.isIncomplete() || w.getNodesCount() == 0);
+        sourceWays.removeIf(w -> w.isIncomplete() || w.isEmpty());
 
         if (!sourceWays.contains(referenceSegment.way)) {
Index: /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 16119)
@@ -32,4 +32,5 @@
      * @param osm The existing primitive to modify. It must belong to a data set
      * @param newOsm The new primitive
+     * @throws IllegalArgumentException if sanity checks fail
      */
     public ChangeCommand(OsmPrimitive osm, OsmPrimitive newOsm) {
@@ -42,4 +43,5 @@
      * @param osm The existing primitive to modify
      * @param newOsm The new primitive
+     * @throws IllegalArgumentException if sanity checks fail
      * @since 11240
      */
@@ -54,5 +56,5 @@
         CheckParameterUtil.ensureParameterNotNull(osm, "osm");
         CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm");
-        if (newOsm instanceof Way && ((Way) newOsm).getNodesCount() == 0) {
+        if (newOsm instanceof Way && ((Way) newOsm).isEmpty()) {
             // Do not allow to create empty ways (see #7465)
             throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm));
Index: /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 16119)
@@ -1017,5 +1017,5 @@
 
     void fireWayNodesChanged(Way way) {
-        if (way.getNodesCount() > 0) {
+        if (!way.isEmpty()) {
             store.reindexWay(way, Way::updatePosition, Relation::updatePosition);
         }
Index: /trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java	(revision 16119)
@@ -174,5 +174,5 @@
         final Stopwatch stopwatch = Stopwatch.createStarted();
         for (Way way : dataSet.getWays()) {
-            if (way.isUsable() && way.getNodesCount() == 0) {
+            if (way.isUsable() && way.isEmpty()) {
                 printError("WARN - ZERO NODES", "Way %s has zero nodes", way);
             } else if (way.isUsable() && way.getNodesCount() == 1) {
Index: /trunk/src/org/openstreetmap/josm/data/osm/IRelation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/IRelation.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/osm/IRelation.java	(revision 16119)
@@ -22,4 +22,13 @@
      */
     int getMembersCount();
+
+    /**
+     * Determines if this relation is empty, i.e. it has no members.
+     * @return {@code true} if this relation is empty, i.e. it has no members
+     * @since 16119
+     */
+    default boolean isEmpty() {
+        return getMembersCount() == 0;
+    }
 
     /**
Index: /trunk/src/org/openstreetmap/josm/data/osm/IWay.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/IWay.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/osm/IWay.java	(revision 16119)
@@ -17,4 +17,13 @@
      */
     int getNodesCount();
+
+    /**
+     * Determines if this way is empty, i.e. it has no nodes.
+     * @return {@code true} if this way is empty, i.e. it has no nodes
+     * @since 16119
+     */
+    default boolean isEmpty() {
+        return getNodesCount() == 0;
+    }
 
     /**
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 16119)
@@ -424,5 +424,5 @@
                     for (Long wayId : wayIds) {
                         Way w = (Way) ds.getPrimitiveById(wayId, OsmPrimitiveType.WAY);
-                        if (w != null && w.getNodesCount() > 0) { // fix #7173 (empty ways on purge)
+                        if (w != null && !w.isEmpty()) { // fix #7173 (empty ways on purge)
                             waysToJoin.add(w);
                         }
@@ -599,5 +599,5 @@
                 for (int i = 0; i < joinArray.length && left != 0; ++i) {
                     Way c = joinArray[i];
-                    if (c != null && c.getNodesCount() > 0) {
+                    if (c != null && !c.isEmpty()) {
                         if (nodes == null) {
                             // new ring
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 16119)
@@ -93,5 +93,5 @@
     @Override
     public void visit(Relation r) {
-        if (r.isMultipolygon() && r.getMembersCount() > 0) {
+        if (r.isMultipolygon() && !r.isEmpty()) {
             List<TestError> tmpErrors = new ArrayList<>(30);
             boolean hasUnexpectedWayRoles = checkMembersAndRoles(r, tmpErrors);
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 16119)
@@ -126,5 +126,5 @@
         }
 
-        if (w.getNodesCount() == 0) {
+        if (w.isEmpty()) {
             errors.add(TestError.builder(this, Severity.ERROR, EMPTY_WAY)
                     .message(tr("Empty ways"))
Index: /trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java	(revision 16119)
@@ -34,5 +34,5 @@
      */
     public static List<List<Way>> getWaysInCell(Way w, Map<Point2D, List<Way>> cellWays) {
-        if (w.getNodesCount() == 0)
+        if (w.isEmpty())
             return Collections.emptyList();
 
Index: /trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/SelectionManager.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/gui/SelectionManager.java	(revision 16119)
@@ -391,5 +391,5 @@
             // ways
             for (Way w : ds.getWays()) {
-                if (!w.isSelectable() || w.getNodesCount() == 0) {
+                if (!w.isSelectable() || w.isEmpty()) {
                     continue;
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java	(revision 16118)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java	(revision 16119)
@@ -65,5 +65,5 @@
         // If the user wanted to create a new relation, but hasn't added any members or
         // tags, don't add an empty relation
-        if (newRelation.getMembersCount() == 0 && !newRelation.hasKeys())
+        if (newRelation.isEmpty() && !newRelation.hasKeys())
             return;
         UndoRedoHandler.getInstance().add(new AddCommand(getLayer().getDataSet(), newRelation));
