Index: trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 7081)
@@ -32,10 +32,10 @@
  */
 public class JumpToAction extends JosmAction {
-    
+
     /**
      * Constructs a new {@code JumpToAction}.
      */
     public JumpToAction() {
-        super(tr("Jump To Position"), (Icon) null, tr("Opens a dialog that allows to jump to a specific location"), 
+        super(tr("Jump To Position"), (Icon) null, tr("Opens a dialog that allows to jump to a specific location"),
                 Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
                         KeyEvent.VK_J, Shortcut.CTRL), true, "action/jumpto", true);
@@ -46,4 +46,16 @@
     private final JosmTextField lon = new JosmTextField();
     private final JosmTextField zm = new JosmTextField();
+
+    class OsmURLListener implements DocumentListener {
+        @Override public void changedUpdate(DocumentEvent e) { parseURL(); }
+        @Override public void insertUpdate(DocumentEvent e) { parseURL(); }
+        @Override public void removeUpdate(DocumentEvent e) { parseURL(); }
+    }
+
+    class OsmLonLatListener implements DocumentListener {
+        @Override public void changedUpdate(DocumentEvent e) { updateUrl(false); }
+        @Override public void insertUpdate(DocumentEvent e) { updateUrl(false); }
+        @Override public void removeUpdate(DocumentEvent e) { updateUrl(false); }
+    }
 
     /**
@@ -73,16 +85,4 @@
                               + "</html>"),
                   BorderLayout.NORTH);
-
-        class OsmURLListener implements DocumentListener {
-            @Override public void changedUpdate(DocumentEvent e) { parseURL(); }
-            @Override public void insertUpdate(DocumentEvent e) { parseURL(); }
-            @Override public void removeUpdate(DocumentEvent e) { parseURL(); }
-        }
-
-        class OsmLonLatListener implements DocumentListener {
-            @Override public void changedUpdate(DocumentEvent e) { updateUrl(false); }
-            @Override public void insertUpdate(DocumentEvent e) { updateUrl(false); }
-            @Override public void removeUpdate(DocumentEvent e) { updateUrl(false); }
-        }
 
         OsmLonLatListener x = new OsmLonLatListener();
@@ -150,5 +150,5 @@
                     int eq = arg.indexOf('=');
                     if (eq == -1 || !"zoom".equalsIgnoreCase(arg.substring(0, eq))) continue;
-    
+
                     zoomLvl = Integer.parseInt(arg.substring(eq + 1));
                     break;
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 7081)
@@ -80,5 +80,5 @@
     final public static int noThreads;
     final public static ExecutorService styleCreatorPool;
-    
+
     static {
         noThreads = Main.pref.getInteger(
@@ -330,4 +330,14 @@
     private boolean leftHandTraffic;
 
+    /**
+     * Constructs a new {@code StyledMapRenderer}.
+     *
+     * @param g the graphics context. Must not be null.
+     * @param nc the map viewport. Must not be null.
+     * @param isInactiveMode if true, the paint visitor shall render OSM objects such that they
+     * look inactive. Example: rendering of data in an inactive layer using light gray as color only.
+     * @throws IllegalArgumentException thrown if {@code g} is null
+     * @throws IllegalArgumentException thrown if {@code nc} is null
+     */
     public StyledMapRenderer(Graphics2D g, NavigatableComponent nc, boolean isInactiveMode) {
         super(g, nc, isInactiveMode);
@@ -1329,5 +1339,5 @@
         return null;
     }
-    
+
     @Override
     public void render(final DataSet data, boolean renderVirtualNodes, Bounds bounds) {
@@ -1343,5 +1353,5 @@
         
         highlightWaySegments = data.getHighlightedWaySegments();
-        
+
         long timeStart=0, timePhase1=0, timeFinished;
         if (Main.isTraceEnabled()) {
@@ -1369,5 +1379,5 @@
                 this.output = output;
             }
-            
+
             @Override
             public List<StyleRecord> call() throws Exception {
@@ -1380,5 +1390,5 @@
                 return output;
             }
-            
+
             @Override
             public void visit(Node n) {
@@ -1456,7 +1466,7 @@
         
         final List<StyleRecord> allStyleElems = new ArrayList<>(nodes.size()+ways.size()+relations.size());
-        
+
         class ConcurrentTasksHelper {
-            
+
             void process(List<? extends OsmPrimitive> prims) {
                 final List<ComputeStyleListWorker> tasks = new ArrayList<>();
@@ -1490,5 +1500,5 @@
         }
         ConcurrentTasksHelper helper = new ConcurrentTasksHelper();
-        
+
         // Need to process all relations first.
         // Reason: Make sure, ElemStyles.getStyleCacheWithRange is
@@ -1505,7 +1515,7 @@
             System.err.print("phase 1 (calculate styles): " + (timePhase1 - timeStart) + " ms");
         }
-        
+
         Collections.sort(allStyleElems);
-        
+
         for (StyleRecord r : allStyleElems) {
             r.style.paintPrimitive(
Index: trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java	(revision 7081)
@@ -242,10 +242,12 @@
         switch (evt.getKey()) {
         case "osm-server.username":
-            if (!(evt.getNewValue() instanceof StringSetting)) return;
-            String newUserName = ((StringSetting) evt.getNewValue()).getValue();
+            String newUserName = null;
+            if (evt.getNewValue() instanceof StringSetting) {
+                newUserName = ((StringSetting) evt.getNewValue()).getValue();
+            }
             if (newUserName == null || newUserName.trim().isEmpty()) {
                 setAnonymous();
             } else {
-                if (! newUserName.equals(userName)) {
+                if (!newUserName.equals(userName)) {
                     setPartiallyIdentified(newUserName);
                 }
@@ -254,6 +256,8 @@
 
         case "osm-server.url":
-            if (!(evt.getNewValue() instanceof StringSetting)) return;
-            String newUrl = ((StringSetting) evt.getNewValue()).getValue();
+            String newUrl = null;
+            if (evt.getNewValue() instanceof StringSetting) {
+                newUrl = ((StringSetting) evt.getNewValue()).getValue();
+            }
             if (newUrl == null || newUrl.trim().isEmpty()) {
                 setAnonymous();
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java	(revision 7081)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
 import org.openstreetmap.josm.gui.preferences.SourceEntry;
+import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
@@ -68,4 +69,7 @@
     public abstract void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed);
 
+    /**
+     * Loads the style source.
+     */
     public abstract void loadStyleSource();
 
@@ -77,4 +81,12 @@
      */
     public abstract InputStream getSourceInputStream() throws IOException;
+    
+    /**
+     * Returns a new {@code MirroredInputStream} to the local file containing style source (can be a text file or an archive).
+     * @return A new {@code MirroredInputStream} to the local file containing style source
+     * @throws IOException if any I/O error occurs.
+     * @since 7081
+     */
+    public abstract MirroredInputStream getMirroredInputStream() throws IOException;
 
     /**
@@ -152,5 +164,3 @@
         this.lastMTime = lastMTime;
     }
-
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java	(revision 7081)
@@ -65,13 +65,13 @@
     }
 
-    public static Condition createPseudoClassCondition(String id, boolean not, Context context) {
+    public static PseudoClassCondition createPseudoClassCondition(String id, boolean not, Context context) {
         return new PseudoClassCondition(id, not, context);
     }
 
-    public static Condition createClassCondition(String id, boolean not, Context context) {
+    public static ClassCondition createClassCondition(String id, boolean not, Context context) {
         return new ClassCondition(id, not);
     }
 
-    public static Condition createExpressionCondition(Expression e, Context context) {
+    public static ExpressionCondition createExpressionCondition(Expression e, Context context) {
         return new ExpressionCondition(e);
     }
@@ -153,5 +153,5 @@
     /**
      * Most common case of a KeyValueCondition.
-     * 
+     *
      * Extra class for performance reasons.
      */
@@ -169,5 +169,5 @@
             return v.equals(e.osm.get(k));
         }
-        
+
         public Tag asTag() {
             return new Tag(k, v);
@@ -178,5 +178,5 @@
             return '[' + k + '=' + v + ']';
         }
-        
+
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 7081)
@@ -151,5 +151,5 @@
         }
     }
-    
+
     @Override
     public InputStream getSourceInputStream() throws IOException {
@@ -157,5 +157,5 @@
             return new ByteArrayInputStream(css.getBytes(Utils.UTF_8));
         }
-        MirroredInputStream in = new MirroredInputStream(url, null, MAPCSS_STYLE_MIME_TYPES);
+        MirroredInputStream in = getMirroredInputStream();
         if (isZip) {
             File file = in.getFile();
@@ -170,4 +170,9 @@
             return in;
         }
+    }
+
+    @Override
+    public MirroredInputStream getMirroredInputStream() throws IOException {
+        return new MirroredInputStream(url, null, MAPCSS_STYLE_MIME_TYPES);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 7081)
@@ -102,5 +102,5 @@
     @Override
     public InputStream getSourceInputStream() throws IOException {
-        MirroredInputStream in = new MirroredInputStream(url, null, XML_STYLE_MIME_TYPES);
+        MirroredInputStream in = getMirroredInputStream();
         InputStream zip = in.findZipEntryInputStream("xml", "style");
         if (zip != null) {
@@ -111,4 +111,9 @@
             return in;
         }
+    }
+
+    @Override
+    public MirroredInputStream getMirroredInputStream() throws IOException {
+        return new MirroredInputStream(url, null, XML_STYLE_MIME_TYPES);
     }
 
Index: trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 7081)
@@ -228,4 +228,8 @@
     }
 
+    /**
+     * Replies the local file.
+     * @return The local file on disk
+     */
     public File getFile() {
         return file;
Index: trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 7081)
@@ -615,4 +615,5 @@
                 url = new URL(new URL(getBaseUrl()), urlSuffix);
                 Main.info(requestMethod + " " + url + "... ");
+                Main.debug(requestBody);
                 // fix #5369, see http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive
                 activeConnection = Utils.openHttpConnection(url, false);
Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 7080)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 7081)
@@ -439,11 +439,8 @@
         }
 
-        // user attribute added in 0.4 API
         String user = parser.getAttributeValue(null, "user");
-        // uid attribute added in 0.6 API
         String uid = parser.getAttributeValue(null, "uid");
         current.setUser(createUser(uid, user));
 
-        // visible attribute added in 0.4 API
         String visible = parser.getAttributeValue(null, "visible");
         if (visible != null) {
@@ -474,5 +471,4 @@
         } else {
             // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6
-            //
             if (!current.isNew() && ds.getVersion() != null && "0.6".equals(ds.getVersion())) {
                 throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.getUniqueId())));
@@ -497,5 +493,6 @@
             try {
                 current.setChangesetId(Integer.parseInt(v));
-            } catch(NumberFormatException e) {
+            } catch (IllegalArgumentException e) {
+                Main.debug(e.getMessage());
                 if (current.isNew()) {
                     // for a new primitive we just log a warning
@@ -506,6 +503,10 @@
                     throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v), e);
                 }
-            }
-            if (current.getChangesetId() <=0) {
+            } catch (IllegalStateException e) {
+                // thrown for positive changeset id on new primitives
+                Main.info(e.getMessage());
+                current.setChangesetId(0);
+            }
+            if (current.getChangesetId() <= 0) {
                 if (current.isNew()) {
                     // for a new primitive we just log a warning
