Index: /trunk/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /trunk/.settings/org.eclipse.jdt.ui.prefs	(revision 6473)
+++ /trunk/.settings/org.eclipse.jdt.ui.prefs	(revision 6474)
@@ -1,3 +1,2 @@
-#Wed Jan 27 11:53:40 EST 2010
 cleanup_settings_version=2
 eclipse.preferences.version=1
@@ -14,4 +13,5 @@
 sp_cleanup.add_missing_nls_tags=false
 sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
 sp_cleanup.add_serial_version_id=false
 sp_cleanup.always_use_blocks=false
@@ -51,5 +51,5 @@
 sp_cleanup.sort_members=false
 sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks=false
 sp_cleanup.use_blocks_only_for_return_and_throw=true
 sp_cleanup.use_parentheses_in_expressions=false
Index: /trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/Main.java	(revision 6473)
+++ /trunk/src/org/openstreetmap/josm/Main.java	(revision 6474)
@@ -212,5 +212,5 @@
      */
     public static int logLevel = 3;
-    
+
     /**
      * Prints an error message if logging is on.
@@ -223,5 +223,5 @@
         System.err.println(tr("ERROR: {0}", msg));
     }
-    
+
     /**
      * Prints a warning message if logging is on.
@@ -233,5 +233,5 @@
         System.err.println(tr("WARNING: {0}", msg));
     }
-    
+
     /**
      * Prints an informational message if logging is on.
@@ -243,5 +243,5 @@
         System.out.println(tr("INFO: {0}", msg));
     }
-    
+
     /**
      * Prints a debug message if logging is on.
@@ -253,5 +253,5 @@
         System.out.println(tr("DEBUG: {0}", msg));
     }
-    
+
     /**
      * Prints a formated error message if logging is on. Calls {@link MessageFormat#format}
@@ -264,5 +264,5 @@
         error(MessageFormat.format(msg, objects));
     }
-    
+
     /**
      * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format}
@@ -274,5 +274,5 @@
         warn(MessageFormat.format(msg, objects));
     }
-    
+
     /**
      * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format}
@@ -284,5 +284,5 @@
         info(MessageFormat.format(msg, objects));
     }
-    
+
     /**
      * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format}
@@ -294,5 +294,5 @@
         debug(MessageFormat.format(msg, objects));
     }
-    
+
     /**
      * Prints an error message for the given Throwable.
@@ -303,5 +303,5 @@
         error(getErrorMessage(t));
     }
-    
+
     /**
      * Prints a warning message for the given Throwable.
@@ -312,5 +312,5 @@
         warn(getErrorMessage(t));
     }
-    
+
     private static String getErrorMessage(Throwable t) {
         StringBuilder sb = new StringBuilder(t.getClass().getName());
@@ -318,4 +318,8 @@
         if (msg != null) {
             sb.append(": ").append(msg.trim());
+        }
+        Throwable cause = t.getCause();
+        if (cause != null && !cause.equals(t)) {
+            sb.append(". ").append(tr("Cause: ")).append(getErrorMessage(cause));
         }
         return sb.toString();
Index: /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 6473)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 6474)
@@ -183,5 +183,9 @@
         if (!tasks.isEmpty()) {
             // TODO: handle multiple suitable tasks ?
-            future = tasks.iterator().next().loadUrl(new_layer, url, monitor);
+            try {
+                future = tasks.iterator().next().loadUrl(new_layer, url, monitor);
+            } catch (IllegalArgumentException e) {
+                Main.error(e);
+            }
         }
         if (future != null) {
Index: /trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 6473)
+++ /trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java	(revision 6474)
@@ -11,4 +11,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
@@ -34,4 +35,5 @@
      */
     public BoundingBoxDownloader(Bounds downloadArea) {
+        CheckParameterUtil.ensureParameterNotNull(downloadArea, "downloadArea");
         this.lat1 = downloadArea.getMinLat();
         this.lon1 = downloadArea.getMinLon();
Index: /trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 6473)
+++ /trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 6474)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.tools;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.HeadlessException;
@@ -15,10 +17,10 @@
 public final class OsmUrlToBounds {
     private static final String SHORTLINK_PREFIX = "http://osm.org/go/";
-    
+
     private OsmUrlToBounds() {
         // Hide default constructor for utils classes
     }
 
-    public static Bounds parse(String url) {
+    public static Bounds parse(String url) throws IllegalArgumentException {
         try {
             // a percent sign indicates an encoded URL (RFC 1738).
@@ -86,21 +88,34 @@
      * @param url string for parsing
      * @return Bounds if hashurl, {@code null} otherwise
-     */
-    private static Bounds parseHashURLs(String url) {
+     * @throws IllegalArgumentException if URL is invalid
+     */
+    private static Bounds parseHashURLs(String url) throws IllegalArgumentException {
         int startIndex = url.indexOf("#map=");
         if (startIndex == -1) return null;
         int endIndex = url.indexOf('&', startIndex);
         if (endIndex == -1) endIndex = url.length();
-        try {
-            String coordPart = url.substring(startIndex+5, endIndex);
-            String[] parts = coordPart.split("/");
-            Bounds b = positionToBounds(Double.parseDouble(parts[1]),
-                    Double.parseDouble(parts[2]),
-                    Integer.parseInt(parts[0]));
-            return b;
-        } catch (Exception ex) {
-            Main.debug(ex.getMessage());
-            return null;
-        }
+        String coordPart = url.substring(startIndex+5, endIndex);
+        String[] parts = coordPart.split("/");
+        if (parts.length < 3) {
+            throw new IllegalArgumentException(tr("URL does not contain {0}/{1}/{2}", tr("zoom"), tr("latitude"), tr("longitude")));
+        }
+        int zoom;
+        double lat, lon;
+        try {
+            zoom = Integer.parseInt(parts[0]);
+        } catch (NumberFormatException e) {
+            throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("zoom")), e);
+        }
+        try {
+            lat = Double.parseDouble(parts[1]);
+        } catch (NumberFormatException e) {
+            throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("latitude")), e);
+        }
+        try {
+            lon = Double.parseDouble(parts[2]);
+        } catch (NumberFormatException e) {
+            throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("longitude")), e);
+        }
+        return positionToBounds(lat, lon, zoom);
     }
 
