Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 14209)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java	(revision 14210)
@@ -6,4 +6,5 @@
 import java.util.Date;
 import java.util.Objects;
+import java.util.function.Consumer;
 
 import org.openstreetmap.josm.data.coor.CachedLatLon;
@@ -501,6 +502,5 @@
         try {
             if (dirExif != null) {
-                int orientation = dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION);
-                setExifOrientation(orientation);
+                setExifOrientation(dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION));
             }
         } catch (MetadataException ex) {
@@ -511,8 +511,6 @@
             if (dir != null) {
                 // there are cases where these do not match width and height stored in dirExif
-                int width = dir.getInt(JpegDirectory.TAG_IMAGE_WIDTH);
-                int height = dir.getInt(JpegDirectory.TAG_IMAGE_HEIGHT);
-                setWidth(width);
-                setHeight(height);
+                setWidth(dir.getInt(JpegDirectory.TAG_IMAGE_WIDTH));
+                setHeight(dir.getInt(JpegDirectory.TAG_IMAGE_HEIGHT));
             }
         } catch (MetadataException ex) {
@@ -526,17 +524,9 @@
         }
 
-        final Double speed = ExifReader.readSpeed(dirGps);
-        if (speed != null) {
-            setSpeed(speed);
-        }
-
-        final Double ele = ExifReader.readElevation(dirGps);
-        if (ele != null) {
-            setElevation(ele);
-        }
-
-        try {
-            final LatLon latlon = ExifReader.readLatLon(dirGps);
-            setExifCoor(latlon);
+        ifNotNull(ExifReader.readSpeed(dirGps), this::setSpeed);
+        ifNotNull(ExifReader.readElevation(dirGps), this::setElevation);
+
+        try {
+            setExifCoor(ExifReader.readLatLon(dirGps));
             setPos(getExifCoor());
         } catch (MetadataException | IndexOutOfBoundsException ex) { // (other exceptions, e.g. #5271)
@@ -547,15 +537,15 @@
 
         try {
-            final Double direction = ExifReader.readDirection(dirGps);
-            if (direction != null) {
-                setExifImgDir(direction);
-            }
+            ifNotNull(ExifReader.readDirection(dirGps), this::setExifImgDir);
         } catch (IndexOutOfBoundsException ex) { // (other exceptions, e.g. #5271)
             Logging.debug(ex);
         }
 
-        final Date gpsDate = dirGps.getGpsDate();
-        if (gpsDate != null) {
-            setExifGpsTime(gpsDate);
+        ifNotNull(dirGps.getGpsDate(), this::setExifGpsTime);
+    }
+
+    private static <T> void ifNotNull(T value, Consumer<T> setter) {
+        if (value != null) {
+            setter.accept(value);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxTimezone.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxTimezone.java	(revision 14209)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxTimezone.java	(revision 14210)
@@ -45,13 +45,13 @@
         StringBuilder ret = new StringBuilder();
 
-        double timezone = this.timezone;
-        if (timezone < 0) {
+        double tz = this.timezone;
+        if (tz < 0) {
             ret.append('-');
-            timezone = -timezone;
+            tz = -tz;
         } else {
             ret.append('+');
         }
-        ret.append((long) timezone).append(':');
-        int minutes = (int) ((timezone % 1) * 60);
+        ret.append((long) tz).append(':');
+        int minutes = (int) ((tz % 1) * 60);
         if (minutes < 10) {
             ret.append('0');
