Index: /trunk/src/org/openstreetmap/josm/data/projection/Projections.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/Projections.java	(revision 3873)
+++ /trunk/src/org/openstreetmap/josm/data/projection/Projections.java	(revision 3874)
@@ -34,4 +34,10 @@
     }
 
+    /**
+     * Adds a new projection to the list of known projections.
+     * 
+     * For Plugins authors: make sure your plugin is an early plugin, i.e. put
+     * Plugin-Early=true in your Manifest.
+     */
     public static void addProjection(Projection proj) {
         allProjections.add(proj);
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java	(revision 3873)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java	(revision 3874)
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.data.projection.ProjectionSubPrefs;
 import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.tools.GBC;
 
@@ -203,25 +204,25 @@
         Projection oldProj = Main.proj;
 
-        try {
-            Main.proj = (Projection)Class.forName(name).newInstance();
-        } catch (final Exception e) {
-            // backup plan: if we cannot instantiate this, maybe we have an instance already.
-            Main.proj = null;
-            for (Projection p : Projections.getProjections()) {
-                if (p.getClass().getName().equals(name)) {
-                    Main.proj = p; break;
-                } 
-            }
-            if (Main.proj == null) {
-                JOptionPane.showMessageDialog(
-                        Main.parent,
-                        tr("The projection {0} could not be activated. Using Mercator", name),
-                        tr("Error"),
-                        JOptionPane.ERROR_MESSAGE
-                );
-                coll = null;
-                Main.proj = new Mercator();
-                name = Main.proj.getClass().getName();
-            }
+        Projection p = null;
+        for (ClassLoader cl : PluginHandler.getResourceClassLoaders()) {
+            try {
+                p = (Projection) Class.forName(name, true, cl).newInstance();
+            } catch (final Exception e) {
+            }
+            if (p != null) {
+                Main.proj = p;
+                break;
+            }
+        }
+        if (p == null) {
+            JOptionPane.showMessageDialog(
+                    Main.parent,
+                    tr("The projection {0} could not be activated. Using Mercator", name),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE
+            );
+            coll = null;
+            Main.proj = new Mercator();
+            name = Main.proj.getClass().getName();
         }
         PROP_SUB_PROJECTION.put(coll);
@@ -285,4 +286,5 @@
      */
     private void setupProjectionCombo() {
+        boolean found = false;
         for (int i = 0; i < projectionCombo.getItemCount(); ++i) {
             Projection proj = (Projection)projectionCombo.getItemAt(i);
@@ -294,7 +296,10 @@
                 projectionCombo.setSelectedIndex(i);
                 selectedProjectionChanged(proj);
+                found = true;
                 break;
             }
         }
+        if (!found)
+            throw new RuntimeException("Couldn't find the current projection in the list of available projections!");
 
         projectionCombo.addActionListener(new ActionListener() {
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 3873)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 3874)
@@ -159,4 +159,22 @@
 
     /**
+     * Add here all ClassLoader whose resource should be searched.
+     */
+    private static final List<ClassLoader> sources = new LinkedList<ClassLoader>();
+
+    static {
+        try {
+            sources.add(ClassLoader.getSystemClassLoader());
+            sources.add(org.openstreetmap.josm.gui.MainApplication.class.getClassLoader());
+        } catch (SecurityException ex) {
+            sources.add(ImageProvider.class.getClassLoader());
+        }
+    }
+
+    public static Collection<ClassLoader> getResourceClassLoaders() {
+        return Collections.unmodifiableCollection(sources);
+    }
+
+    /**
      * Removes deprecated plugins from a collection of plugins. Modifies the
      * collection <code>plugins</code>.
@@ -516,5 +534,5 @@
 
             ClassLoader pluginClassLoader = createClassLoader(toLoad);
-            ImageProvider.sources.add(0, pluginClassLoader);
+            sources.add(0, pluginClassLoader);
             monitor.setTicksCount(toLoad.size());
             for (PluginInformation info : toLoad) {
Index: /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 3873)
+++ /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 3874)
@@ -65,8 +65,14 @@
             availablePlugins.put(info.getName(), info);
         } else {
-            availablePlugins.get(info.getName()).localversion = info.version;
+            PluginInformation current = availablePlugins.get(info.getName());
+            current.localversion = info.version;
             if (info.icon != null) {
-                availablePlugins.get(info.getName()).icon = info.icon;
-            }
+                current.icon = info.icon;
+            }
+            current.early = info.early;
+            current.className = info.className;
+            current.libraries = info.libraries;
+            current.stage = info.stage;
+            current.requires = info.requires;
         }
     }
Index: /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 3873)
+++ /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 3874)
@@ -24,6 +24,4 @@
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.Map;
 import java.util.zip.ZipEntry;
@@ -36,4 +34,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.io.MirroredInputStream;
+import org.openstreetmap.josm.plugins.PluginHandler;
 
 /**
@@ -68,10 +67,4 @@
      */
     private static Map<String, ImageWrapper> cache = new HashMap<String, ImageWrapper>();
-
-    /**
-     * Add here all ClassLoader whose resource should be searched. Plugin's class loaders are added
-     * by main.
-     */
-    public static final List<ClassLoader> sources = new LinkedList<ClassLoader>();
 
     /**
@@ -234,5 +227,5 @@
         if (path.startsWith("resource://")) {
             String p = path.substring("resource://".length());
-            for (ClassLoader source : sources) {
+            for (ClassLoader source : PluginHandler.getResourceClassLoaders()) {
                 URL res;
                 if ((res = source.getResource(p + name)) != null)
@@ -355,13 +348,4 @@
     }
 
-    static {
-        try {
-            sources.add(ClassLoader.getSystemClassLoader());
-            sources.add(org.openstreetmap.josm.gui.MainApplication.class.getClassLoader());
-        } catch (SecurityException ex) {
-            sources.add(ImageProvider.class.getClassLoader());
-        }
-    }
-
     /*
      * from: http://www.jidesoft.com/blog/2008/02/29/rotate-an-icon-in-java/ License:
