Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 11374)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 11376)
@@ -67,7 +67,32 @@
     public static class JoinAreasResult {
 
-        public boolean hasChanges;
-
-        public List<Multipolygon> polygons;
+        private final boolean hasChanges;
+        private final List<Multipolygon> polygons;
+
+        /**
+         * Constructs a new {@code JoinAreasResult}.
+         * @param hasChanges whether the result has changes
+         * @param polygons the result polygons, can be null
+         */
+        public JoinAreasResult(boolean hasChanges, List<Multipolygon> polygons) {
+            this.hasChanges = hasChanges;
+            this.polygons = polygons;
+        }
+
+        /**
+         * Determines if the result has changes.
+         * @return {@code true} if the result has changes
+         */
+        public final boolean hasChanges() {
+            return hasChanges;
+        }
+
+        /**
+         * Returns the result polygons, can be null.
+         * @return the result polygons, can be null
+         */
+        public final List<Multipolygon> getPolygons() {
+            return polygons;
+        }
     }
 
@@ -545,6 +570,5 @@
     public JoinAreasResult joinAreas(List<Multipolygon> areas) throws UserCancelException {
 
-        JoinAreasResult result = new JoinAreasResult();
-        result.hasChanges = false;
+        boolean hasChanges = false;
 
         List<Way> allStartingWays = new ArrayList<>();
@@ -565,5 +589,5 @@
 
         if (removedDuplicates) {
-            result.hasChanges = true;
+            hasChanges = true;
             commitCommands(marktr("Removed duplicate nodes"));
         }
@@ -574,5 +598,5 @@
         //no intersections, return.
         if (nodes.isEmpty())
-            return result;
+            return new JoinAreasResult(hasChanges, null);
         commitCommands(marktr("Added node on all intersections"));
 
@@ -655,7 +679,5 @@
         }
 
-        result.hasChanges = true;
-        result.polygons = polygons;
-        return result;
+        return new JoinAreasResult(true, polygons);
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java	(revision 11374)
+++ trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java	(revision 11376)
@@ -111,6 +111,6 @@
             try {
                 JoinAreasResult result = new JoinAreasAction().joinAreas(areas);
-                if (result.hasChanges) {
-                    for (Multipolygon mp : result.polygons) {
+                if (result.hasChanges()) {
+                    for (Multipolygon mp : result.getPolygons()) {
                         optimizedWays.add(mp.outerWay);
                     }
