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 3094)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 3095)
@@ -7,5 +7,4 @@
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.LinkedList;
 import java.util.List;
 
@@ -19,4 +18,26 @@
 public class Multipolygon {
 
+    public static class JoinedWay {
+        private final List<Node> nodes;
+        private final boolean selected;
+
+        public JoinedWay(List<Node> nodes, boolean selected) {
+            this.nodes = nodes;
+            this.selected = selected;
+        }
+
+        public List<Node> getNodes() {
+            return nodes;
+        }
+
+        public boolean isSelected() {
+            return selected;
+        }
+
+        public boolean isClosed() {
+            return nodes.isEmpty() || nodes.get(nodes.size() - 1).equals(nodes.get(0));
+        }
+    }
+
     public static class PolyData {
         public enum Intersection {INSIDE, OUTSIDE, CROSSING}
@@ -26,4 +47,8 @@
         private Point lastP;
         private Rectangle bounds;
+
+        public PolyData(NavigatableComponent nc, JoinedWay joinedWay) {
+            this(nc, joinedWay.getNodes(), joinedWay.isSelected());
+        }
 
         public PolyData(NavigatableComponent nc, List<Node> nodes, boolean selected) {
@@ -92,5 +117,4 @@
     private final List<PolyData> outerPolygons = new ArrayList<PolyData>();
     private final List<PolyData> combinedPolygons = new ArrayList<PolyData>();
-    private boolean hasNonClosedWays;
 
     public Multipolygon(NavigatableComponent nc) {
@@ -137,10 +161,12 @@
         }
 
-        result.addAll(joinWays(waysToJoin));
-    }
-
-    public Collection<PolyData> joinWays(Collection<Way> join)
+        for (JoinedWay jw: joinWays(waysToJoin)) {
+            result.add(new PolyData(nc, jw));
+        }
+    }
+
+    public static Collection<JoinedWay> joinWays(Collection<Way> join)
     {
-        Collection<PolyData> res = new LinkedList<PolyData>();
+        Collection<JoinedWay> res = new ArrayList<JoinedWay>();
         Way[] joinArray = join.toArray(new Way[join.size()]);
         int left = join.size();
@@ -230,9 +256,5 @@
             }
 
-            if(!n.isEmpty() && !n.get(n.size() - 1).equals(n.get(0))) {
-                hasNonClosedWays = true;
-            }
-            PolyData pd = new PolyData(nc, n, selected);
-            res.add(pd);
+            res.add(new JoinedWay(n, selected));
         } /* while(left != 0) */
 
@@ -323,7 +345,3 @@
     }
 
-    public boolean hasNonClosedWays() {
-        return hasNonClosedWays;
-    }
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java	(revision 3094)
+++ trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java	(revision 3095)
@@ -42,4 +42,5 @@
 import java.util.ListIterator;
 import java.util.Map;
+
 import javax.swing.UIManager;
 
@@ -141,7 +142,6 @@
      */
     public void setModel(Node model) {
-        if ((model == null) || (model instanceof Divider)) {
+        if ((model == null) || (model instanceof Divider))
             throw new IllegalArgumentException("invalid model");
-        }
         Node oldModel = model;
         this.model = model;
@@ -168,7 +168,6 @@
      */
     public void setDividerSize(int dividerSize) {
-        if (dividerSize < 0) {
+        if (dividerSize < 0)
             throw new IllegalArgumentException("invalid dividerSize");
-        }
         int oldDividerSize = this.dividerSize;
         this.dividerSize = dividerSize;
@@ -212,7 +211,6 @@
      */
     public void addLayoutComponent(String name, Component child) {
-        if (name == null) {
+        if (name == null)
             throw new IllegalArgumentException("name not specified");
-        }
         childMap.put(name, child);
     }
@@ -253,7 +251,6 @@
 
     private Dimension preferredNodeSize(Node root) {
-        if (root instanceof Leaf) {
+        if (root instanceof Leaf)
             return preferredComponentSize(root);
-        }
         else if (root instanceof Divider) {
             int dividerSize = getDividerSize();
@@ -363,5 +360,4 @@
         Rectangle splitBounds = split.getBounds();
         ListIterator<Node> splitChildren = split.getChildren().listIterator();
-        Node lastWeightedChild = split.lastWeightedChild();
 
         if (split.isRowLayout()) {
@@ -385,32 +381,32 @@
                 (totalWeightedWidth - minWeightedWidth) > extraWidth;
 
-            while(splitChildren.hasNext()) {
-                Node splitChild = splitChildren.next();
-                Rectangle splitChildBounds = splitChild.getBounds();
-                double minSplitChildWidth = minimumNodeSize(splitChild).getWidth();
-                double splitChildWeight = (onlyShrinkWeightedComponents)
+                while(splitChildren.hasNext()) {
+                    Node splitChild = splitChildren.next();
+                    Rectangle splitChildBounds = splitChild.getBounds();
+                    double minSplitChildWidth = minimumNodeSize(splitChild).getWidth();
+                    double splitChildWeight = (onlyShrinkWeightedComponents)
                     ? splitChild.getWeight()
-                    : (splitChildBounds.getWidth() / (double)totalWidth);
-
-                if (!splitChildren.hasNext()) {
-                    double newWidth =  Math.max(minSplitChildWidth, bounds.getMaxX() - x);
-                    Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);
-                    layout2(splitChild, newSplitChildBounds);
-                }
-                else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) {
-                    double allocatedWidth = Math.rint(splitChildWeight * extraWidth);
-                    double oldWidth = splitChildBounds.getWidth();
-                    double newWidth = Math.max(minSplitChildWidth, oldWidth - allocatedWidth);
-                    Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);
-                    layout2(splitChild, newSplitChildBounds);
-                    availableWidth -= (oldWidth - splitChild.getBounds().getWidth());
-                }
-                else {
-                    double existingWidth = splitChildBounds.getWidth();
-                    Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, existingWidth);
-                    layout2(splitChild, newSplitChildBounds);
-                }
-                x = splitChild.getBounds().getMaxX();
-            }
+                            : (splitChildBounds.getWidth() / totalWidth);
+
+                    if (!splitChildren.hasNext()) {
+                        double newWidth =  Math.max(minSplitChildWidth, bounds.getMaxX() - x);
+                        Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);
+                        layout2(splitChild, newSplitChildBounds);
+                    }
+                    else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) {
+                        double allocatedWidth = Math.rint(splitChildWeight * extraWidth);
+                        double oldWidth = splitChildBounds.getWidth();
+                        double newWidth = Math.max(minSplitChildWidth, oldWidth - allocatedWidth);
+                        Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);
+                        layout2(splitChild, newSplitChildBounds);
+                        availableWidth -= (oldWidth - splitChild.getBounds().getWidth());
+                    }
+                    else {
+                        double existingWidth = splitChildBounds.getWidth();
+                        Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, existingWidth);
+                        layout2(splitChild, newSplitChildBounds);
+                    }
+                    x = splitChild.getBounds().getMaxX();
+                }
         }
 
@@ -435,34 +431,34 @@
                 (totalWeightedHeight - minWeightedHeight) > extraHeight;
 
-            while(splitChildren.hasNext()) {
-                Node splitChild = splitChildren.next();
-                Rectangle splitChildBounds = splitChild.getBounds();
-                double minSplitChildHeight = minimumNodeSize(splitChild).getHeight();
-                double splitChildWeight = (onlyShrinkWeightedComponents)
+                while(splitChildren.hasNext()) {
+                    Node splitChild = splitChildren.next();
+                    Rectangle splitChildBounds = splitChild.getBounds();
+                    double minSplitChildHeight = minimumNodeSize(splitChild).getHeight();
+                    double splitChildWeight = (onlyShrinkWeightedComponents)
                     ? splitChild.getWeight()
-                    : (splitChildBounds.getHeight() / (double)totalHeight);
-
-                if (!splitChildren.hasNext()) {
-                    double oldHeight = splitChildBounds.getHeight();
-                    double newHeight =  Math.max(minSplitChildHeight, bounds.getMaxY() - y);
-                    Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);
-                    layout2(splitChild, newSplitChildBounds);
-                    availableHeight -= (oldHeight - splitChild.getBounds().getHeight());
-                }
-                else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {
-                    double allocatedHeight = Math.rint(splitChildWeight * extraHeight);
-                    double oldHeight = splitChildBounds.getHeight();
-                    double newHeight = Math.max(minSplitChildHeight, oldHeight - allocatedHeight);
-                    Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);
-                    layout2(splitChild, newSplitChildBounds);
-                    availableHeight -= (oldHeight - splitChild.getBounds().getHeight());
-                }
-                else {
-                    double existingHeight = splitChildBounds.getHeight();
-                    Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, existingHeight);
-                    layout2(splitChild, newSplitChildBounds);
-                }
-                y = splitChild.getBounds().getMaxY();
-            }
+                            : (splitChildBounds.getHeight() / totalHeight);
+
+                    if (!splitChildren.hasNext()) {
+                        double oldHeight = splitChildBounds.getHeight();
+                        double newHeight =  Math.max(minSplitChildHeight, bounds.getMaxY() - y);
+                        Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);
+                        layout2(splitChild, newSplitChildBounds);
+                        availableHeight -= (oldHeight - splitChild.getBounds().getHeight());
+                    }
+                    else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {
+                        double allocatedHeight = Math.rint(splitChildWeight * extraHeight);
+                        double oldHeight = splitChildBounds.getHeight();
+                        double newHeight = Math.max(minSplitChildHeight, oldHeight - allocatedHeight);
+                        Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);
+                        layout2(splitChild, newSplitChildBounds);
+                        availableHeight -= (oldHeight - splitChild.getBounds().getHeight());
+                    }
+                    else {
+                        double existingHeight = splitChildBounds.getHeight();
+                        Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, existingHeight);
+                        layout2(splitChild, newSplitChildBounds);
+                    }
+                    y = splitChild.getBounds().getMaxY();
+                }
         }
 
@@ -508,6 +504,6 @@
                 else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) {
                     double allocatedWidth = (splitChild.equals(lastWeightedChild))
-                        ? availableWidth
-                        : Math.rint(splitChildWeight * extraWidth);
+                    ? availableWidth
+                            : Math.rint(splitChildWeight * extraWidth);
                     double newWidth = splitChildBounds.getWidth() + allocatedWidth;
                     Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);
@@ -550,6 +546,6 @@
                 else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {
                     double allocatedHeight = (splitChild.equals(lastWeightedChild))
-                        ? availableHeight
-                        : Math.rint(splitChildWeight * extraHeight);
+                    ? availableHeight
+                            : Math.rint(splitChildWeight * extraHeight);
                     double newHeight = splitChildBounds.getHeight() + allocatedHeight;
                     Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);
@@ -570,5 +566,5 @@
      * as needed.
      */
-   private void layout2(Node root, Rectangle bounds) {
+    private void layout2(Node root, Rectangle bounds) {
         if (root instanceof Leaf) {
             Component child = childForNode(root);
@@ -584,6 +580,6 @@
             Split split = (Split)root;
             boolean grow = split.isRowLayout()
-                ? (split.getBounds().width <= bounds.width)
-                : (split.getBounds().height <= bounds.height);
+            ? (split.getBounds().width <= bounds.width)
+                    : (split.getBounds().height <= bounds.height);
             if (grow) {
                 layoutGrow(split, bounds);
@@ -635,27 +631,27 @@
                         (splitChildren.hasNext()) ? (Divider)(splitChildren.next()) : null;
 
-                    double childWidth = 0.0;
-                    if (getFloatingDividers()) {
-                        childWidth = preferredNodeSize(splitChild).getWidth();
-                    }
-                    else {
-                        if (dividerChild != null) {
-                            childWidth = dividerChild.getBounds().getX() - x;
+                        double childWidth = 0.0;
+                        if (getFloatingDividers()) {
+                            childWidth = preferredNodeSize(splitChild).getWidth();
                         }
                         else {
-                            childWidth = split.getBounds().getMaxX() - x;
+                            if (dividerChild != null) {
+                                childWidth = dividerChild.getBounds().getX() - x;
+                            }
+                            else {
+                                childWidth = split.getBounds().getMaxX() - x;
+                            }
                         }
-                    }
-                    childBounds = boundsWithXandWidth(bounds, x, childWidth);
-                    layout1(splitChild, childBounds);
-
-                    if (getFloatingDividers() && (dividerChild != null)) {
-                        double dividerX = childBounds.getMaxX();
-                        Rectangle dividerBounds = boundsWithXandWidth(bounds, dividerX, dividerSize);
-                        dividerChild.setBounds(dividerBounds);
-                    }
-                    if (dividerChild != null) {
-                        x = dividerChild.getBounds().getMaxX();
-                    }
+                        childBounds = boundsWithXandWidth(bounds, x, childWidth);
+                        layout1(splitChild, childBounds);
+
+                        if (getFloatingDividers() && (dividerChild != null)) {
+                            double dividerX = childBounds.getMaxX();
+                            Rectangle dividerBounds = boundsWithXandWidth(bounds, dividerX, dividerSize);
+                            dividerChild.setBounds(dividerBounds);
+                        }
+                        if (dividerChild != null) {
+                            x = dividerChild.getBounds().getMaxX();
+                        }
                 }
             }
@@ -673,27 +669,27 @@
                         (splitChildren.hasNext()) ? (Divider)(splitChildren.next()) : null;
 
-                    double childHeight = 0.0;
-                    if (getFloatingDividers()) {
-                        childHeight = preferredNodeSize(splitChild).getHeight();
-                    }
-                    else {
-                        if (dividerChild != null) {
-                            childHeight = dividerChild.getBounds().getY() - y;
+                        double childHeight = 0.0;
+                        if (getFloatingDividers()) {
+                            childHeight = preferredNodeSize(splitChild).getHeight();
                         }
                         else {
-                            childHeight = split.getBounds().getMaxY() - y;
+                            if (dividerChild != null) {
+                                childHeight = dividerChild.getBounds().getY() - y;
+                            }
+                            else {
+                                childHeight = split.getBounds().getMaxY() - y;
+                            }
                         }
-                    }
-                    childBounds = boundsWithYandHeight(bounds, y, childHeight);
-                    layout1(splitChild, childBounds);
-
-                    if (getFloatingDividers() && (dividerChild != null)) {
-                        double dividerY = childBounds.getMaxY();
-                        Rectangle dividerBounds = boundsWithYandHeight(bounds, dividerY, dividerSize);
-                        dividerChild.setBounds(dividerBounds);
-                    }
-                    if (dividerChild != null) {
-                        y = dividerChild.getBounds().getMaxY();
-                    }
+                        childBounds = boundsWithYandHeight(bounds, y, childHeight);
+                        layout1(splitChild, childBounds);
+
+                        if (getFloatingDividers() && (dividerChild != null)) {
+                            double dividerY = childBounds.getMaxY();
+                            Rectangle dividerBounds = boundsWithYandHeight(bounds, dividerY, dividerSize);
+                            dividerChild.setBounds(dividerBounds);
+                        }
+                        if (dividerChild != null) {
+                            y = dividerChild.getBounds().getMaxY();
+                        }
                 }
             }
@@ -781,7 +777,6 @@
             Split split = (Split)root;
             for(Node child : split.getChildren()) {
-                if (child.getBounds().contains(x, y)) {
+                if (child.getBounds().contains(x, y))
                     return dividerAt(child, x, y);
-                }
             }
         }
@@ -804,6 +799,6 @@
         Rectangle r1 = node.getBounds();
         return
-            (r1.x <= (r2.x + r2.width)) && ((r1.x + r1.width) >= r2.x) &&
-            (r1.y <= (r2.y + r2.height)) && ((r1.y + r1.height) >= r2.y);
+        (r1.x <= (r2.x + r2.width)) && ((r1.x + r1.width) >= r2.x) &&
+        (r1.y <= (r2.y + r2.height)) && ((r1.y + r1.height) >= r2.y);
     }
 
@@ -822,8 +817,6 @@
             }
             return dividers;
-        }
-        else {
+        } else
             return Collections.emptyList();
-        }
     }
 
@@ -837,7 +830,6 @@
      */
     public List<Divider> dividersThatOverlap(Rectangle r) {
-        if (r == null) {
+        if (r == null)
             throw new IllegalArgumentException("null Rectangle");
-        }
         return dividersThatOverlap(getModel(), r);
     }
@@ -890,7 +882,6 @@
          */
         public void setBounds(Rectangle bounds) {
-            if (bounds == null) {
+            if (bounds == null)
                 throw new IllegalArgumentException("null bounds");
-            }
             this.bounds = new Rectangle(bounds);
         }
@@ -921,7 +912,6 @@
          */
         public void setWeight(double weight) {
-            if ((weight < 0.0)|| (weight > 1.0)) {
+            if ((weight < 0.0)|| (weight > 1.0))
                 throw new IllegalArgumentException("invalid weight");
-            }
             this.weight = weight;
         }
@@ -929,8 +919,10 @@
         private Node siblingAtOffset(int offset) {
             Split parent = getParent();
-            if (parent == null) { return null; }
+            if (parent == null)
+                return null;
             List<Node> siblings = parent.getChildren();
             int index = siblings.indexOf(this);
-            if (index == -1) { return null; }
+            if (index == -1)
+                return null;
             index += offset;
             return ((index > -1) && (index < siblings.size())) ? siblings.get(index) : null;
@@ -1020,7 +1012,6 @@
          */
         public void setChildren(List<Node> children) {
-            if (children == null) {
+            if (children == null)
                 throw new IllegalArgumentException("children must be a non-null List");
-            }
             for(Node child : this.children) {
                 child.setParent(null);
@@ -1051,4 +1042,5 @@
         }
 
+        @Override
         public String toString() {
             int nChildren = getChildren().size();
@@ -1081,7 +1073,6 @@
          */
         public Leaf(String name) {
-            if (name == null) {
+            if (name == null)
                 throw new IllegalArgumentException("name is null");
-            }
             this.name = name;
         }
@@ -1102,10 +1093,10 @@
          */
         public void setName(String name) {
-            if (name == null) {
+            if (name == null)
                 throw new IllegalArgumentException("name is null");
-            }
             this.name = name;
         }
 
+        @Override
         public String toString() {
             StringBuffer sb = new StringBuffer("MultiSplitLayout.Leaf");
@@ -1142,8 +1133,10 @@
          * @throws UnsupportedOperationException
          */
+        @Override
         public void setWeight(double weight) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public String toString() {
             return "MultiSplitLayout.Divider " + getBounds().toString();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 3094)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 3095)
@@ -118,8 +118,7 @@
         //
         memberTableModel = new MemberTableModel(getLayer());
-        DataSet.selListeners.add(memberTableModel);
-        getLayer().data.addDataSetListener(memberTableModel);
+        memberTableModel.register();
         selectionTableModel = new SelectionTableModel(getLayer());
-        DataSet.selListeners.add(selectionTableModel);
+        selectionTableModel.register();
         referrerModel = new ReferringRelationsBrowserModel(relation);
 
@@ -553,7 +552,5 @@
             //
             selectionTableModel.unregister();
-            DataSet.selListeners.remove(memberTableModel);
-            DataSet.selListeners.remove(selectionTableModel);
-            getLayer().data.removeDataSetListener(memberTableModel);
+            memberTableModel.unregister();
             memberTable.unlinkAsListener();
             dispose();
@@ -1054,5 +1051,5 @@
 
         /**
-         * Apply the updates for an existing relation which has not been changed
+         * Apply the updates for an existing relation which has been changed
          * outside of the relation editor.
          *
@@ -1067,5 +1064,5 @@
 
         /**
-         * Apply the updates for an existing relation which has been changed
+         * Apply the updates for an existing relation which has not been changed
          * outside of the relation editor.
          *
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 3094)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 3095)
@@ -28,4 +28,5 @@
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -50,6 +51,6 @@
      * data of the table model: The list of members and the cached WayConnectionType of each member.
      **/
-    private ArrayList<RelationMember> members;
-    private ArrayList<WayConnectionType> connectionType = null;
+    private List<RelationMember> members;
+    private List<WayConnectionType> connectionType = null;
 
     private DefaultListSelectionModel listSelectionModel;
@@ -69,4 +70,14 @@
     public OsmDataLayer getLayer() {
         return layer;
+    }
+
+    public void register() {
+        DataSet.selListeners.add(this);
+        getLayer().data.addDataSetListener(this);
+    }
+
+    public void unregister() {
+        DataSet.selListeners.remove(this);
+        getLayer().data.removeDataSetListener(this);
     }
 
@@ -695,5 +706,5 @@
      * @return sorted collection of relation members
      */
-    private ArrayList<RelationMember> sortMembers(ArrayList<RelationMember> relationMembers) {
+    private List<RelationMember> sortMembers(List<RelationMember> relationMembers) {
         RelationNodeMap map = new RelationNodeMap(relationMembers);
         // List of groups of linked members
@@ -744,7 +755,7 @@
      */
     void sort() {
-        ArrayList<RelationMember> selectedMembers = new ArrayList<RelationMember>(getSelectedMembers());
-        ArrayList<RelationMember> sortedMembers = null;
-        ArrayList<RelationMember> newMembers;
+        List<RelationMember> selectedMembers = new ArrayList<RelationMember>(getSelectedMembers());
+        List<RelationMember> sortedMembers = null;
+        List<RelationMember> newMembers;
         if (selectedMembers.size() <= 1) {
             newMembers = sortMembers(members);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java	(revision 3094)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java	(revision 3095)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.dialogs.relation;
+
+import static org.openstreetmap.josm.gui.dialogs.relation.WayConnectionType.Direction.NONE;
 
 import java.util.ArrayList;
@@ -12,6 +14,4 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
-
-import static org.openstreetmap.josm.gui.dialogs.relation.WayConnectionType.Direction.*;
 
 /**
@@ -31,8 +31,4 @@
 public class RelationNodeMap {
     /*
-     * read only list of all relation members
-     */
-    private final List<RelationMember> members;
-    /*
      * the maps. (Need TreeMap for efficiency.)
      */
@@ -49,7 +45,5 @@
     private List<Integer> notSortable = new ArrayList<Integer>();
 
-    RelationNodeMap(ArrayList<RelationMember> members) {
-        this.members = members;
-
+    RelationNodeMap(List<RelationMember> members) {
         nodesMap = new TreeMap<Node, TreeSet<Integer>>();
         waysMap = new TreeMap<Integer, TreeSet<Node>>();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java	(revision 3094)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java	(revision 3095)
@@ -32,6 +32,10 @@
         this.layer = layer;
         cache = new ArrayList<OsmPrimitive>();
+        populateSelectedPrimitives(layer);
+    }
+
+    public void register() {
+        DataSet.selListeners.add(this);
         MapView.addLayerChangeListener(this);
-        populateSelectedPrimitives(layer);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 3094)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 3095)
@@ -47,5 +47,5 @@
     /**
      * Creates a new authorisation client with default OAuth parameters
-     * 
+     *
      */
     public OsmOAuthAuthorizationClient() {
@@ -57,5 +57,5 @@
     /**
      * Creates a new authorisation client with the parameters <code>parameters</code>.
-     * 
+     *
      * @param parameters the OAuth parameters. Must not be null.
      * @throws IllegalArgumentException thrown if parameters is null
@@ -71,5 +71,5 @@
      * Creates a new authorisation client with the parameters <code>parameters</code>
      * and an already known Request Token.
-     * 
+     *
      * @param parameters the OAuth parameters. Must not be null.
      * @param requestToken the request token. Must not be null.
@@ -117,5 +117,5 @@
      * Submits a request for a Request Token to the Request Token Endpoint Url of the OAuth Service
      * Provider and replies the request token.
-     * 
+     *
      * @param monitor a progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null
      * @return the OAuth Request Token
@@ -147,7 +147,7 @@
      * Submits a request for an Access Token to the Access Token Endpoint Url of the OAuth Service
      * Provider and replies the request token.
-     * 
+     *
      * You must have requested a Request Token using {@see #getRequestToken(ProgressMonitor)} first.
-     * 
+     *
      * @param monitor a progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null
      * @return the OAuth Access Token
@@ -180,5 +180,5 @@
      * Builds the authorise URL for a given Request Token. Users can be redirected to this URL.
      * There they can login to OSM and authorise the request.
-     * 
+     *
      * @param requestToken  the request token
      * @return  the authorise URL for this request
@@ -241,5 +241,5 @@
     /**
      * Derives the OSM login URL from the OAuth Authorization Website URL
-     * 
+     *
      * @return the OSM login URL
      * @throws OsmOAuthAuthorizationException thrown if something went wrong, in particular if the
@@ -261,5 +261,5 @@
     /**
      * Derives the OSM logout URL from the OAuth Authorization Website URL
-     * 
+     *
      * @return the OSM logout URL
      * @throws OsmOAuthAuthorizationException thrown if something went wrong, in particular if the
@@ -279,5 +279,5 @@
      * Submits a request to the OSM website for a login form. The OSM website replies a session ID in
      * a cookie.
-     * 
+     *
      * @return the session ID
      * @throws OsmOAuthAuthorizationException thrown if something went wrong
@@ -460,5 +460,5 @@
     /**
      * Automatically authorises a request token for a set of privileges.
-     * 
+     *
      * @param requestToken the request token. Must not be null.
      * @param osmUserName the OSM user name. Must not be null.
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java	(revision 3094)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java	(revision 3095)
@@ -201,5 +201,4 @@
     public void decideMultiple() {
 
-        TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
         TagMergeModel model = new TagMergeModel();
         for (int i=0; i < 10; i++) {
@@ -216,5 +215,5 @@
         model.decide(new int[] {0, 3, 5}, MergeDecisionType.KEEP_MINE);
         for (int i = 0; i< 10; i++) {
-            item = list.get(i);
+            TagMergeItem item = list.get(i);
             if (i == 0 || i == 3 || i == 5) {
                 assertEquals(MergeDecisionType.KEEP_MINE, item.getMergeDecision());
