Index: applications/editors/josm/plugins/agpifoj/.classpath
===================================================================
--- applications/editors/josm/plugins/agpifoj/.classpath	(revision 18287)
+++ applications/editors/josm/plugins/agpifoj/.classpath	(revision 18593)
@@ -2,6 +2,7 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK 5"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
+	<classpathentry kind="lib" path="/JOSM/lib/metadata-extractor-2.3.1-nosun.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: applications/editors/josm/plugins/agpifoj/build.xml
===================================================================
--- applications/editors/josm/plugins/agpifoj/build.xml	(revision 18287)
+++ applications/editors/josm/plugins/agpifoj/build.xml	(revision 18593)
@@ -34,5 +34,5 @@
                 <attribute name="Plugin-Early" value="false"/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/AgPifoJ"/>
-                <attribute name="Plugin-Mainversion" value="2322"/>
+                <attribute name="Plugin-Mainversion" value="2450"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java	(revision 18287)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java	(revision 18593)
@@ -9,5 +9,5 @@
 
 import java.awt.Component;
-import java.awt.Graphics;
+import java.awt.Graphics2D;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.RenameLayerAction;
+import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.CachedLatLon;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -109,9 +110,9 @@
         	this.errorMessages.add(message);
         }
-        
+
         public Loader(File[] selection) {
             super(tr("Extracting GPS locations from EXIF"));
             this.selection = selection;
-            errorMessages = new LinkedHashSet<String>(); 
+            errorMessages = new LinkedHashSet<String>();
         }
 
@@ -122,5 +123,5 @@
             try {
                 addRecursiveFiles(files, selection);
-            } catch(NullPointerException npe) {            	
+            } catch(NullPointerException npe) {
                 rememberError(tr("One of the selected files was null"));
             }
@@ -128,5 +129,5 @@
             if (cancelled) {
                 return;
-            }            
+            }
             progressMonitor.subTask(tr("Read photos..."));
             progressMonitor.setTicksCount(files.size());
@@ -200,5 +201,5 @@
                         } catch(NullPointerException npe) {
                             npe.printStackTrace();
-                            
+
                             rememberError(tr("Found null file in directory {0}\n", f.getPath()));
                         }
@@ -232,5 +233,5 @@
     		return sb.toString();
         }
-        
+
         @Override protected void finish() {
         	if (!errorMessages.isEmpty()) {
@@ -361,5 +362,5 @@
 
     @Override
-    public void paint(Graphics g, MapView mv) {
+    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
 
         int iconWidth = icon.getIconWidth() / 2;
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 18287)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 18593)
@@ -96,5 +96,6 @@
         }
 
-        public String toString() {
+        @Override
+		public String toString() {
             return name;
         }
@@ -172,5 +173,5 @@
                     x.printStackTrace();
                     JOptionPane.showMessageDialog(
-                    		Main.parent, 
+                    		Main.parent,
                     		tr("Error while parsing {0}",sel.getName())+": "+x.getMessage(),
                     		tr("Error"),
@@ -181,5 +182,5 @@
                     x.printStackTrace();
                     JOptionPane.showMessageDialog(
-                    		Main.parent, 
+                    		Main.parent,
                     		tr("Could not read \"{0}\"",sel.getName())+"\n"+x.getMessage(),
                     		tr("Error"),
@@ -386,6 +387,6 @@
             while (! isOk) {
                 int answer = JOptionPane.showConfirmDialog(
-                		Main.parent, panel, 
-                		tr("Synchronize time from a photo of the GPS receiver"), 
+                		Main.parent, panel,
+                		tr("Synchronize time from a photo of the GPS receiver"),
                 		JOptionPane.OK_CANCEL_OPTION,
                 		JOptionPane.QUESTION_MESSAGE
@@ -637,9 +638,6 @@
         // Search whether an other layer has yet defined some bounding box.
         // If none, we'll zoom to the bounding box of the layer with the photos.
-        Collection<Layer> layerCol = Main.map.mapView.getAllLayers();
-        Iterator<Layer> layerIter = layerCol.iterator();
         boolean boundingBoxedLayerFound = false;
-        while (layerIter.hasNext()) {
-            Layer l = layerIter.next();
+        for (Layer l: Main.map.mapView.getAllLayers()) {
             if (l != yLayer) {
                 BoundingXYVisitor bbox = new BoundingXYVisitor();
@@ -657,5 +655,5 @@
         }
 
-        Main.main.map.repaint();
+        Main.map.repaint();
 
         JOptionPane.showMessageDialog(Main.parent, tr("Found {0} matches of {1} in GPX track {2}", matched, dateImgLst.size(), selectedGpx.name),
@@ -886,5 +884,5 @@
         ExtendedDialog d = new ExtendedDialog(Main.parent,
             tr("Adjust timezone and offset"),
-            new String[] { tr("Close"),  tr("Default Values") }           
+            new String[] { tr("Close"),  tr("Default Values") }
         );
 
