Index: trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java	(revision 9062)
@@ -162,7 +162,5 @@
         }
 
-        // now we can start doing things to OSM data
-        Collection<Command> cmds = new LinkedList<>();
-        EastNorth center = null;
+        EastNorth center;
 
         if (nodes.size() == 2) {
@@ -201,4 +199,7 @@
         int[] count = distributeNodes(angles,
                 numberOfNodesInCircle >= nodes.size() ? numberOfNodesInCircle - nodes.size() : 0);
+
+        // now we can start doing things to OSM data
+        Collection<Command> cmds = new LinkedList<>();
 
         // build a way for the circle
Index: trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 9062)
@@ -141,5 +141,4 @@
 
         final Collection<Way> selectedWays = Main.main.getCurrentDataSet().getSelectedWays();
-        final Collection<Relation> selectedRelations = Main.main.getCurrentDataSet().getSelectedRelations();
 
         if (selectedWays.isEmpty()) {
@@ -154,4 +153,5 @@
         }
 
+        final Collection<Relation> selectedRelations = Main.main.getCurrentDataSet().getSelectedRelations();
         final Relation multipolygonRelation = update
                 ? getSelectedMultipolygonRelation(selectedWays, selectedRelations)
Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 9062)
@@ -768,6 +768,4 @@
     private List<WayInPolygon> markWayInsideSide(List<Way> parts, boolean isInner) {
 
-        List<WayInPolygon> result = new ArrayList<>();
-
         //prepare next map
         Map<Way, Way> nextWayMap = new HashMap<>();
@@ -854,4 +852,5 @@
         Way curWay = topWay;
         boolean curWayInsideToTheRight = wayClockwise ^ isInner;
+        List<WayInPolygon> result = new ArrayList<>();
 
         //iterate till full circle is reached
Index: trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 9062)
@@ -97,6 +97,4 @@
 
         double dist = mv.getDist100Pixel();
-        double zoomFactor = 1/dist;
-
         zm.setText(Long.toString(Math.round(dist*100)/100));
         updateUrl(true);
@@ -161,4 +159,5 @@
         }
 
+        double zoomFactor = 1/dist;
         mv.zoomToFactor(mv.getProjection().latlon2eastNorth(ll), zoomFactor * zoomLvl);
     }
Index: trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 9062)
@@ -314,6 +314,4 @@
         try {
             TagCollection nodeTags = TagCollection.unionOfAllPrimitives(nodes);
-            List<Command> resultion = CombinePrimitiveResolverDialog.launchIfNecessary(nodeTags, nodes, Collections.singleton(targetNode));
-            List<Command> cmds = new LinkedList<>();
 
             // the nodes we will have to delete
@@ -324,12 +322,9 @@
             // fix the ways referring to at least one of the merged nodes
             //
-            Collection<Way> waysToDelete = new HashSet<>();
-            List<Command> wayFixCommands = fixParentWays(
-                    nodesToDelete,
-                    targetNode);
+            List<Command> wayFixCommands = fixParentWays(nodesToDelete, targetNode);
             if (wayFixCommands == null) {
                 return null;
             }
-            cmds.addAll(wayFixCommands);
+            List<Command> cmds = new LinkedList<>(wayFixCommands);
 
             // build the commands
@@ -343,10 +338,7 @@
                 }
             }
-            cmds.addAll(resultion);
+            cmds.addAll(CombinePrimitiveResolverDialog.launchIfNecessary(nodeTags, nodes, Collections.singleton(targetNode)));
             if (!nodesToDelete.isEmpty()) {
                 cmds.add(new DeleteCommand(nodesToDelete));
-            }
-            if (!waysToDelete.isEmpty()) {
-                cmds.add(new DeleteCommand(waysToDelete));
             }
             return new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
Index: trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 9062)
@@ -189,5 +189,4 @@
      */
     public void openUrl(boolean newLayer, final String url) {
-        PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download Data"));
         Collection<DownloadTask> tasks = findDownloadTasks(url, false);
 
@@ -198,4 +197,6 @@
             return;
         }
+
+        PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download Data"));
 
         for (final DownloadTask task : tasks) {
@@ -207,5 +208,4 @@
             }
         }
-
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java	(revision 9062)
@@ -136,20 +136,16 @@
      */
     public void extend(DataSet data) {
-        Collection<OsmPrimitive> currentSelection;
-        Collection<OsmPrimitive> selection;
-        boolean selectionChanged = false;
-        Way way;
-
         if (!canExtend())
             return;
 
-        currentSelection = data.getSelected();
+        Collection<OsmPrimitive> currentSelection = data.getSelected();
 
-        way = findWay(currentSelection);
+        Way way = findWay(currentSelection);
 
         if (way == null)
             return;
 
-        selection = new LinkedList<>();
+        boolean selectionChanged = false;
+        Collection<OsmPrimitive> selection = new LinkedList<>();
         for (OsmPrimitive primitive : currentSelection) {
             selection.add(primitive);
Index: trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 9062)
@@ -230,5 +230,4 @@
 
         protected final Component build() {
-            JPanel p = new JPanel(new GridBagLayout());
             JPanel ip = new JPanel(new GridBagLayout());
             for (Layer layer : layers) {
@@ -249,4 +248,5 @@
             JScrollPane sp = new JScrollPane(ip);
             sp.setBorder(BorderFactory.createEmptyBorder());
+            JPanel p = new JPanel(new GridBagLayout());
             p.add(sp, GBC.eol().fill());
             final JTabbedPane tabs = new JTabbedPane();
Index: trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 9062)
@@ -137,6 +137,4 @@
         List<Node> selectedNodes = OsmPrimitive.getFilteredList(selection, Node.class);
         List<Way> selectedWays = OsmPrimitive.getFilteredList(selection, Way.class);
-        List<Relation> selectedRelations =
-            OsmPrimitive.getFilteredList(selection, Relation.class);
         List<Way> applicableWays = getApplicableWays(selectedWays, selectedNodes);
 
@@ -191,4 +189,6 @@
         final List<List<Node>> wayChunks = buildSplitChunks(selectedWay, selectedNodes);
         if (wayChunks != null) {
+            List<Relation> selectedRelations =
+                    OsmPrimitive.getFilteredList(selection, Relation.class);
             final List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size() + selectedRelations.size());
             sel.addAll(selectedWays);
Index: trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 9062)
@@ -101,6 +101,4 @@
             }
         }
-        UploadHullBuilder builder = new UploadHullBuilder();
-        UploadSelectionDialog dialog = new UploadSelectionDialog();
         Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(getEditLayer().data.getAllSelected());
         Collection<OsmPrimitive> deletedCandidates = getDeletedPrimitives(getEditLayer().data);
@@ -114,4 +112,5 @@
             return;
         }
+        UploadSelectionDialog dialog = new UploadSelectionDialog();
         dialog.populate(
                 modifiedCandidates,
@@ -121,5 +120,5 @@
         if (dialog.isCanceled())
             return;
-        Collection<OsmPrimitive> toUpload = builder.build(dialog.getSelectedPrimitives());
+        Collection<OsmPrimitive> toUpload = new UploadHullBuilder().build(dialog.getSelectedPrimitives());
         if (toUpload.isEmpty()) {
             JOptionPane.showMessageDialog(
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java	(revision 9062)
@@ -68,5 +68,4 @@
         }
         Main.map.selectMapMode(Main.map.mapModeSelect);
-        LatLon latlon = Main.map.mapView.getLatLon(e.getPoint().x, e.getPoint().y);
 
         NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Create new note"), tr("Create note"));
@@ -79,4 +78,5 @@
         String input = dialog.getInputText();
         if (input != null && !input.isEmpty()) {
+            LatLon latlon = Main.map.mapView.getLatLon(e.getPoint().x, e.getPoint().y);
             noteData.createNote(latlon, input);
         } else {
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 9062)
@@ -394,9 +394,5 @@
         DataSet ds = getCurrentDataSet();
         Collection<OsmPrimitive> selection = new ArrayList<>(ds.getSelected());
-        Collection<Command> cmds = new LinkedList<>();
-        Collection<OsmPrimitive> newSelection = new LinkedList<>(ds.getSelected());
-
-        List<Way> reuseWays = new ArrayList<>(),
-                replacedWays = new ArrayList<>();
+
         boolean newNode = false;
         Node n = null;
@@ -451,4 +447,9 @@
             snapHelper.unsetFixedMode();
         }
+
+        Collection<Command> cmds = new LinkedList<>();
+        Collection<OsmPrimitive> newSelection = new LinkedList<>(ds.getSelected());
+        List<Way> reuseWays = new ArrayList<>();
+        List<Way> replacedWays = new ArrayList<>();
 
         if (newNode) {
@@ -769,5 +770,4 @@
      */
     private void computeHelperLine() {
-        MapView mv = Main.map.mapView;
         if (mousePos == null) {
             // Don't draw the line.
@@ -779,4 +779,5 @@
         Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
 
+        MapView mv = Main.map.mapView;
         Node currentMouseNode = null;
         mouseOnExistingNode = null;
@@ -1271,7 +1272,7 @@
         public void actionPerformed(ActionEvent e) {
             Main.main.undoRedo.undo();
-            Node n = null;
             Command lastCmd = Main.main.undoRedo.commands.peekLast();
             if (lastCmd == null) return;
+            Node n = null;
             for (OsmPrimitive p: lastCmd.getParticipatingPrimitives()) {
                 if (p instanceof Node) {
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 9062)
@@ -393,5 +393,4 @@
         mouseHasBeenDragged = true;
 
-        Point p = e.getPoint();
         if (mode == Mode.normal) {
             // Should we ensure that the copyTags modifiers are still valid?
@@ -407,4 +406,5 @@
 
         // Calculate distance to the reference line
+        Point p = e.getPoint();
         EastNorth enp = mv.getEastNorth((int) p.getX(), (int) p.getY());
         EastNorth nearestPointOnRefLine = Geometry.closestPointToLine(referenceSegment.getFirstNode().getEastNorth(),
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 9062)
@@ -1102,6 +1102,4 @@
          */
         private Collection<OsmPrimitive> cyclePrims() {
-            OsmPrimitive nxt = null;
-
             if (cycleList.size() <= 1) {
                 // no real cycling, just return one-element collection with nearest primitive in it
@@ -1112,5 +1110,5 @@
             DataSet ds = getCurrentDataSet();
             OsmPrimitive first = cycleList.iterator().next(), foundInDS = null;
-            nxt = first;
+            OsmPrimitive nxt = first;
 
             if (cyclePrims && shift) {
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 9062)
@@ -374,6 +374,4 @@
             return null;
 
-        Collection<Way> waysToBeChanged = new HashSet<>();
-
         if (alsoDeleteNodesInWay) {
             // delete untagged nodes only referenced by primitives in primitivesToDelete, too
@@ -386,5 +384,5 @@
             return null;
 
-        waysToBeChanged.addAll(OsmPrimitive.getFilteredSet(OsmPrimitive.getReferrer(primitivesToDelete), Way.class));
+        Collection<Way> waysToBeChanged = new HashSet<>(OsmPrimitive.getFilteredSet(OsmPrimitive.getReferrer(primitivesToDelete), Way.class));
 
         Collection<Command> cmds = new LinkedList<>();
Index: trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/PurgeCommand.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/command/PurgeCommand.java	(revision 9062)
@@ -200,6 +200,4 @@
         @SuppressWarnings({ "unchecked", "rawtypes" })
         Set<Relation> inR = (Set) in;
-        Set<Relation> childlessR = new HashSet<>();
-        List<Relation> outR = new ArrayList<>(inR.size());
 
         Map<Relation, Integer> numChilds = new HashMap<>();
@@ -219,4 +217,5 @@
             }
         }
+        Set<Relation> childlessR = new HashSet<>();
         for (Relation r : inR) {
             if (numChilds.get(r).equals(0)) {
@@ -225,4 +224,5 @@
         }
 
+        List<Relation> outR = new ArrayList<>(inR.size());
         while (!childlessR.isEmpty()) {
             // Identify one childless Relation and
Index: trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java	(revision 9062)
@@ -139,5 +139,4 @@
             if (answer == JOptionPane.YES_OPTION) {
                 for (Entry<OsmPrimitive, List<TagCorrection>> entry : tagCorrectionsMap.entrySet()) {
-                    List<TagCorrection> tagCorrections = entry.getValue();
                     OsmPrimitive primitive = entry.getKey();
 
@@ -158,4 +157,5 @@
 
                     // apply all changes to this clone
+                    List<TagCorrection> tagCorrections = entry.getValue();
                     for (int i = 0; i < tagCorrections.size(); i++) {
                         if (tagTableMap.get(primitive).getCorrectionTableModel().getApply(i)) {
Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 9062)
@@ -380,4 +380,35 @@
         if (message == null) return false;
 
+        UpdatePluginsMessagePanel pnlMessage = new UpdatePluginsMessagePanel();
+        pnlMessage.setMessage(message);
+        pnlMessage.initDontShowAgain(togglePreferenceKey);
+
+        // check whether automatic update at startup was disabled
+        //
+        String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase(Locale.ENGLISH);
+        switch(policy) {
+        case "never":
+            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
+            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));
+            }
+            return false;
+
+        case "always":
+            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
+            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
+                Main.info(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));
+            }
+            return true;
+
+        case "ask":
+            break;
+
+        default:
+            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
+        }
+
         ButtonSpec[] options = new ButtonSpec[] {
                 new ButtonSpec(
@@ -394,35 +425,4 @@
                 )
         };
-
-        UpdatePluginsMessagePanel pnlMessage = new UpdatePluginsMessagePanel();
-        pnlMessage.setMessage(message);
-        pnlMessage.initDontShowAgain(togglePreferenceKey);
-
-        // check whether automatic update at startup was disabled
-        //
-        String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase(Locale.ENGLISH);
-        switch(policy) {
-        case "never":
-            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
-            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Skipping plugin update after elapsed update interval. Automatic update at startup is disabled."));
-            }
-            return false;
-
-        case "always":
-            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
-            } else if ("pluginmanager.time-based-update.policy".equals(togglePreferenceKey)) {
-                Main.info(tr("Running plugin update after elapsed update interval. Automatic update at startup is disabled."));
-            }
-            return true;
-
-        case "ask":
-            break;
-
-        default:
-            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
-        }
 
         int ret = HelpAwareOptionPane.showOptionDialog(
Index: trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 9062)
@@ -315,5 +315,4 @@
         if (sites == null) return;
         getProgressMonitor().setTicksCount(sites.size() * 3);
-        File pluginDir = Main.pref.getPluginsDirectory();
 
         // collect old cache files and remove if no longer in use
@@ -334,4 +333,5 @@
         }
 
+        File pluginDir = Main.pref.getPluginsDirectory();
         for (String site: sites) {
             String printsite = site.replaceAll("%<(.*)>", "");
Index: trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 9062)
@@ -352,5 +352,4 @@
         double a2 = p4.getY() - p3.getY();
         double b2 = p3.getX() - p4.getX();
-        double c2 = (p4.getX() - p1.getX()) * (p3.getY() - p1.getY()) - (p3.getX() - p1.getX()) * (p4.getY() - p1.getY());
 
         // Solve the equations
@@ -358,4 +357,6 @@
         if (det == 0)
             return null; // Lines are parallel
+
+        double c2 = (p4.getX() - p1.getX()) * (p3.getY() - p1.getY()) - (p3.getX() - p1.getX()) * (p4.getY() - p1.getY());
 
         return new EastNorth(b1 * c2 / det + p1.getX(), -a1 * c2 / det + p1.getY());
@@ -573,13 +574,13 @@
             return false;
 
+        //iterate each side of the polygon, start with the last segment
+        Node oldPoint = polygonNodes.get(polygonNodes.size() - 1);
+
+        if (!oldPoint.isLatLonKnown()) {
+            return false;
+        }
+
         boolean inside = false;
         Node p1, p2;
-
-        //iterate each side of the polygon, start with the last segment
-        Node oldPoint = polygonNodes.get(polygonNodes.size() - 1);
-
-        if (!oldPoint.isLatLonKnown()) {
-            return false;
-        }
 
         for (Node newPoint : polygonNodes) {
@@ -708,9 +709,9 @@
      */
     public static boolean isClockwise(List<Node> nodes) {
-        double area2 = 0.;
         int nodesCount = nodes.size();
         if (nodesCount < 3 || nodes.get(0) != nodes.get(nodesCount - 1)) {
             throw new IllegalArgumentException("Way must be closed to check orientation.");
         }
+        double area2 = 0.;
 
         for (int node = 1; node <= /*sic! consider last-first as well*/ nodesCount; node++) {
Index: trunk/src/org/openstreetmap/josm/tools/I18n.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 9062)
@@ -583,5 +583,4 @@
                     }
                     String[] enstrings = new String[ennum];
-                    String[] trstrings = new String[trnum];
                     for (int i = 0; i < ennum; ++i) {
                         int val = ens.read(enlen);
@@ -597,4 +596,5 @@
                         enstrings[i] = new String(str, 0, val, StandardCharsets.UTF_8);
                     }
+                    String[] trstrings = new String[trnum];
                     for (int i = 0; i < trnum; ++i) {
                         int val = trs.read(trlen);
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 9062)
@@ -836,5 +836,4 @@
         Matcher m = dataUrlPattern.matcher(url);
         if (m.matches()) {
-            String mediatype = m.group(1);
             String base64 = m.group(2);
             String data = m.group(3);
@@ -850,4 +849,5 @@
                 }
             }
+            String mediatype = m.group(1);
             if ("image/svg+xml".equals(mediatype)) {
                 String s = new String(bytes, StandardCharsets.UTF_8);
Index: trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 9062)
@@ -93,5 +93,4 @@
         }
         int zoom;
-        double lat, lon;
         try {
             zoom = Integer.parseInt(parts[0]);
@@ -100,4 +99,5 @@
             return null;
         }
+        double lat, lon;
         try {
             lat = Double.parseDouble(parts[1]);
Index: trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java	(revision 9062)
@@ -67,5 +67,4 @@
      */
     public static WindowGeometry centerInWindow(Component reference, Dimension extent) {
-        Window parentWindow = null;
         while (reference != null && !(reference instanceof Window)) {
             reference = reference.getParent();
@@ -73,5 +72,5 @@
         if (reference == null)
             return new WindowGeometry(new Point(0, 0), extent);
-        parentWindow = (Window) reference;
+        Window parentWindow = (Window) reference;
         Point topLeft = new Point(
                 Math.max(0, (parentWindow.getSize().width - extent.width) /2),
Index: trunk/src/org/openstreetmap/josm/tools/date/PrimaryDateParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/date/PrimaryDateParser.java	(revision 9061)
+++ trunk/src/org/openstreetmap/josm/tools/date/PrimaryDateParser.java	(revision 9062)
@@ -41,5 +41,4 @@
 
     private static boolean isDateInShortStandardFormat(String date) {
-        char[] dateChars;
         // We can only parse the date if it is in a very specific format.
         // eg. 2007-09-23T08:25:43Z
@@ -49,5 +48,5 @@
         }
 
-        dateChars = date.toCharArray();
+        char[] dateChars = date.toCharArray();
 
         // Make sure any fixed characters are in the correct place.
@@ -108,5 +107,4 @@
 
     private static boolean isDateInLongStandardFormat(String date) {
-        char[] dateChars;
         // We can only parse the date if it is in a very specific format.
         // eg. 2007-09-23T08:25:43.000Z
@@ -116,5 +114,5 @@
         }
 
-        dateChars = date.toCharArray();
+        char[] dateChars = date.toCharArray();
 
         // Make sure any fixed characters are in the correct place.
