From: <sh...@us...> - 2009-05-20 07:28:27
|
Revision: 15313 http://jedit.svn.sourceforge.net/jedit/?rev=15313&view=rev Author: shlomy Date: 2009-05-20 07:28:19 +0000 (Wed, 20 May 2009) Log Message: ----------- When saving the user properties file, the output stream was closed only after the temporary file (containing the updated properties) was renamed, causing the properties file not to be saved correctly. Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/jEdit.java Modified: jEdit/trunk/org/gjt/sp/jedit/jEdit.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2009-05-19 21:24:59 UTC (rev 15312) +++ jEdit/trunk/org/gjt/sp/jedit/jEdit.java 2009-05-20 07:28:19 UTC (rev 15313) @@ -2702,8 +2702,6 @@ { out = new FileOutputStream(file1); propMgr.saveUserProps(out); - file2.delete(); - file1.renameTo(file2); } catch(IOException io) { @@ -2713,7 +2711,12 @@ { IOUtilities.closeQuietly(out); } - + file2.delete(); + if (! file1.renameTo(file2)) + { + Log.log(Log.ERROR,jEdit.class,"Failed to rename \"" + file1 + + "\" to the user properties file \"" + file2 + "\"."); + } propsModTime = file2.lastModified(); } } //}}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |