portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r894316 - /portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
Date Tue, 29 Dec 2009 06:56:22 GMT
Author: rwatler
Date: Tue Dec 29 06:56:22 2009
New Revision: 894316

URL: http://svn.apache.org/viewvc?rev=894316&view=rev
Log:
fix NPE and add comments

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java?rev=894316&r1=894315&r2=894316&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/om/page/impl/ContentFragmentImpl.java
Tue Dec 29 06:56:22 2009
@@ -1374,6 +1374,7 @@
             FragmentProperty findFragmentProperty = (FragmentProperty)propertiesIter.next();
             if (findFragmentProperty.getName().equals(propName))
             {
+                // compare scopes
                 String findFragmentPropertyScope = findFragmentProperty.getScope();
                 if ((scope == null) && (findFragmentPropertyScope == null))
                 {
@@ -1387,6 +1388,7 @@
                     {
                         scopeValue = Utils.getCurrentUserScopeValue();
                     }
+                    // compare scope values                    
                     String findFragmentPropertyScopeValue = findFragmentProperty.getScopeValue();
                     if ((findFragmentPropertyScopeValue != null) && findFragmentPropertyScopeValue.equals(scopeValue))
                     {
@@ -1400,15 +1402,17 @@
         // add, set, or remove property
         if (fragmentProperty != null)
         {
+            // remove old property setting
             getProperties().remove(fragmentProperty);                
         }
         if (value != null)
         {
             // default user scope value
-            if ((scopeValue == null) && scope.equals(USER_PROPERTY_SCOPE))
+            if ((scopeValue == null) && (scope != null) && scope.equals(USER_PROPERTY_SCOPE))
             {
                 scopeValue = Utils.getCurrentUserScopeValue();
             }
+            // add new property
             getProperties().add(new ContentFragmentPropertyImpl(propName, scope, scopeValue,
value));
         }
     }



---------------------------------------------------------------------
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