From: David ‘Bombe’ Roden Date: Sat, 1 Dec 2007 12:18:09 +0000 (+0000) Subject: fix exception when files is removed (should fix #1755) X-Git-Tag: 0.4.9.4~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6a27a4ea40649df0a8fb62f9c79da1f7c1ce5507;p=jSite.git fix exception when files is removed (should fix #1755) --- diff --git a/src/de/todesbaum/jsite/gui/ProjectFilesPage.java b/src/de/todesbaum/jsite/gui/ProjectFilesPage.java index d8bac9c..4ae819f 100644 --- a/src/de/todesbaum/jsite/gui/ProjectFilesPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectFilesPage.java @@ -31,8 +31,11 @@ import java.awt.event.KeyEvent; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; +import java.util.Map.Entry; import javax.swing.AbstractAction; import javax.swing.Action; @@ -400,13 +403,17 @@ public class ProjectFilesPage extends TWizardPage implements ActionListener, Lis rebuildContainerComboBox(); } }); + Set entriesToRemove = new HashSet(); Iterator filenames = project.getFileOptions().keySet().iterator(); while (filenames.hasNext()) { String filename = filenames.next(); if (!files.contains(filename)) { - project.setFileOption(filename, null); + entriesToRemove.add(filename); } } + for (String filename: entriesToRemove) { + project.setFileOption(filename, null); + } } else { JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.scan-error"), null, JOptionPane.ERROR_MESSAGE); }