Index: trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 7834)
@@ -85,6 +85,6 @@
     private final Deque<File> deletedLayers = new LinkedList<>();
 
-    private final File autosaveDir = new File(Main.pref.getPreferencesDir() + AUTOSAVE_DIR);
-    private final File deletedLayersDir = new File(Main.pref.getPreferencesDir() + DELETED_LAYERS_DIR);
+    private final File autosaveDir = new File(Main.pref.getUserDataDirectory(), AUTOSAVE_DIR);
+    private final File deletedLayersDir = new File(Main.pref.getUserDataDirectory(), DELETED_LAYERS_DIR);
 
     public void schedule() {
Index: trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 7834)
@@ -157,5 +157,5 @@
      */
     public static void messageBox(String type, String text) {
-        if (type==null || type.length()==0) type="plain";
+        if (type==null || type.isEmpty()) type="plain";
 
         switch (type.charAt(0)) {
@@ -390,15 +390,15 @@
 
     private static String getDirectoryByAbbr(String base) {
-            String dir;
-            if ("prefs".equals(base) || base.length()==0) {
-                dir = Main.pref.getPreferencesDir();
-            } else if ("cache".equals(base)) {
-                dir = Main.pref.getCacheDirectory().getAbsolutePath();
-            } else if ("plugins".equals(base)) {
-                dir = Main.pref.getPluginsDirectory().getAbsolutePath();
-            } else {
-                dir = null;
-            }
-            return dir;
+        String dir;
+        if ("prefs".equals(base) || base.isEmpty()) {
+            dir = Main.pref.getPreferencesDirectory().getAbsolutePath();
+        } else if ("cache".equals(base)) {
+            dir = Main.pref.getCacheDirectory().getAbsolutePath();
+        } else if ("plugins".equals(base)) {
+            dir = Main.pref.getPluginsDirectory().getAbsolutePath();
+        } else {
+            dir = null;
+        }
+        return dir;
     }
 
@@ -459,5 +459,5 @@
                 engine.eval("API={}; API.pref={}; API.fragments={};");
 
-                engine.eval("homeDir='"+normalizeDirName(Main.pref.getPreferencesDir()) +"';");
+                engine.eval("homeDir='"+normalizeDirName(Main.pref.getPreferencesDirectory().getAbsolutePath()) +"';");
                 engine.eval("josmVersion="+Version.getInstance().getVersion()+";");
                 String className = CustomConfigurator.class.getName();
@@ -629,5 +629,5 @@
             if (locText.length()>0) text=locText;
             String var = elem.getAttribute("var");
-            if (var.length()==0) var="result";
+            if (var.isEmpty()) var="result";
 
             String input = evalVars(elem.getAttribute("input"));
Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 7834)
@@ -22,4 +22,5 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -30,4 +31,5 @@
 import java.util.Objects;
 import java.util.ResourceBundle;
+import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -84,12 +86,12 @@
      * Internal storage for the preference directory.
      * Do not access this variable directly!
-     * @see #getPreferencesDirFile()
-     */
-    private File preferencesDirFile = null;
+     * @see #getPreferencesDirectory()
+     */
+    private File preferencesDir = null;
 
     /**
      * Internal storage for the cache directory.
      */
-    private File cacheDirFile = null;
+    private File cacheDir = null;
 
     /**
@@ -530,7 +532,10 @@
      * Returns the location of the user defined preferences directory
      * @return The location of the user defined preferences directory
-     */
+     * @deprecated use #getPreferencesDirectory() to access preferences directory
+     * or #getUserDataDirectory to access user data directory
+     */
+    @Deprecated
     public String getPreferencesDir() {
-        final String path = getPreferencesDirFile().getPath();
+        final String path = getPreferencesDirectory().getPath();
         if (path.endsWith(File.separator))
             return path;
@@ -539,26 +544,37 @@
 
     /**
-     * Returns the user defined preferences directory
-     * @return The user defined preferences directory
-     */
-    public File getPreferencesDirFile() {
-        if (preferencesDirFile != null)
-            return preferencesDirFile;
+     * Returns the user defined preferences directory, containing the preferences.xml file
+     * @return The user defined preferences directory, containing the preferences.xml file
+     * @since 7834
+     */
+    public File getPreferencesDirectory() {
+        if (preferencesDir != null)
+            return preferencesDir;
         String path;
         path = System.getProperty("josm.home");
         if (path != null) {
-            preferencesDirFile = new File(path).getAbsoluteFile();
+            preferencesDir = new File(path).getAbsoluteFile();
         } else {
-            preferencesDirFile = Main.platform.getDefaultPrefDirectory();
-        }
-        return preferencesDirFile;
-    }
-
-    /**
-     * Returns the user preferences file
-     * @return The user preferences file
+            preferencesDir = Main.platform.getDefaultPrefDirectory();
+        }
+        return preferencesDir;
+    }
+
+    /**
+     * Returns the user data directory, containing autosave, plugins, etc.
+     * Depending on the OS it may be the same directory as preferences directory.
+     * @return The user data directory, containing autosave, plugins, etc.
+     * @since 7834
+     */
+    public File getUserDataDirectory() {
+        return Main.platform.getDefaultUserDataDirectory();
+    }
+
+    /**
+     * Returns the user preferences file (preferences.xml)
+     * @return The user preferences file (preferences.xml)
      */
     public File getPreferenceFile() {
-        return new File(getPreferencesDirFile(), "preferences.xml");
+        return new File(getPreferencesDirectory(), "preferences.xml");
     }
 
@@ -568,5 +584,5 @@
      */
     public File getPluginsDirectory() {
-        return new File(getPreferencesDirFile(), "plugins");
+        return new File(getUserDataDirectory(), "plugins");
     }
 
@@ -580,59 +596,62 @@
      */
     public File getCacheDirectory() {
-        if (cacheDirFile != null)
-            return cacheDirFile;
+        if (cacheDir != null)
+            return cacheDir;
         String path = System.getProperty("josm.cache");
         if (path != null) {
-            cacheDirFile = new File(path).getAbsoluteFile();
+            cacheDir = new File(path).getAbsoluteFile();
         } else {
             path = get("cache.folder", null);
             if (path != null) {
-                cacheDirFile = new File(path);
+                cacheDir = new File(path);
             } else {
-                cacheDirFile = Main.platform.getDefaultCacheDirectory();
-            }
-        }
-        if (!cacheDirFile.exists() && !cacheDirFile.mkdirs()) {
-            Main.warn(tr("Failed to create missing cache directory: {0}", cacheDirFile.getAbsoluteFile()));
+                cacheDir = Main.platform.getDefaultCacheDirectory();
+            }
+        }
+        if (!cacheDir.exists() && !cacheDir.mkdirs()) {
+            Main.warn(tr("Failed to create missing cache directory: {0}", cacheDir.getAbsoluteFile()));
             JOptionPane.showMessageDialog(
                     Main.parent,
-                    tr("<html>Failed to create missing cache directory: {0}</html>", cacheDirFile.getAbsoluteFile()),
+                    tr("<html>Failed to create missing cache directory: {0}</html>", cacheDir.getAbsoluteFile()),
                     tr("Error"),
                     JOptionPane.ERROR_MESSAGE
             );
         }
-        return cacheDirFile;
-    }
-
-    /**
-     * @return A list of all existing directories where resources could be stored.
+        return cacheDir;
+    }
+
+    private void addPossibleResourceDir(Set<String> locations, String s) {
+        if (s != null) {
+            if (!s.endsWith(File.separator)) {
+                s += File.separator;
+            }
+            locations.add(s);
+        }
+    }
+
+    /**
+     * Returns a set of all existing directories where resources could be stored.
+     * @return A set of all existing directories where resources could be stored.
      */
     public Collection<String> getAllPossiblePreferenceDirs() {
-        LinkedList<String> locations = new LinkedList<>();
-        locations.add(getPreferencesDir());
-        String s;
-        if ((s = System.getenv("JOSM_RESOURCES")) != null) {
-            if (!s.endsWith(File.separator)) {
-                s = s + File.separator;
-            }
-            locations.add(s);
-        }
-        if ((s = System.getProperty("josm.resources")) != null) {
-            if (!s.endsWith(File.separator)) {
-                s = s + File.separator;
-            }
-            locations.add(s);
-        }
-        String appdata = System.getenv("APPDATA");
-        if (System.getenv("ALLUSERSPROFILE") != null && appdata != null
-                && appdata.lastIndexOf(File.separator) != -1) {
-            appdata = appdata.substring(appdata.lastIndexOf(File.separator));
-            locations.add(new File(new File(System.getenv("ALLUSERSPROFILE"),
-                    appdata), "JOSM").getPath());
-        }
-        locations.add("/usr/local/share/josm/");
-        locations.add("/usr/local/lib/josm/");
-        locations.add("/usr/share/josm/");
-        locations.add("/usr/lib/josm/");
+        Set<String> locations = new HashSet<>();
+        addPossibleResourceDir(locations, getPreferencesDirectory().getPath());
+        addPossibleResourceDir(locations, getUserDataDirectory().getPath());
+        addPossibleResourceDir(locations, System.getenv("JOSM_RESOURCES"));
+        addPossibleResourceDir(locations, System.getProperty("josm.resources"));
+        if (Main.isPlatformWindows()) {
+            String appdata = System.getenv("APPDATA");
+            if (System.getenv("ALLUSERSPROFILE") != null && appdata != null
+                    && appdata.lastIndexOf(File.separator) != -1) {
+                appdata = appdata.substring(appdata.lastIndexOf(File.separator));
+                locations.add(new File(new File(System.getenv("ALLUSERSPROFILE"),
+                        appdata), "JOSM").getPath());
+            }
+        } else {
+            locations.add("/usr/local/share/josm/");
+            locations.add("/usr/local/lib/josm/");
+            locations.add("/usr/share/josm/");
+            locations.add("/usr/lib/josm/");
+        }
         return locations;
     }
@@ -811,5 +830,5 @@
     public void init(boolean reset) {
         // get the preferences.
-        File prefDir = getPreferencesDirFile();
+        File prefDir = getPreferencesDirectory();
         if (prefDir.exists()) {
             if(!prefDir.isDirectory()) {
Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 7834)
@@ -154,5 +154,5 @@
      */
     public static String getValidatorDir() {
-        return Main.pref.getPreferencesDir() + "validator/";
+        return new File(Main.pref.getUserDataDirectory(), "validator").getAbsolutePath();
     }
 
@@ -174,5 +174,5 @@
         ignoredErrors.clear();
         if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) {
-            Path path = Paths.get(getValidatorDir() + "ignorederrors");
+            Path path = Paths.get(getValidatorDir()).resolve("ignorederrors");
             if (Files.exists(path)) {
                 try {
@@ -196,6 +196,6 @@
 
     public static void saveIgnoredErrors() {
-        try (PrintWriter out = new PrintWriter(new OutputStreamWriter(
-                new FileOutputStream(getValidatorDir() + "ignorederrors"), StandardCharsets.UTF_8), false)) {
+        try (PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(
+                new File(getValidatorDir(), "ignorederrors")), StandardCharsets.UTF_8), false)) {
             for (String e : ignoredErrors) {
                 out.println(e);
@@ -282,5 +282,5 @@
      * until most bugs were discovered while keeping the processing time reasonable)
      */
-    public final void initializeGridDetail() {
+    public static final void initializeGridDetail() {
         String code = Main.getProjection().toCode();
         if (Arrays.asList(ProjectionPreference.wgs84.allCodes()).contains(code)) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java	(revision 7834)
@@ -2,24 +2,7 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
-import org.openstreetmap.josm.data.osm.PrimitiveId;
-import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
-import org.openstreetmap.josm.gui.widgets.HtmlPanel;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
-import org.openstreetmap.josm.gui.widgets.OsmIdTextField;
-import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
-import org.openstreetmap.josm.tools.Utils;
-
-import javax.swing.BorderFactory;
-import javax.swing.GroupLayout;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.KeyStroke;
-import javax.swing.border.EtchedBorder;
-import javax.swing.plaf.basic.BasicComboBoxEditor;
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trc;
+
 import java.awt.Component;
 import java.awt.Dimension;
@@ -37,6 +20,24 @@
 import java.util.Set;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.trc;
+import javax.swing.BorderFactory;
+import javax.swing.GroupLayout;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.KeyStroke;
+import javax.swing.border.EtchedBorder;
+import javax.swing.plaf.basic.BasicComboBoxEditor;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
+import org.openstreetmap.josm.data.osm.PrimitiveId;
+import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
+import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
+import org.openstreetmap.josm.gui.widgets.OsmIdTextField;
+import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -197,5 +198,5 @@
     protected void tryToPasteFromClipboard(OsmIdTextField tfId, OsmPrimitiveTypesComboBox cbType) {
         String buf = Utils.getClipboardContent();
-        if (buf == null || buf.length()==0) return;
+        if (buf == null || buf.isEmpty()) return;
         if (buf.length() > Main.pref.getInteger("downloadprimitive.max-autopaste-length", 2000)) return;
         final List<SimplePrimitiveId> ids = SimplePrimitiveId.fuzzyParse(buf);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java	(revision 7834)
@@ -367,5 +367,5 @@
                    }
                 }
-                for (File f: Main.pref.getPreferencesDirFile().listFiles()) {
+                for (File f: Main.pref.getPreferencesDirectory().listFiles()) {
                    String s = f.getName();
                    int idx = s.indexOf('_');
Index: trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 7834)
@@ -358,5 +358,5 @@
         public void filter() {
             String expr = filterField.getText().trim();
-            if (expr.length()==0) { expr=null; }
+            if (expr.isEmpty()) { expr=null; }
             try {
                 final TableRowSorter<? extends TableModel> sorter =
Index: trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 7834)
@@ -79,5 +79,6 @@
      *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
      *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
-     *  <li>{@code josmdir://SOME/FILE} file inside josm config directory (since r7058)</li></ul>
+     *  <li>{@code josmdir://SOME/FILE} file inside josm user data directory (since r7058)</li></ul>
+     *  <li>{@code josmplugindir://SOME/FILE} file inside josm plugin directory (since r7832)</li></ul>
      */
     public CachedFile(String name) {
@@ -92,5 +93,6 @@
      *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
      *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
-     *  <li>{@code josmdir://SOME/FILE} file inside josm config directory (since r7058)</li></ul>
+     *  <li>{@code josmdir://SOME/FILE} file inside josm user data directory (since r7058)</li></ul>
+     *  <li>{@code josmplugindir://SOME/FILE} file inside josm plugin directory (since r7832)</li></ul>
      * @return this object
      */
@@ -206,5 +208,7 @@
                 return null;
             } else if (name.startsWith("josmdir://")) {
-                cacheFile = new File(Main.pref.getPreferencesDir(), name.substring("josmdir://".length()));
+                cacheFile = new File(Main.pref.getUserDataDirectory(), name.substring("josmdir://".length()));
+            } else if (name.startsWith("josmplugindir://")) {
+                cacheFile = new File(Main.pref.getPluginsDirectory(), name.substring("josmplugindir://".length()));
             } else {
                 cacheFile = new File(name);
Index: trunk/src/org/openstreetmap/josm/io/GpxExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 7834)
@@ -200,5 +200,5 @@
 
         if (enable) {
-            if (copyrightYear.getText().length()==0) {
+            if (copyrightYear.getText().isEmpty()) {
                 String sCopyrightYear = data.getString(META_COPYRIGHT_YEAR);
                 if (sCopyrightYear == null) {
@@ -207,5 +207,5 @@
                 copyrightYear.setText(sCopyrightYear);
             }
-            if (copyright.getText().length()==0) {
+            if (copyright.getText().isEmpty()) {
                 String sCopyright = data.getString(META_COPYRIGHT_LICENSE);
                 if (sCopyright == null) {
@@ -308,5 +308,5 @@
                         break;
                     }
-                    license += license.length()==0 ? urls[i] : ", "+urls[i];
+                    license += license.isEmpty() ? urls[i] : ", "+urls[i];
                 }
                 copyright.setText(license);
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java	(revision 7834)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.io.remotecontrol;
 
+import java.io.File;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -28,5 +29,6 @@
      * @since 7335
      */
-    public static final BooleanProperty PROP_REMOTECONTROL_HTTPS_ENABLED = new BooleanProperty("remotecontrol.https.enabled", false);
+    public static final BooleanProperty PROP_REMOTECONTROL_HTTPS_ENABLED = new BooleanProperty(
+            "remotecontrol.https.enabled", false);
 
     /**
@@ -72,5 +74,5 @@
      */
     public static String getRemoteControlDir() {
-        return Main.pref.getPreferencesDir() + "remotecontrol/";
+        return new File(Main.pref.getUserDataDirectory(), "remotecontrol").getAbsolutePath();
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 7834)
@@ -880,6 +880,6 @@
             }
         }
-        // Try user-preference directory
-        String dir = Main.pref.getPreferencesDir() + "images";
+        // Try user-data directory
+        String dir = new File(Main.pref.getUserDataDirectory(), "images").getAbsolutePath();
         try {
             u = getImageUrl(dir, imageName, additionalClassLoaders);
@@ -952,5 +952,6 @@
             });
 
-            CachedFile cf = new CachedFile(base + fn).setDestDir(new File(Main.pref.getPreferencesDir(), "images").toString());
+            CachedFile cf = new CachedFile(base + fn).setDestDir(
+                    new File(Main.pref.getUserDataDirectory(), "images").getPath());
             try (InputStream is = cf.getInputStream()) {
                 parser.parse(new InputSource(is));
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHook.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHook.java	(revision 7834)
@@ -134,3 +134,10 @@
      */
     public File getDefaultPrefDirectory();
+
+    /**
+     * Returns the platform-dependent default user data directory.
+     * @return the platform-dependent default user data directory
+     * @since 7834
+     */
+    public File getDefaultUserDataDirectory();
 }
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java	(revision 7834)
@@ -333,3 +333,8 @@
         return new File(System.getProperty("user.home")+"/Library/Preferences", "JOSM");
     }
+
+    @Override
+    public File getDefaultUserDataDirectory() {
+        return new File(System.getProperty("user.home")+"/Library/Application Support", "JOSM");
+    }
 }
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 7834)
@@ -373,5 +373,5 @@
     @Override
     public File getDefaultCacheDirectory() {
-        return new File(Main.pref.getPreferencesDirFile(), "cache");
+        return new File(Main.pref.getUserDataDirectory(), "cache");
     }
 
@@ -380,3 +380,9 @@
         return new File(System.getProperty("user.home"), ".josm");
     }
+
+    @Override
+    public File getDefaultUserDataDirectory() {
+        // Use preferences directory by default
+        return Main.pref.getPreferencesDirectory();
+    }
 }
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 7833)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 7834)
@@ -287,5 +287,6 @@
     public File getDefaultCacheDirectory() {
         String p = System.getenv("LOCALAPPDATA");
-        if (p == null || "".equals(p)) {
+        if (p == null || p.isEmpty()) {
+            // Fallback for Windows OS earlier than Windows Vista, where the variable is not defined
             p = System.getenv("APPDATA");
         }
