Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9216)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9217)
@@ -310,19 +310,5 @@
         @Override
         public boolean equalVal(List<String> otherVal) {
-            return equalCollection(value, otherVal);
-        }
-
-        public static boolean equalCollection(Collection<String> a, Collection<String> b) {
-            if (a == null) return b == null;
-            if (b == null) return false;
-            if (a.size() != b.size()) return false;
-            Iterator<String> itA = a.iterator();
-            Iterator<String> itB = b.iterator();
-            while (itA.hasNext()) {
-                String aStr = itA.next();
-                String bStr = itB.next();
-                if (!Objects.equals(aStr, bStr)) return false;
-            }
-            return true;
+            return Utils.equalCollection(value, otherVal);
         }
 
@@ -392,5 +378,5 @@
             Iterator<List<String>> itB = otherVal.iterator();
             while (itA.hasNext()) {
-                if (!ListSetting.equalCollection(itA.next(), itB.next())) return false;
+                if (!Utils.equalCollection(itA.next(), itB.next())) return false;
             }
             return true;
@@ -518,13 +504,35 @@
     }
 
+    /**
+     * Event triggered when a preference entry value changes.
+     */
     public interface PreferenceChangeEvent {
+        /**
+         * Returns the preference key.
+         * @return the preference key
+         */
         String getKey();
 
+        /**
+         * Returns the old preference value.
+         * @return the old preference value
+         */
         Setting<?> getOldValue();
 
+        /**
+         * Returns the new preference value.
+         * @return the new preference value
+         */
         Setting<?> getNewValue();
     }
 
+    /**
+     * Listener to preference change events.
+     */
     public interface PreferenceChangedListener {
+        /**
+         * Trigerred when a preference entry value changes.
+         * @param e the preference change event
+         */
         void preferenceChanged(PreferenceChangeEvent e);
     }
@@ -897,5 +905,5 @@
      * @throws XMLStreamException if an XML error occurs while parsing the file (after validation)
      */
-    public void load() throws IOException, SAXException, XMLStreamException {
+    protected void load() throws IOException, SAXException, XMLStreamException {
         settingsMap.clear();
         File pref = getPreferenceFile();
@@ -1293,7 +1301,7 @@
      * Indicates that a certain field should be considered in the conversion
      * process. Otherwise it is ignored.
-     * 
+     *
      * @see #serializeStruct(java.lang.Object, java.lang.Class)
-     * @see #deserializeStruct(java.util.Map, java.lang.Class) 
+     * @see #deserializeStruct(java.util.Map, java.lang.Class)
      */
     @Retention(RetentionPolicy.RUNTIME) // keep annotation at runtime
@@ -1304,5 +1312,5 @@
      * Indicates that a certain field should be written to the map, even if
      * the value is the same as the default value.
-     * 
+     *
      * @see #serializeStruct(java.lang.Object, java.lang.Class)
      */
@@ -1347,9 +1355,9 @@
      * Convenience method that saves a MapListSetting which is provided as a
      * Collection of objects.
-     * 
+     *
      * Each object is converted to a <code>Map&lt;String, String&gt;</code> using
      * the fields with {@link pref} annotation. The field name is the key and
      * the value will be converted to a string.
-     * 
+     *
      * Considers only fields that have the @pref annotation.
      * In addition it does not write fields with null values. (Thus they are cleared)
@@ -1358,5 +1366,5 @@
      * Fields equal to the default value are not written unless the field has
      * the @writeExplicitly annotation.
-     * @param <T> the class, 
+     * @param <T> the class,
      * @param key main preference key
      * @param val the list that is supposed to be saved
@@ -1417,14 +1425,14 @@
      * Convert an object to a String Map, by using field names and values as map
      * key and value.
-     * 
+     *
      * The field value is converted to a String.
-     * 
+     *
      * Only fields with annotation {@link pref} are taken into account.
-     * 
+     *
      * Fields will not be written to the map if the value is null or unchanged
      * (compared to an object created with the no-arg-constructor).
      * The {@link writeExplicitly} annotation overrides this behavior, i.e. the
      * default value will also be written.
-     * 
+     *
      * @param <T> the class of the object <code>struct</code>
      * @param struct the object to be converted
@@ -1470,9 +1478,9 @@
      * map keys to field names of the class and assigning map values to the
      * corresponding fields.
-     * 
+     *
      * The map value (a String) is converted to the field type. Supported
      * types are: boolean, Boolean, int, Integer, double, Double, String and
      * Map&lt;String, String&gt;.
-     * 
+     *
      * Only fields with annotation {@link pref} are taken into account.
      * @param <T> the class
@@ -1625,5 +1633,5 @@
     protected XMLStreamReader parser;
 
-    public void validateXML(Reader in) throws IOException, SAXException {
+    public static void validateXML(Reader in) throws IOException, SAXException {
         SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         try (InputStream xsdStream = new CachedFile("resource://data/preferences.xsd").getInputStream()) {
@@ -1634,5 +1642,5 @@
     }
 
-    public void fromXML(Reader in) throws XMLStreamException {
+    protected void fromXML(Reader in) throws XMLStreamException {
         XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(in);
         this.parser = parser;
@@ -1640,12 +1648,14 @@
     }
 
-    public void parse() throws XMLStreamException {
+    private void parse() throws XMLStreamException {
         int event = parser.getEventType();
         while (true) {
             if (event == XMLStreamConstants.START_ELEMENT) {
-                try
-                {
-                  loadedVersion = Integer.parseInt(parser.getAttributeValue(null, "version"));
-                } catch (Exception e) {
+                try {
+                    loadedVersion = Integer.parseInt(parser.getAttributeValue(null, "version"));
+                } catch (NumberFormatException e) {
+                    if (Main.isDebugEnabled()) {
+                        Main.debug(e.getMessage());
+                    }
                 }
                 parseRoot();
@@ -1662,5 +1672,5 @@
     }
 
-    public void parseRoot() throws XMLStreamException {
+    private void parseRoot() throws XMLStreamException {
         while (true) {
             int event = parser.next();
@@ -1698,5 +1708,5 @@
     }
 
-    protected void parseToplevelList() throws XMLStreamException {
+    private void parseToplevelList() throws XMLStreamException {
         String key = parser.getAttributeValue(null, "key");
         String name = parser.getLocalName();
@@ -1753,5 +1763,5 @@
     }
 
-    protected List<String> parseInnerList() throws XMLStreamException {
+    private List<String> parseInnerList() throws XMLStreamException {
         List<String> entries = new ArrayList<>();
         while (true) {
@@ -1771,5 +1781,5 @@
     }
 
-    protected Map<String, String> parseMap() throws XMLStreamException {
+    private Map<String, String> parseMap() throws XMLStreamException {
         Map<String, String> map = new LinkedHashMap<>();
         while (true) {
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 9216)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 9217)
@@ -48,4 +48,5 @@
 import java.util.List;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -515,4 +516,24 @@
     public static boolean equalsEpsilon(double a, double b) {
         return Math.abs(a - b) <= EPSILON;
+    }
+
+    /**
+     * Determines if two collections are equal.
+     * @param a first collection
+     * @param b second collection
+     * @return {@code true} if collections are equal, {@code false} otherwise
+     * @since 9217
+     */
+    public static boolean equalCollection(Collection<?> a, Collection<?> b) {
+        if (a == null) return b == null;
+        if (b == null) return false;
+        if (a.size() != b.size()) return false;
+        Iterator<?> itA = a.iterator();
+        Iterator<?> itB = b.iterator();
+        while (itA.hasNext()) {
+            if (!Objects.equals(itA.next(), itB.next()))
+                return false;
+        }
+        return true;
     }
 
