Index: src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 3751)
+++ src/org/openstreetmap/josm/actions/OpenFileAction.java	(working copy)
@@ -243,21 +243,33 @@
                 Collections.reverse(ims);
 
                 Set<String> fileHistory = new LinkedHashSet<String>();
+                List<String> failedHistory = new ArrayList<String>();
 
                 for (FileImporter importer : ims) {
                     List<File> files = new ArrayList<File>(map.get(importer));
                     importData(importer, files);
+                    // suppose all files will fail to load
+                    List<File> failedFiles = new ArrayList<File>(files);
 
                     if (recordHistory && !importer.isBatchImporter()) {
+                        // only add those files which really have been opened successfully
+                        files.retainAll(successfullyOpenedFiles);
+                        // remove the files which didn't fail to load from the failed list
+                        failedFiles.removeAll(successfullyOpenedFiles);
                         for (File f : files) {
                             fileHistory.add(f.getPath());
                         }
+                        for (File f : failedFiles) {
+                            failedHistory.add(f.getPath());
+                        }
                     }
                 }
 
                 if (recordHistory) {
                     Collection<String> oldFileHistory = Main.pref.getCollection("file-open.history");
                     fileHistory.addAll(oldFileHistory);
+                    // remove the files which failed to load from the list
+                    fileHistory.removeAll(failedHistory);
                     int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
                     Collection<String> trimmedFileHistory = new ArrayList<String>(Math.min(maxsize, fileHistory.size()));
                     int i = 0;
