portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r1578526 [2/2] - in /portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src: main/java/org/apache/jetspeed/om/folder/impl/ main/java/org/apache/jetspeed/om/folder/psml/ main/java/org/apache/jetspeed/om/page/ main/java/org/apac...
Date Mon, 17 Mar 2014 19:24:57 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerUtils.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerUtils.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageManagerUtils.java Mon Mar 17 19:24:56 2014
@@ -16,11 +16,6 @@
  */
 package org.apache.jetspeed.page;
 
-import java.security.Principal;
-import java.util.Iterator;
-
-import javax.security.auth.Subject;
-
 import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
@@ -29,14 +24,17 @@ import org.apache.jetspeed.om.page.Fragm
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageTemplate;
+import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.security.Role;
 import org.apache.jetspeed.security.SubjectHelper;
 import org.apache.jetspeed.security.User;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.security.auth.Subject;
+import java.security.Principal;
+
 /**
  * PageManagerUtils
  * 
@@ -85,10 +83,8 @@ public class PageManagerUtils
             // for each role for a user, deep copy the folder contents for that role 
             // into the user's home
             // TODO: this algorithm could actually merge pages on dups
-            Iterator roles = SubjectHelper.getPrincipals(subject, Role.class).iterator();
-            while (roles.hasNext())
-            {                            
-                Role role = (Role)roles.next();
+            for (Principal role : SubjectHelper.getPrincipals(subject, Role.class))
+            {
                 if (pageManager.folderExists(Folder.ROLE_FOLDER + role.getName()))
                 {
                     Folder roleFolder = pageManager.getFolder(Folder.ROLE_FOLDER + role.getName());                    
@@ -121,43 +117,39 @@ public class PageManagerUtils
     public static void deepMergeFolder(PageManager pageManager, Folder srcFolder, String destinationPath, String owner, String uniqueName)
     throws NodeException
     {        
-        Iterator pages = srcFolder.getPages().iterator();
-        while (pages.hasNext())
+        for (Node srcPageNode : srcFolder.getPages())
         {
-            Page srcPage = (Page)pages.next();
+            Page srcPage = (Page)srcPageNode;
             String path = concatenatePaths(destinationPath, srcPage.getName());
             if (!pageManager.pageExists(path))
             {
                 Page dstPage = pageManager.copyPage(srcPage, path);
                 pageManager.updatePage(dstPage);
             }
-        }     
-        Iterator pageTemplates = srcFolder.getPageTemplates().iterator();
-        while (pageTemplates.hasNext())
+        }
+        for (Node srcPageTemplateNode : srcFolder.getPageTemplates())
         {
-            PageTemplate srcPageTemplate = (PageTemplate)pageTemplates.next();
+            PageTemplate srcPageTemplate = (PageTemplate)srcPageTemplateNode;
             String path = concatenatePaths(destinationPath, srcPageTemplate.getName());
             if (!pageManager.pageTemplateExists(path))
             {
                 PageTemplate dstPageTemplate = pageManager.copyPageTemplate(srcPageTemplate, path);
                 pageManager.updatePageTemplate(dstPageTemplate);
             }
-        }     
-        Iterator dynamicPages = srcFolder.getDynamicPages().iterator();
-        while (dynamicPages.hasNext())
+        }
+        for (Node srcDynamicPageNode : srcFolder.getDynamicPages())
         {
-            DynamicPage srcDynamicPage = (DynamicPage)dynamicPages.next();
+            DynamicPage srcDynamicPage = (DynamicPage)srcDynamicPageNode;
             String path = concatenatePaths(destinationPath, srcDynamicPage.getName());
             if (!pageManager.dynamicPageExists(path))
             {
                 DynamicPage dstDynamicPage = pageManager.copyDynamicPage(srcDynamicPage, path);
                 pageManager.updateDynamicPage(dstDynamicPage);
             }
-        }     
-        Iterator fragmentDefinitions = srcFolder.getFragmentDefinitions().iterator();
-        while (fragmentDefinitions.hasNext())
+        }
+        for (Node srcFragmentDefinitionNode : srcFolder.getFragmentDefinitions())
         {
-            FragmentDefinition srcFragmentDefinition = (FragmentDefinition)fragmentDefinitions.next();
+            FragmentDefinition srcFragmentDefinition = (FragmentDefinition)srcFragmentDefinitionNode;
             String path = concatenatePaths(destinationPath, srcFragmentDefinition.getName());
             if (!pageManager.fragmentDefinitionExists(path))
             {
@@ -165,11 +157,10 @@ public class PageManagerUtils
                 pageManager.updateFragmentDefinition(dstFragmentDefinition);
             }
         }
-        
-        Iterator links = srcFolder.getLinks().iterator();
-        while (links.hasNext())
+
+        for (Node srcLinkNode : srcFolder.getLinks())
         {
-            Link srcLink = (Link)links.next();
+            Link srcLink = (Link)srcLinkNode;
             String path = concatenatePaths(destinationPath, srcLink.getName());
             if (!pageManager.linkExists(path))
             {
@@ -177,11 +168,10 @@ public class PageManagerUtils
                 pageManager.updateLink(dstLink);
             }
         }
-        
-        Iterator folders = srcFolder.getFolders().iterator();
-        while (folders.hasNext())
+
+        for (Node srcFolderNode : srcFolder.getFolders())
         {
-            Folder folder = (Folder)folders.next();
+            Folder folder = (Folder)srcFolderNode;
             String newPath = concatenatePaths(destinationPath, folder.getName());
             if (!pageManager.folderExists(newPath))
             {
@@ -268,52 +258,46 @@ public class PageManagerUtils
         }
         pageManager.updateFolder(dstFolder);
         
-        Iterator pages = srcFolder.getPages().iterator();
-        while (pages.hasNext())
+        for (Node srcPageNode : srcFolder.getPages())
         {
-            Page srcPage = (Page)pages.next();
+            Page srcPage = (Page)srcPageNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcPage.getName());
             Page dstPage = pageManager.copyPage(srcPage, path, copyIds);
             pageManager.updatePage(dstPage);
         }
-        Iterator pageTemplates = srcFolder.getPageTemplates().iterator();
-        while (pageTemplates.hasNext())
+        for (Node srcPageTemplateNode : srcFolder.getPageTemplates())
         {
-            PageTemplate srcPageTemplate = (PageTemplate)pageTemplates.next();
+            PageTemplate srcPageTemplate = (PageTemplate)srcPageTemplateNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcPageTemplate.getName());
             PageTemplate dstPageTemplate = pageManager.copyPageTemplate(srcPageTemplate, path, copyIds);
             pageManager.updatePageTemplate(dstPageTemplate);
         }     
-        Iterator dynamicPages = srcFolder.getDynamicPages().iterator();
-        while (dynamicPages.hasNext())
+        for (Node srcDynamicPageNode : srcFolder.getDynamicPages())
         {
-            DynamicPage srcDynamicPage = (DynamicPage)dynamicPages.next();
+            DynamicPage srcDynamicPage = (DynamicPage)srcDynamicPageNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcDynamicPage.getName());
             DynamicPage dstDynamicPage = pageManager.copyDynamicPage(srcDynamicPage, path, copyIds);
             pageManager.updateDynamicPage(dstDynamicPage);
         }     
-        Iterator fragmentDefinitions = srcFolder.getFragmentDefinitions().iterator();
-        while (fragmentDefinitions.hasNext())
+        for (Node srcFragmentDefinitionNode : srcFolder.getFragmentDefinitions())
         {
-            FragmentDefinition srcFragmentDefinition = (FragmentDefinition)fragmentDefinitions.next();
+            FragmentDefinition srcFragmentDefinition = (FragmentDefinition)srcFragmentDefinitionNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcFragmentDefinition.getName());
             FragmentDefinition dstFragmentDefinition = pageManager.copyFragmentDefinition(srcFragmentDefinition, path, copyIds);
             pageManager.updateFragmentDefinition(dstFragmentDefinition);
         }     
      
-        Iterator links = srcFolder.getLinks().iterator();
-        while (links.hasNext())
+        for (Node srcLinkNode : srcFolder.getLinks())
         {
-            Link srcLink = (Link)links.next();
+            Link srcLink = (Link)srcLinkNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcLink.getName());
             Link dstLink = pageManager.copyLink(srcLink, path);
             pageManager.updateLink(dstLink);
         }
      
-        Iterator folders = srcFolder.getFolders().iterator();
-        while (folders.hasNext())
+        for (Node srcFolderNode : srcFolder.getFolders())
         {
-            Folder folder = (Folder)folders.next();
+            Folder folder = (Folder)srcFolderNode;
             String newPath = concatenatePaths(destinationPath, folder.getName()); 
             deepCopyFolder(pageManager, folder, newPath, null, copyIds);
         }        
@@ -356,10 +340,9 @@ public class PageManagerUtils
             }
             pageManager.updateFolder(dstFolder);
         }
-        Iterator pages = srcFolder.getPages().iterator();
-        while (pages.hasNext())
+        for (Node srcPageNode : srcFolder.getPages())
         {
-            Page srcPage = (Page)pages.next();
+            Page srcPage = (Page)srcPageNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcPage.getName());
             if (!pageManager.pageExists(path))
             {
@@ -367,10 +350,9 @@ public class PageManagerUtils
                 pageManager.updatePage(dstPage);
             }
         }
-        Iterator pageTemplates = srcFolder.getPageTemplates().iterator();
-        while (pageTemplates.hasNext())
+        for (Node srcPageTemplateNode : srcFolder.getPageTemplates())
         {
-            PageTemplate srcPageTemplate = (PageTemplate)pageTemplates.next();
+            PageTemplate srcPageTemplate = (PageTemplate)srcPageTemplateNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcPageTemplate.getName());
             if (!pageManager.pageTemplateExists(path))
             {
@@ -378,21 +360,19 @@ public class PageManagerUtils
                 pageManager.updatePageTemplate(dstPageTemplate);
             }
         }     
-        Iterator dynamicPages = srcFolder.getDynamicPages().iterator();
-        while (dynamicPages.hasNext())
+        for (Node srcDynamicPageNode : srcFolder.getDynamicPages())
         {
-            DynamicPage srcDynamicPage = (DynamicPage)dynamicPages.next();
+            DynamicPage srcDynamicPage = (DynamicPage)srcDynamicPageNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcDynamicPage.getName());
             if (!pageManager.dynamicPageExists(path))
             {
                 DynamicPage dstDynamicPage = pageManager.copyDynamicPage(srcDynamicPage, path, copyIds);
                 pageManager.updateDynamicPage(dstDynamicPage);
             }
-        }     
-        Iterator fragmentDefinitions = srcFolder.getFragmentDefinitions().iterator();
-        while (fragmentDefinitions.hasNext())
+        }
+        for (Node srcFragmentDefinitionNode : srcFolder.getFragmentDefinitions())
         {
-            FragmentDefinition srcFragmentDefinition = (FragmentDefinition)fragmentDefinitions.next();
+            FragmentDefinition srcFragmentDefinition = (FragmentDefinition)srcFragmentDefinitionNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcFragmentDefinition.getName());
             if (!pageManager.fragmentDefinitionExists(path))
             {
@@ -401,10 +381,9 @@ public class PageManagerUtils
             }
         }
      
-        Iterator links = srcFolder.getLinks().iterator();
-        while (links.hasNext())
+        for (Node srcLinkNode : srcFolder.getLinks())
         {
-            Link srcLink = (Link)links.next();
+            Link srcLink = (Link)srcLinkNode;
             String path = PageManagerUtils.concatenatePaths(destinationPath, srcLink.getName());
             if (!pageManager.linkExists(path))
             {            
@@ -413,10 +392,9 @@ public class PageManagerUtils
             }
         }
      
-        Iterator folders = srcFolder.getFolders().iterator();
-        while (folders.hasNext())
+        for (Node srcFolderNode : srcFolder.getFolders())
         {
-            Folder folder = (Folder)folders.next();
+            Folder folder = (Folder)srcFolderNode;
             String newPath = concatenatePaths(destinationPath, folder.getName()); 
             deepMergeFolder(pageManager, folder, newPath, null, copyIds);
         }        

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java Mon Mar 17 19:24:56 2014
@@ -16,8 +16,6 @@
  */
 package org.apache.jetspeed.page;
 
-import java.util.Iterator;
-
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
@@ -28,6 +26,7 @@ import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
+import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.tools.ToolsLogger;
 
 /**
@@ -248,10 +247,9 @@ public class PageSerializerImpl implemen
             dest.updateFolder(dstFolder);
             context.folderCount++;
         }
-        Iterator pages = srcFolder.getPages().iterator();
-        while (pages.hasNext())
+        for (Node srcPageNode : srcFolder.getPages())
         {
-            Page srcPage = (Page) pages.next();
+            Page srcPage = (Page) srcPageNode;
             Page dstPage = lookupPage(dest, srcPage.getPath());
             if (null != dstPage)
             {
@@ -276,10 +274,9 @@ public class PageSerializerImpl implemen
                 context.pageCount++;
             }
         }
-        Iterator pageTemplates = srcFolder.getPageTemplates().iterator();
-        while (pageTemplates.hasNext())
+        for (Node srcPageTemplateNode : srcFolder.getPageTemplates())
         {
-            PageTemplate srcPageTemplate = (PageTemplate) pageTemplates.next();
+            PageTemplate srcPageTemplate = (PageTemplate) srcPageTemplateNode;
             PageTemplate dstPageTemplate = lookupPageTemplate(dest, srcPageTemplate.getPath());
             if (null != dstPageTemplate)
             {
@@ -304,10 +301,9 @@ public class PageSerializerImpl implemen
                 context.pageCount++;
             }
         }
-        Iterator dynamicPages = srcFolder.getDynamicPages().iterator();
-        while (dynamicPages.hasNext())
+        for (Node srcDynamicPageNode : srcFolder.getDynamicPages())
         {
-            DynamicPage srcDynamicPage = (DynamicPage) dynamicPages.next();
+            DynamicPage srcDynamicPage = (DynamicPage) srcDynamicPageNode;
             DynamicPage dstDynamicPage = lookupDynamicPage(dest, srcDynamicPage.getPath());
             if (null != dstDynamicPage)
             {
@@ -332,10 +328,9 @@ public class PageSerializerImpl implemen
                 context.pageCount++;
             }
         }
-        Iterator fragmentDefinitions = srcFolder.getFragmentDefinitions().iterator();
-        while (fragmentDefinitions.hasNext())
+        for (Node srcFragmentDefinitionNode : srcFolder.getFragmentDefinitions())
         {
-            FragmentDefinition srcFragmentDefinition = (FragmentDefinition) fragmentDefinitions.next();
+            FragmentDefinition srcFragmentDefinition = (FragmentDefinition) srcFragmentDefinitionNode;
             FragmentDefinition dstFragmentDefinition = lookupFragmentDefinition(dest, srcFragmentDefinition.getPath());
             if (null != dstFragmentDefinition)
             {
@@ -360,10 +355,9 @@ public class PageSerializerImpl implemen
                 context.pageCount++;
             }
         }
-        Iterator links = srcFolder.getLinks().iterator();
-        while (links.hasNext())
+        for (Node srcLinkNode : srcFolder.getLinks())
         {
-            Link srcLink = (Link) links.next();
+            Link srcLink = (Link) srcLinkNode;
             Link dstLink = lookupLink(dest, srcLink.getPath());
             if (null != dstLink)
             {
@@ -389,10 +383,9 @@ public class PageSerializerImpl implemen
             }
         }
 
-        Iterator folders = srcFolder.getFolders().iterator();
-        while (folders.hasNext())
+        for (Node srcFolderNode : srcFolder.getFolders())
         {
-            Folder folder = (Folder) folders.next();
+            Folder folder = (Folder) srcFolderNode;
             processFolder(folder, dest, context);
         }
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java Mon Mar 17 19:24:56 2014
@@ -145,10 +145,8 @@ public class NodeSetImpl implements Node
     public NodeSet subset(String type)
     {
         NodeSetImpl subset = new NodeSetImpl(comparator);
-        Iterator nodeItr = iterator();
-        while (nodeItr.hasNext())
+        for (Node node : this)
         {
-            Node node = (Node) nodeItr.next();
             if (node.getType().equals(type))
             {
                 subset.add(node);
@@ -164,10 +162,8 @@ public class NodeSetImpl implements Node
     {
         Pattern pattern = getCachedPattern(regex);
         NodeSetImpl subset = new NodeSetImpl(comparator);
-        Iterator nodeItr = iterator();
-        while (nodeItr.hasNext())
+        for (Node node : this)
         {
-            Node node = (Node) nodeItr.next();
             if (pattern.matcher(node.getName()).matches())
             {
                 subset.add(node);
@@ -183,10 +179,8 @@ public class NodeSetImpl implements Node
     {
         Pattern pattern = getCachedPattern(regex);
         NodeSetImpl subset = new NodeSetImpl(comparator);
-        Iterator nodeItr = iterator();
-        while (nodeItr.hasNext())
+        for (Node node : this)
         {
-            Node node = (Node) nodeItr.next();
             if (!pattern.matcher(node.getName()).matches())
             {
                 subset.add(node);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java Mon Mar 17 19:24:56 2014
@@ -24,7 +24,6 @@ import org.apache.jetspeed.page.document
 import org.apache.jetspeed.util.ArgUtil;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -60,17 +59,15 @@ public class DocumentHandlerFactoryImpl 
         this.handlers = handlers;        
 
         // register this with handlers
-        Iterator handlersIter = handlers.values().iterator();
-        while (handlersIter.hasNext())
+        for (DocumentHandler handler : handlers.values())
         {
-            ((DocumentHandler)handlersIter.next()).setHandlerFactory(this);
+            handler.setHandlerFactory(this);
         }
     }
     
     public DocumentHandlerFactoryImpl()
     {
         this(new HashMap<String,DocumentHandler>());
-             
     }
 
     /**
@@ -208,10 +205,9 @@ public class DocumentHandlerFactoryImpl 
     public void shutdown()
     {
         // propagate to handlers        
-        Iterator handlersIter = handlers.values().iterator();
-        while (handlersIter.hasNext())
+        for (DocumentHandler handler : handlers.values())
         {
-            ((DocumentHandler)handlersIter.next()).shutdown();
+            handler.shutdown();
         }
     }    
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java Mon Mar 17 19:24:56 2014
@@ -20,7 +20,6 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FilenameFilter;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.slf4j.Logger;
@@ -324,17 +323,14 @@ public class FileSystemFolderHandler imp
         {
             // copy all folder nodes to remove
             List<Node> removeNodes = new ArrayList<Node>();
-            Iterator copyIter = folderImpl.getAllNodes().iterator();
-            while (copyIter.hasNext())
+            for (Node node : folderImpl.getAllNodes())
             {
-                removeNodes.add((Node)copyIter.next());
+                removeNodes.add(node);
             }
             
             // remove folder nodes
-            Iterator removeIter = removeNodes.iterator();
-            while (removeIter.hasNext())
+            for (Node node : removeNodes)
             {
-                Node node = (Node)removeIter.next();
                 if (node instanceof Folder)
                 {
                     // recursively remove folder
@@ -632,11 +628,9 @@ public class FileSystemFolderHandler imp
 
             // match recursively over matched folders
             path = path.substring(separatorIndex);
-            Iterator matchedFoldersIter = matchedFolders.iterator();
-            while (matchedFoldersIter.hasNext())
+            for (Node matchedFolder : matchedFolders)
             {
-                Folder matchedFolder = (Folder) matchedFoldersIter.next();
-                getNodes(matchedFolder, path, regexp, matched);
+                getNodes((Folder)matchedFolder, path, regexp, matched);
             }
             return;
         }
@@ -647,22 +641,19 @@ public class FileSystemFolderHandler imp
         if (regexp)
         {
             // get regexp matched nodes
-            Iterator addIter = ((FolderImpl)folder).getAllNodes().inclusiveSubset(nodePath).iterator();
-            while (addIter.hasNext())
+            for (Node matchedNode : ((FolderImpl)folder).getAllNodes().inclusiveSubset(nodePath))
             {
-                matched.add((Node) addIter.next());
+                matched.add(matchedNode);
             }
         }
         else
         {
             // get single matched node
-            Iterator findIter = ((FolderImpl)folder).getAllNodes().iterator();
-            while (findIter.hasNext())
+            for (Node findNode : ((FolderImpl)folder).getAllNodes())
             {
-                Node addNode = (Node) findIter.next();
-                if (addNode.getPath().equals(nodePath))
+                if (findNode.getPath().equals(nodePath))
                 {
-                    matched.add(addNode);
+                    matched.add(findNode);
                     break;
                 }
             }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeSetImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeSetImpl.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeSetImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeSetImpl.java Mon Mar 17 19:24:56 2014
@@ -160,10 +160,8 @@ public class NodeSetImpl implements Node
         {
             subset = new NodeSetImpl(resolveToPath, comparator);
 
-            Iterator nodeItr = nodes.values().iterator();
-            while (nodeItr.hasNext())
+            for (Node node : this)
             {
-                Node node = (Node) nodeItr.next();
                 if (node.getType().equals(type))
                 {
                     subset.add(node);
@@ -190,20 +188,17 @@ public class NodeSetImpl implements Node
      */
     public NodeSet exclusiveSubset( String regex )
     {
-        Iterator allNodes = nodes.entrySet().iterator();
         NodeSetImpl subset = new NodeSetImpl(resolveToPath, comparator);
-        final Pattern pattern = getPattern(regex);
-        while (allNodes.hasNext())
+        Pattern pattern = getPattern(regex);
+        for (Map.Entry<String,Node> entry : nodes.entrySet())
         {
-            Map.Entry entry = (Map.Entry) allNodes.next();
-            Node node = (Node) entry.getValue();
-            String key = (String) entry.getKey();
+            Node node = entry.getValue();
+            String key = entry.getKey();
             if (!matches(pattern, key) && !matches(pattern, node.getName()))
             {
                 subset.add(node);
             }
         }
-        
         return subset;
     }
 
@@ -218,20 +213,17 @@ public class NodeSetImpl implements Node
      */
     public NodeSet inclusiveSubset( String regex )
     {
-        Iterator allNodes = nodes.entrySet().iterator();
         NodeSetImpl subset = new NodeSetImpl(resolveToPath, comparator);
-        final Pattern pattern = getPattern(regex);
-        while (allNodes.hasNext())
+        Pattern pattern = getPattern(regex);
+        for (Map.Entry<String,Node> entry : nodes.entrySet())
         {
-            Map.Entry entry = (Map.Entry) allNodes.next();
-            String key = (String) entry.getKey();
-            Node node = (Node) entry.getValue();
+            String key = entry.getKey();
+            Node node = entry.getValue();
             if (matches(pattern, key) || matches(pattern, node.getName()))
             {
                 subset.add(node);
             }
         }
-        
         return subset;
     }
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java Mon Mar 17 19:24:56 2014
@@ -121,7 +121,6 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 /**
  * DatabasePageManager
@@ -1718,10 +1717,11 @@ public class DatabasePageManager extends
             Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pages != null)
             {
-                Iterator pagesIter = pages.iterator();
-                while (pagesIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<PageImpl> pageImpls = pages;
+                for (Page page : pageImpls)
                 {
-                    updatePage((Page)pagesIter.next());
+                    updatePage(page);
                 }
             }
 
@@ -1732,10 +1732,11 @@ public class DatabasePageManager extends
             Collection pageTemplates = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pageTemplates != null)
             {
-                Iterator pageTemplatesIter = pageTemplates.iterator();
-                while (pageTemplatesIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<PageTemplateImpl> pageTemplateImpls = pageTemplates;
+                for (PageTemplate pageTemplate : pageTemplateImpls)
                 {
-                    updatePageTemplate((PageTemplate)pageTemplatesIter.next());
+                    updatePageTemplate(pageTemplate);
                 }
             }
 
@@ -1746,10 +1747,11 @@ public class DatabasePageManager extends
             Collection dynamicPages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (dynamicPages != null)
             {
-                Iterator dynamicPagesIter = dynamicPages.iterator();
-                while (dynamicPagesIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<DynamicPageImpl> dynamicPageImpls = dynamicPages;
+                for (DynamicPage dynamicPage : dynamicPageImpls)
                 {
-                    updateDynamicPage((DynamicPage)dynamicPagesIter.next());
+                    updateDynamicPage(dynamicPage);
                 }
             }
 
@@ -1760,10 +1762,11 @@ public class DatabasePageManager extends
             Collection fragmentDefinitions = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (fragmentDefinitions != null)
             {
-                Iterator fragmentDefinitionsIter = fragmentDefinitions.iterator();
-                while (fragmentDefinitionsIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<FragmentDefinitionImpl> fragmentDefinitionImpls = fragmentDefinitions;
+                for (FragmentDefinition fragmentDefinition : fragmentDefinitionImpls)
                 {
-                    updateFragmentDefinition((FragmentDefinition)fragmentDefinitionsIter.next());
+                    updateFragmentDefinition(fragmentDefinition);
                 }
             }
 
@@ -1774,10 +1777,11 @@ public class DatabasePageManager extends
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (links != null)
             {
-                Iterator linksIter = links.iterator();
-                while (linksIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<LinkImpl> linkImpls = links;
+                for (Link link : linkImpls)
                 {
-                    updateLink((Link)linksIter.next());
+                    updateLink(link);
                 }
             }
 
@@ -1798,10 +1802,11 @@ public class DatabasePageManager extends
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (folders != null)
             {
-                Iterator foldersIter = folders.iterator();
-                while (foldersIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<FolderImpl> folderImpls = folders;
+                for (Folder folder : folderImpls)
                 {
-                    updateFolder((Folder)foldersIter.next(), true);
+                    updateFolder(folder, true);
                 }
             }
         }
@@ -1885,10 +1890,11 @@ public class DatabasePageManager extends
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (folders != null)
             {
-                Iterator foldersIter = folders.iterator();
-                while (foldersIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<FolderImpl> folderImpls = folders;
+                for (Folder folder : folderImpls)
                 {
-                    removeFolder((Folder)foldersIter.next());
+                    removeFolder(folder);
                 }
             }
 
@@ -1899,10 +1905,11 @@ public class DatabasePageManager extends
             Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pages != null)
             {
-                Iterator pagesIter = pages.iterator();
-                while (pagesIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<PageImpl> pageImpls = pages;
+                for (Page page : pageImpls)
                 {
-                    removePage((Page)pagesIter.next());
+                    removePage(page);
                 }
             }
 
@@ -1913,10 +1920,11 @@ public class DatabasePageManager extends
             Collection pageTemplates = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pageTemplates != null)
             {
-                Iterator pageTemplatesIter = pageTemplates.iterator();
-                while (pageTemplatesIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<PageTemplateImpl> pageTemplateImpls = pageTemplates;
+                for (PageTemplate pageTemplate : pageTemplateImpls)
                 {
-                    removePageTemplate((PageTemplate)pageTemplatesIter.next());
+                    removePageTemplate(pageTemplate);
                 }
             }
 
@@ -1927,10 +1935,11 @@ public class DatabasePageManager extends
             Collection dynamicPages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (dynamicPages != null)
             {
-                Iterator dynamicPagesIter = dynamicPages.iterator();
-                while (dynamicPagesIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<DynamicPageImpl> dynamicPageImpls = dynamicPages;
+                for (DynamicPage dynamicPage : dynamicPageImpls)
                 {
-                    removeDynamicPage((DynamicPage)dynamicPagesIter.next());
+                    removeDynamicPage(dynamicPage);
                 }
             }
 
@@ -1941,10 +1950,11 @@ public class DatabasePageManager extends
             Collection fragmentDefinitions = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (fragmentDefinitions != null)
             {
-                Iterator fragmentDefinitionsIter = fragmentDefinitions.iterator();
-                while (fragmentDefinitionsIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<FragmentDefinitionImpl> fragmentDefinitionImpls = fragmentDefinitions;
+                for (FragmentDefinition fragmentDefinition : fragmentDefinitionImpls)
                 {
-                    removeFragmentDefinition((FragmentDefinition)fragmentDefinitionsIter.next());
+                    removeFragmentDefinition(fragmentDefinition);
                 }
             }
 
@@ -1955,10 +1965,11 @@ public class DatabasePageManager extends
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (links != null)
             {
-                Iterator linksIter = links.iterator();
-                while (linksIter.hasNext())
+                @SuppressWarnings("unchecked")
+                Collection<LinkImpl> linkImpls = links;
+                for (Link link : linkImpls)
                 {
-                    removeLink((Link)linksIter.next());
+                    removeLink(link);
                 }
             }
 
@@ -2748,11 +2759,8 @@ public class DatabasePageManager extends
             {
                 if (GROUP_AND_ROLE_PROPERTY_SCOPES_ENABLED)
                 {
-                    Set<Principal> principals = subject.getPrincipals();
-                    Iterator principalsIter = principals.iterator();
-                    while (principalsIter.hasNext())
+                    for (Principal principal : subject.getPrincipals())
                     {
-                        Principal principal = (Principal)principalsIter.next();
                         String principalScope = null;
                         if (principal instanceof User)
                         {
@@ -2824,11 +2832,8 @@ public class DatabasePageManager extends
                 {
                     if (principalFragmentPropertyLists != null)
                     {                        
-                        Set<Principal> principals = subject.getPrincipals();
-                        Iterator principalsIter = principals.iterator();
-                        while (principalsIter.hasNext())
+                        for (Principal principal : subject.getPrincipals())
                         {
-                            Principal principal = (Principal)principalsIter.next();
                             String principalScope = null;
                             if (principal instanceof User)
                             {
@@ -2845,7 +2850,7 @@ public class DatabasePageManager extends
                             if (principalScope != null)
                             {
                                 String principalKey = getFragmentPropertyListPrincipalKey(principalScope, principal.getName());
-                                DatabasePageManagerCachedFragmentPropertyList principalFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)principalFragmentPropertyLists.get(principalKey);
+                                DatabasePageManagerCachedFragmentPropertyList principalFragmentPropertyList = principalFragmentPropertyLists.get(principalKey);
                                 List<FragmentProperty> principalFragmentProperties = filterPrincipalFragmentPropertyList(principalFragmentPropertyList, baseFragmentElementImpl);
                                 if (principalFragmentProperties != null)
                                 {
@@ -2875,10 +2880,8 @@ public class DatabasePageManager extends
                     // this should only happen before new objects are committed
                     // and here we are assuming that only the current user has
                     // access to the new objects
-                    Iterator sourceIter = transientList.iterator();
-                    while (sourceIter.hasNext())
+                    for (FragmentProperty sourceProperty : transientList)
                     {
-                        FragmentProperty sourceProperty = (FragmentProperty)sourceIter.next();
                         FragmentProperty targetProperty = list.getMatchingProperty(sourceProperty);
                         if (targetProperty != null)
                         {
@@ -2957,11 +2960,9 @@ public class DatabasePageManager extends
                 {
                     allProperties.addAll(removedProperties);                    
                 }
-                Iterator allPropertiesIter = allProperties.iterator();
-                while (allPropertiesIter.hasNext())
+                for (FragmentProperty property : allProperties)
                 {
-                    FragmentPropertyImpl property = (FragmentPropertyImpl)allPropertiesIter.next();
-                    property.setFragment(baseFragmentElementImpl);
+                    ((FragmentPropertyImpl)property).setFragment(baseFragmentElementImpl);
                     String propertyScope = property.getScope();
                     String propertyScopeValue = property.getScopeValue();
                     if (updateAllScopes || ((scope == null) && (propertyScope == null)) || ((scope != null) && scope.equals(propertyScope)))
@@ -3025,10 +3026,8 @@ public class DatabasePageManager extends
                 
                 // populate properties lists for cache updates and
                 // update persistent properties
-                Iterator propertiesIter = properties.iterator();
-                while (propertiesIter.hasNext())
+                for (FragmentProperty storeProperty : properties)
                 {
-                    FragmentPropertyImpl storeProperty = (FragmentPropertyImpl)propertiesIter.next();
                     String storePropertyScope = storeProperty.getScope();
                     String storePropertyScopeValue = storeProperty.getScopeValue();
                     if (updateAllScopes || ((scope == null) && (storePropertyScope == null)) || ((scope != null) && scope.equals(storePropertyScope)))
@@ -3036,7 +3035,7 @@ public class DatabasePageManager extends
                         // classify and decompose update into individual caches:
                         // allow update only if scoped properties list created above
                         // exists since the subject matching rules are checked there
-                        updateTransaction = (updateTransaction || (storeProperty.getIdentity() != 0));
+                        updateTransaction = (updateTransaction || (((FragmentPropertyImpl)storeProperty).getIdentity() != 0));
                         boolean store = false;
                         if (storePropertyScope == null)
                         {
@@ -3068,11 +3067,9 @@ public class DatabasePageManager extends
                 }
                 if (removedProperties != null)
                 {
-                    Iterator removedPropertiesIter = removedProperties.iterator();
-                    while (removedPropertiesIter.hasNext())
+                    for (FragmentProperty deleteProperty : removedProperties)
                     {
-                        FragmentPropertyImpl deleteProperty = (FragmentPropertyImpl)removedPropertiesIter.next();
-                        deleteProperty.setFragment(baseFragmentElementImpl);
+                        ((FragmentPropertyImpl)deleteProperty).setFragment(baseFragmentElementImpl);
                         String deletePropertyScope = deleteProperty.getScope();
                         String deletePropertyScopeValue = deleteProperty.getScopeValue();
                         if (updateAllScopes || ((scope == null) && (deletePropertyScope == null)) || ((scope != null) && scope.equals(deletePropertyScope)))
@@ -3114,12 +3111,10 @@ public class DatabasePageManager extends
                 if (principalPartialFragmentPropertyLists != null)
                 {
                     // update cached principal scoped fragment property lists
-                    Iterator listsIter = principalPartialFragmentPropertyLists.entrySet().iterator();
-                    while (listsIter.hasNext())
+                    for (Map.Entry<String,DatabasePageManagerCachedFragmentPropertyList> entry : principalPartialFragmentPropertyLists.entrySet())
                     {
-                        Map.Entry entry = (Map.Entry)listsIter.next();
-                        String principalKey = (String)entry.getKey();
-                        DatabasePageManagerCachedFragmentPropertyList principalPartialFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)entry.getValue();
+                        String principalKey = entry.getKey();
+                        DatabasePageManagerCachedFragmentPropertyList principalPartialFragmentPropertyList = entry.getValue();
                         // update cached principal scoped fragment property list
                         DatabasePageManagerCachedFragmentPropertyList cachedPrincipalFragmentPropertyList = DatabasePageManagerCache.principalFragmentPropertyListCacheLookup(principalKey);
                         if (cachedPrincipalFragmentPropertyList != null)
@@ -3232,10 +3227,9 @@ public class DatabasePageManager extends
         List<FragmentProperty> filteredList = null;
         synchronized (principalFragmentPropertyList)
         {
-            for (Iterator iter = principalFragmentPropertyList.iterator(); iter.hasNext();)
+            for (FragmentProperty fragmentProperty : principalFragmentPropertyList)
             {
-                FragmentPropertyImpl fragmentProperty = (FragmentPropertyImpl)iter.next();
-                if (((BaseFragmentElementImpl)fragmentProperty.getFragment()).getIdentity() == baseFragmentElementImpl.getIdentity())
+                if (((BaseFragmentElementImpl)((FragmentPropertyImpl)fragmentProperty).getFragment()).getIdentity() == baseFragmentElementImpl.getIdentity())
                 {
                     if (filteredList == null)
                     {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java Mon Mar 17 19:24:56 2014
@@ -21,6 +21,7 @@ import org.apache.jetspeed.cache.Jetspee
 import org.apache.jetspeed.cache.JetspeedCacheEventListener;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.impl.FolderImpl;
+import org.apache.jetspeed.om.page.FragmentProperty;
 import org.apache.jetspeed.om.page.impl.BaseFragmentElementImpl;
 import org.apache.jetspeed.om.page.impl.FragmentPropertyImpl;
 import org.apache.jetspeed.page.PageManager;
@@ -34,7 +35,6 @@ import org.slf4j.LoggerFactory;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -231,10 +231,8 @@ public class DatabasePageManagerCache im
                             {
                                 // remove all indexed fragment keys, (copy first since "quiet" removes
                                 // from fragment property caches will side effect this set while iterating)
-                                Iterator fragmentKeyIter = (new ArrayList<String>(index)).iterator();
-                                while (fragmentKeyIter.hasNext())
+                                for (String fragmentKey : (new ArrayList<String>(index)))
                                 {
-                                    String fragmentKey = (String)fragmentKeyIter.next();
                                     // parse key to extract fragment id
                                     int fragmentId = getFragmentIdFromFragmentKey(fragmentKey);
                                     // remove principal fragment property list caches that have fragment properties
@@ -338,10 +336,8 @@ public class DatabasePageManagerCache im
                         if (index != null)
                         {
                             // remove all indexed cache keys
-                            Iterator fragmentKeyIter = index.iterator();
-                            while (fragmentKeyIter.hasNext())
+                            for (String fragmentKey : index)
                             {
-                                String fragmentKey = (String)fragmentKeyIter.next();
                                 DatabasePageManagerCache.propertiesCache.removeQuiet(fragmentKey);
                             }
                             propertiesCacheIndexMap.remove(fragmentKeyOrPath);
@@ -502,20 +498,16 @@ public class DatabasePageManagerCache im
         // scan principal fragment property cache
         @SuppressWarnings("unchecked")
         List<String> principalKeys = principalPropertiesCache.getKeys();
-        Iterator principalKeysIter = principalKeys.iterator();
-        while (principalKeysIter.hasNext())
+        for (String principalKey : principalKeys)
         {
-            String principalKey = (String)principalKeysIter.next();
             CacheElement propertiesElement = principalPropertiesCache.get(principalKey);
             if (propertiesElement != null)
             {
                 // scan cached principal fragment property list
                 DatabasePageManagerCachedFragmentPropertyList cachedPrincipalFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)propertiesElement.getContent();
-                Iterator fragmentPropertyIter = cachedPrincipalFragmentPropertyList.iterator();
-                while (fragmentPropertyIter.hasNext())
+                for (FragmentProperty fragmentProperty : cachedPrincipalFragmentPropertyList)
                 {
-                    FragmentPropertyImpl fragmentProperty = (FragmentPropertyImpl)fragmentPropertyIter.next();
-                    if (((BaseFragmentElementImpl)fragmentProperty.getFragment()).getIdentity() == fragmentId)
+                    if (((BaseFragmentElementImpl)((FragmentPropertyImpl)fragmentProperty).getFragment()).getIdentity() == fragmentId)
                     {
                         // remove cached principal fragment property list
                         DatabasePageManagerCache.principalPropertiesCache.removeQuiet(principalKey);
@@ -647,39 +639,33 @@ public class DatabasePageManagerCache im
         // remove all items from oid and properties caches
         // individually to ensure notifications are run to
         // detach elements; do not invoke JetspeedCache.clear()
-        Iterator removeOidIter = oidCache.getKeys().iterator();
-        while (removeOidIter.hasNext())
+        for (Object remove : oidCache.getKeys())
         {
-            oidCache.remove((Identity)removeOidIter.next());
+            oidCache.remove((Identity)remove);
         }
-        Iterator removePropertiesIter = propertiesCache.getKeys().iterator();
-        while (removePropertiesIter.hasNext())
+        for (Object remove : propertiesCache.getKeys())
         {
-            propertiesCache.remove(removePropertiesIter.next());
+            propertiesCache.remove(remove);
         }
-        Iterator removePrincipalPropertiesIter = principalPropertiesCache.getKeys().iterator();
-        while (removePrincipalPropertiesIter.hasNext())
+        for (Object remove : principalPropertiesCache.getKeys())
         {
-            principalPropertiesCache.remove(removePrincipalPropertiesIter.next());
+            principalPropertiesCache.remove(remove);
         }
         // remove all items from path caches individually
         // to avoid potential distributed clear invocation
         // that would be performed against all peers; do
         // not invoke JetspeedCache.clear()
-        Iterator removePathIter = pathCache.getKeys().iterator();
-        while (removePathIter.hasNext())
+        for (Object remove : pathCache.getKeys())
         {
-            pathCache.removeQuiet(removePathIter.next());
+            pathCache.removeQuiet(remove);
         }
-        Iterator removePropertiesPathIter = propertiesPathCache.getKeys().iterator();
-        while (removePropertiesPathIter.hasNext())
+        for (Object remove : propertiesPathCache.getKeys())
         {
-            propertiesPathCache.removeQuiet(removePropertiesPathIter.next());
+            propertiesPathCache.removeQuiet(remove);
         }
-        Iterator removePrincipalPropertiesPathIter = principalPropertiesPathCache.getKeys().iterator();
-        while (removePrincipalPropertiesPathIter.hasNext())
+        for (Object remove : principalPropertiesPathCache.getKeys())
         {
-            principalPropertiesPathCache.removeQuiet(removePrincipalPropertiesPathIter.next());
+            principalPropertiesPathCache.removeQuiet(remove);
         }
     }
 
@@ -818,10 +804,9 @@ public class DatabasePageManagerCache im
     public synchronized static void resetCachedSecurityConstraints()
     {
         // reset cached objects
-        Iterator resetIter = oidCache.getKeys().iterator();
-        while (resetIter.hasNext())
+        for (Object reset : oidCache.getKeys())
         {
-            NodeImpl node = cacheLookup((Identity)resetIter.next(), false);
+            NodeImpl node = cacheLookup((Identity)reset, false);
             if (node != null)
             {
             	node.resetCachedSecurityConstraints();
@@ -1033,10 +1018,8 @@ public class DatabasePageManagerCache im
      */
     public synchronized static void rollbackTransactions()
     {
-        Iterator transactions = getTransactions().iterator();
-        while (transactions.hasNext())
+        for (TransactionedOperation operation : getTransactions())
         {
-            TransactionedOperation operation = (TransactionedOperation)transactions.next();
             if ((operation.getTransactionType() == TransactionedOperation.ADD_OPERATION) ||
                 (operation.getTransactionType() == TransactionedOperation.UPDATE_OPERATION))
             {
@@ -1131,10 +1114,9 @@ public class DatabasePageManagerCache im
     {
         StringBuilder dump = new StringBuilder();
         dump.append("--------------------------"+EOL);
-        Iterator dumpIter = oidCache.getKeys().iterator();
-        while (dumpIter.hasNext())
+        for (Object dumpOid : oidCache.getKeys())
         {
-            Identity oid = (Identity)dumpIter.next();
+            Identity oid = (Identity)dumpOid;
             NodeImpl node = cacheLookup(oid, false);
             dump.append("node="+node.getPath()+", oid="+oid+EOL);
         }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java Mon Mar 17 19:24:56 2014
@@ -81,7 +81,6 @@ import java.io.FileNotFoundException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -257,7 +256,7 @@ public class CastorXmlPageManager extend
      * updatePage
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
+     * @see org.apache.jetspeed.page.PageManager#updatePage(org.apache.jetspeed.om.page.Page)
      */
     public void updatePage(Page page) throws NodeException
     {
@@ -270,7 +269,7 @@ public class CastorXmlPageManager extend
      * updatePageTemplate
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updatePageTemplate(org.apache.jetspeed.om.page.PageTemplate)
+     * @see org.apache.jetspeed.page.PageManager#updatePageTemplate(org.apache.jetspeed.om.page.PageTemplate)
      */
     public void updatePageTemplate(PageTemplate pageTemplate) throws NodeException
     {
@@ -283,7 +282,7 @@ public class CastorXmlPageManager extend
      * updateDynamicPage
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updateDynamicPage(org.apache.jetspeed.om.page.DynamicPage)
+     * @see org.apache.jetspeed.page.PageManager#updateDynamicPage(org.apache.jetspeed.om.page.DynamicPage)
      */
     public void updateDynamicPage(DynamicPage dynamicPage) throws NodeException
     {
@@ -296,7 +295,7 @@ public class CastorXmlPageManager extend
      * updateFragmentDefinition
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updateFragmentDefinition(org.apache.jetspeed.om.page.FragmentDefinition)
+     * @see org.apache.jetspeed.page.PageManager#updateFragmentDefinition(org.apache.jetspeed.om.page.FragmentDefinition)
      */
     public void updateFragmentDefinition(FragmentDefinition fragmentDefinition) throws NodeException
     {
@@ -432,7 +431,7 @@ public class CastorXmlPageManager extend
      * removePage
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#removePage(org.apache.jetspeed.om.page.Page)
+     * @see org.apache.jetspeed.page.PageManager#removePage(org.apache.jetspeed.om.page.Page)
      */
     public void removePage(Page page) throws NodeException
     {
@@ -445,7 +444,7 @@ public class CastorXmlPageManager extend
      * removePageTemplate
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#removePageTemplate(org.apache.jetspeed.om.page.PageTemplate)
+     * @see org.apache.jetspeed.page.PageManager#removePageTemplate(org.apache.jetspeed.om.page.PageTemplate)
      */
     public void removePageTemplate(PageTemplate pageTemplate) throws NodeException
     {
@@ -458,7 +457,7 @@ public class CastorXmlPageManager extend
      * removeDynamicPage
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#removeDynamicPage(org.apache.jetspeed.om.page.DynamicPage)
+     * @see org.apache.jetspeed.page.PageManager#removeDynamicPage(org.apache.jetspeed.om.page.DynamicPage)
      */
     public void removeDynamicPage(DynamicPage dynamicPage) throws NodeException
     {
@@ -471,7 +470,7 @@ public class CastorXmlPageManager extend
      * removeFragmentDefinition
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#removeFragmentDefinition(org.apache.jetspeed.om.page.FragmentDefinition)
+     * @see org.apache.jetspeed.page.PageManager#removeFragmentDefinition(org.apache.jetspeed.om.page.FragmentDefinition)
      */
     public void removeFragmentDefinition(FragmentDefinition fragmentsDefinition) throws NodeException
     {
@@ -547,7 +546,7 @@ public class CastorXmlPageManager extend
      * updateLink
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updateLink(org.apache.jetspeed.om.page.Link)
+     * @see org.apache.jetspeed.page.PageManager#updateLink(org.apache.jetspeed.om.page.Link)
      */
     public void updateLink(Link link) throws NodeException
     {
@@ -627,7 +626,7 @@ public class CastorXmlPageManager extend
      * removeLink
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#removeLink(org.apache.jetspeed.om.page.Link)
+     * @see org.apache.jetspeed.page.PageManager#removeLink(org.apache.jetspeed.om.page.Link)
      */
     public void removeLink(Link link) throws NodeException
     {
@@ -964,7 +963,7 @@ public class CastorXmlPageManager extend
      * updateFolder
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#updateFolder(org.apache.jetspeed.om.folder.Folder)
+     * @see org.apache.jetspeed.page.PageManager#updateFolder(org.apache.jetspeed.om.folder.Folder)
      */
     public void updateFolder(Folder folder) throws NodeException, FolderNotUpdatedException
     {
@@ -1069,7 +1068,7 @@ public class CastorXmlPageManager extend
      * updateFolderNodes - recursively update all folder nodes
      *
      * @param folderImpl folder whose nodes are to be updated
-     * @param throws FolderNotUpdatedException
+     * @throws FolderNotUpdatedException
      */
     private void updateFolderNodes(FolderImpl folderImpl) throws FolderNotUpdatedException
     {
@@ -1077,10 +1076,8 @@ public class CastorXmlPageManager extend
         {
             // update folder documents
             NodeSet nodes = folderImpl.getAllNodes();
-            Iterator nodesIter = nodes.iterator();
-            while (nodesIter.hasNext())
+            for (Node node : nodes)
             {
-                Node node = (Node) nodesIter.next();
                 if (node instanceof Page)
                 {
                     updatePage((Page)node);
@@ -1108,10 +1105,8 @@ public class CastorXmlPageManager extend
             }
 
             // update folders last: breadth first recursion
-            nodesIter = nodes.iterator();
-            while (nodesIter.hasNext())
+            for (Node node : nodes)
             {
-                Node node = (Node) nodesIter.next();
                 if (node instanceof Folder)
                 {
                     updateFolder((Folder)node, true);
@@ -1137,7 +1132,7 @@ public class CastorXmlPageManager extend
      * removeFolder
      * </p>
      * 
-     * @see org.apache.jetspeed.services.page.PageManagerService#removeFolder(org.apache.jetspeed.om.folder.Folder)
+     * @see org.apache.jetspeed.page.PageManager#removeFolder(org.apache.jetspeed.om.folder.Folder)
      */
     public void removeFolder(Folder folder) throws NodeException
     {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/util/ojb/ACLFieldConversion.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/util/ojb/ACLFieldConversion.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/util/ojb/ACLFieldConversion.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/util/ojb/ACLFieldConversion.java Mon Mar 17 19:24:56 2014
@@ -20,7 +20,6 @@ import org.apache.ojb.broker.accesslayer
 import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
 
@@ -47,10 +46,8 @@ public class ACLFieldConversion implemen
             if (csvList.size() > 1)
             {
                 StringBuffer buffer = null;
-                Iterator values = csvList.iterator();
-                while (values.hasNext())
+                for (String value : csvList)
                 {
-                    String value = (String)values.next();
                     if (value.length() > 0)
                     {
                         if (buffer == null)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/om/page/TestPageObjectModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/om/page/TestPageObjectModel.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/om/page/TestPageObjectModel.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/om/page/TestPageObjectModel.java Mon Mar 17 19:24:56 2014
@@ -17,15 +17,14 @@
 package org.apache.jetspeed.om.page;
 
 // Java imports
-import java.util.Iterator;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-
 import org.apache.jetspeed.om.page.psml.FragmentImpl;
 import org.apache.jetspeed.om.page.psml.PageImpl;
 
+import java.util.Iterator;
+
 /**
  * TestMarshalPsml
  *
@@ -134,7 +133,7 @@ public class TestPageObjectModel extends
 
         //Check the construct
         assertTrue(root.getFragments().size()==2);
-        Iterator i = root.getFragments().iterator();
+        Iterator<BaseFragmentElement> i = root.getFragments().iterator();
         FragmentImpl f = (FragmentImpl)i.next();
         assertNotNull(f);
         assertTrue(f.getName().equals("Portlet1"));

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java Mon Mar 17 19:24:56 2014
@@ -82,7 +82,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -223,14 +222,13 @@ public interface PageManagerTestShared
             if ((list != null) && !list.isEmpty())
             {
                 StringBuffer csv = new StringBuffer();
-                Iterator listIter = list.iterator();
-                while (listIter.hasNext())
+                for (String item : list)
                 {
                     if (csv.length() > 0)
                     {
                         csv.append(",");
                     }
-                    csv.append(listIter.next());
+                    csv.append(item);
                 }
                 return csv.toString();
             }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java Mon Mar 17 19:24:56 2014
@@ -45,6 +45,7 @@ import org.apache.jetspeed.om.portlet.Ge
 import org.apache.jetspeed.om.portlet.LocalizedField;
 import org.apache.jetspeed.om.preference.FragmentPreference;
 import org.apache.jetspeed.page.document.DocumentNotFoundException;
+import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.psml.CastorXmlPageManager;
 import org.apache.jetspeed.security.JSSubject;
 import org.apache.jetspeed.security.PrincipalsSet;
@@ -965,12 +966,10 @@ public class TestCastorXmlPageManager ex
         Folder subsites = pageManager.getFolder("/subsites");
         assertNotNull(subsites);
 
-        Iterator ssi = subsites.getFolders().iterator();
-        assertTrue(ssi.hasNext());
         int count = 0;
-        while (ssi.hasNext())
+        for (Node folderNode : subsites.getFolders())
         {
-            Folder folder = (Folder)ssi.next();
+            Folder folder = (Folder)folderNode;
             System.out.println("folder = " + folder.getName());
             count++;
         }
@@ -989,7 +988,7 @@ public class TestCastorXmlPageManager ex
                 
         assertEquals(2, folder1.getFolders().size());
         assertEquals(2, pageManager.getFolders(folder1).size());
-        Iterator childItr = folder1.getFolders().iterator();
+        Iterator<Node> childItr = folder1.getFolders().iterator();
         // Test that the folders are naturally orderd
         Folder folder2 = (Folder) childItr.next();
         assertEquals("/folder1/folder2", folder2.getPath());
@@ -1009,7 +1008,7 @@ public class TestCastorXmlPageManager ex
         // Check link order
         assertEquals(6, folder3.getAll().size());
         assertEquals(6, pageManager.getAll(folder3).size());
-        Iterator linkItr = folder3.getAll().iterator();
+        Iterator<Node> linkItr = folder3.getAll().iterator();
         assertEquals("Jetspeed2Wiki.link", ((Link)linkItr.next()).getName());
         assertEquals("Jetspeed2.link", ((Link)linkItr.next()).getName());        
         assertEquals("apache_portals.link", ((Link)linkItr.next()).getName());
@@ -1622,18 +1621,16 @@ public class TestCastorXmlPageManager ex
     public Collection<String> collectIds(Folder f) throws Exception {
         Collection<String> result = new ArrayList<String>();
         
-        for (Iterator iter = f.getAll().iterator(); iter.hasNext();)
+        for (Node node : f.getAll())
         {
-           Object obj = iter.next();
-           
-           if (obj instanceof Page){
-               Page thisPage = (Page) obj;
+           if (node instanceof Page){
+               Page thisPage = (Page) node;
                if (thisPage.getRootFragment()!=null){
                    result.addAll(collectIds(thisPage.getRootFragment()));    
                }                          
            } else
-           if (obj instanceof Folder){
-               Folder thisFolder = (Folder)obj;
+           if (node instanceof Folder){
+               Folder thisFolder = (Folder)node;
                result.addAll(collectIds(thisFolder));
            }            
         }   
@@ -1648,8 +1645,7 @@ public class TestCastorXmlPageManager ex
     	if (bf instanceof Fragment) {
     	    Fragment f = (Fragment)bf;
     	    if (f.getFragments().size() > 0){
-    	        for (Iterator iter = f.getFragments().iterator(); iter.hasNext();) {
-    	            BaseFragmentElement child = (BaseFragmentElement) iter.next();
+                for (BaseFragmentElement child : f.getFragments()) {
     	            result.addAll(collectIds(child));
     	        }
     	    }
@@ -1661,9 +1657,8 @@ public class TestCastorXmlPageManager ex
         int result = 1;
         if (bf instanceof Fragment) {
             Fragment f = (Fragment)bf;
-            for (Iterator iter = f.getFragments().iterator(); iter.hasNext();)
-            {
-                result+=countFragments((BaseFragmentElement)iter.next());
+            for (BaseFragmentElement child : f.getFragments()) {
+                result+=countFragments(child);
             }
         }
         
@@ -1671,12 +1666,10 @@ public class TestCastorXmlPageManager ex
     }
     
     private void compareFolders(Folder folder1, Folder folder2) throws Exception {
-        for (Iterator iter = folder1.getAll().iterator(); iter.hasNext();)
+        for (Node node : folder1.getAll())
         {
-           Object obj = iter.next();
-           
-           if (obj instanceof Page){
-               Page thisPage = (Page) obj;
+           if (node instanceof Page){
+               Page thisPage = (Page) node;
                Page otherPage = folder2.getPage(thisPage.getName());
                assertEquals(thisPage.getRootFragment()!=null,otherPage.getRootFragment() != null);
                if (thisPage.getRootFragment() != null){
@@ -1689,8 +1682,8 @@ public class TestCastorXmlPageManager ex
                    assertEquals(countFragments(thisRootFragment),countFragments(otherRootFragment));
                }               
            } else
-           if (obj instanceof Folder){
-               Folder thisFolder = (Folder)obj;
+           if (node instanceof Folder){
+               Folder thisFolder = (Folder)node;
                compareFolders(thisFolder, folder2.getFolder(thisFolder.getName())); 
            }
             
@@ -1702,10 +1695,9 @@ public class TestCastorXmlPageManager ex
         Folder webappNoIds = pageManager.getFolder("/webapp-no-ids");
         
         compareFolders(webappIds,webappNoIds);
-        
+
         Collection<String> allIds = collectIds(webappNoIds);
-        for (Iterator iter = allIds.iterator(); iter.hasNext();) {
-			String id = (String) iter.next();
+        for (String id : allIds) {
 			assertNotNull(id);
 			assertEquals(true,id.length() > 0);
             if (CollectionUtils.cardinality(id, allIds) > 1){

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java Mon Mar 17 19:24:56 2014
@@ -645,7 +645,7 @@ public class TestDatabasePageManager ext
         assertEquals(9, folder.getAll().size());
         assertNotNull(pageManager.getAll(folder));
         assertEquals(9, pageManager.getAll(folder).size());
-        Iterator all = folder.getAll().iterator();
+        Iterator<Node> all = folder.getAll().iterator();
         assertEquals("some-other-page.psml", ((Node)all.next()).getName());
         assertEquals("default-page.psml", ((Node)all.next()).getName());
         assertEquals("__subsite-rootx", ((Node)all.next()).getName());
@@ -1032,7 +1032,7 @@ public class TestDatabasePageManager ext
             assertEquals(1, check.getFolders().size());
             assertNotNull(check.getAll());
             assertEquals(9, check.getAll().size());
-            Iterator all = check.getAll().iterator();
+            Iterator<Node> all = check.getAll().iterator();
             assertEquals("some-other-page.psml", ((Node)all.next()).getName());
             assertEquals("default-page.psml", ((Node)all.next()).getName());
             assertEquals("__subsite-rootx", ((Node)all.next()).getName());
@@ -1152,10 +1152,8 @@ public class TestDatabasePageManager ext
         assertEquals("/default-page.psml", page.getPath());
         page.setTitle("UPDATED");
         FragmentProperty removeProperty = null;
-        Iterator propertyIter = page.getRootFragment().getProperties().iterator();
-        while (propertyIter.hasNext())
+        for (FragmentProperty property : page.getRootFragment().getProperties())
         {
-            FragmentProperty property = (FragmentProperty)propertyIter.next();
             if (property.getName().equals("custom-prop1"))
             {
                 removeProperty = property;
@@ -1222,7 +1220,7 @@ public class TestDatabasePageManager ext
         pageManager.updateFolder(folder);
         assertNotNull(folder.getAll());
         assertEquals(9, folder.getAll().size());
-        Iterator all = folder.getAll().iterator();
+        Iterator<Node> all = folder.getAll().iterator();
         assertEquals("default-page.psml", ((Node)all.next()).getName());
         assertEquals("some-other-page.psml", ((Node)all.next()).getName());
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java?rev=1578526&r1=1578525&r2=1578526&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java Mon Mar 17 19:24:56 2014
@@ -16,10 +16,7 @@
  */
 package org.apache.jetspeed.page;
 
-import java.util.Iterator;
-
 import junit.framework.TestCase;
-
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.preference.FragmentPreference;
 import org.exolab.castor.mapping.Mapping;
@@ -49,9 +46,7 @@ public class TestMappings extends TestCa
         
         assertEquals("Google", pref.getName());
         assertEquals(false, pref.isReadOnly());
-        Iterator itr = pref.getValueList().iterator();
-        String value = (String)itr.next();
-        assertEquals("http://www.google.com", value );
+        assertEquals("http://www.google.com", pref.getValueList().get(0));
 
     }
 }



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