On Tuesday 20 November 2007 19:15, you wrote:
> + private void storeBookmarks() {
> + Logger.normal(this, "Attempting to save bookmarks to " +
bookmarksFile.toString());
> + SimpleFieldSet sfs;
> + synchronized (bookmarks) {
> + if (isSavingBookmarks) {
> + return;
> + }
> + isSavingBookmarks = true;
> +
> + SimpleFieldSet toSave = MAIN_CATEGORY.toSimpleFieldSet();
> + if(toSave.isEmpty()) {
> + isSavingBookmarks = false;
> + return;
> + }
> + sfs = toSave;
> + }
> + FileWriter fw = null;
> + try {
> + File tmp = File.createTempFile("bookmark", ".bak",
bookmarksFile.getParentFile());
> + fw = new FileWriter(tmp);
> + sfs.writeTo(fw);
> + if (!tmp.renameTo(bookmarksFile)) {
> + Logger.error(this, "Unable to rename " + tmp.toString() + "
to " + bookmarksFile.toString());
> + }
> + } catch (IOException ioe) {
> + Logger.error(this, "An error has occured saving the bookmark
file :" + ioe.getMessage(), ioe);
> + } finally {
> + try {
> + if (fw != null) {
> + fw.close();
> + }
> + } catch (IOException e) {
> + }
> + }
> +
> + synchronized (bookmarks) {
> + isSavingBookmarks = false;
> + }
Should this be in finally {} ?
> + }
pgpN3dj1LBdxL.pgp
Description: PGP signature
_______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
