Index: applications/viewer/jmapviewer/.project
===================================================================
--- applications/viewer/jmapviewer/.project	(revision 31429)
+++ applications/viewer/jmapviewer/.project	(revision 31430)
@@ -16,8 +16,14 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+		<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
 	</natures>
 </projectDescription>
Index: applications/viewer/jmapviewer/.settings/edu.umd.cs.findbugs.core.prefs
===================================================================
--- applications/viewer/jmapviewer/.settings/edu.umd.cs.findbugs.core.prefs	(revision 31430)
+++ applications/viewer/jmapviewer/.settings/edu.umd.cs.findbugs.core.prefs	(revision 31430)
@@ -0,0 +1,143 @@
+#FindBugs User Preferences
+#Sat Aug 01 22:46:10 CEST 2015
+cloud_id=edu.umd.cs.findbugs.cloud.doNothingCloud
+detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
+detectorAtomicityProblem=AtomicityProblem|true
+detectorBadAppletConstructor=BadAppletConstructor|false
+detectorBadResultSetAccess=BadResultSetAccess|true
+detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
+detectorBadUseOfReturnValue=BadUseOfReturnValue|true
+detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
+detectorBooleanReturnNull=BooleanReturnNull|true
+detectorCallToUnsupportedMethod=CallToUnsupportedMethod|false
+detectorCheckExpectedWarnings=CheckExpectedWarnings|false
+detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
+detectorCheckRelaxingNullnessAnnotation=CheckRelaxingNullnessAnnotation|true
+detectorCheckTypeQualifiers=CheckTypeQualifiers|true
+detectorCloneIdiom=CloneIdiom|true
+detectorComparatorIdiom=ComparatorIdiom|true
+detectorConfusedInheritance=ConfusedInheritance|true
+detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
+detectorCovariantArrayAssignment=CovariantArrayAssignment|false
+detectorCrossSiteScripting=CrossSiteScripting|true
+detectorDefaultEncodingDetector=DefaultEncodingDetector|true
+detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
+detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
+detectorDontIgnoreResultOfPutIfAbsent=DontIgnoreResultOfPutIfAbsent|true
+detectorDontUseEnum=DontUseEnum|true
+detectorDroppedException=DroppedException|true
+detectorDumbMethodInvocations=DumbMethodInvocations|true
+detectorDumbMethods=DumbMethods|true
+detectorDuplicateBranches=DuplicateBranches|true
+detectorEmptyZipFileEntry=EmptyZipFileEntry|false
+detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true
+detectorExplicitSerialization=ExplicitSerialization|true
+detectorFinalizerNullsFields=FinalizerNullsFields|true
+detectorFindBadCast2=FindBadCast2|true
+detectorFindBadForLoop=FindBadForLoop|true
+detectorFindCircularDependencies=FindCircularDependencies|false
+detectorFindComparatorProblems=FindComparatorProblems|true
+detectorFindDeadLocalStores=FindDeadLocalStores|true
+detectorFindDoubleCheck=FindDoubleCheck|true
+detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
+detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
+detectorFindFinalizeInvocations=FindFinalizeInvocations|true
+detectorFindFloatEquality=FindFloatEquality|true
+detectorFindHEmismatch=FindHEmismatch|true
+detectorFindInconsistentSync2=FindInconsistentSync2|true
+detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
+detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
+detectorFindMaskedFields=FindMaskedFields|true
+detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
+detectorFindNakedNotify=FindNakedNotify|true
+detectorFindNonShortCircuit=FindNonShortCircuit|true
+detectorFindNullDeref=FindNullDeref|true
+detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true
+detectorFindOpenStream=FindOpenStream|true
+detectorFindPuzzlers=FindPuzzlers|true
+detectorFindRefComparison=FindRefComparison|true
+detectorFindReturnRef=FindReturnRef|true
+detectorFindRoughConstants=FindRoughConstants|true
+detectorFindRunInvocations=FindRunInvocations|true
+detectorFindSelfComparison=FindSelfComparison|true
+detectorFindSelfComparison2=FindSelfComparison2|true
+detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
+detectorFindSpinLoop=FindSpinLoop|true
+detectorFindSqlInjection=FindSqlInjection|true
+detectorFindTwoLockWait=FindTwoLockWait|true
+detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
+detectorFindUnconditionalWait=FindUnconditionalWait|true
+detectorFindUninitializedGet=FindUninitializedGet|true
+detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
+detectorFindUnreleasedLock=FindUnreleasedLock|true
+detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true
+detectorFindUnsyncGet=FindUnsyncGet|true
+detectorFindUseOfNonSerializableValue=FindUseOfNonSerializableValue|true
+detectorFindUselessControlFlow=FindUselessControlFlow|true
+detectorFindUselessObjects=FindUselessObjects|true
+detectorFormatStringChecker=FormatStringChecker|true
+detectorHugeSharedStringConstants=HugeSharedStringConstants|true
+detectorIDivResultCastToDouble=IDivResultCastToDouble|true
+detectorIncompatMask=IncompatMask|true
+detectorInconsistentAnnotations=InconsistentAnnotations|true
+detectorInefficientIndexOf=InefficientIndexOf|false
+detectorInefficientInitializationInsideLoop=InefficientInitializationInsideLoop|false
+detectorInefficientMemberAccess=InefficientMemberAccess|false
+detectorInefficientToArray=InefficientToArray|false
+detectorInfiniteLoop=InfiniteLoop|true
+detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
+detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
+detectorInitializationChain=InitializationChain|true
+detectorInitializeNonnullFieldsInConstructor=InitializeNonnullFieldsInConstructor|true
+detectorInstantiateStaticClass=InstantiateStaticClass|true
+detectorIntCast2LongAsInstant=IntCast2LongAsInstant|true
+detectorInvalidJUnitTest=InvalidJUnitTest|true
+detectorIteratorIdioms=IteratorIdioms|true
+detectorLazyInit=LazyInit|true
+detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
+detectorLostLoggerDueToWeakReference=LostLoggerDueToWeakReference|true
+detectorMethodReturnCheck=MethodReturnCheck|true
+detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
+detectorMutableEnum=MutableEnum|true
+detectorMutableLock=MutableLock|true
+detectorMutableStaticFields=MutableStaticFields|true
+detectorNaming=Naming|true
+detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true
+detectorNumberConstructor=NumberConstructor|true
+detectorOptionalReturnNull=OptionalReturnNull|true
+detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
+detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
+detectorPublicSemaphores=PublicSemaphores|false
+detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
+detectorReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass=ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass|true
+detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
+detectorRedundantConditions=RedundantConditions|true
+detectorRedundantInterfaces=RedundantInterfaces|true
+detectorRepeatedConditionals=RepeatedConditionals|true
+detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
+detectorSerializableIdiom=SerializableIdiom|true
+detectorStartInConstructor=StartInConstructor|true
+detectorStaticCalendarDetector=StaticCalendarDetector|true
+detectorStringConcatenation=StringConcatenation|true
+detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
+detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
+detectorSwitchFallthrough=SwitchFallthrough|true
+detectorSynchronizationOnSharedBuiltinConstant=SynchronizationOnSharedBuiltinConstant|true
+detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
+detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
+detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
+detectorURLProblems=URLProblems|true
+detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
+detectorUnnecessaryMath=UnnecessaryMath|true
+detectorUnreadFields=UnreadFields|true
+detectorUselessSubclassMethod=UselessSubclassMethod|false
+detectorVarArgsProblems=VarArgsProblems|true
+detectorVolatileUsage=VolatileUsage|true
+detectorWaitInLoop=WaitInLoop|true
+detectorWrongMapIterator=WrongMapIterator|true
+detectorXMLFactoryBypass=XMLFactoryBypass|true
+detector_threshold=3
+effort=max
+filter_settings=Low|BAD_PRACTICE,CORRECTNESS,EXPERIMENTAL,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false|18
+filter_settings_neg=NOISE|
+run_at_full_build=true
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31430)
@@ -44,17 +44,17 @@
 public class JMapViewer extends JPanel implements TileLoaderListener {
 
-    public static boolean debug = false;
+    public static final boolean DEBUG = false;
 
     /**
      * Vectors for clock-wise tile painting
      */
-    protected static final Point[] move = {new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1)};
+    private static final Point[] move = {new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1)};
 
     public static final int MAX_ZOOM = 22;
     public static final int MIN_ZOOM = 0;
 
-    protected List<MapMarker> mapMarkerList;
-    protected List<MapRectangle> mapRectangleList;
-    protected List<MapPolygon> mapPolygonList;
+    protected transient List<MapMarker> mapMarkerList;
+    protected transient List<MapRectangle> mapRectangleList;
+    protected transient List<MapPolygon> mapPolygonList;
 
     protected boolean mapMarkersVisible;
@@ -65,5 +65,5 @@
     protected boolean scrollWrapEnabled;
 
-    protected TileController tileController;
+    protected transient TileController tileController;
 
     /**
@@ -91,5 +91,5 @@
     protected transient TileSource tileSource;
 
-    protected AttributionSupport attribution = new AttributionSupport();
+    protected transient AttributionSupport attribution = new AttributionSupport();
 
     /**
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31430)
@@ -34,5 +34,5 @@
     protected BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
 
-    protected static int workerThreadMaxCount = 8;
+    private static int workerThreadMaxCount = 8;
 
     /**
@@ -42,5 +42,5 @@
      * ignores the timeout and will never terminate itself.
      */
-    protected static int workerThreadTimeout = 30;
+    private static int workerThreadTimeout = 30;
 
     /**
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java	(revision 31430)
@@ -16,5 +16,5 @@
      * default tile size
      */
-    public static int DEFAUL_TILE_SIZE = 256;
+    public static final int DEFAUL_TILE_SIZE = 256;
     /** maximum latitude (north) for mercator display */
     public static final double MAX_LAT = 85.05112877980659;
@@ -128,5 +128,5 @@
      * @return [0..2^Zoomlevel*TILE_SIZE[
      */
-    public double LonToX(double aLongitude, int aZoomlevel) {
+    public double lonToX(double aLongitude, int aZoomlevel) {
         int mp = getMaxPixels(aZoomlevel);
         double x = (mp * (aLongitude + 180L)) / 360L;
@@ -151,5 +151,5 @@
      * @return [0..2^Zoomlevel*TILE_SIZE[
      */
-    public double LatToY(double aLat, int aZoomlevel) {
+    public double latToY(double aLat, int aZoomlevel) {
         if (aLat < MIN_LAT)
             aLat = MIN_LAT;
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java	(revision 31430)
@@ -144,5 +144,5 @@
             } catch (NumberFormatException e) {
                 // ignore malformed Cache-Control headers
-                if (JMapViewer.debug) {
+                if (JMapViewer.DEBUG) {
                     System.err.println(e.getMessage());
                 }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31430)
@@ -27,17 +27,17 @@
      * Hourglass image that is displayed until a map tile has been loaded, except for overlay sources
      */
-    public static BufferedImage LOADING_IMAGE;
+    public static final BufferedImage LOADING_IMAGE = loadImage("images/hourglass.png");
 
     /**
      * Red cross image that is displayed after a loading error, except for overlay sources
      */
-    public static BufferedImage ERROR_IMAGE;
-
-    static {
+    public static final BufferedImage ERROR_IMAGE = loadImage("images/error.png");
+
+    private static BufferedImage loadImage(String path) {
         try {
-            LOADING_IMAGE = ImageIO.read(JMapViewer.class.getResourceAsStream("images/hourglass.png"));
-            ERROR_IMAGE = ImageIO.read(JMapViewer.class.getResourceAsStream("images/error.png"));
+            return ImageIO.read(JMapViewer.class.getResourceAsStream(path));
         } catch (Exception ex) {
             ex.printStackTrace();
+            return null;
         }
     }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java	(revision 31430)
@@ -129,10 +129,10 @@
     @Override
     public int lonToX(double lon, int zoom) {
-        return (int) osmMercator.LonToX(lon, zoom);
+        return (int) osmMercator.lonToX(lon, zoom);
     }
 
     @Override
     public int latToY(double lat, int zoom) {
-        return (int) osmMercator.LatToY(lat, zoom);
+        return (int) osmMercator.latToY(lat, zoom);
     }
 
@@ -140,6 +140,6 @@
     public Point latLonToXY(double lat, double lon, int zoom) {
         return new Point(
-                (int) osmMercator.LonToX(lon, zoom),
-                (int) osmMercator.LatToY(lat, zoom)
+                (int) osmMercator.lonToX(lon, zoom),
+                (int) osmMercator.latToY(lat, zoom)
                 );
     }
@@ -175,10 +175,10 @@
     @Override
     public double latToTileY(double lat, int zoom) {
-        return osmMercator.LatToY(lat, zoom) / tileSize;
+        return osmMercator.latToY(lat, zoom) / tileSize;
     }
 
     @Override
     public double lonToTileX(double lon, int zoom) {
-        return osmMercator.LonToX(lon, zoom) / tileSize;
+        return osmMercator.lonToX(lon, zoom) / tileSize;
     }
 
@@ -186,6 +186,6 @@
     public TileXY latLonToTileXY(double lat, double lon, int zoom) {
         return new TileXY(
-                osmMercator.LonToX(lon, zoom) / tileSize,
-                osmMercator.LatToY(lat, zoom) / tileSize
+                osmMercator.lonToX(lon, zoom) / tileSize,
+                osmMercator.latToY(lat, zoom) / tileSize
                 );
     }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31430)
@@ -196,5 +196,5 @@
                 for (int i = 0; i < 5 && getAttribution() == null; i++) {
                     // Makes sure attribution is loaded
-                    if (JMapViewer.debug) {
+                    if (JMapViewer.DEBUG) {
                         System.out.println("Bing attribution attempt " + (i+1));
                     }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java	(revision 31430)
@@ -90,5 +90,5 @@
         if (m.matches()) {
             if (m.group(1) != null) {
-                finalZoom = Integer.valueOf(m.group(1))-zoom;
+                finalZoom = Integer.parseInt(m.group(1))-zoom;
             }
             if (m.group(2) != null) {
@@ -96,5 +96,5 @@
                 if (ofs.startsWith("+"))
                     ofs = ofs.substring(1);
-                finalZoom += Integer.valueOf(ofs);
+                finalZoom += Integer.parseInt(ofs);
             }
         }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java	(revision 31429)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java	(revision 31430)
@@ -13,10 +13,11 @@
 public class TileSourceInfo {
     /** id for this imagery entry, optional at the moment */
-    protected String id;
+    private final String id;
+
     /** URL of the imagery service */
-    protected  String url = null;
+    private final String url;
 
     /** name of the imagery layer */
-    protected String name;
+    private final String name;
 
     /** headers meaning, that there is no tile at this zoom level */
@@ -46,5 +47,5 @@
      */
     public TileSourceInfo(String name, String base_url, String id) {
-        this(name);
+        this.name = name;
         this.url = base_url;
         this.id = id;
@@ -57,5 +58,5 @@
      */
     public TileSourceInfo(String name) {
-        this.name = name;
+        this(name, null, null);
     }
 
@@ -64,4 +65,5 @@
      */
     public TileSourceInfo() {
+        this(null, null, null);
     }
 
@@ -70,5 +72,5 @@
      * @return name of the tile source
      */
-    public String getName() {
+    public final String getName() {
         return name;
     }
@@ -78,6 +80,14 @@
      * @return url of the tile source
      */
-    public String getUrl() {
+    public final String getUrl() {
         return url;
+    }
+
+    /**
+     * Request ID of the tile source
+     * @return id of the tile source
+     */
+    public final String getId() {
+        return id;
     }
 
