Index: trunk/src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 2123)
+++ trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 2124)
@@ -14,4 +14,5 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
+import java.util.logging.Logger;
 
 import javax.swing.JCheckBox;
@@ -23,5 +24,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.Base64;
 import org.openstreetmap.josm.tools.GBC;
@@ -34,4 +34,5 @@
  */
 public class OsmConnection {
+    private static final Logger logger = Logger.getLogger(OsmConnection.class.getName());
 
     protected boolean cancel = false;
Index: trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 2123)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java	(revision 2124)
@@ -7,4 +7,5 @@
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -21,4 +22,5 @@
      */
     public OsmServerChangesetReader(){
+        setDoAuthenticate(false);
     }
 
@@ -32,8 +34,20 @@
     }
 
-
+    /**
+     * Queries a list
+     * @param query  the query specification. Must not be null.
+     * @param monitor a progress monitor. Set to {@see NullProgressMonitor#INSTANCE} if null
+     * @return the list of changesets read from the server
+     * @throws IllegalArgumentException thrown if query is null
+     * @throws OsmTransferException
+     */
     public List<Changeset> queryChangesets(ChangesetQuery query, ProgressMonitor monitor) throws OsmTransferException {
+        if (query == null)
+            throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "query"));
+        if (monitor == null) {
+            monitor = NullProgressMonitor.INSTANCE;
+        }
         try {
-            monitor.beginTask(tr("Reading changesetss..."));
+            monitor.beginTask(tr("Reading changesets..."));
             StringBuffer sb = new StringBuffer();
             sb.append("changesets?").append(query.getQueryString());
@@ -53,5 +67,19 @@
     }
 
+    /**
+     * Reads teh changeset with id <code>id</code> from the server
+     * 
+     * @param id  the changeset id. id > 0 required.
+     * @param monitor the progress monitor. Set to {@see NullProgressMonitor#INSTANCE} if null
+     * @return the changeset read
+     * @throws OsmTransferException thrown if something goes wrong
+     * @throws IllegalArgumentException if id <= 0
+     */
     public Changeset readChangeset(long id, ProgressMonitor monitor) throws OsmTransferException {
+        if (id <= 0)
+            throw new IllegalArgumentException(tr("parameter ''{0}'' > 0 expected. Got {1}", "id", id));
+        if (monitor == null) {
+            monitor = NullProgressMonitor.INSTANCE;
+        }
         try {
             monitor.beginTask(tr("Reading changeset {0} ...",id));
@@ -61,5 +89,5 @@
             if (in == null)
                 return null;
-            monitor.indeterminateSubTask(tr("Downloading changeset ..."));
+            monitor.indeterminateSubTask(tr("Downloading changeset {0} ...", id));
             List<Changeset> changesets = OsmChangesetParser.parse(in, monitor.createSubTaskMonitor(1, true));
             if (changesets == null || changesets.isEmpty())
@@ -75,7 +103,14 @@
     }
 
+    /**
+     * not implemented yet
+     * 
+     * @param id
+     * @param monitor
+     * @return
+     * @throws OsmTransferException
+     */
     public Changeset downloadChangeset(long id, ProgressMonitor monitor) throws OsmTransferException {
         return null;
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 2123)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 2124)
@@ -10,4 +10,5 @@
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.nio.charset.CharacterCodingException;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.Inflater;
@@ -30,4 +31,5 @@
 
     private OsmApi api = OsmApi.getOsmApi();
+    private boolean doAuthenticate = false;
 
     /**
@@ -66,4 +68,12 @@
             }
 
+            try {
+                if (doAuthenticate) {
+                    addAuth(activeConnection);
+                }
+            } catch(CharacterCodingException e) {
+                System.err.println(tr("Error: failed to add authentication credentials to the connection."));
+                throw new OsmTransferException(e);
+            }
             if (Main.pref.getBoolean("osm-server.use-compression", true)) {
                 activeConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");
@@ -122,3 +132,24 @@
     public abstract DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException;
 
+    /**
+     * Returns true if this reader is adding authentication credentials to the read
+     * request sent to the server.
+     * 
+     * @return true if this reader is adding authentication credentials to the read
+     * request sent to the server
+     */
+    public boolean isDoAuthenticate() {
+        return doAuthenticate;
+    }
+
+    /**
+     * Sets whether this reader adds authentication credentials to the read
+     * request sent to the server.
+     * 
+     * @param doAuthenticate  true if  this reader adds authentication credentials to the read
+     * request sent to the server
+     */
+    public void setDoAuthenticate(boolean doAuthenticate) {
+        this.doAuthenticate = doAuthenticate;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java	(revision 2123)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java	(revision 2124)
@@ -24,4 +24,8 @@
 
 public class OsmServerUserInfoReader extends OsmServerReader {
+
+    public OsmServerUserInfoReader() {
+        setDoAuthenticate(true);
+    }
 
     @Override
