Rewrite FilePreferences
This commit is contained in:
parent
0d637a07f7
commit
a545c6d727
|
@ -29,7 +29,7 @@ public class FilePreferencesFactory implements PreferencesFactory {
|
|||
try {
|
||||
node.sync();
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(FilePreferences.class.getName()).log(Level.WARNING, e, e::toString);
|
||||
Logger.getLogger(FilePreferences.class.getName()).log(Level.WARNING, "Failed to load preferences: " + backingStoreFile, e);
|
||||
}
|
||||
|
||||
// store preferences on exit
|
||||
|
@ -37,7 +37,7 @@ public class FilePreferencesFactory implements PreferencesFactory {
|
|||
try {
|
||||
userRoot.flush();
|
||||
} catch (BackingStoreException e) {
|
||||
Logger.getLogger(FilePreferences.class.getName()).log(Level.WARNING, e, e::toString);
|
||||
Logger.getLogger(FilePreferences.class.getName()).log(Level.WARNING, "Failed to save preferences: " + backingStoreFile, e);
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
@ -115,8 +115,8 @@ public class PropertyFileBackingStore {
|
|||
}
|
||||
|
||||
public void flush() throws IOException {
|
||||
StringWriter buffer = new StringWriter(1024);
|
||||
this.toProperties().store(buffer, null);
|
||||
StringWriter buffer = new StringWriter();
|
||||
toProperties().store(buffer, null);
|
||||
|
||||
ByteBuffer data = UTF_8.encode(CharBuffer.wrap(buffer.getBuffer()));
|
||||
|
||||
|
|
Loading…
Reference in New Issue