//
PreferencesInfo prefs = referencedPortletInfo.getPreferences();
// Clone the current state
PropertyMap properties = new SimplePropertyMap(statefulContext.getProperties());
// Clone argument
for (PropertyChange change : changes)
{
String key = change.getKey();
int type = change.getType();
// If the original value exist and is read only we perform a reset instead
PreferenceInfo pref = prefs.getPreference(key);
if (pref != null)
{
if (Boolean.TRUE.equals(pref.isReadOnly()))
{
type = PropertyChange.PREF_RESET;
}
}
//
if (type == PropertyChange.PREF_UPDATE)
{
properties.setProperty(key, change.getValue());
}
else
{
properties.remove(key);
}
}
//
if (statefulContext.isLocal())