Index: trunk/src/org/openstreetmap/josm/data/projection/Projections.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/Projections.java	(revision 9125)
+++ trunk/src/org/openstreetmap/josm/data/projection/Projections.java	(revision 9126)
@@ -12,4 +12,5 @@
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Locale;
@@ -18,5 +19,4 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -40,5 +40,4 @@
 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
 import org.openstreetmap.josm.io.CachedFile;
-import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -49,4 +48,19 @@
 public final class Projections {
 
+    /**
+     * Class to hold information about one projection.
+     */
+    public static class ProjectionDefinition {
+        public String code;
+        public String name;
+        public String definition;
+
+        public ProjectionDefinition(String code, String name, String definition) {
+            this.code = code;
+            this.name = name;
+            this.definition = definition;
+        }
+    }
+
     private Projections() {
         // Hide default constructor for utils classes
@@ -72,5 +86,5 @@
     static final Map<String, Datum> datums = new HashMap<>();
     static final Map<String, NTV2GridShiftFileWrapper> nadgrids = new HashMap<>();
-    static final Map<String, Pair<String, String>> inits = new HashMap<>();
+    static final Map<String, ProjectionDefinition> inits;
 
     static {
@@ -128,5 +142,9 @@
         nadgrids.put("ntf_r93_b.gsb", NTV2GridShiftFileWrapper.ntf_rgf93);
 
-        loadInits();
+        try {
+            inits = loadProjectionDefinitions("resource://data/projection/epsg");
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
     }
 
@@ -173,36 +191,55 @@
      */
     public static String getInit(String id) {
-        Pair<String, String> r = inits.get(id.toUpperCase(Locale.ENGLISH));
-        if (r == null) return null;
-        return r.b;
-    }
-
-    /**
-     * Load +init "presets" from file
-     */
-    private static void loadInits() {
-        Pattern epsgPattern = Pattern.compile("<(\\d+)>(.*)<>");
+        ProjectionDefinition pd = inits.get(id.toUpperCase(Locale.ENGLISH));
+        if (pd == null) return null;
+        return pd.definition;
+    }
+
+    /**
+     * Load projection definitions from file.
+     * 
+     * @param path the path
+     * @return projection definitions
+     * @throws java.io.IOException
+     */
+    public static Map<String, ProjectionDefinition> loadProjectionDefinitions(String path) throws IOException {
         try (
-            InputStream in = new CachedFile("resource://data/projection/epsg").getInputStream();
+            InputStream in = new CachedFile(path).getInputStream();
             BufferedReader r = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
         ) {
-            String line, lastline = "";
-            while ((line = r.readLine()) != null) {
-                line = line.trim();
-                if (!line.startsWith("#") && !line.isEmpty()) {
-                    if (!lastline.startsWith("#")) throw new AssertionError("EPSG file seems corrupted");
-                    String name = lastline.substring(1).trim();
-                    Matcher m = epsgPattern.matcher(line);
-                    if (m.matches()) {
-                        inits.put("EPSG:" + m.group(1), Pair.create(name, m.group(2).trim()));
-                    } else {
-                        Main.warn("Failed to parse line from the EPSG projection definition: "+line);
-                    }
-                }
-                lastline = line;
-            }
+            return loadProjectionDefinitions(r);
         } catch (IOException ex) {
             throw new RuntimeException(ex);
         }
+    }
+
+    /**
+     * Load projection definitions from file.
+     * 
+     * @param r the reader
+     * @return projection definitions
+     * @throws java.io.IOException
+     */
+    public static Map<String, ProjectionDefinition> loadProjectionDefinitions(BufferedReader r) throws IOException {
+        Map<String, ProjectionDefinition> result = new LinkedHashMap<>();
+        Pattern epsgPattern = Pattern.compile("<(\\d+)>(.*)<>");
+        String line, lastline = "";
+        while ((line = r.readLine()) != null) {
+            line = line.trim();
+            if (!line.startsWith("#") && !line.isEmpty()) {
+                if (!lastline.startsWith("#")) throw new AssertionError("EPSG file seems corrupted");
+                String name = lastline.substring(1).trim();
+                Matcher m = epsgPattern.matcher(line);
+                if (m.matches()) {
+                    String code = "EPSG:" + m.group(1);
+                    String definition = m.group(2).trim();
+                    result.put(code, new ProjectionDefinition(code, name, definition));
+                } else {
+                    Main.warn("Failed to parse line from the EPSG projection definition: "+line);
+                }
+            }
+            lastline = line;
+        }
+        return result;
     }
 
@@ -236,9 +273,7 @@
         }
         if (proj == null) {
-            Pair<String, String> pair = inits.get(code);
-            if (pair == null) return null;
-            String name = pair.a;
-            String init = pair.b;
-            proj = new CustomProjection(name, code, init, null);
+            ProjectionDefinition pd = inits.get(code);
+            if (pd == null) return null;
+            proj = new CustomProjection(pd.name, code, pd.definition, null);
         }
         projectionsByCode_cache.put(code, proj);
