src/macosx/classes/java/util/prefs/MacOSXPreferences.java
Print this page
*** 133,162 ****
--- 133,166 ----
return MacOSXPreferencesFile.getFile(name, isUser);
}
// AbstractPreferences implementation
+ @Override
protected void putSpi(String key, String value)
{
file.addKeyToNode(path, key, value);
}
// AbstractPreferences implementation
+ @Override
protected String getSpi(String key)
{
return file.getKeyFromNode(path, key);
}
// AbstractPreferences implementation
+ @Override
protected void removeSpi(String key)
{
Objects.requireNonNull(key, "Specified key cannot be null");
file.removeKeyFromNode(path, key);
}
// AbstractPreferences implementation
+ @Override
protected void removeNodeSpi()
throws BackingStoreException
{
// Disallow flush or sync between these two operations
// (they may be manipulating two different files)
*** 172,199 ****
--- 176,206 ----
file.removeChildFromNode(path, child);
}
// AbstractPreferences implementation
+ @Override
protected String[] childrenNamesSpi()
throws BackingStoreException
{
String[] result = file.getChildrenForNode(path);
if (result == null) throw new BackingStoreException("Couldn't get list of children for node '" + path + "'");
return result;
}
// AbstractPreferences implementation
+ @Override
protected String[] keysSpi()
throws BackingStoreException
{
String[] result = file.getKeysForNode(path);
if (result == null) throw new BackingStoreException("Couldn't get list of keys for node '" + path + "'");
return result;
}
// AbstractPreferences implementation
+ @Override
protected AbstractPreferences childSpi(String name)
{
// Add to parent's child list here and disallow sync
// because parent and child might be in different files.
synchronized(MacOSXPreferencesFile.class) {
*** 201,210 ****
--- 208,218 ----
return new MacOSXPreferences(this, name);
}
}
// AbstractPreferences override
+ @Override
public void flush()
throws BackingStoreException
{
// Flush should *not* check for removal, unlike sync, but should
// prevent simultaneous removal.
*** 215,231 ****
--- 223,241 ----
}
}
}
// AbstractPreferences implementation
+ @Override
protected void flushSpi()
throws BackingStoreException
{
// nothing here - overridden flush() doesn't call this
}
// AbstractPreferences override
+ @Override
public void sync()
throws BackingStoreException
{
synchronized(lock) {
if (isRemoved())
*** 242,251 ****
--- 252,262 ----
}
}
}
// AbstractPreferences implementation
+ @Override
protected void syncSpi()
throws BackingStoreException
{
// nothing here - overridden sync() doesn't call this
}