String value = preferences.getValue(PREF_NAME, DEF_VALUE);
if (NEW_VALUE.equals(value)) {
setOccured = true;
}
// Reset the preference so that default value is restored.
preferences.reset(PREF_NAME);
value = preferences.getValue(PREF_NAME, DEF_VALUE);
if (PREF_VALUE.equals(value)) {
resetOccured = true;
}
} catch (ReadOnlyException ex) {