Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 9059)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 9062)
@@ -380,4 +380,35 @@
         if (message == null) return false;
 
+        UpdatePluginsMessagePanel pnlMessage = new UpdatePluginsMessagePanel();
+        pnlMessage.setMessage(message);
+        pnlMessage.initDontShowAgain(togglePreferenceKey);
+
+        // check whether automatic update at startup was disabled
+        //
+        String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase(Locale.ENGLISH);
+        switch(policy) {
+        case "never":
+            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
+            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));
+            }
+            return false;
+
+        case "always":
+            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
+            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));
+            }
+            return true;
+
+        case "ask":
+            break;
+
+        default:
+            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
+        }
+
         ButtonSpec[] options = new ButtonSpec[] {
                 new ButtonSpec(
@@ -394,35 +425,4 @@
                 )
         };
-
-        UpdatePluginsMessagePanel pnlMessage = new UpdatePluginsMessagePanel();
-        pnlMessage.setMessage(message);
-        pnlMessage.initDontShowAgain(togglePreferenceKey);
-
-        // check whether automatic update at startup was disabled
-        //
-        String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase(Locale.ENGLISH);
-        switch(policy) {
-        case "never":
-            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
-            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));
-            }
-            return false;
-
-        case "always":
-            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
-            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));
-            }
-            return true;
-
-        case "ask":
-            break;
-
-        default:
-            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
-        }
 
         int ret = HelpAwareOptionPane.showOptionDialog(
Index: trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 9059)
+++ trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 9062)
@@ -315,5 +315,4 @@
         if (sites == null) return;
         getProgressMonitor().setTicksCount(sites.size() * 3);
-        File pluginDir = Main.pref.getPluginsDirectory();
 
         // collect old cache files and remove if no longer in use
@@ -334,4 +333,5 @@
         }
 
+        File pluginDir = Main.pref.getPluginsDirectory();
         for (String site: sites) {
             String printsite = site.replaceAll("%<(.*)>", "");
