Index: trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 3145)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java	(revision 3146)
@@ -80,5 +80,5 @@
 /**
  * A small tool dialog for displaying the current selection.
- * 
+ *
  */
 public class SelectionListDialog extends ToggleDialog  {
@@ -96,5 +96,5 @@
     /**
      * Builds the panel with the list of selected OSM primitives
-     * 
+     *
      * @return the panel with the list of selected OSM primitives
      */
@@ -114,5 +114,5 @@
     /**
      * Builds the row of action buttons at the bottom of this dialog
-     * 
+     *
      * @return the panel
      */
@@ -147,5 +147,5 @@
     /**
      * Builds the content panel for this dialog
-     * 
+     *
      * @return the content panel
      */
@@ -326,5 +326,5 @@
     /**
      * The action for zooming to the primitives in the current JOSM selection
-     * 
+     *
      */
     class ZoomToJOSMSelectionAction extends AbstractAction implements ListDataListener {
@@ -361,5 +361,5 @@
      * The action for zooming to the primitives which are currently selected in
      * the list displaying the JOSM selection
-     * 
+     *
      */
     class ZoomToListSelection extends AbstractAction implements ListSelectionListener{
@@ -393,8 +393,8 @@
     /**
      * The list model for the list of OSM primitives in the current JOSM selection.
-     * 
+     *
      * The model also maintains a history of the last {@see SelectionListModel#SELECTION_HISTORY_SIZE}
      * JOSM selection.
-     * 
+     *
      */
     static private class SelectionListModel extends AbstractListModel implements EditLayerChangeListener, SelectionChangedListener, DataSetListener{
@@ -416,5 +416,5 @@
         /**
          * Replies a summary of the current JOSM selection
-         * 
+         *
          * @return a summary of the current JOSM selection
          */
@@ -436,5 +436,5 @@
         /**
          * Remembers a JOSM selection the history of JOSM selections
-         * 
+         *
          * @param selection the JOSM selection. Ignored if null or empty.
          */
@@ -455,5 +455,5 @@
         /**
          * Replies the history of JOSM selections
-         * 
+         *
          * @return
          */
@@ -473,5 +473,5 @@
          * Replies the collection of OSM primitives currently selected in the view
          * of this model
-         * 
+         *
          * @return
          */
@@ -488,5 +488,5 @@
         /**
          * Sets the OSM primitives to be selected in the view of this model
-         * 
+         *
          * @param sel the collection of primitives to select
          */
@@ -511,5 +511,5 @@
         /**
          * Sets the collection of currently selected OSM objects
-         * 
+         *
          * @param selection the collection of currently selected OSM objects
          */
@@ -529,5 +529,5 @@
          * Triggers a refresh of the view for all primitives in {@code toUpdate}
          * which are currently displayed in the view
-         * 
+         *
          * @param toUpdate the collection of primitives to update
          */
@@ -547,5 +547,5 @@
         /**
          * Replies the list of selected relations with incomplete members
-         * 
+         *
          * @return the list of selected relations with incomplete members
          */
@@ -654,5 +654,5 @@
     /**
      * The popup menu for the search history entries
-     * 
+     *
      */
     protected static class SearchPopupMenu extends JPopupMenu {
@@ -738,5 +738,5 @@
     /**
      * Action for downloading incomplete members of selected relations
-     * 
+     *
      */
     class DownloadSelectedIncompleteMembersAction extends AbstractAction implements ListSelectionListener{
@@ -778,5 +778,5 @@
 
     static private class OsmPrimitiveComparator implements Comparator<OsmPrimitive> {
-        final private HashMap<Object, String> cache= new HashMap<Object, String>();
+        final private HashMap<OsmPrimitive, String> cache= new HashMap<OsmPrimitive, String>();
         final private DefaultNameFormatter df  = DefaultNameFormatter.getInstance();
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 3145)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 3146)
@@ -267,7 +267,6 @@
             value = null; // delete the key instead
         }
-        if (key.equals(newkey) && tr("<different>").equals(value)) {
+        if (key.equals(newkey) && tr("<different>").equals(value))
             return;
-        }
         if (key.equals(newkey) || value == null) {
             Main.main.undoRedo.add(new ChangePropertyCommand(sel, newkey, value));
@@ -763,9 +762,10 @@
 
         Map<Relation, Collection<RelationMember>> roles = new HashMap<Relation, Collection<RelationMember>>();
-        if (Main.main.getCurrentDataSet() != null) {
-            for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
-                if (!r.isFiltered() && !r.isIncomplete() && !r.isDeleted()) {
+        for (OsmPrimitive primitive: newSelection) {
+            for (OsmPrimitive ref: primitive.getReferrers()) {
+                if (ref instanceof Relation && !ref.isFiltered() && !ref.isIncomplete() && !ref.isDeleted()) {
+                    Relation r = (Relation) ref;
                     for (RelationMember m : r.getMembers()) {
-                        if (newSelection.contains(m.getMember())) {
+                        if (m.getMember() == primitive) {
                             Collection<RelationMember> value = roles.get(r);
                             if (value == null) {
@@ -779,4 +779,5 @@
             }
         }
+
         for (Entry<Relation, Collection<RelationMember>> e : roles.entrySet()) {
             membershipData.addRow(new Object[]{e.getKey(), e.getValue()});
