Index: trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 4280)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 4281)
@@ -280,5 +280,25 @@
             " dashed=" + Arrays.toString(line.getDashArray()) +
             (line.getDashPhase() == 0f ? "" : " dashesOffses=" + line.getDashPhase()) +
-            " dashedColor=" + Utils.toString(dashesBackground) + '}';
+            " dashedColor=" + Utils.toString(dashesBackground) +
+            " linejoin=" + linejoinToString(line.getLineJoin()) +
+            " linecap=" + linecapToString(line.getEndCap()) +
+            '}';
+    }
+    
+    public String linejoinToString(int linejoin) {
+        switch (linejoin) {
+            case BasicStroke.JOIN_BEVEL: return "bevel";
+            case BasicStroke.JOIN_ROUND: return "round";
+            case BasicStroke.JOIN_MITER: return "miter";
+            default: return null;
+        }
+    }
+    public String linecapToString(int linecap) {
+        switch (linecap) {
+            case BasicStroke.CAP_BUTT: return "none";
+            case BasicStroke.CAP_ROUND: return "round";
+            case BasicStroke.CAP_SQUARE: return "square";
+            default: return null;
+        }
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java	(revision 4280)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java	(revision 4281)
@@ -25,4 +25,6 @@
 
         TextElement text = TextElement.create(c, PaintColors.TEXT.get(), false);
+        if (text == null)
+            return null;
         return new LineTextElemStyle(c, text);
     }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java	(revision 4280)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java	(revision 4281)
@@ -122,4 +122,5 @@
 
         LabelCompositionStrategy strategy = buildLabelCompositionStrategy(c, defaultAnnotate);
+        if (strategy == null) return null;
         Font font = ElemStyle.getFont(c);
 
