Index: /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustMapMode.java
===================================================================
--- /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustMapMode.java	(revision 33756)
+++ /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustMapMode.java	(revision 33757)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.photoadjust;
 
@@ -43,8 +44,13 @@
     private MouseMotionAdapter mouseMotionAdapter;
     private IconToggleButton mmButton;
-    private PhotoAdjustWorker worker;
+    private final PhotoAdjustWorker worker;
     /** True if one existing GeoImageLayer is to be ignored. */
     private boolean ignoreOneGILayer = false;
 
+    /**
+     * Initialize photo adjust map mode.
+     *
+     * @param worker Worker that does the actual work.
+     */
     public PhotoAdjustMapMode(PhotoAdjustWorker worker) {
         super(tr("Adjust photos"), "photoadjust.png",
@@ -79,6 +85,5 @@
         if (hasLayersToAdjust()) {
             return tr("Click+drag photo, shift+click to position photo, control+click to set direction.");
-        }
-        else {
+        } else {
             return tr("Please load some photos.");
         }
@@ -183,4 +188,5 @@
     @Override
     public void layerOrderChanged(LayerOrderChangeEvent e) {
+        // Nothing to do at layer order change.
     }
 
@@ -234,5 +240,5 @@
      * @return list of visible GeoImageLayer's
      */
-    private List<GeoImageLayer> getVisibleGeoImageLayers() {
+    private static List<GeoImageLayer> getVisibleGeoImageLayers() {
         List<GeoImageLayer> all = new ArrayList<>(MainApplication.getLayerManager().getLayersOfType(GeoImageLayer.class));
         Iterator<GeoImageLayer> it = all.iterator();
Index: /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustPlugin.java
===================================================================
--- /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustPlugin.java	(revision 33756)
+++ /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustPlugin.java	(revision 33757)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.photoadjust;
 
@@ -23,8 +24,8 @@
 public class PhotoAdjustPlugin extends Plugin implements ActiveLayerChangeListener {
   
-    private GeoImageLayer imageLayer = null;
-    private MouseAdapter mouseAdapter = null;
-    private MouseMotionAdapter mouseMotionAdapter = null;
-    public PhotoAdjustWorker worker = null;
+    private GeoImageLayer imageLayer;
+    private MouseAdapter mouseAdapter;
+    private MouseMotionAdapter mouseMotionAdapter;
+    private final PhotoAdjustWorker worker = new PhotoAdjustWorker();
 
     /**
@@ -36,6 +37,5 @@
 	super(info);
         GeoImageLayer.registerMenuAddition(new UntaggedGeoImageLayerAction());
-        new PhotoPropertyEditor();
-        worker = new PhotoAdjustWorker();
+        PhotoPropertyEditor.init();
         initAdapters();
     }
@@ -90,9 +90,8 @@
         Layer oldLayer = e.getPreviousActiveLayer();
         Layer newLayer = MainApplication.getLayerManager().getActiveLayer();
-        if ( oldLayer instanceof GeoImageLayer
-             && newLayer instanceof GeoImageLayer) {
+        if (oldLayer instanceof GeoImageLayer
+            && newLayer instanceof GeoImageLayer) {
             imageLayer = (GeoImageLayer)newLayer;
-        }
-        else {
+        } else {
             if (oldLayer instanceof GeoImageLayer) {
                 MainApplication.getMap().mapView.removeMouseListener(mouseAdapter);
Index: /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java
===================================================================
--- /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java	(revision 33756)
+++ /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java	(revision 33757)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.photoadjust;
 
@@ -17,10 +18,10 @@
 public class PhotoAdjustWorker {
 
-    private ImageEntry dragPhoto = null;
-    private GeoImageLayer dragLayer = null;
+    private ImageEntry dragPhoto;
+    private GeoImageLayer dragLayer;
     // Offset between center of the photo and point where it is
     // clicked.  This must be in pixels to maintain the same offset if
     // the photo is moved very far.
-    private Point2D dragOffset = null;
+    private Point2D dragOffset;
     private boolean centerViewIsDisabled = false;
     private boolean centerViewNeedsEnable = false;
@@ -76,5 +77,5 @@
 
         if (evt.getButton() == MouseEvent.BUTTON1
-            && imageLayers != null && imageLayers.size() > 0) {
+            && imageLayers != null && !imageLayers.isEmpty()) {
             // Check if modifier key is pressed and change to
             // image viewer photo if it is.
@@ -84,7 +85,7 @@
                 final GeoImageLayer viewerLayer = ImageViewerDialog.getCurrentLayer();
                 final ImageEntry img = ImageViewerDialog.getCurrentImage();
-                if ( img != null && viewerLayer != null
-                     && viewerLayer.isVisible()
-                     && imageLayers.contains(viewerLayer)) {
+                if (img != null && viewerLayer != null
+                    && viewerLayer.isVisible()
+                    && imageLayers.contains(viewerLayer)) {
                     // Change direction if control is pressed, position
                     // otherwise.  Shift+control changes direction, similar to
@@ -107,6 +108,5 @@
                             changeDirection(img, viewerLayer, evt);
                         }
-                    }
-                    else { // shift pressed
+                    } else { // shift pressed
                         movePhoto(img, viewerLayer, evt);
                     }
@@ -114,6 +114,5 @@
                     dragLayer = viewerLayer;
                 }
-            }
-            else {
+            } else {
                 // Start with the top layer.
                 for (GeoImageLayer layer: imageLayers) {
@@ -151,10 +150,9 @@
      */
     public void doMouseDragged(MouseEvent evt) {
-        if ( dragLayer != null && dragLayer.isVisible()
-             && dragPhoto != null) {
+        if (dragLayer != null && dragLayer.isVisible()
+            && dragPhoto != null) {
             if ((evt.getModifiers() & InputEvent.CTRL_MASK) != 0) {
                 changeDirection(dragPhoto, dragLayer, evt);
-            }
-            else {
+            } else {
                 disableCenterView();
                 movePhoto(dragPhoto, dragLayer, evt);
@@ -189,6 +187,5 @@
                 dragOffset.getX() + evt.getX(),
                 dragOffset.getY() + evt.getY());
-        }
-        else {
+        } else {
             newPos = MainApplication.getMap().mapView.getLatLon(evt.getX(), evt.getY());
         }
Index: /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoPropertyEditor.java
===================================================================
--- /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoPropertyEditor.java	(revision 33756)
+++ /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoPropertyEditor.java	(revision 33757)
@@ -1,5 +1,5 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.photoadjust;
 
-//import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -42,5 +42,8 @@
 public class PhotoPropertyEditor {
 
-    public PhotoPropertyEditor() {
+    /**
+     * Add photo property editor to edit menu.
+     */
+    public static void init() {
         MainMenu.add(MainApplication.getMenu().editMenu, new PropertyEditorAction());
     }
@@ -62,13 +65,12 @@
     private static class PropertyEditorAction extends JosmAction {
         public PropertyEditorAction() {
-            super(tr("Edit photo GPS data"),	// String name
-                  (String)null,			// String iconName
+            super(tr("Edit photo GPS data"),    // String name
+                  (String)null,                         // String iconName
                   tr("Edit GPS data of selected photo."), // String tooltip
-                  null,				// Shortcut shortcut
-                  true,				// boolean registerInToolbar
+                  null,                                 // Shortcut shortcut
+                  true,                                 // boolean registerInToolbar
                   "photoadjust/propertyeditor", // String toolbarId
-                  true				// boolean installAdapters
+                  true                          // boolean installAdapters
                   );
-            //putValue("help", ht("/Action/..."));
         }
 
@@ -114,5 +116,5 @@
          *         image shown, {@code false} otherwise.
          */
-        private boolean enabled() {
+        private static boolean enabled() {
             try {
                 //return ImageViewerDialog.getInstance().hasImage();
@@ -147,9 +149,9 @@
         public PropertyEditorDialog(String title, final ImageEntry image,
                                     final GeoImageLayer layer) {
-            super(Main.parent, title, new String[] {tr("Ok"), tr("Cancel")});
+            super(Main.parent, title, tr("Ok"), tr("Cancel"));
             this.image = image;
             this.layer = layer;
             imgOrig = image.clone();
-            setButtonIcons(new String[] {"ok", "cancel"});
+            setButtonIcons("ok", "cancel");
             final JPanel content = new JPanel(new GridBagLayout());
             //content.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
@@ -183,5 +185,5 @@
             Action editCoordAction = new AbstractAction(tr("Edit")) {
                 @Override public void actionPerformed(ActionEvent evt) {
-                    final LatLonDialog llDialog 
+                    final LatLonDialog llDialog
                         = new LatLonDialog(Main.parent,
                                            tr("Edit Image Coordinates"), null);
@@ -317,12 +319,11 @@
          * @return Image position as text.
          */
-        private String posToText(LatLon pos) {
+        private static String posToText(LatLon pos) {
             // See josm.gui.dialogs.LatLonDialog.setCoordinates().
-            String posStr =
+            return
                 pos == null ? "" :
                 CoordinateFormatManager.getDefaultFormat().latToString(pos) +
                 ' ' +
                 CoordinateFormatManager.getDefaultFormat().lonToString(pos);
-            return posStr;
         }
 
@@ -389,5 +390,5 @@
          *         converted to double.
          */
-        private Double getDoubleValue(JosmTextField txtFld) {
+        private static Double getDoubleValue(JosmTextField txtFld) {
             final String text = txtFld.getText();
             if (text == null || text.isEmpty()) {
@@ -424,7 +425,7 @@
                 // doesn't work to compare imgTmp.getPos() with getLatLon()
                 // because the dialog will round the initial position.
-                if ( imgOrig.getPos() == null
-                     || !posToText(imgOrig.getPos()).equals(posToText(imgTmp.getPos()))
-                     ) {
+                if (imgOrig.getPos() == null
+                    || !posToText(imgOrig.getPos()).equals(
+                        posToText(imgTmp.getPos()))) {
                     imgTmp.flagNewGpsData();
                 }
@@ -492,6 +493,6 @@
                 latLon = null;
             }
-            if ( latLon == null && coordsText != null
-                 && !coordsText.isEmpty()) {
+            if ((latLon == null && coordsText != null
+                 && !coordsText.isEmpty())) {
                 setErrorFeedback(coords);
                 setOkEnabled(false);
@@ -522,9 +523,7 @@
             final String text = txtFld.getText();
             Double value = null;
-            if (text == null || text.isEmpty()) {
-                isError = false;
-            } else {
+            if (text != null && !text.isEmpty()) {
                 try {
-                    value = Double.parseDouble(text);
+                    value = Double.valueOf(text);
                     if (min != null && value < min) {
                         isError = true;
Index: /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/UntaggedGeoImageLayerAction.java
===================================================================
--- /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/UntaggedGeoImageLayerAction.java	(revision 33756)
+++ /applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/UntaggedGeoImageLayerAction.java	(revision 33757)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.photoadjust;
 
