Index: trunk/scripts/BuildProjectionDefinitions.java
===================================================================
--- trunk/scripts/BuildProjectionDefinitions.java	(revision 14200)
+++ trunk/scripts/BuildProjectionDefinitions.java	(revision 14201)
@@ -8,4 +8,5 @@
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -74,6 +75,7 @@
 
     static List<String> initList(String baseDir, String ext) {
-        return Arrays.asList(new File(baseDir + File.separator + PROJ_DIR)
-                .list((dir, name) -> !name.contains(".") || name.toLowerCase(Locale.ENGLISH).endsWith(ext)));
+        String[] result = new File(baseDir + File.separator + PROJ_DIR)
+                .list((dir, name) -> !name.contains(".") || name.toLowerCase(Locale.ENGLISH).endsWith(ext));
+        return result != null ? Arrays.asList(result) : Collections.emptyList();
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 14200)
+++ trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 14201)
@@ -320,9 +320,10 @@
                 }
 
+                Pattern urlPattern = Pattern.compile(".*(https?://.*)");
                 for (File urlFile: urlFiles) {
                     try (BufferedReader reader = Files.newBufferedReader(urlFile.toPath(), StandardCharsets.UTF_8)) {
                         String line;
                         while ((line = reader.readLine()) != null) {
-                            Matcher m = Pattern.compile(".*(https?://.*)").matcher(line);
+                            Matcher m = urlPattern.matcher(line);
                             if (m.matches()) {
                                 String url = m.group(1);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 14200)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 14201)
@@ -425,5 +425,5 @@
      * Add a new map paint style.
      * @param entry map paint style
-     * @return loaded style source, or {@code null}
+     * @return loaded style source
      */
     public static StyleSource addStyle(SourceEntry entry) {
Index: trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 14200)
+++ trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 14201)
@@ -653,5 +653,6 @@
         Collection<String> parameters = new ArrayList<>();
         NodeList paramNl = parametersEl.getElementsByTagName("param");
-        for (int i = 0; i < paramNl.getLength(); i++) {
+        int length = paramNl.getLength();
+        for (int i = 0; i < length; i++) {
             Element paramEl = (Element) paramNl.item(i);
             parameters.add(paramEl.getTextContent());
Index: trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java
===================================================================
--- trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java	(revision 14200)
+++ trunk/test/performance/org/openstreetmap/josm/data/osm/KeyValuePerformanceTest.java	(revision 14201)
@@ -157,4 +157,5 @@
      */
     @Test
+    @SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
     public void testKeyValueGet() {
         for (double tagNodeRatio : TAG_NODE_RATIOS) {
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PluginDownloadTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PluginDownloadTaskTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PluginDownloadTaskTest.java	(revision 14201)
@@ -9,4 +9,5 @@
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 
@@ -35,5 +36,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().https().assumeRevision(
+    public JOSMTestRules testRule = new JOSMTestRules().https().assumeRevision(
         "Revision: 8000\n"
     ).preferences();
@@ -68,5 +69,5 @@
         // put existing "plugin file" in place
         pluginFile.getParentFile().mkdirs();
-        final byte[] existingPluginContents = "Existing plugin contents 123".getBytes();
+        final byte[] existingPluginContents = "Existing plugin contents 123".getBytes(StandardCharsets.UTF_8);
         try (FileOutputStream existingPluginOutputStream = new FileOutputStream(pluginFile)) {
             existingPluginOutputStream.write(existingPluginContents);
@@ -111,5 +112,5 @@
 
         pluginFile.getParentFile().mkdirs();
-        final byte[] existingPluginContents = "Existing plugin contents 123".getBytes();
+        final byte[] existingPluginContents = "Existing plugin contents 123".getBytes(StandardCharsets.UTF_8);
         try (FileOutputStream existingPluginOutputStream = new FileOutputStream(pluginFile)) {
             existingPluginOutputStream.write(existingPluginContents);
Index: trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/data/UserIdentityManagerTest.java	(revision 14201)
@@ -102,4 +102,5 @@
      */
     @Test(expected = IllegalArgumentException.class)
+    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
     public void testSetPartiallyIdentifiedNull() {
         UserIdentityManager.getInstance().setPartiallyIdentified(null);
@@ -149,4 +150,5 @@
      */
     @Test(expected = IllegalArgumentException.class)
+    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS")
     public void testSetFullyIdentifiedNullName() {
         UserIdentityManager.getInstance().setFullyIdentified(null, newUserInfo());
Index: trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java	(revision 14201)
@@ -545,5 +545,5 @@
         assertArrayEquals("cached dummy".getBytes(StandardCharsets.UTF_8), listener.data);
         assertTrue(testStart + expires <= listener.attributes.getExpirationTime());
-        listener = submitJob(job, false);
+        submitJob(job, false);
         tileServer.verify(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test"))); // no more requests were made
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java	(revision 14201)
@@ -7,4 +7,6 @@
 
 import java.text.DecimalFormat;
+import java.util.Arrays;
+import java.util.List;
 
 import org.junit.Rule;
@@ -34,6 +36,5 @@
      * Lat/Lon sample values for unit tests
      */
-    @SuppressFBWarnings(value = "MS_PKGPROTECT")
-    public static final double[] SAMPLE_VALUES = new double[]{
+    public static final List<Double> SAMPLE_VALUES = Arrays.asList(
             // CHECKSTYLE.OFF: SingleSpaceSeparator
             -180.0, -179.9, -179.6, -179.5, -179.4, -179.1, -179.0, -100.0, -99.9, -10.0, -9.9, -1.0, -0.1,
@@ -44,5 +45,5 @@
             100.12, 100.123, 100.1234, 100.12345, 100.123456, 100.1234567
             // CHECKSTYLE.ON: SingleSpaceSeparator
-           };
+            );
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java	(revision 14201)
@@ -60,5 +60,5 @@
         protected final void await() {
             try {
-                latch.await(2, TimeUnit.SECONDS);
+                Logging.trace(Boolean.toString(latch.await(2, TimeUnit.SECONDS)));
             } catch (InterruptedException e) {
                 Logging.error(e);
Index: trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtilTest.java	(revision 14201)
@@ -5,5 +5,4 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
@@ -82,5 +81,5 @@
         tc.add(otherSource); // other source should prevent resolution
         TagConflictResolutionUtil.applyAutomaticTagConflictResolution(tc);
-        assertSame(18, tc.getValues("source").size());
+        assertEquals(18, tc.getValues("source").size());
         tc.remove(otherSource);
         TagConflictResolutionUtil.applyAutomaticTagConflictResolution(tc);
@@ -373,12 +372,12 @@
         public void testGroupChoices() {
             Collection<AutomaticChoiceGroup> groups = AutomaticChoiceGroup.groupChoices(Arrays.asList(choiceKey1Group1, choiceKey1Group2));
-            assertSame(2, groups.size());
+            assertEquals(2, groups.size());
 
             groups = AutomaticChoiceGroup.groupChoices(Arrays.asList(
                 choiceKey1Group1, choiceKey1Group2, choiceKey2Group1, choiceKey2Group2, choiceEmpty));
-            assertSame(5, groups.size());
+            assertEquals(5, groups.size());
 
             groups = AutomaticChoiceGroup.groupChoices(Arrays.asList(choiceKey1Group1, choiceKey1Group1bis));
-            assertSame(1, groups.size());
+            assertEquals(1, groups.size());
             AutomaticChoiceGroup group1 = groups.iterator().next();
             assertEquals(group1.key, choiceKey1Group1.key);
@@ -389,5 +388,5 @@
                 choiceKey1Group1, choiceKey1Group1bis, choiceKey1Group2, choiceKey1Group2bis,
                 choiceKey2Group1, choiceKey2Group1bis, choiceKey2Group2, choiceKey2Group2bis));
-            assertSame(4, groups.size());
+            assertEquals(4, groups.size());
             for (AutomaticChoiceGroup group: groups) {
                 for (AutomaticChoice choice: group.choices) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14201)
@@ -16,4 +16,5 @@
 import java.util.Arrays;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.Callable;
 import java.util.regex.Matcher;
@@ -113,5 +114,5 @@
                         // sources should all come before any separators
                         break;
-                    } else if (((JMenuItem) c).getText() == label) {
+                    } else if (Objects.equals(((JMenuItem) c).getText(), label)) {
                         ((JMenuItem) c).doClick();
                         return;
@@ -127,10 +128,10 @@
     }
 
-    protected MinimapDialog minimap;
-    protected SlippyMapBBoxChooser slippyMap;
-    protected SourceButton sourceButton;
-    protected Callable<Boolean> slippyMapTasksFinished;
-
-    protected static BufferedImage paintedSlippyMap;
+    private MinimapDialog minimap;
+    private SlippyMapBBoxChooser slippyMap;
+    private SourceButton sourceButton;
+    private Callable<Boolean> slippyMapTasksFinished;
+
+    private static BufferedImage paintedSlippyMap;
 
     protected void setUpMiniMap() {
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 14201)
@@ -12,4 +12,5 @@
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -115,6 +116,8 @@
         }
         // cleanup
-        for (Path entry : Files.newDirectoryStream(task.getAutosaveDir(), "*.{osm,pid}")) {
-            Files.delete(entry);
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(task.getAutosaveDir(), "*.{osm,pid}")) {
+            for (Path entry : stream) {
+                Files.delete(entry);
+            }
         }
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java	(revision 14201)
@@ -6,5 +6,4 @@
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -84,16 +83,12 @@
                     }
                 }
-                if (style != null) {
-                    System.out.println(style.isValid() ? " => OK" : " => KO");
-                    Collection<Throwable> errors = style.getErrors();
-                    Collection<String> warnings = style.getWarnings();
-                    if (!errors.isEmpty()) {
-                        allErrors.put(source.url, errors);
-                    }
-                    if (!warnings.isEmpty()) {
-                        allWarnings.put(source.url, warnings);
-                    }
-                } else {
-                    allWarnings.put(source.url, Collections.singleton("MapPaintStyles.addStyle() returned null"));
+                System.out.println(style.isValid() ? " => OK" : " => KO");
+                Collection<Throwable> errors = style.getErrors();
+                Collection<String> warnings = style.getWarnings();
+                if (!errors.isEmpty()) {
+                    allErrors.put(source.url, errors);
+                }
+                if (!warnings.isEmpty()) {
+                    allWarnings.put(source.url, warnings);
                 }
             }
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetContentParserTest.java	(revision 14201)
@@ -53,8 +53,9 @@
      */
     @Test
+    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL")
     public void test_Constructor() {
 
         // should be OK
-        new OsmChangesetContentParser(new ByteArrayInputStream("".getBytes()));
+        new OsmChangesetContentParser(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)));
 
         shouldFail(() -> {
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmJsonReaderTest.java	(revision 14201)
@@ -9,5 +9,4 @@
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
-import java.text.SimpleDateFormat;
 import java.util.Iterator;
 
@@ -39,6 +38,4 @@
     public JOSMTestRules test = new JOSMTestRules();
 
-    private static final SimpleDateFormat iso8601 = DateUtils.newIsoDateTimeFormat();
-
     /**
      * Setup test
@@ -46,5 +43,5 @@
     @BeforeClass
     public static void setUp() {
-        iso8601.setTimeZone(DateUtils.UTC);
+        DateUtils.newIsoDateTimeFormat().setTimeZone(DateUtils.UTC);
     }
 
@@ -122,5 +119,5 @@
         assertEquals(1, n.getUniqueId());
         assertEquals(new LatLon(2.0, -3.0), n.getCoor());
-        assertEquals("2018-01-01T00:00:00Z", iso8601.format(n.getTimestamp()));
+        assertEquals("2018-01-01T00:00:00Z", DateUtils.newIsoDateTimeFormat().format(n.getTimestamp()));
         assertEquals(4, n.getVersion());
         assertEquals(5, n.getChangesetId());
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 14201)
@@ -7,5 +7,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -15,6 +17,6 @@
 import org.junit.Test;
 import org.openstreetmap.josm.data.osm.DownloadPolicy;
+import org.openstreetmap.josm.data.osm.NodeData;
 import org.openstreetmap.josm.data.osm.UploadPolicy;
-import org.openstreetmap.josm.data.osm.NodeData;
 
 /**
@@ -60,5 +62,5 @@
     private static void doTestHeader(DownloadPolicy download, UploadPolicy upload, String expected) throws IOException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        try (PrintWriter out = new PrintWriter(baos);
+        try (PrintWriter out = new PrintWriter(new OutputStreamWriter(baos, StandardCharsets.UTF_8));
              OsmWriter writer = OsmWriterFactory.createOsmWriter(out, true, OsmWriter.DEFAULT_API_VERSION)) {
             writer.header(download, upload);
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java	(revision 14201)
@@ -46,4 +46,11 @@
     private String httpsBase;
 
+    private static class PlatformHookWindowsMock extends MockUp<PlatformHookWindows> {
+        @Mock
+        public boolean setupHttpsCertificate(String entryAlias, TrustedCertificateEntry trustedCert) {
+            return true;
+        }
+    }
+
     /**
      * Starts Remote control before testing requests.
@@ -59,10 +66,5 @@
             // appveyor doesn't like us tinkering with the root keystore, so mock this out
             TestUtils.assumeWorkingJMockit();
-            new MockUp<PlatformHookWindows>() {
-                @Mock
-                public boolean setupHttpsCertificate(String entryAlias, TrustedCertificateEntry trustedCert) {
-                    return true;
-                }
-            };
+            new PlatformHookWindowsMock();
         }
 
Index: trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14201)
@@ -8,4 +8,5 @@
 import java.io.File;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.security.GeneralSecurityException;
 import java.text.MessageFormat;
@@ -360,5 +361,5 @@
         MockVersion(final String propertiesString) {
             super.initFromRevisionInfo(
-                new ByteArrayInputStream(propertiesString.getBytes())
+                new ByteArrayInputStream(propertiesString.getBytes(StandardCharsets.UTF_8))
             );
         }
Index: trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java	(revision 14201)
@@ -47,5 +47,5 @@
      * this cache
      */
-    public static HashMap<ConstSource, ByteArrayWrapper> constPayloadCache = new HashMap<>();
+    public static final HashMap<ConstSource, ByteArrayWrapper> constPayloadCache = new HashMap<>();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java	(revision 14201)
@@ -165,5 +165,5 @@
                     "Invalid result for HelpAwareOptionPane: %s (in call with options = %s)",
                     retval,
-                    options
+                    Arrays.asList(options)
                 ));
             }
Index: trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java	(revision 14200)
+++ trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java	(revision 14201)
@@ -22,4 +22,6 @@
 
 import com.kitfox.svg.SVGConst;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
@@ -85,4 +87,5 @@
      */
     @Test
+    @SuppressFBWarnings(value = "LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE")
     public void testTicket14319() throws IOException {
         LogHandler14319 handler = new LogHandler14319();
