[jboss-cvs] jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168 ...
Julien Viet
julien at jboss.com
Tue Aug 22 08:33:28 EDT 2006
User: julien
Date: 06/08/22 08:33:28
Modified: portlet/src/main/org/jboss/portal/portlet/impl/jsr168
PortletPreferencesImpl.java
Log:
make the PropertyChange instances created via factory methods
Revision Changes Path
1.9 +6 -30 jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletPreferencesImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PortletPreferencesImpl.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletPreferencesImpl.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- PortletPreferencesImpl.java 22 Jun 2006 05:13:16 -0000 1.8
+++ PortletPreferencesImpl.java 22 Aug 2006 12:33:27 -0000 1.9
@@ -45,7 +45,7 @@
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class PortletPreferencesImpl implements PortletPreferences
{
@@ -99,7 +99,7 @@
for (Iterator i = updates.values().iterator(); i.hasNext();)
{
PropertyChange change = (PropertyChange)i.next();
- if (change.getType() == PropertyChange.PREF_SET)
+ if (change.getType() == PropertyChange.PREF_UPDATE)
{
names.add(change.getKey());
}
@@ -119,7 +119,7 @@
PropertyChange change = (PropertyChange)updates.get(key);
if (change != null)
{
- if (change.getType() == PropertyChange.PREF_SET)
+ if (change.getType() == PropertyChange.PREF_UPDATE)
{
value = change.getValue();
}
@@ -195,15 +195,7 @@
{
throw new ReadOnlyException("Key " + key + " cannot be written");
}
- PropertyChange change = (PropertyChange)updates.get(key);
- if (change == null)
- {
- updates.put(key, new PropertyChange(PropertyChange.PREF_RESET, key, null));
- }
- else
- {
- change.asReset();
- }
+ updates.put(key, PropertyChange.newReset(key));
}
public void setValue(String key, String value) throws IllegalArgumentException, ReadOnlyException
@@ -217,15 +209,7 @@
throw new ReadOnlyException("Key " + key + " cannot be written");
}
Value value_ = new StringValue(value);
- PropertyChange change = (PropertyChange)updates.get(key);
- if (change == null)
- {
- updates.put(key, new PropertyChange(PropertyChange.PREF_SET, key, value_));
- }
- else
- {
- change.asSet(value_);
- }
+ updates.put(key, PropertyChange.newUpdate(key, value_));
}
public void setValues(String key, String[] values) throws IllegalArgumentException, ReadOnlyException
@@ -243,15 +227,7 @@
values = new String[1];
}
Value value_ = new StringValue(values);
- PropertyChange change = (PropertyChange)updates.get(key);
- if (change == null)
- {
- updates.put(key, new PropertyChange(PropertyChange.PREF_SET, key, value_));
- }
- else
- {
- change.asSet(value_);
- }
+ updates.put(key, PropertyChange.newUpdate(key, value_));
}
public void store() throws IOException, ValidatorException
More information about the jboss-cvs-commits
mailing list