Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 11323)
+++ /trunk/build.xml	(revision 11324)
@@ -663,5 +663,5 @@
         <sequential>
             <echo message="Generating Taginfo for type @{type} to @{output}"/>
-            <groovy src="${taginfoextract}" classpath="${dist.dir}/josm-custom.jar">
+            <groovy src="${taginfoextract}" classpath="${dist.dir}/josm-custom.jar:tools/findbugs/annotations.jar">
                 <arg value="-t"/>
                 <arg value="@{type}"/>
Index: /trunk/scripts/BuildProjectionDefinitions.java
===================================================================
--- /trunk/scripts/BuildProjectionDefinitions.java	(revision 11323)
+++ /trunk/scripts/BuildProjectionDefinitions.java	(revision 11324)
@@ -63,9 +63,10 @@
         }
 
-        try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
-                new FileOutputStream(baseDir + File.separator + OUTPUT_EPSG_FILE), StandardCharsets.UTF_8))) {
+        try (FileOutputStream output = new FileOutputStream(baseDir + File.separator + OUTPUT_EPSG_FILE);
+             BufferedWriter out = new BufferedWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8))) {
             out.write("## This file is autogenerated, do not edit!\n");
             out.write("## Run ant task \"epsg\" to rebuild.\n");
-            out.write(String.format("## Source files are %s (can be changed) and %s (copied from the proj.4 project).%n", JOSM_EPSG_FILE, PROJ4_EPSG_FILE));
+            out.write(String.format("## Source files are %s (can be changed) and %s (copied from the proj.4 project).%n",
+                    JOSM_EPSG_FILE, PROJ4_EPSG_FILE));
             out.write("##\n");
             out.write("## Entries checked and maintained by the JOSM team:\n");
Index: /trunk/scripts/TagInfoExtract.groovy
===================================================================
--- /trunk/scripts/TagInfoExtract.groovy	(revision 11323)
+++ /trunk/scripts/TagInfoExtract.groovy	(revision 11324)
@@ -9,6 +9,4 @@
  * groovy -cp dist/josm-custom.jar scripts/taginfoextract.groovy -t external_presets
  */
-import groovy.json.JsonBuilder
-
 import java.awt.image.BufferedImage
 import java.nio.file.FileSystems
@@ -49,4 +47,7 @@
 import org.openstreetmap.josm.tools.Utils
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
+import groovy.json.JsonBuilder
+
 class TagInfoExtract {
 
@@ -118,4 +119,5 @@
     }
 
+    @SuppressFBWarnings(value = "MF_CLASS_MASKS_FIELD")
     class NodeChecker extends Checker {
         NodeChecker(tag) {
@@ -137,4 +139,5 @@
     }
 
+    @SuppressFBWarnings(value = "MF_CLASS_MASKS_FIELD")
     class WayChecker extends Checker {
         WayChecker(tag) {
@@ -159,4 +162,5 @@
     }
 
+    @SuppressFBWarnings(value = "MF_CLASS_MASKS_FIELD")
     class AreaChecker extends Checker {
         AreaChecker(tag) {
Index: /trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
===================================================================
--- /trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java	(revision 11323)
+++ /trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java	(revision 11324)
@@ -15,7 +15,9 @@
 import java.io.PrintWriter;
 import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
 import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Locale;
+import java.util.Random;
 import java.util.logging.Logger;
 
@@ -39,7 +41,10 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests of {@link MultiFetchServerObjectReader}.
  */
+@SuppressFBWarnings(value = "CRLF_INJECTION_LOGS")
 public class MultiFetchServerObjectReaderTest {
     private static Logger logger = Logger.getLogger(MultiFetchServerObjectReader.class.getName());
@@ -59,4 +64,5 @@
         DataSet ds = new DataSet();
         ds.setVersion("0.6");
+        Random rand = new SecureRandom();
 
         int numNodes = 1000;
@@ -81,6 +87,6 @@
         for (int i = 0; i < numWays; i++) {
             Way w = new Way();
-            int numNodesInWay = 2 + (int) Math.round(Math.random() * 5);
-            int start = (int) Math.round(Math.random() * numNodes);
+            int numNodesInWay = 2 + (int) Math.round(rand.nextDouble() * 5);
+            int start = (int) Math.round(rand.nextDouble() * numNodes);
             for (int j = 0; j < numNodesInWay; j++) {
                 int idx = (start + j) % numNodes;
@@ -98,6 +104,6 @@
             Relation r = new Relation();
             r.put("name", "relation-" +i);
-            int numNodesInRelation = (int) Math.round(Math.random() * 10);
-            int start = (int) Math.round(Math.random() * numNodes);
+            int numNodesInRelation = (int) Math.round(rand.nextDouble() * 10);
+            int start = (int) Math.round(rand.nextDouble() * numNodes);
             for (int j = 0; j < numNodesInRelation; j++) {
                 int idx = (start + j) % 500;
@@ -105,6 +111,6 @@
                 r.addMember(new RelationMember("role-" + j, n));
             }
-            int numWaysInRelation = (int) Math.round(Math.random() * 10);
-            start = (int) Math.round(Math.random() * numWays);
+            int numWaysInRelation = (int) Math.round(rand.nextDouble() * 10);
+            start = (int) Math.round(rand.nextDouble() * numWays);
             for (int j = 0; j < numWaysInRelation; j++) {
                 int idx = (start + j) % 500;
Index: /trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
===================================================================
--- /trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java	(revision 11323)
+++ /trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java	(revision 11324)
@@ -44,8 +44,11 @@
 import org.openstreetmap.josm.tools.Logging;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Reads primitives referring to a particular primitive (ways including a node, relations referring to a relation)
  * @since 1806
  */
+@SuppressFBWarnings(value = "CRLF_INJECTION_LOGS")
 public class OsmServerBackreferenceReaderTest {
     private static final Logger logger = Logger.getLogger(OsmServerBackreferenceReader.class.getName());
Index: /trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java	(revision 11323)
+++ /trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java	(revision 11324)
@@ -112,4 +112,5 @@
     }
 
+    @SuppressFBWarnings(value = "DM_GC")
     private static void cleanSystem() {
         System.gc();
Index: /trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java	(revision 11323)
+++ /trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java	(revision 11324)
@@ -8,4 +8,5 @@
 import static org.junit.Assert.assertTrue;
 
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Random;
@@ -125,5 +126,5 @@
     public void generateTestStrings() {
         testStrings.clear();
-        random = new Random(123);
+        random = new SecureRandom();
         for (int i = 0; i < TEST_STRING_COUNT; i++) {
             testStrings.add(RandomStringUtils.random(10, 0, 0, true, true, null, random));
Index: /trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java	(revision 11323)
+++ /trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java	(revision 11324)
@@ -3,4 +3,5 @@
 
 import java.io.File;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Random;
@@ -41,5 +42,6 @@
          */
         public RandomStringList(int seed, int size) {
-            random = new Random(seed);
+            random = new SecureRandom();
+            random.setSeed(seed);
             strings = new String[size];
             interned = new String[size];
@@ -88,5 +90,5 @@
         protected DataGenerator(String datasetName) {
             this.datasetName = datasetName;
-            this.random = new Random(1234);
+            this.random = new SecureRandom();
         }
 
@@ -126,5 +128,5 @@
          */
         public File getFile() {
-            return new File(DATA_DIR + File.separator + datasetName + ".osm");
+            return new File(DATA_DIR, datasetName + ".osm");
         }
 
@@ -139,5 +141,5 @@
         @Override
         public String toString() {
-            return "DataGenerator [datasetName=" + datasetName + "]";
+            return "DataGenerator [datasetName=" + datasetName + ']';
         }
     }
Index: /trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
===================================================================
--- /trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java	(revision 11323)
+++ /trunk/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java	(revision 11324)
@@ -166,5 +166,4 @@
         public int noIterations = 7;
         public boolean dumpImage = DUMP_IMAGE;
-        public boolean skipDraw = false;
         public boolean clearStyleCache = true;
         public String label = "";
@@ -264,5 +263,4 @@
         test.bounds = BOUNDS_CITY_ALL;
         test.label = "big";
-        test.skipDraw = true;
         test.dumpImage = false;
         test.noWarmup = 3;
Index: /trunk/test/unit/org/openstreetmap/josm/TestUtils.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 11324)
@@ -10,4 +10,6 @@
 import java.io.InputStream;
 import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.Arrays;
 import java.util.Collection;
@@ -79,5 +81,5 @@
      */
     public static InputStream getRegressionDataStream(int ticketid, String filename) throws IOException {
-        return Compression.getUncompressedFileInputStream(new File(getRegressionDataDir(ticketid) + '/' + filename));
+        return Compression.getUncompressedFileInputStream(new File(getRegressionDataDir(ticketid), filename));
     }
 
@@ -173,5 +175,8 @@
     public static Object getPrivateField(Object obj, String fieldName) throws ReflectiveOperationException {
         Field f = obj.getClass().getDeclaredField(fieldName);
-        f.setAccessible(true);
+        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
+            f.setAccessible(true);
+            return null;
+        });
         return f.get(obj);
     }
Index: /trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java	(revision 11324)
@@ -20,4 +20,6 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests for class {@link SelectByInternalPointAction}.
@@ -29,4 +31,5 @@
      */
     @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
 
Index: /trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java	(revision 11324)
@@ -27,4 +27,6 @@
 import org.openstreetmap.josm.tools.date.DateUtils;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests for class {@link SearchCompiler}.
@@ -36,4 +38,5 @@
      */
     @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
 
Index: /trunk/test/unit/org/openstreetmap/josm/data/AutosaveTaskTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/AutosaveTaskTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/AutosaveTaskTest.java	(revision 11324)
@@ -8,8 +8,8 @@
 import static org.junit.Assert.assertTrue;
 
+import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
@@ -143,10 +143,6 @@
 
     private int countFiles() {
-        return task.getAutosaveDir().toFile().list(new FilenameFilter() {
-            @Override
-            public boolean accept(File dir, String name) {
-                return name.endsWith(".osm");
-            }
-        }).length;
+        String[] files = task.getAutosaveDir().toFile().list((dir, name) -> name.endsWith(".osm"));
+        return files != null ? files.length : 0;
     }
 
@@ -194,5 +190,6 @@
     public void testDiscardUnsavedLayersIgnoresCurrentInstance() throws IOException {
         runAutosaveTaskSeveralTimes(1);
-        try (FileWriter file = new FileWriter(new File(task.getAutosaveDir().toFile(), "any_other_file.osm"))) {
+        try (BufferedWriter file = Files.newBufferedWriter(
+                new File(task.getAutosaveDir().toFile(), "any_other_file.osm").toPath(), StandardCharsets.UTF_8)) {
             file.append("");
         }
@@ -237,5 +234,6 @@
     public void testRecoverLayers() throws Exception {
         runAutosaveTaskSeveralTimes(1);
-        try (FileWriter file = new FileWriter(new File(task.getAutosaveDir().toFile(), "any_other_file.osm"))) {
+        try (BufferedWriter file = Files.newBufferedWriter(
+                new File(task.getAutosaveDir().toFile(), "any_other_file.osm").toPath(), StandardCharsets.UTF_8)) {
             file.append("<?xml version=\"1.0\"?><osm version=\"0.6\"><node id=\"1\" lat=\"1\" lon=\"2\" version=\"1\"/></osm>");
         }
Index: /trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java	(revision 11324)
@@ -45,5 +45,7 @@
             File cacheFile = new File("foobar/testUseBigDiskFile_BLOCK_v2.data");
             if (!cacheFile.exists()) {
-                cacheFile.createNewFile();
+                if (!cacheFile.createNewFile()) {
+                    System.err.println("Unable to create " + cacheFile.getAbsolutePath());
+                }
             }
             try (FileOutputStream fileOutputStream = new FileOutputStream(cacheFile, false)) {
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java	(revision 11324)
@@ -31,4 +31,5 @@
      */
     @Test
+    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
     public void testSetKeys() {
         final Changeset cs = new Changeset();
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/NodeDataTest.java	(revision 11324)
@@ -15,6 +15,9 @@
 import org.openstreetmap.josm.data.coor.LatLon;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 public class NodeDataTest {
 
+    @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION")
     private static NodeData serializeUnserialize(NodeData data) throws IOException, ClassNotFoundException {
         try (ByteArrayOutputStream bytes = new ByteArrayOutputStream();
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 11324)
@@ -4,4 +4,5 @@
 import java.io.FileInputStream;
 import java.io.InputStream;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -193,5 +194,5 @@
 
         // force splits in quad buckets
-        Random random = new Random(31);
+        Random random = new SecureRandom();
         for (int i = 0; i < NUM_COMPLETE_WAYS; i++) {
             Way w = new Way(wayId++);
@@ -213,8 +214,6 @@
 
         // add some incomplete nodes
-        List<Node> incompleteNodes = new ArrayList<>();
         for (int i = 0; i < NUM_INCOMPLETE_NODES; i++) {
             Node n = new Node(nodeId++);
-            incompleteNodes.add(n);
             n.setIncomplete(true);
             ds.addPrimitive(n);
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java	(revision 11324)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java	(revision 11324)
@@ -0,0 +1,36 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+/**
+ * Unit tests for class {@link Storage}.
+ */
+public class StorageTest {
+
+    /**
+     * Setup test.
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
+
+    /**
+     * Unit test of methods {@link Storage#equals} and {@link Storage#hashCode}.
+     */
+    @Test
+    public void testEqualsContract() {
+        EqualsVerifier.forClass(Storage.class).usingGetClass()
+            /*.withPrefabValues(Collection.class, new HashSet<>(Arrays.asList(1)), new HashSet<>(Arrays.asList(2)))
+            .withPrefabValues(AbstractCollection.class, new HashSet<>(Arrays.asList(1)), new HashSet<>(Arrays.asList(2)))
+            .withPrefabValues(Set.class, new HashSet<>(Arrays.asList(1)), new HashSet<>(Arrays.asList(2)))
+            .withPrefabValues(AbstractSet.class, new HashSet<>(Arrays.asList(1)), new HashSet<>(Arrays.asList(2)))*/
+            .withPrefabValues(Hash.class, Storage.<Integer>defaultHash(), Storage.<Boolean>defaultHash())
+            .verify();
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/osm/WayDataTest.java	(revision 11324)
@@ -11,6 +11,10 @@
 import org.junit.Test;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 public class WayDataTest {
+
     @Test
+    @SuppressFBWarnings(value = "OBJECT_DESERIALIZATION")
     public void testSerializationForDragAndDrop() throws Exception {
         final WayData data = new WayData();
Index: /trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/projection/EllipsoidTest.java	(revision 11324)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.data.projection;
 
+import java.security.SecureRandom;
 import java.util.Random;
 
@@ -20,5 +21,5 @@
     @Test
     public void testLatLon2Cart2LatLon() {
-        Random r = new Random(System.currentTimeMillis());
+        Random r = new SecureRandom();
         double maxErrLat = 0, maxErrLon = 0;
         Ellipsoid ellips = Ellipsoid.WGS84;
Index: /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 11324)
@@ -6,5 +6,4 @@
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -14,4 +13,5 @@
 import java.io.OutputStreamWriter;
 import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -38,4 +38,6 @@
 import org.openstreetmap.josm.tools.Pair;
 import org.openstreetmap.josm.tools.Utils;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
@@ -72,7 +74,12 @@
     }
 
-    static Random rand = new Random();
-
-    public static void main(String[] args) throws FileNotFoundException, IOException {
+    static Random rand = new SecureRandom();
+
+    /**
+     * Program entry point.
+     * @param args no argument is expected
+     * @throws IOException in case of I/O error
+     */
+    public static void main(String[] args) throws IOException {
         Collection<RefEntry> refs = readData();
         refs = updateData(refs);
@@ -200,10 +207,10 @@
 
     /**
-     * Run external cs2cs command from the PROJ.4 library to convert lat/lon to
-     * east/north value.
+     * Run external cs2cs command from the PROJ.4 library to convert lat/lon to east/north value.
      * @param def the proj.4 projection definition string
      * @param ll the LatLon
      * @return projected EastNorth or null in case of error
      */
+    @SuppressFBWarnings(value = "COMMAND_INJECTION")
     private static EastNorth latlon2eastNorthProj4(String def, LatLon ll) {
         List<String> args = new ArrayList<>();
Index: /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 11324)
@@ -12,4 +12,5 @@
 import java.io.OutputStreamWriter;
 import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -86,5 +87,5 @@
         }
 
-        Random rand = new Random();
+        Random rand = new SecureRandom();
         try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
                 new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) {
Index: /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionTest.java	(revision 11324)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.data.projection;
 
+import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Collection;
@@ -18,5 +19,5 @@
 public class ProjectionTest {
 
-    private static Random rand = new Random(System.currentTimeMillis());
+    private static Random rand = new SecureRandom();
 
     boolean error;
Index: /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 11324)
@@ -9,9 +9,7 @@
 import java.io.IOException;
 import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collection;
-
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
 
 import org.junit.BeforeClass;
@@ -25,4 +23,6 @@
 import org.openstreetmap.josm.plugins.PluginListParseException;
 import org.openstreetmap.josm.plugins.PluginListParser;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
@@ -39,4 +39,5 @@
     }
 
+    @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING")
     private void testShow(final String arg, String expected) throws InterruptedException, IOException {
         PrintStream old = System.out;
@@ -49,8 +50,8 @@
                 }
             };
-            t.run();
+            t.start();
             t.join();
             System.out.flush();
-            assertEquals(expected, baos.toString().trim());
+            assertEquals(expected, baos.toString(StandardCharsets.UTF_8.name()).trim());
         } finally {
             System.setOut(old);
@@ -85,9 +86,6 @@
         try {
             System.setProperty("josm.plugins", "buildings_tools,plastic_laf");
-            SplashProgressMonitor monitor = new SplashProgressMonitor("foo", new ChangeListener() {
-                @Override
-                public void stateChanged(ChangeEvent e) {
-                    // Do nothing
-                }
+            SplashProgressMonitor monitor = new SplashProgressMonitor("foo", e -> {
+                // Do nothing
             });
             Collection<PluginInformation> plugins = MainApplication.updateAndLoadEarlyPlugins(null, monitor);
Index: /trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 11324)
@@ -32,5 +32,5 @@
 public class NavigatableComponentTest {
 
-    private final class NavigatableComponentMock extends NavigatableComponent {
+    private static final class NavigatableComponentMock extends NavigatableComponent {
         @Override
         public Point getLocationOnScreen() {
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/MainLayerManagerTest.java	(revision 11324)
@@ -43,5 +43,5 @@
     }
 
-    protected class AbstractTestOsmLayer extends OsmDataLayer {
+    protected static class AbstractTestOsmLayer extends OsmDataLayer {
         public AbstractTestOsmLayer() {
             super(new DataSet(), "OSM layer", null);
Index: /trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java	(revision 11324)
@@ -20,5 +20,4 @@
 import javax.net.ssl.HttpsURLConnection;
 import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
@@ -29,4 +28,6 @@
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.Main;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
@@ -77,4 +78,5 @@
             new X509TrustManager() {
                 @Override
+                @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER")
                 public X509Certificate[] getAcceptedIssuers() {
                     return new X509Certificate[0];
@@ -82,8 +84,10 @@
 
                 @Override
+                @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER")
                 public void checkClientTrusted(X509Certificate[] certs, String authType) {
                 }
 
                 @Override
+                @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER")
                 public void checkServerTrusted(X509Certificate[] certs, String authType) {
                 }
@@ -97,10 +101,5 @@
 
         // Create all-trusting host name verifier
-        HostnameVerifier allHostsValid = new HostnameVerifier() {
-            @Override
-            public boolean verify(String hostname, SSLSession session) {
-                return true;
-            }
-        };
+        HostnameVerifier allHostsValid = (hostname, session) -> true;
 
         // Install the all-trusting host verifier
Index: /trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 11324)
@@ -43,5 +43,5 @@
     private List<Layer> testRead(String sessionFileName) throws IOException, IllegalDataException {
         boolean zip = sessionFileName.endsWith(".joz");
-        File file = new File(getSessionDataDir()+"/"+sessionFileName);
+        File file = new File(getSessionDataDir(), sessionFileName);
         SessionReader reader = new SessionReader();
         reader.loadSession(file, zip, null);
Index: /trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/LoggingTest.java	(revision 11324)
@@ -5,4 +5,5 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -18,4 +19,6 @@
 import org.junit.Test;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * @author michael
@@ -73,4 +76,5 @@
     }
 
+    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION")
     private void testLogCaptured(Level level, Consumer<String> expectedTester, Runnable printMessage) {
         Logging.setLogLevel(level);
@@ -78,4 +82,5 @@
         printMessage.run();
 
+        assertNotNull(captured);
         expectedTester.accept(captured.getMessage());
         assertEquals(level, captured.getLevel());
Index: /trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java	(revision 11324)
@@ -9,4 +9,6 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests of {@link RightAndLefthandTraffic} class.
@@ -17,4 +19,5 @@
      */
     @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().platform().projection().commands();
 
Index: /trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java	(revision 11324)
@@ -12,4 +12,6 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests of {@link Territories} class.
@@ -20,4 +22,5 @@
      */
     @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules().platform().projection().commands();
 
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 11323)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 11324)
@@ -16,4 +16,6 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Unit tests of {@link Utils} class.
@@ -24,4 +26,5 @@
      */
     @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules rules = new JOSMTestRules();
 
