// Get the portlet info
PortletInfo referencedPortletInfo = referencedPortlet.getInfo();
//
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;