Index: trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 18484)
+++ trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 18485)
@@ -81,13 +81,13 @@
     private static final String TOOLTIP_DEFAULT = tr("Save the current session.");
 
-    protected FileFilter joz = new ExtensionFileFilter("joz", "joz", tr("Session file (archive) (*.joz)"));
-    protected FileFilter jos = new ExtensionFileFilter("jos", "jos", tr("Session file (*.jos)"));
+    protected transient FileFilter joz = new ExtensionFileFilter("joz", "joz", tr("Session file (archive) (*.joz)"));
+    protected transient FileFilter jos = new ExtensionFileFilter("jos", "jos", tr("Session file (*.jos)"));
 
     private File removeFileOnSuccess;
 
     private static String tooltip = TOOLTIP_DEFAULT;
-    protected static File sessionFile;
-    protected static boolean isZipSessionFile;
-    protected static List<WeakReference<Layer>> layersInSessionFile;
+    static File sessionFile;
+    static boolean isZipSessionFile;
+    static List<WeakReference<Layer>> layersInSessionFile;
 
     private static final SessionSaveAction instance = new SessionSaveAction();
@@ -97,5 +97,5 @@
      * @return the instance
      */
-    public static final SessionSaveAction getInstance() {
+    public static SessionSaveAction getInstance() {
         return instance;
     }
@@ -132,6 +132,6 @@
         try {
             saveSession(false, false);
-        } catch (UserCancelException ignore) {
-            Logging.trace(ignore);
+        } catch (UserCancelException exception) {
+            Logging.trace(exception);
         }
     }
@@ -203,11 +203,5 @@
         setCurrentLayers(layersOut);
 
-
-        if (fn.indexOf('.') == -1) {
-            sessionFile = new File(sessionFile.getPath() + (isZipSessionFile ? ".joz" : ".jos"));
-            if (!SaveActionBase.confirmOverwrite(sessionFile)) {
-                throw new UserCancelException();
-            }
-        }
+        updateSessionFile(fn);
 
         Stream<Layer> layersToSaveStream = layersOut.stream()
@@ -219,5 +213,5 @@
 
         boolean success = true;
-        if (forceSaveAll || SAVE_LOCAL_FILES_PROPERTY.get()) {
+        if (forceSaveAll || Boolean.TRUE.equals(SAVE_LOCAL_FILES_PROPERTY.get())) {
             // individual files must be saved before the session file as the location may change
             if (layersToSaveStream
@@ -394,14 +388,18 @@
 
             int numNoExporter = 0;
-            WHILE: while (numNoExporter != noExporter.size()) {
+            while (numNoExporter != noExporter.size()) {
                 numNoExporter = noExporter.size();
-                for (Layer layer : layers) {
-                    if (noExporter.contains(layer)) continue;
-                    for (Layer depLayer : dependencies.get(layer)) {
-                        if (noExporter.contains(depLayer)) {
-                            noExporter.add(layer);
-                            exporters.put(layer, null);
-                            break WHILE;
-                        }
+                updateExporters(noExporter);
+            }
+        }
+
+        private void updateExporters(Collection<Layer> noExporter) {
+            for (Layer layer : layers) {
+                if (noExporter.contains(layer)) continue;
+                for (Layer depLayer : dependencies.get(layer)) {
+                    if (noExporter.contains(depLayer)) {
+                        noExporter.add(layer);
+                        exporters.put(layer, null);
+                        return;
                     }
                 }
@@ -436,7 +434,5 @@
             op.add(tabs, GBC.eol().fill());
             JCheckBox chkSaveLocal = new JCheckBox(tr("Save all local files to disk"), SAVE_LOCAL_FILES_PROPERTY.get());
-            chkSaveLocal.addChangeListener(l -> {
-                SAVE_LOCAL_FILES_PROPERTY.put(chkSaveLocal.isSelected());
-            });
+            chkSaveLocal.addChangeListener(l -> SAVE_LOCAL_FILES_PROPERTY.put(chkSaveLocal.isSelected()));
             op.add(chkSaveLocal);
             return op;
@@ -496,4 +492,18 @@
 
     /**
+     * Update the session file
+     * @param fileName The filename to use. If there are no periods in the file, we update the extension.
+     * @throws UserCancelException If the user does not want to overwrite a previously existing file.
+     */
+    private static void updateSessionFile(String fileName) throws UserCancelException {
+        if (fileName.indexOf('.') == -1) {
+            sessionFile = new File(sessionFile.getPath() + (isZipSessionFile ? ".joz" : ".jos"));
+            if (!SaveActionBase.confirmOverwrite(sessionFile)) {
+                throw new UserCancelException();
+            }
+        }
+    }
+
+    /**
      * Sets the current session file and the layers included in that file
      * @param file file
@@ -528,5 +538,5 @@
     public static void setCurrentLayers(List<Layer> layers) {
         layersInSessionFile = layers.stream()
-                .filter(l -> l instanceof AbstractModifiableLayer)
+                .filter(AbstractModifiableLayer.class::isInstance)
                 .map(WeakReference::new)
                 .collect(Collectors.toList());
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 18484)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 18485)
@@ -402,5 +402,5 @@
         mouseDownButton = e.getButton();
         // return early
-        if (!mv.isActiveLayerVisible() || !(Boolean) this.getValue("active") || mouseDownButton != MouseEvent.BUTTON1)
+        if (!mv.isActiveLayerVisible() || Boolean.FALSE.equals(this.getValue("active")) || mouseDownButton != MouseEvent.BUTTON1)
             return;
 
@@ -744,4 +744,6 @@
                                 dh += Math.PI/2;
                                 break;
+                            default:
+                                // Just in case we cannot clamp
                             }
                             clampedEastNorth = currentEN.rotate(startEN, -dh);
@@ -1149,9 +1151,10 @@
                         // special case:  for cycle groups of 2, we can toggle to the
                         // true nearest primitive on mousePressed right away
-                        if (cycleList.size() == 2 && !waitForMouseUpParameter) {
-                            if (!(osm.equals(old) || osm.isNew() || platformMenuShortcutKeyMask)) {
+                        if (cycleList.size() == 2 && !waitForMouseUpParameter
+                                // This was a nested if statement (see commented code below)
+                                && (!(osm.equals(old) || osm.isNew() || platformMenuShortcutKeyMask))) {
                                 cyclePrims = false;
                                 osm = old;
-                            } // else defer toggling to mouseRelease time in those cases:
+                            // else defer toggling to mouseRelease time in those cases:
                             /*
                              * osm == old -- the true nearest node is the
Index: trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Feature.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Feature.java	(revision 18484)
+++ trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Feature.java	(revision 18485)
@@ -57,8 +57,8 @@
      *
      * @param layer  The layer the feature is part of (required for tags)
-     * @param record The record to create the feature from
+     * @param protobufRecord The record to create the feature from
      * @throws IOException - if an IO error occurs
      */
-    public Feature(Layer layer, ProtobufRecord record) throws IOException {
+    public Feature(Layer layer, ProtobufRecord protobufRecord) throws IOException {
         long tId = 0;
         GeometryTypes geometryTypeTemp = GeometryTypes.UNKNOWN;
@@ -69,5 +69,5 @@
         // By avoiding array copies in TagMap, Feature#init goes from 339 MB to 188 MB.
         ArrayList<String> tagList = null;
-        try (ProtobufParser parser = new ProtobufParser(record.getBytes())) {
+        try (ProtobufParser parser = new ProtobufParser(protobufRecord.getBytes())) {
             ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(4);
             while (parser.hasNext()) {
@@ -111,5 +111,5 @@
         this.id = tId;
         this.geometryType = geometryTypeTemp;
-        record.close();
+        protobufRecord.close();
         if (tagList != null && !tagList.isEmpty()) {
             this.tags = new TagMap(tagList.toArray(EMPTY_STRING_ARRAY));
@@ -128,5 +128,5 @@
      * @return The new key (if {@code null}, then a value was parsed and added to tags)
      */
-    private String parseTagValue(String key, Layer layer, Number number, List<String> tagList) {
+    private static String parseTagValue(String key, Layer layer, Number number, List<String> tagList) {
         if (key == null) {
             key = layer.getKey(number.intValue());
