Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9716)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9717)
@@ -662,6 +662,5 @@
      * Get the directory where cached content of any kind should be stored.
      *
-     * If the directory doesn't exist on the file system, it will be created
-     * by this method.
+     * If the directory doesn't exist on the file system, it will be created by this method.
      *
      * @return the cache directory
@@ -737,6 +736,5 @@
      * Get settings value for a certain key.
      * @param key the identifier for the setting
-     * @return "" if there is nothing set for the preference key,
-     *  the corresponding value otherwise. The result is not null.
+     * @return "" if there is nothing set for the preference key, the corresponding value otherwise. The result is not null.
      */
     public synchronized String get(final String key) {
@@ -748,8 +746,6 @@
      * Get settings value for a certain key and provide default a value.
      * @param key the identifier for the setting
-     * @param def the default value. For each call of get() with a given key, the
-     *  default value must be the same.
-     * @return the corresponding value if the property has been set before,
-     *  def otherwise
+     * @param def the default value. For each call of get() with a given key, the default value must be the same.
+     * @return the corresponding value if the property has been set before, {@code def} otherwise
      */
     public synchronized String get(final String key, final String def) {
@@ -817,6 +813,5 @@
      * Set a value for a certain setting.
      * @param key the unique identifier for the setting
-     * @param value the value of the setting. Can be null or "" which both removes
-     *  the key-value entry.
+     * @param value the value of the setting. Can be null or "" which both removes the key-value entry.
      * @return {@code true}, if something has changed (i.e. value is different than before)
      */
@@ -1146,6 +1141,5 @@
      * @param key the identifier for the setting
      * @param def the default value.
-     * @return the corresponding value if the property has been set before,
-     *  def otherwise
+     * @return the corresponding value if the property has been set before, {@code def} otherwise
      */
     public Collection<String> getCollection(String key, Collection<String> def) {
@@ -1156,6 +1150,5 @@
      * Get a list of values for a certain key
      * @param key the identifier for the setting
-     * @return the corresponding value if the property has been set before,
-     *  an empty Collection otherwise.
+     * @return the corresponding value if the property has been set before, an empty collection otherwise.
      */
     public Collection<String> getCollection(String key) {
@@ -1171,10 +1164,8 @@
 
     /**
-     * Set a value for a certain setting. The changed setting is saved
-     * to the preference file immediately. Due to caching mechanisms on modern
-     * operating systems and hardware, this shouldn't be a performance problem.
+     * Set a value for a certain setting. The changed setting is saved to the preference file immediately.
+     * Due to caching mechanisms on modern operating systems and hardware, this shouldn't be a performance problem.
      * @param key the unique identifier for the setting
-     * @param setting the value of the setting. In case it is null, the key-value
-     * entry will be removed.
+     * @param setting the value of the setting. In case it is null, the key-value entry will be removed.
      * @return {@code true}, if something has changed (i.e. value is different than before)
      */
@@ -1220,10 +1211,8 @@
      * @param <T> the setting type
      * @param key the identifier for the setting
-     * @param def the default value. For each call of getSetting() with a given
-     * key, the default value must be the same. <code>def</code> must not be
-     * null, but the value of <code>def</code> can be null.
+     * @param def the default value. For each call of getSetting() with a given key, the default value must be the same.
+     * <code>def</code> must not be null, but the value of <code>def</code> can be null.
      * @param klass the setting type (same as T)
-     * @return the corresponding value if the property has been set before,
-     *  def otherwise
+     * @return the corresponding value if the property has been set before, {@code def} otherwise
      */
     @SuppressWarnings("unchecked")
@@ -1312,6 +1301,5 @@
     /**
      * Annotation used for converting objects to String Maps and vice versa.
-     * Indicates that a certain field should be considered in the conversion
-     * process. Otherwise it is ignored.
+     * Indicates that a certain field should be considered in the conversion process. Otherwise it is ignored.
      *
      * @see #serializeStruct(java.lang.Object, java.lang.Class)
@@ -1323,6 +1311,5 @@
     /**
      * Annotation used for converting objects to String Maps.
-     * Indicates that a certain field should be written to the map, even if
-     * the value is the same as the default value.
+     * 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)
@@ -1333,8 +1320,6 @@
     /**
      * Get a list of hashes which are represented by a struct-like class.
-     * Possible properties are given by fields of the class klass that have
-     * the @pref annotation.
-     * Default constructor is used to initialize the struct objects, properties
-     * then override some of these default values.
+     * Possible properties are given by fields of the class klass that have the @pref annotation.
+     * Default constructor is used to initialize the struct objects, properties then override some of these default values.
      * @param <T> klass type
      * @param key main preference key
@@ -1372,17 +1357,13 @@
 
     /**
-     * Convenience method that saves a MapListSetting which is provided as a
-     * Collection of objects.
+     * 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.
+     * 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)
-     * Default values are given by the field values after default constructor has
-     * been called.
-     * Fields equal to the default value are not written unless the field has
-     * the @writeExplicitly annotation.
+     * Default values are given by the field values after default constructor has been called.
+     * Fields equal to the default value are not written unless the field has the @writeExplicitly annotation.
      * @param <T> the class,
      * @param key main preference key
@@ -1457,6 +1438,5 @@
 
     /**
-     * Convert an object to a String Map, by using field names and values as map
-     * key and value.
+     * 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.
@@ -1466,6 +1446,5 @@
      * 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.
+     * 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>
@@ -1509,11 +1488,9 @@
 
     /**
-     * Converts a String-Map to an object of a certain class, by comparing
-     * map keys to field names of the class and assigning map values to the
-     * corresponding fields.
+     * Converts a String-Map to an object of a certain class, by comparing 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,
-     * Map&lt;String, String&gt; and Map&lt;String, List&lt;String&gt;&gt;.
+     * The map value (a String) is converted to the field type. Supported types are: boolean, Boolean, int, Integer, double,
+     * Double, String, Map&lt;String, String&gt; and Map&lt;String, List&lt;String&gt;&gt;.
      *
      * Only fields with annotation {@link pref} are taken into account.
@@ -1589,15 +1566,12 @@
      */
     public void updateSystemProperties() {
-        if ("true".equals(get("prefer.ipv6", "auto"))) {
+        if ("true".equals(get("prefer.ipv6", "auto")) && !"true".equals(Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true"))) {
             // never set this to false, only true!
-            if (!"true".equals(Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true"))) {
-                Main.info(tr("Try enabling IPv6 network, prefering IPv6 over IPv4 (only works on early startup)."));
-            }
+            Main.info(tr("Try enabling IPv6 network, prefering IPv6 over IPv4 (only works on early startup)."));
         }
         Utils.updateSystemProperty("http.agent", Version.getInstance().getAgentString());
         Utils.updateSystemProperty("user.language", get("language"));
-        // Workaround to fix a Java bug.
+        // Workaround to fix a Java bug. This ugly hack comes from Sun bug database: https://bugs.openjdk.java.net/browse/JDK-6292739
         // Force AWT toolkit to update its internal preferences (fix #6345).
-        // This ugly hack comes from Sun bug database: https://bugs.openjdk.java.net/browse/JDK-6292739
         if (!GraphicsEnvironment.isHeadless()) {
             try {
@@ -1620,9 +1594,8 @@
             Utils.updateSystemProperty("jsse.enableSNIExtension", "false");
         }
-        // Workaround to fix another Java bug
+        // Workaround to fix another Java bug - The bug seems to have been fixed in Java 8, to remove during transition
         // Force Java 7 to use old sorting algorithm of Arrays.sort (fix #8712).
         // See Oracle bug database: https://bugs.openjdk.java.net/browse/JDK-7075600
         // and https://bugs.openjdk.java.net/browse/JDK-6923200
-        // The bug seems to have been fixed in Java 8, to remove during transition
         if (getBoolean("jdk.Arrays.useLegacyMergeSort", !Version.getInstance().isLocalBuild())) {
             Utils.updateSystemProperty("java.util.Arrays.useLegacyMergeSort", "true");
@@ -1669,7 +1642,6 @@
 
     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()) {
-            Schema schema = factory.newSchema(new StreamSource(xsdStream));
+            Schema schema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(new StreamSource(xsdStream));
             Validator validator = schema.newValidator();
             validator.validate(new StreamSource(in));
@@ -1678,6 +1650,5 @@
 
     protected void fromXML(Reader in) throws XMLStreamException {
-        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(in);
-        this.parser = parser;
+        this.parser = XMLInputFactory.newInstance().createXMLStreamReader(in);
         parse();
     }
@@ -1968,5 +1939,5 @@
                 List<Map<String, String>> l = new LinkedList<>();
                 boolean modified = false;
-                for (Map<String, String> map: ((MapListSetting)setting).getValue()) {
+                for (Map<String, String> map: ((MapListSetting) setting).getValue()) {
                     Map<String, String> newMap = new HashMap<>();
                     for (Entry<String, String> entry: map.entrySet()) {
Index: trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java	(revision 9716)
+++ trunk/src/org/openstreetmap/josm/tools/OverpassTurboQueryWizard.java	(revision 9717)
@@ -1,6 +1,4 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.tools;
-
-import org.openstreetmap.josm.Main;
 
 import java.io.IOException;
@@ -14,4 +12,6 @@
 import javax.script.ScriptEngineManager;
 import javax.script.ScriptException;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -59,9 +59,10 @@
         try {
             final Object result = ((Invocable) engine).invokeMethod(engine.get("global"),
-                    "overpassWizard", search, new HashMap<String, Object>() {{
+                    "overpassWizard", search, new HashMap<String, Object>() { {
                         put("comment", false);
                         put("outputFormat", "xml");
                         put("outputMode", "recursive_meta");
-                    }});
+                    } }
+            );
             if (result == Boolean.FALSE) {
                 throw new UncheckedParseException();
