Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Coordinate.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Coordinate.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Coordinate.java	(revision 31427)
@@ -6,5 +6,4 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.Serializable;
 import java.util.Objects;
 
@@ -18,5 +17,5 @@
  *
  */
-public class Coordinate implements Serializable, ICoordinate {
+public class Coordinate implements ICoordinate {
     private transient Point2D.Double data;
 
@@ -52,4 +51,5 @@
     }
 
+    @Override
     public String toString() {
         return "Coordinate[" + data.y + ", " + data.x + "]";
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31427)
@@ -89,5 +89,5 @@
     protected ZOOM_BUTTON_STYLE zoomButtonStyle;
 
-    protected TileSource tileSource;
+    protected transient TileSource tileSource;
 
     protected AttributionSupport attribution = new AttributionSupport();
@@ -263,5 +263,5 @@
         int mapZoomMax = tileController.getTileSource().getMaxZoom();
 
-        if (markers) {
+        if (markers && mapMarkerList != null) {
             synchronized (mapMarkerList) {
                 for (MapMarker marker : mapMarkerList) {
@@ -277,5 +277,5 @@
         }
 
-        if (rectangles) {
+        if (rectangles && mapRectangleList != null) {
             synchronized (mapRectangleList) {
                 for (MapRectangle rectangle : mapRectangleList) {
@@ -292,5 +292,5 @@
         }
 
-        if (polygons) {
+        if (polygons && mapPolygonList != null) {
             synchronized (mapPolygonList) {
                 for (MapPolygon polygon : mapPolygonList) {
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewerTree.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewerTree.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewerTree.java	(revision 31427)
@@ -41,5 +41,5 @@
         super();
         splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
-        
+
         tree = new CheckBoxTree(name);
         treePanel = new JPanel();
@@ -51,5 +51,5 @@
         splitPane.setOneTouchExpandable(true);
         splitPane.setDividerLocation(150);
-        
+
         //Provide minimum sizes for the two components in the split pane
         Dimension minimumSize = new Dimension(100, 50);
@@ -60,7 +60,9 @@
         setTreeVisible(treeVisible);
         tree.addNodeListener(new MouseAdapter() {
+            @Override
             public void mousePressed(MouseEvent e) {
                 maybeShowPopup(e);
             }
+            @Override
             public void mouseReleased(MouseEvent e) {
                 maybeShowPopup(e);
@@ -68,5 +70,4 @@
             private void maybeShowPopup(MouseEvent e) {
                 if (e.isPopupTrigger()) {
-                    e.getSource();
                     AbstractLayer layer = ((CheckBoxNodePanel)e.getComponent()).getData().getAbstractLayer();
                     if(layer!=null)
@@ -79,8 +80,8 @@
         JMenuItem menuItemShow = new JMenuItem("show texts");
         JMenuItem menuItemHide = new JMenuItem("hide texts");
- 
+
         //Create the popup menu.
         JPopupMenu popup = new JPopupMenu();
-        
+
         // Create items
         if(layer.isVisibleTexts()==null){
@@ -89,5 +90,5 @@
         }else if(layer.isVisibleTexts()) popup.add(menuItemHide);
         else popup.add(menuItemShow);
-        
+
         menuItemShow.addActionListener(new ActionListener(){
             @Override
@@ -106,5 +107,5 @@
             }
         });
- 
+
         return popup;
     }
@@ -143,5 +144,5 @@
     }
     public void addMapObject(MapObject o){
-        
+
     }
     public void setTreeVisible(boolean visible){
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31427)
@@ -98,5 +98,5 @@
             if(job.getTile() != null) {
                 for(TileJob oldJob : jobQueue) {
-                    if(oldJob.getTile() == job.getTile()) {
+                    if (job.getTile().equals(oldJob.getTile())) {
                         return;
                     }
@@ -104,6 +104,8 @@
             }
             jobQueue.put(job);
-            if (workerThreadIdleCount == 0 && workerThreadCount < workerThreadMaxCount)
-                addWorkerThread();
+            synchronized (this) {
+                if (workerThreadIdleCount == 0 && workerThreadCount < workerThreadMaxCount)
+                    addWorkerThread();
+            }
         } catch (InterruptedException e) {
         }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/LayerGroup.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/LayerGroup.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/LayerGroup.java	(revision 31427)
@@ -6,5 +6,5 @@
 public class LayerGroup extends AbstractLayer{
     private List<AbstractLayer> layers;
-    
+
     public LayerGroup(String name){
         super(name);
@@ -41,9 +41,9 @@
         return this;
     }
-    public void calculateVisibleTexts(){
+    public void calculateVisibleTexts() {
         Boolean calculate=null;
-        if(layers!=null&&layers.size()>0){
+        if (layers!=null&&layers.size()>0){
             calculate=layers.get(0).isVisibleTexts();
-            for(int i=1;i<layers.size(); i++){
+            for (int i=1;i<layers.size(); i++){
                 calculate = resultOf(calculate, layers.get(i).isVisibleTexts());
             }
@@ -52,8 +52,9 @@
         if(getParent()!=null) getParent().calculateVisibleTexts();
     }
-    public Boolean resultOf(Boolean b1, Boolean b2){
-        if(b1==null||b2==null) return null;
-        else if(b1.booleanValue() == b2.booleanValue()) return b1.booleanValue();
-        else return null;
+    public Boolean resultOf(Boolean b1, Boolean b2) {
+        if (b1 != null && b1.equals(b2)) {
+            return b1;
+        }
+        return Boolean.FALSE;
     }
 }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapObjectImpl.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapObjectImpl.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapObjectImpl.java	(revision 31427)
@@ -69,5 +69,5 @@
         if(style!=null) style.setStroke(stroke);
     }
-    
+
     public Font getFont() {
         Style styleAssigned = getStyleAssigned();
@@ -95,6 +95,10 @@
     public static Font getDefaultFont(){
         Font f = UIManager.getDefaults().getFont("TextField.font");
+        if (f == null) {
+            f = Font.decode(null);
+        }
         return new Font(f.getName(), Font.BOLD, f.getSize());
     }
+
     public void paintText(Graphics g, Point position) {
         if(name!=null && g!=null && position!=null){
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java	(revision 31427)
@@ -91,9 +91,9 @@
 
     @Override
-    public int getTileCount() {
+    public synchronized int getTileCount() {
         return hash.size();
     }
 
-    public int getCacheSize() {
+    public synchronized int getCacheSize() {
         return cacheSize;
     }
@@ -117,5 +117,4 @@
     protected static class CacheEntry {
         Tile tile;
-
         CacheEntry next;
         CacheEntry prev;
@@ -124,17 +123,4 @@
             this.tile = tile;
         }
-
-        public Tile getTile() {
-            return tile;
-        }
-
-        public CacheEntry getNext() {
-            return next;
-        }
-
-        public CacheEntry getPrev() {
-            return prev;
-        }
-
     }
 
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31427)
@@ -278,4 +278,7 @@
         if (zoom != other.zoom)
             return false;
+        if (!getTileSource().equals(other.getTileSource())) {
+            return false;
+        }
         return true;
     }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java	(revision 31427)
@@ -21,5 +21,5 @@
 /**
  * JTree for checkBox Tree Layers
- * 
+ *
  * @author galo
  */
@@ -27,5 +27,5 @@
     /** Serial Version UID */
     private static final long serialVersionUID = 6943401106938034256L;
-    
+
     private final CheckBoxNodeEditor editor;
 
@@ -48,5 +48,5 @@
         setCellEditor(editor);
         setEditable(true);
-        
+
         // listen for changes in the model (including check box toggles)
         getModel().addTreeModelListener(new TreeModelListener() {
@@ -121,6 +121,9 @@
     private static Boolean childStatus(DefaultMutableTreeNode node){
         Boolean status = data(node.getChildAt(0)).isSelected();
-        for(int i=1; i<node.getChildCount()&&status!=null; i++){
-            if(status != data(node.getChildAt(i)).isSelected()) return null;
+        for (int i=1; i<node.getChildCount() && status!=null; i++){
+            if (!status.equals(
+                    data(node.getChildAt(i)).isSelected()
+                    ))
+                return null;
         }
         return status;
@@ -132,5 +135,5 @@
                 CheckBoxNodeData dataParent = data(parent);
                 Boolean childStatus = childStatus(parent);
-                if(dataParent.isSelected()!=childStatus){
+                if(childStatus != null && !childStatus.equals(dataParent.isSelected())) {
                     dataParent.setSelected(childStatus);
                     changeParents(parent);
@@ -148,5 +151,5 @@
         for(int i=0; i<node.getChildCount(); i++){
             DefaultMutableTreeNode childNode = node(node.getChildAt(i));
-            if (data(childNode).isSelected() !=data(node).isSelected()){
+            if (!data(childNode).isSelected().equals(data(node).isSelected())){
                 data(childNode).setSelected(data(node).isSelected());
                 setChildrens(childNode, value);
@@ -216,5 +219,5 @@
     public DefaultMutableTreeNode add(DefaultMutableTreeNode parent, final AbstractLayer layer){
         layer.setVisible(data(parent).isSelected());
-        DefaultMutableTreeNode node = createNode(layer); 
+        DefaultMutableTreeNode node = createNode(layer);
         parent.add(node);
         ((DefaultTreeModel)getModel()).reload();
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31427)
@@ -61,5 +61,5 @@
     }
 
-    protected class Attribution {
+    protected static class Attribution {
         String attribution;
         int minZoom;
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java	(revision 31371)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java	(revision 31427)
@@ -30,5 +30,5 @@
 
     /** cookies that needs to be sent to tile source */
-    protected String cookies;
+    protected String cookies = "";
 
     /** tile size of the displayed tiles */
