portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r330939 - /portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java
Date Fri, 04 Nov 2005 22:42:29 GMT
Author: taylor
Date: Fri Nov  4 14:42:27 2005
New Revision: 330939

URL: http://svn.apache.org/viewcvs?rev=330939&view=rev
Log:
preferences are not always available
handle this case

Modified:
    portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java

Modified: portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java?rev=330939&r1=330938&r2=330939&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java
(original)
+++ portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/om/preference/impl/FragmentPortletPreferenceSet.java
Fri Nov  4 14:42:27 2005
@@ -45,20 +45,25 @@
     {
         this.preferenceSet = preferenceSet;
         this.fragment = fragment;
-        this.prefs = new HashMap(fragment.getPreferences().size());
-        Iterator itr = fragment.getPreferences().iterator();
-        
-        while(itr.hasNext())
+        if (fragment.getPreferences() != null)
         {
-            Preference pref = (Preference) itr.next();
-            prefs.put(pref.getName(), pref);
+            this.prefs = new HashMap(fragment.getPreferences().size());
+            Iterator itr = fragment.getPreferences().iterator();        
+            while(itr.hasNext())
+            {
+                Preference pref = (Preference) itr.next();
+                prefs.put(pref.getName(), pref);
+            }
+        }
+        else
+        {
+            this.prefs = new HashMap();
         }
         
-        
-        itr = preferenceSet.iterator();
-        while(itr.hasNext())
+        Iterator iterator = preferenceSet.iterator();
+        while(iterator.hasNext())
         {
-            Preference pref = (Preference) itr.next();
+            Preference pref = (Preference) iterator.next();
             prefs.put(pref.getName(), pref);
         }        
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message