Index: trunk/src/org/openstreetmap/josm/gui/oauth/OsmLoginFailedException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/OsmLoginFailedException.java	(revision 9226)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/OsmLoginFailedException.java	(revision 9227)
@@ -2,20 +2,16 @@
 package org.openstreetmap.josm.gui.oauth;
 
+/**
+ * OSM login failure exception.
+ * @since 2746
+ */
 public class OsmLoginFailedException extends OsmOAuthAuthorizationException {
 
-    public OsmLoginFailedException() {
-        super();
-    }
-
-    public OsmLoginFailedException(String arg0, Throwable arg1) {
-        super(arg0, arg1);
-    }
-
-    public OsmLoginFailedException(String arg0) {
-        super(arg0);
-    }
-
-    public OsmLoginFailedException(Throwable arg0) {
-        super(arg0);
+    /**
+     * Constructs a new {@code OsmLoginFailedException} with the specified cause.
+     * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+     */
+    public OsmLoginFailedException(Throwable cause) {
+        super(cause);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 9226)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 9227)
@@ -50,14 +50,4 @@
         private String token;
         private String userName;
-    }
-
-    /**
-     * Creates a new authorisation client with default OAuth parameters
-     *
-     */
-    public OsmOAuthAuthorizationClient() {
-        oauthProviderParameters = OAuthParameters.createDefault(Main.pref.get("osm-server.url"));
-        consumer = oauthProviderParameters.buildConsumer();
-        provider = oauthProviderParameters.buildProvider(consumer);
     }
 
@@ -241,5 +231,5 @@
     }
 
-    protected String buildPostRequest(Map<String, String> parameters) throws OsmOAuthAuthorizationException {
+    protected static String buildPostRequest(Map<String, String> parameters) {
         StringBuilder sb = new StringBuilder(32);
 
@@ -322,4 +312,6 @@
      * Submits a request to the OSM website for a OAuth form. The OSM website replies a session token in
      * a hidden parameter.
+     * @param sessionId session id
+     * @param requestToken request token
      *
      * @throws OsmOAuthAuthorizationException if something went wrong
Index: trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationException.java	(revision 9226)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationException.java	(revision 9227)
@@ -2,20 +2,24 @@
 package org.openstreetmap.josm.gui.oauth;
 
+/**
+ * OSM OAuth authorization exception.
+ * @since 2746
+ */
 public class OsmOAuthAuthorizationException extends Exception {
 
-    public OsmOAuthAuthorizationException() {
-        super();
+    /**
+     * Constructs a new {@code OsmLoginFailedException} with the specified detail message.
+     * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
+     */
+    public OsmOAuthAuthorizationException(String message) {
+        super(message);
     }
 
-    public OsmOAuthAuthorizationException(String arg0, Throwable arg1) {
-        super(arg0, arg1);
-    }
-
-    public OsmOAuthAuthorizationException(String arg0) {
-        super(arg0);
-    }
-
-    public OsmOAuthAuthorizationException(Throwable arg0) {
-        super(arg0);
+    /**
+     * Constructs a new {@code OsmLoginFailedException} with the specified cause.
+     * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method).
+     */
+    public OsmOAuthAuthorizationException(Throwable cause) {
+        super(cause);
     }
 }
Index: trunk/src/org/openstreetmap/josm/io/ProgressInputStream.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ProgressInputStream.java	(revision 9226)
+++ trunk/src/org/openstreetmap/josm/io/ProgressInputStream.java	(revision 9227)
@@ -10,4 +10,5 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 
 /**
@@ -23,5 +24,5 @@
      * Constructs a new {@code ProgressInputStream}.
      *
-     * @param in the stream to monitor
+     * @param in the stream to monitor. Must not be null
      * @param size the total size which will be sent
      * @param progressMonitor the monitor to report to
@@ -29,4 +30,5 @@
      */
     public ProgressInputStream(InputStream in, long size, ProgressMonitor progressMonitor) {
+        CheckParameterUtil.ensureParameterNotNull(in, "in");
         if (progressMonitor == null) {
             progressMonitor = NullProgressMonitor.INSTANCE;
@@ -43,4 +45,5 @@
      * @param con the connection to monitor
      * @param progressMonitor the monitor to report to
+     * @throws OsmTransferException if any I/O error occurs
      */
     public ProgressInputStream(URLConnection con, ProgressMonitor progressMonitor) throws OsmTransferException {
Index: trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9226)
+++ trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9227)
@@ -231,4 +231,5 @@
          * @see HttpURLConnection#getErrorStream()
          */
+        @SuppressWarnings("resource")
         public InputStream getContent() throws IOException {
             InputStream in;
@@ -238,21 +239,23 @@
                 in = connection.getErrorStream();
             }
-            in = new ProgressInputStream(in, getContentLength(), monitor);
-            in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
-            Compression compression = Compression.NONE;
-            if (uncompress) {
-                final String contentType = getContentType();
-                Main.debug("Uncompressing input stream according to Content-Type header: {0}", contentType);
-                compression = Compression.forContentType(contentType);
-            }
-            if (uncompressAccordingToContentDisposition && Compression.NONE.equals(compression)) {
-                final String contentDisposition = getHeaderField("Content-Disposition");
-                final Matcher matcher = Pattern.compile("filename=\"([^\"]+)\"").matcher(contentDisposition);
-                if (matcher.find()) {
-                    Main.debug("Uncompressing input stream according to Content-Disposition header: {0}", contentDisposition);
-                    compression = Compression.byExtension(matcher.group(1));
+            if (in != null) {
+                in = new ProgressInputStream(in, getContentLength(), monitor);
+                in = "gzip".equalsIgnoreCase(getContentEncoding()) ? new GZIPInputStream(in) : in;
+                Compression compression = Compression.NONE;
+                if (uncompress) {
+                    final String contentType = getContentType();
+                    Main.debug("Uncompressing input stream according to Content-Type header: {0}", contentType);
+                    compression = Compression.forContentType(contentType);
                 }
-            }
-            in = compression.getUncompressedInputStream(in);
+                if (uncompressAccordingToContentDisposition && Compression.NONE.equals(compression)) {
+                    final String contentDisposition = getHeaderField("Content-Disposition");
+                    final Matcher matcher = Pattern.compile("filename=\"([^\"]+)\"").matcher(contentDisposition);
+                    if (matcher.find()) {
+                        Main.debug("Uncompressing input stream according to Content-Disposition header: {0}", contentDisposition);
+                        compression = Compression.byExtension(matcher.group(1));
+                    }
+                }
+                in = compression.getUncompressedInputStream(in);
+            }
             return in;
         }
