portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r594632 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
Date Tue, 13 Nov 2007 20:25:05 GMT
Author: taylor
Date: Tue Nov 13 12:25:04 2007
New Revision: 594632

URL: http://svn.apache.org/viewvc?rev=594632&view=rev
Log:
* don't throw exception when no permissions found
* clean up formatting

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java?rev=594632&r1=594631&r2=594632&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/serializer/src/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
Tue Nov 13 12:25:04 2007
@@ -800,75 +800,73 @@
         if (permissions != null)
         {
            list =  permissions.iterator();
-        while (list.hasNext())
-        {
-            JSPermission _js = (JSPermission)list.next();
-            PortalResourcePermission perm = _js.getPermissionForType();
-            if ((perm != null) && (perm instanceof PortalResourcePermission))
+            while (list.hasNext())
             {
-            	try
+                JSPermission _js = (JSPermission)list.next();
+                PortalResourcePermission perm = _js.getPermissionForType();
+                if ((perm != null) && (perm instanceof PortalResourcePermission))
                 {
-                    pm.addPermission(perm);
-                    ArrayList listTemp = null;
-					JSUserGroups jsUserGroups = _js.getGroupString();
-					if (jsUserGroups != null)
-						listTemp = this.getTokens(jsUserGroups.toString());
-					else
-						listTemp = null;
-					if ((listTemp != null) && (listTemp.size()>0))
-					{
-						Iterator _itTemp = listTemp.iterator();
-						while (_itTemp.hasNext())
-						{
-							Principal p = (Principal)this.groupMap.get((String)_itTemp.next());
-							if (p != null)
-								pm.grantPermission(p, perm);
-						}
-					}
-					JSUserRoles jsUserRoles = _js.getRoleString();
-					if (jsUserRoles != null)
-						listTemp = this.getTokens(jsUserRoles.toString());
-					else
-						listTemp = null;
-					if ((listTemp != null) && (listTemp.size()>0))
-					{
-						Iterator _itTemp = listTemp.iterator();
-						while (_itTemp.hasNext())
-						{
-   							Principal p = (Principal)this.roleMap.get((String)_itTemp.next());
-							if (p != null)
-								pm.grantPermission(p, perm);
-						}
-					}
-					JSUserUsers jsUserUsers = _js.getUserString();
-					if (jsUserUsers != null)
-						listTemp = this.getTokens(jsUserUsers.toString());
-					else
-						listTemp = null;
-					if ((listTemp != null) && (listTemp.size()>0))
-					{
-						Iterator _itTemp = listTemp.iterator();
-						while (_itTemp.hasNext())
-						{
-   							Principal p = (Principal)this.userMap.get((String)_itTemp.next());
-							if (p != null)
-								pm.grantPermission(p, perm);
-						}
-					}
-
-	            } 
-	           	catch (Exception e)
-	            {
-	                throw new SerializerException(
-	                        SerializerException.CREATE_SERIALIZED_OBJECT_FAILED
-	                                .create(new String[]
-	                                { "Permissions", e.getMessage()}));
-	            }
+                	try
+                    {
+                        pm.addPermission(perm);
+                        ArrayList listTemp = null;
+    					JSUserGroups jsUserGroups = _js.getGroupString();
+    					if (jsUserGroups != null)
+    						listTemp = this.getTokens(jsUserGroups.toString());
+    					else
+    						listTemp = null;
+    					if ((listTemp != null) && (listTemp.size()>0))
+    					{
+    						Iterator _itTemp = listTemp.iterator();
+    						while (_itTemp.hasNext())
+    						{
+    							Principal p = (Principal)this.groupMap.get((String)_itTemp.next());
+    							if (p != null)
+    								pm.grantPermission(p, perm);
+    						}
+    					}
+    					JSUserRoles jsUserRoles = _js.getRoleString();
+    					if (jsUserRoles != null)
+    						listTemp = this.getTokens(jsUserRoles.toString());
+    					else
+    						listTemp = null;
+    					if ((listTemp != null) && (listTemp.size()>0))
+    					{
+    						Iterator _itTemp = listTemp.iterator();
+    						while (_itTemp.hasNext())
+    						{
+       							Principal p = (Principal)this.roleMap.get((String)_itTemp.next());
+    							if (p != null)
+    								pm.grantPermission(p, perm);
+    						}
+    					}
+    					JSUserUsers jsUserUsers = _js.getUserString();
+    					if (jsUserUsers != null)
+    						listTemp = this.getTokens(jsUserUsers.toString());
+    					else
+    						listTemp = null;
+    					if ((listTemp != null) && (listTemp.size()>0))
+    					{
+    						Iterator _itTemp = listTemp.iterator();
+    						while (_itTemp.hasNext())
+    						{
+       							Principal p = (Principal)this.userMap.get((String)_itTemp.next());
+    							if (p != null)
+    								pm.grantPermission(p, perm);
+    						}
+    					}
+    
+    	            } 
+    	           	catch (Exception e)
+    	            {
+    	                throw new SerializerException(
+    	                        SerializerException.CREATE_SERIALIZED_OBJECT_FAILED
+    	                                .create(new String[]
+    	                                { "Permissions", e.getMessage()}));
+    	            }
+                }
             }
-        }}else{ throw new SerializerException(
-                SerializerException.GET_EXISTING_OBJECTS
-                .create(new String[]
-                { "Permissions"}));}
+        }
     	logMe("recreatePermissions - done");
     }
 



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