Index: trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/Lambert.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/data/projection/Lambert.java	(revision 5236)
@@ -96,4 +96,6 @@
 
     public Lambert(final int layoutZone) {
+        if (layoutZone < 0 || layoutZone >= 4)
+            throw new IllegalArgumentException();
         this.layoutZone = layoutZone;
         ellps = Ellipsoid.clarkeIGN;
Index: trunk/src/org/openstreetmap/josm/data/projection/ProjectionInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/ProjectionInfo.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/data/projection/ProjectionInfo.java	(revision 5236)
@@ -4,4 +4,5 @@
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Map;
 
 import org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice;
@@ -9,9 +10,8 @@
 
 public class ProjectionInfo {
-    private static HashMap<String, ProjectionChoice> allCodesPC;
-    private static HashMap<String, Projection> allCodes;
+    private static Map<String, ProjectionChoice> allCodesPC = new HashMap<String, ProjectionChoice>();
+    private static Map<String, Projection> allCodes = new HashMap<String, Projection>();
 
     static {
-        allCodes = new HashMap<String, Projection>();
         for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) {
             for (String code : pc.allCodes()) {
Index: trunk/src/org/openstreetmap/josm/data/projection/Puwg.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/Puwg.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/data/projection/Puwg.java	(revision 5236)
@@ -22,5 +22,5 @@
     private final int zone;
 
-    static public PuwgData[] Zones = new PuwgData[] {
+    static public PuwgData[] zones = new PuwgData[] {
         new Epsg2180(),
         new Epsg2176(),
@@ -35,4 +35,6 @@
 
     public Puwg(int zone) {
+        if (zone < 0 || zone >= zones.length)
+            throw new IllegalArgumentException();
         ellps = Ellipsoid.GRS80;
         proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator();
@@ -44,5 +46,5 @@
         datum = GRS80Datum.INSTANCE;
         this.zone = zone;
-        PuwgData z = Zones[zone];
+        PuwgData z = zones[zone];
         x_0 = z.getPuwgFalseEasting();
         y_0 = z.getPuwgFalseNorthing();
@@ -58,5 +60,5 @@
     @Override
     public Integer getEpsgCode() {
-        return Zones[zone].getEpsgCode();
+        return zones[zone].getEpsgCode();
     }
 
@@ -68,10 +70,10 @@
     @Override
     public String getCacheDirectoryName() {
-        return Zones[zone].getCacheDirectoryName();
+        return zones[zone].getCacheDirectoryName();
     }
 
     @Override
     public Bounds getWorldBoundsLatLon() {
-        return Zones[zone].getWorldBoundsLatLon();
+        return zones[zone].getWorldBoundsLatLon();
     }
 
Index: trunk/src/org/openstreetmap/josm/data/projection/UTM.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/UTM.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/data/projection/UTM.java	(revision 5236)
@@ -24,14 +24,11 @@
     private Hemisphere hemisphere;
 
-    /**
-     * Applies an additional false easting of 3000000 m if true.
-     */
-    private boolean offset;
-
     public UTM() {
-        this(DEFAULT_ZONE, DEFAULT_HEMISPHERE, false);
+        this(DEFAULT_ZONE, DEFAULT_HEMISPHERE);
     }
 
-    public UTM(int zone, Hemisphere hemisphere, boolean offset) {
+    public UTM(int zone, Hemisphere hemisphere) {
+        if (zone < 1 || zone > 60)
+            throw new IllegalArgumentException();
         ellps = Ellipsoid.WGS84;
         proj = new org.openstreetmap.josm.data.projection.proj.TransverseMercator();
@@ -44,6 +41,5 @@
         this.zone = zone;
         this.hemisphere = hemisphere;
-        this.offset = offset;
-        x_0 = 500000 + (offset ? 3000000 : 0);
+        x_0 = 500000;
         y_0 = hemisphere == Hemisphere.North ? 0 : 10000000;
         lon_0 = getUtmCentralMeridianDeg(zone);
@@ -81,5 +77,5 @@
     @Override
     public Integer getEpsgCode() {
-        return ((offset?325800:32600) + getzone() + (hemisphere == Hemisphere.South?100:0));
+        return (32600 + getzone() + (hemisphere == Hemisphere.South?100:0));
     }
 
Index: trunk/src/org/openstreetmap/josm/data/projection/UTM_France_DOM.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/UTM_France_DOM.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/data/projection/UTM_France_DOM.java	(revision 5236)
@@ -61,4 +61,6 @@
 
     public UTM_France_DOM(int currentGeodesic) {
+        if (currentGeodesic < 0 || currentGeodesic >= 5)
+            throw new IllegalArgumentException();
         this.currentGeodesic = currentGeodesic;
         datum = utmDatums[currentGeodesic];
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java	(revision 5236)
@@ -20,15 +20,18 @@
     @Override
     public Projection getProjection() {
-        return new GaussKrueger(indexToZone(index));
+        return new GaussKrueger(index + 2);
     }
 
     @Override
-    protected int indexToZone(int index) {
-        return index + 2;
+    protected String indexToZone(int index) {
+        return Integer.toString(index + 2);
     }
 
     @Override
-    protected int zoneToIndex(int zone) {
-        return zone - 2;
+    protected int zoneToIndex(String zone) {
+        try {
+            return Integer.parseInt(zone) - 2;
+        } catch(NumberFormatException e) {}
+        return defaultIndex;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java	(revision 5236)
@@ -76,11 +76,14 @@
     
     @Override
-    protected int indexToZone(int index) {
-        return index + 1;
+    protected String indexToZone(int index) {
+        return Integer.toString(index + 1);
     }
 
     @Override
-    protected int zoneToIndex(int zone) {
-        return zone - 1;
+    protected int zoneToIndex(String zone) {
+        try {
+            return Integer.parseInt(zone) - 1;
+        } catch(NumberFormatException e) {}
+        return defaultIndex;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java	(revision 5236)
@@ -70,11 +70,14 @@
 
     @Override
-    protected int indexToZone(int index) {
-        return index + 1;
+    protected String indexToZone(int index) {
+        return Integer.toString(index + 1);
     }
 
     @Override
-    protected int zoneToIndex(int zone) {
-        return zone - 1;
+    protected int zoneToIndex(String zone) {
+        try {
+            return Integer.parseInt(zone) - 1;
+        } catch(NumberFormatException e) {}
+        return defaultIndex;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 5236)
@@ -46,18 +46,16 @@
      * Convert 0-based index to preference value.
      */
-    abstract protected int indexToZone(int index);
+    abstract protected String indexToZone(int index);
 
     /**
      * Convert preference value to 0-based index.
      */
-    abstract protected int zoneToIndex(int zone);
+    abstract protected int zoneToIndex(String zone);
 
     @Override
     public void setPreferences(Collection<String> args) {
-        Integer zone = null;
+        String zone = null;
         if (args != null && args.size() >= 1) {
-            try {
-                zone = Integer.parseInt(args.iterator().next());
-            } catch(NumberFormatException e) {}
+            zone = args.iterator().next();
         }
         int index;
@@ -101,5 +99,5 @@
         CBPanel p = (CBPanel) panel;
         int index = p.prefcb.getSelectedIndex();
-        return Collections.singleton(Integer.toString(indexToZone(index)));
+        return Collections.singleton(indexToZone(index));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/PuwgProjectionChoice.java	(revision 5236)
@@ -13,5 +13,5 @@
 
     public PuwgProjectionChoice() {
-        super("core:puwg", tr("PUWG (Poland)"), Puwg.Zones, tr("PUWG Zone"));
+        super("core:puwg", tr("PUWG (Poland)"), Puwg.zones, tr("PUWG Zone"));
     }
 
@@ -23,7 +23,7 @@
     @Override
     public String[] allCodes() {
-        String[] zones = new String[Puwg.Zones.length];
-        for (int zone = 0; zone < Puwg.Zones.length; zone++) {
-            zones[zone] = Puwg.Zones[zone].toCode();
+        String[] zones = new String[Puwg.zones.length];
+        for (int index = 0; index < Puwg.zones.length; index++) {
+            zones[index] = Puwg.zones[index].toCode();
         }
         return zones;
@@ -32,5 +32,5 @@
     @Override
     public Collection<String> getPreferencesFromCode(String code) {
-        for (Puwg.PuwgData p : Puwg.Zones) {
+        for (Puwg.PuwgData p : Puwg.zones) {
             if (code.equals(p.toCode()))
                 return Collections.singleton(code);
@@ -45,11 +45,16 @@
 
     @Override
-    protected int indexToZone(int index) {
-        return index;
+    protected String indexToZone(int index) {
+        return Puwg.zones[index].toCode();
     }
 
     @Override
-    protected int zoneToIndex(int zone) {
-        return zone;
+    protected int zoneToIndex(String zone) {
+        for (int i=0; i<Puwg.zones.length; i++) {
+            if (zone.equals(Puwg.zones[i].toCode())) {
+                return i;
+            }
+        }
+        return defaultIndex;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java	(revision 5236)
@@ -12,5 +12,4 @@
 
 import javax.swing.ButtonGroup;
-import javax.swing.JCheckBox;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
@@ -27,9 +26,4 @@
     private UTM.Hemisphere hemisphere;
     
-    /**
-     * Applies an additional false easting of 3000000 m if true.
-     */
-    private boolean offset;
-
     private final static List<String> cbEntries = new ArrayList<String>();
     static {
@@ -46,5 +40,4 @@
 
         public JRadioButton north, south;
-        public JCheckBox offsetBox;
 
         public UTMPanel(Object[] entries, int initialIndex, String label, ActionListener listener) {
@@ -76,17 +69,7 @@
             this.add(GBC.glue(1, 1), GBC.eol().fill(GBC.BOTH));
 
-            //Offset
-            offsetBox = new JCheckBox();
-            offsetBox.setSelected(offset);
-
-            this.add(new JLabel(tr("Offset 3.000.000m east")), GBC.std().insets(5,5,0,5));
-            this.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));
-            this.add(offsetBox, GBC.eop().fill(GBC.HORIZONTAL));
-            this.add(GBC.glue(1, 1), GBC.eol().fill(GBC.BOTH));
-
             if (listener != null) {
                 north.addActionListener(listener);
                 south.addActionListener(listener);
-                offsetBox.addActionListener(listener);
             }
         }
@@ -100,5 +83,5 @@
     @Override
     public Projection getProjection() {
-        return new UTM(indexToZone(index), hemisphere, offset);
+        return new UTM(index + 1, hemisphere);
     }
 
@@ -108,6 +91,5 @@
         int index = p.prefcb.getSelectedIndex();
         UTM.Hemisphere hemisphere = p.south.isSelected()?UTM.Hemisphere.South:UTM.Hemisphere.North;
-        boolean offset = p.offsetBox.isSelected();
-        return Arrays.asList(Integer.toString(indexToZone(index)), hemisphere.toString(), (offset?"offset":"standard"));
+        return Arrays.asList(indexToZone(index), hemisphere.toString());
     }
 
@@ -116,8 +98,6 @@
         ArrayList<String> projections = new ArrayList<String>(60*4);
         for (int zone = 1;zone <= 60; zone++) {
-            for (boolean offset : new boolean[] { false, true }) {
-                for (UTM.Hemisphere hemisphere : UTM.Hemisphere.values()) {
-                    projections.add("EPSG:" + ((offset?325800:32600) + zone + (hemisphere == UTM.Hemisphere.South?100:0)));
-                }
+            for (UTM.Hemisphere hemisphere : UTM.Hemisphere.values()) {
+                projections.add("EPSG:" + (32600 + zone + (hemisphere == UTM.Hemisphere.South?100:0)));
             }
         }
@@ -127,21 +107,12 @@
     @Override
     public Collection<String> getPreferencesFromCode(String code) {
-        boolean offset = code.startsWith("EPSG:3258") || code.startsWith("EPSG:3259");
 
-        if (code.startsWith("EPSG:326") || code.startsWith("EPSG:327") || offset) {
+        if (code.startsWith("EPSG:326") || code.startsWith("EPSG:327")) {
             try {
-                UTM.Hemisphere hemisphere;
-                String zonestring;
-                if (offset) {
-                    hemisphere = code.charAt(8)=='8'?UTM.Hemisphere.North:UTM.Hemisphere.South;
-                    zonestring = code.substring(9);
-                } else {
-                    hemisphere = code.charAt(7)=='6'?UTM.Hemisphere.North:UTM.Hemisphere.South;
-                    zonestring = code.substring(8);
-                }
-
+                UTM.Hemisphere hemisphere = code.charAt(7)=='6'?UTM.Hemisphere.North:UTM.Hemisphere.South;
+                String zonestring = code.substring(8);
                 int zoneval = Integer.parseInt(zonestring);
                 if(zoneval > 0 && zoneval <= 60)
-                    return Arrays.asList(zonestring, hemisphere.toString(), (offset?"offset":"standard"));
+                    return Arrays.asList(zonestring, hemisphere.toString());
             } catch(NumberFormatException e) {}
         }
@@ -153,5 +124,4 @@
         super.setPreferences(args);
         UTM.Hemisphere hemisphere = DEFAULT_HEMISPHERE;
-        boolean offset = false;
 
         if(args != null) {
@@ -161,21 +131,19 @@
                 hemisphere = UTM.Hemisphere.valueOf(array[1]);
             }
-
-            if (array.length > 2) {
-                offset = array[2].equals("offset");
-            }
         }
         this.hemisphere = hemisphere;
-        this.offset = offset;
     }
 
     @Override
-    protected int indexToZone(int index) {
-        return index + 1;
+    protected String indexToZone(int index) {
+        return Integer.toString(index + 1);
     }
 
     @Override
-    protected int zoneToIndex(int zone) {
-        return zone - 1;
+    protected int zoneToIndex(String zone) {
+        try {
+            return Integer.parseInt(zone) - 1;
+        } catch(NumberFormatException e) {}
+        return defaultIndex;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTM_France_DOM_ProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTM_France_DOM_ProjectionChoice.java	(revision 5235)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTM_France_DOM_ProjectionChoice.java	(revision 5236)
@@ -24,11 +24,14 @@
 
     @Override
-    protected int indexToZone(int index) {
-        return index + 1;
+    protected String indexToZone(int index) {
+        return Integer.toString(index + 1);
     }
 
     @Override
-    protected int zoneToIndex(int zone) {
-        return zone - 1;
+    protected int zoneToIndex(String zone) {
+        try {
+            return Integer.parseInt(zone) - 1;
+        } catch(NumberFormatException e) {}
+        return defaultIndex;
     }
 
