portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r1577887 [4/5] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/impl/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/psml/ components/jetspeed-...
Date Sat, 15 Mar 2014 15:59:19 GMT
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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -16,6 +16,10 @@
  */
 package org.apache.jetspeed.page.document.impl;
 
+import org.apache.commons.collections.map.LRUMap;
+import org.apache.jetspeed.page.document.Node;
+import org.apache.jetspeed.page.document.NodeSet;
+
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -23,10 +27,6 @@ import java.util.Map;
 import java.util.TreeMap;
 import java.util.regex.Pattern;
 
-import org.apache.commons.collections.map.LRUMap;
-import org.apache.jetspeed.page.document.Node;
-import org.apache.jetspeed.page.document.NodeSet;
-
 /**
  * NodeSetImpl
  *
@@ -37,18 +37,19 @@ public class NodeSetImpl implements Node
 {
     public static final NodeSetImpl EMPTY_NODE_SET = new NodeSetImpl();
 
-    private static final Map patternCache = new LRUMap(128);
+    @SuppressWarnings("unchecked")
+    private static final Map<String,Pattern> patternCache = new LRUMap(128);
 
-    private Map nodes;
-    private Comparator comparator;
+    private Map<String,Node> nodes;
+    private Comparator<String> comparator;
 
-    public NodeSetImpl(List nodes, Comparator comparator)
+    public NodeSetImpl(List<? extends Node> nodes, Comparator<String> comparator)
     {
-        this.nodes = new TreeMap(comparator);        
-        Object[] nodeToCopy = nodes.toArray();
+        this.nodes = new TreeMap<String,Node>(comparator);
+        Node[] nodeToCopy = nodes.toArray(new Node[nodes.size()]);
         for (int ix = 0; ix < nodeToCopy.length; ix++)
         {
-            Node node = (Node)nodeToCopy[ix];
+            Node node = nodeToCopy[ix];
             if (!this.nodes.containsKey( node.getName()))
             {
                 this.nodes.put(node.getName(), node);
@@ -57,19 +58,19 @@ public class NodeSetImpl implements Node
         this.comparator = comparator;
     }
 
-    public NodeSetImpl(List nodes)
+    public NodeSetImpl(List<? extends Node> nodes)
     {
         this(nodes, null);
     }
 
-    public NodeSetImpl(Comparator comparator)
+    public NodeSetImpl(Comparator<String> comparator)
     {
         this.comparator = comparator;
     }
 
     public NodeSetImpl(NodeSet nodeSet)
     {
-        this((nodeSet instanceof NodeSetImpl) ? ((NodeSetImpl)nodeSet).comparator : (Comparator)null);
+        this((nodeSet instanceof NodeSetImpl) ? ((NodeSetImpl)nodeSet).comparator : null);
     }
 
     public NodeSetImpl()
@@ -88,7 +89,7 @@ public class NodeSetImpl implements Node
         {
             if (patternCache.containsKey(regex))
             {
-                return (Pattern)patternCache.get(regex);
+                return patternCache.get(regex);
             }
             else
             {
@@ -106,7 +107,7 @@ public class NodeSetImpl implements Node
     {
         if (nodes == null)
         {
-            nodes = new TreeMap(comparator);
+            nodes = new TreeMap<String,Node>(comparator);
         }
         if (!nodes.containsKey(node.getName()))
         {
@@ -121,7 +122,7 @@ public class NodeSetImpl implements Node
     {
         if (nodes != null)
         {
-            return (Node)nodes.get(name);
+            return nodes.get(name);
         }
         return null;
     }
@@ -129,11 +130,11 @@ public class NodeSetImpl implements Node
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.document.NodeSet#iterator()
      */
-    public Iterator iterator()
+    public Iterator<Node> iterator()
     {
         if (nodes == null)
         {
-            nodes = new TreeMap(comparator);
+            nodes = new TreeMap<String,Node>(comparator);
         }
         return nodes.values().iterator();
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/AbstractNode.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/AbstractNode.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/AbstractNode.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/AbstractNode.java Sat Mar 15 15:59:17 2014
@@ -16,10 +16,6 @@
  */
 package org.apache.jetspeed.page.document.psml;
 
-import java.util.Collection;
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.idgenerator.IdGenerator;
 import org.apache.jetspeed.om.common.SecurityConstraints;
@@ -28,8 +24,13 @@ import org.apache.jetspeed.om.page.PageS
 import org.apache.jetspeed.om.page.psml.AbstractBaseElement;
 import org.apache.jetspeed.om.page.psml.SecurityConstraintsImpl;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
+import org.apache.jetspeed.om.portlet.LocalizedField;
 import org.apache.jetspeed.page.document.Node;
 
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+
 
 /**
  * <p>
@@ -83,7 +84,7 @@ public abstract class AbstractNode exten
      *
      * @return metadata fields collection
      */
-    public Collection getMetadataFields()
+    public Collection<LocalizedField> getMetadataFields()
     {
         // return metadata fields collection that
         // may in fact be side effected on unmarshall
@@ -95,7 +96,7 @@ public abstract class AbstractNode exten
      *
      * @param metadataFields metadata fields collection
      */
-    public void setMetadataFields(Collection metadataFields)
+    public void setMetadataFields(Collection<LocalizedField> metadataFields)
     {
         // set metadata fields collection that
         // may in fact be side effected after
@@ -394,7 +395,7 @@ public abstract class AbstractNode exten
      * @param checkParentsOnly
      * @throws SecurityException
      */
-    public void checkConstraints(List actions, List userPrincipals, List rolePrincipals, List groupPrincipals, boolean checkNodeOnly, boolean checkParentsOnly) throws SecurityException
+    public void checkConstraints(List<String> actions, List<String> userPrincipals, List<String> rolePrincipals, List<String> groupPrincipals, boolean checkNodeOnly, boolean checkParentsOnly) throws SecurityException
     {
         // check constraints in node hierarchy
         if (checkNodeOnly)
@@ -499,7 +500,7 @@ public abstract class AbstractNode exten
         // force metadata update after unmarshalled since
         // metadata collection can be side effected by
         // unmarshalling collection accessors
-        Collection metadataFields = getMetadataFields();
+        Collection<LocalizedField> metadataFields = getMetadataFields();
         if (metadataFields != null)
         {
             setMetadataFields(metadataFields);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.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/CastorFileSystemDocumentHandler.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java Sat Mar 15 15:59:17 2014
@@ -392,7 +392,7 @@ public class CastorFileSystemDocumentHan
  		classDescriptorResolver.setMappingLoader(mappingLoader);
     }
 
-    protected Object unmarshallDocument( Class clazz, String path, String extension ) throws DocumentNotFoundException,
+    protected Object unmarshallDocument(Class<?> clazz, String path, String extension ) throws DocumentNotFoundException,
             DocumentException
     {
         Document document = null;

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -16,17 +16,16 @@
  */
 package org.apache.jetspeed.page.document.psml;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
 import org.apache.jetspeed.page.document.DocumentHandler;
 import org.apache.jetspeed.page.document.DocumentHandlerFactory;
 import org.apache.jetspeed.page.document.DocumentTypeAlreadyRegisteredException;
+import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.util.ArgUtil;
 
-import org.apache.jetspeed.page.document.Node;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * <p>
@@ -42,7 +41,7 @@ import org.apache.jetspeed.page.document
  */
 public class DocumentHandlerFactoryImpl implements DocumentHandlerFactory
 {
-    private Map handlers;
+    private Map<String,DocumentHandler> handlers;
 
     private boolean permissionsEnabled;
 
@@ -52,7 +51,7 @@ public class DocumentHandlerFactoryImpl 
     /**
      *  
      */
-    public DocumentHandlerFactoryImpl( Map handlers )
+    public DocumentHandlerFactoryImpl( Map<String,DocumentHandler> handlers )
     {
         super();
         
@@ -70,7 +69,7 @@ public class DocumentHandlerFactoryImpl 
     
     public DocumentHandlerFactoryImpl()
     {
-        this(new HashMap());
+        this(new HashMap<String,DocumentHandler>());
              
     }
 
@@ -87,7 +86,7 @@ public class DocumentHandlerFactoryImpl 
     {        
         if(handlers.containsKey(documentType))
         {
-            return (DocumentHandler)handlers.get(documentType);
+            return handlers.get(documentType);
         }
         else
         {
@@ -100,7 +99,7 @@ public class DocumentHandlerFactoryImpl 
      * registerDocumentHandler
      * </p>
      *
-     * @see org.apache.jetspeed.page.document.DocumentHandlerFactory#registerDocumentHandler(org.apache.jetspeed.page.documenthandler.DocumentHandler)
+     * @see org.apache.jetspeed.page.document.DocumentHandlerFactory#registerDocumentHandler(org.apache.jetspeed.page.document.DocumentHandler)
      * @param documentHandler
      * @throws DocumentTypeAlreadyRegisteredException
      */

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -323,11 +323,11 @@ public class FileSystemFolderHandler imp
         try
         {
             // copy all folder nodes to remove
-            List removeNodes = new ArrayList();
+            List<Node> removeNodes = new ArrayList<Node>();
             Iterator copyIter = folderImpl.getAllNodes().iterator();
             while (copyIter.hasNext())
             {
-                removeNodes.add(copyIter.next());
+                removeNodes.add((Node)copyIter.next());
             }
             
             // remove folder nodes

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeOrderComparator.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/NodeOrderComparator.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeOrderComparator.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/NodeOrderComparator.java Sat Mar 15 15:59:17 2014
@@ -37,15 +37,15 @@ import java.util.List;
  * @version $Id$
  *  
  */
-public class NodeOrderComparator implements Comparator
+public class NodeOrderComparator implements Comparator<String>
 {
-    private List nodeIndex;
+    private List<String> nodeIndex;
     private String relativePath="";
 
     /**
      *  
      */
-    public NodeOrderComparator( List nodeIndex, String relativePath )
+    public NodeOrderComparator( List<String> nodeIndex, String relativePath )
     {
         super();
         this.nodeIndex = nodeIndex;        
@@ -58,32 +58,32 @@ public class NodeOrderComparator impleme
      * </p>
      * 
      * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-     * @param o1
-     * @param o2
+     * @param s1
+     * @param s2
      * @return
      */
-    public int compare( Object o1, Object o2 )
+    public int compare( String s1, String s2 )
     {
         
             String node1 = null;
             String node2 = null;
        
-            if(relativePath.length() < o1.toString().length())
+            if(relativePath.length() < s1.length())
             {
-                node1 =  o1.toString().substring(relativePath.length());
+                node1 =  s1.substring(relativePath.length());
             }
             else
             {
-                node1 =  o1.toString(); 
+                node1 =  s1;
             }
             
-            if(relativePath.length() < o2.toString().length())
+            if(relativePath.length() < s2.length())
             {
-                node2 =  o2.toString().substring(relativePath.length());
+                node2 =  s2.substring(relativePath.length());
             }
             else
             {
-                node2 =  o2.toString(); 
+                node2 =  s2;
             }
 
             String c1 = null;

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -16,6 +16,9 @@
  */
 package org.apache.jetspeed.page.document.psml;
 
+import org.apache.jetspeed.page.document.Node;
+import org.apache.jetspeed.page.document.NodeSet;
+
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -23,9 +26,6 @@ import java.util.Map;
 import java.util.TreeMap;
 import java.util.regex.Pattern;
 
-import org.apache.jetspeed.page.document.Node;
-import org.apache.jetspeed.page.document.NodeSet;
-
 /**
  * <p>
  * PageSetImpl
@@ -40,17 +40,17 @@ import org.apache.jetspeed.page.document
  */
 public class NodeSetImpl implements NodeSet
 {
-    private Map nodes;
-    private Map subsets;
+    private Map<String,Node> nodes;
+    private Map<String,NodeSet> subsets;
     private String resolveToPath;
-    private Comparator comparator;
-    protected static final Map patternCache = new HashMap();
+    private Comparator<String> comparator;
+    protected static final Map<String,Pattern> patternCache = new HashMap<String,Pattern>();
 
     public NodeSetImpl( String resolveToPath )
     {
         this.resolveToPath = resolveToPath;
-        nodes = new TreeMap();
-        subsets = new HashMap();
+        this.nodes = new TreeMap<String,Node>();
+        this.subsets = new HashMap<String,NodeSet>();
     }
 
     /**
@@ -58,12 +58,12 @@ public class NodeSetImpl implements Node
      * @param resolveToPath
      * @param comparator
      */
-    public NodeSetImpl( String resolveToPath, Comparator comparator )
+    public NodeSetImpl( String resolveToPath, Comparator<String> comparator )
     {
         this.resolveToPath = resolveToPath;
-        nodes = new TreeMap(comparator);
+        this.nodes = new TreeMap<String,Node>(comparator);
         this.comparator = comparator;
-        subsets = new HashMap();
+        this.subsets = new HashMap<String,NodeSet>();
     }
 
     /**
@@ -81,17 +81,17 @@ public class NodeSetImpl implements Node
 
         if (nodes.containsKey(name))
         {
-            return (Node) nodes.get(name);
+            return nodes.get(name);
         }
         else if (resolveToPath != null)
         {
             if (resolveToPath.endsWith(Node.PATH_SEPARATOR))
             {
-                return (Node) nodes.get(resolveToPath + name);
+                return nodes.get(resolveToPath + name);
             }
             else
             {
-                return (Node) nodes.get(resolveToPath + Node.PATH_SEPARATOR + name);
+                return nodes.get(resolveToPath + Node.PATH_SEPARATOR + name);
             }
         }
 
@@ -105,7 +105,7 @@ public class NodeSetImpl implements Node
      * </p>
      * 
      * @see org.apache.jetspeed.page.document.NodeSet#add(org.apache.jetspeed.page.document.Node)
-     * @param document
+     * @param node
      */
     public void add( Node node )
     {
@@ -113,7 +113,7 @@ public class NodeSetImpl implements Node
         nodes.put(path, node);
         if (subsets.containsKey(node.getType()))
         {
-            ((NodeSet) subsets.get(node.getType())).add(node);
+            subsets.get(node.getType()).add(node);
         }
     }
 
@@ -139,7 +139,7 @@ public class NodeSetImpl implements Node
      * @see org.apache.jetspeed.page.document.NodeSet#iterator()
      * @return
      */
-    public Iterator iterator()
+    public Iterator<Node> iterator()
     {
         return nodes.values().iterator();
     }
@@ -155,7 +155,7 @@ public class NodeSetImpl implements Node
      */
     public NodeSet subset( String type )
     {
-        NodeSet subset = (NodeSet) subsets.get(type);
+        NodeSet subset = subsets.get(type);
         if (subset == null)
         {
             subset = new NodeSetImpl(resolveToPath, comparator);
@@ -243,7 +243,7 @@ public class NodeSetImpl implements Node
      * 
      * @return comparator used to order nodes
      */
-    public Comparator getComparator()
+    public Comparator<String> getComparator()
     {
         return comparator;
     }
@@ -291,7 +291,7 @@ public class NodeSetImpl implements Node
      * contains
      * </p>
      * 
-     * @see org.apache.jetspeed.page.document.NodeSet#contains()
+     * @see org.apache.jetspeed.page.document.NodeSet#contains(org.apache.jetspeed.page.document.Node node)
      * @return
      */
     public boolean contains( Node node )

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -16,20 +16,6 @@
  */
 package org.apache.jetspeed.page.impl;
 
-import java.lang.ref.WeakReference;
-import java.security.AccessController;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
@@ -124,6 +110,19 @@ import org.apache.ojb.broker.query.Query
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.security.auth.Subject;
+import java.lang.ref.WeakReference;
+import java.security.AccessController;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * DatabasePageManager
  * 
@@ -137,9 +136,9 @@ public class DatabasePageManager extends
     
     private static final int MIN_THREAD_CACHE_SIZE = 16;
 
-    private static ThreadLocal fragmentPropertyListsCache = new ThreadLocal();
+    private static ThreadLocal<Map<String,WeakReference<FragmentPropertyList>>> fragmentPropertyListsCache = new ThreadLocal<Map<String,WeakReference<FragmentPropertyList>>>();
     
-    private static Map modelClasses = new HashMap();
+    private static Map<String,Class<?>> modelClasses = new HashMap<String,Class<?>>();
     static
     {
         modelClasses.put("FragmentImpl", FragmentImpl.class);
@@ -183,7 +182,7 @@ public class DatabasePageManager extends
                                JetspeedCache propertiesCache, JetspeedCache propertiesPathCache, JetspeedCache principalPropertiesCache, JetspeedCache principalPropertiesPathCache)
     {
         super(repositoryPath);
-        delegator = new DelegatingPageManager(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
+        delegator = new DelegatingPageManager(this, generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
         maxThreadCacheSize = Math.max(Math.max(Math.max(oidCache.getMaxSize()/10, propertiesCache.getMaxSize()/10), principalPropertiesCache.getMaxSize()/10), MIN_THREAD_CACHE_SIZE);
         DatabasePageManagerCache.cacheInit(oidCache, pathCache, propertiesCache, propertiesPathCache, principalPropertiesCache, principalPropertiesPathCache, this);
     }
@@ -815,7 +814,7 @@ public class DatabasePageManager extends
         {
             // query for folders
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -823,7 +822,9 @@ public class DatabasePageManager extends
             folderImpl.accessFolders().clear();
             if (folders != null)
             {
-                folderImpl.accessFolders().addAll(folders);
+                @SuppressWarnings("unchecked")
+                Collection<FolderImpl> folderImpls = folders;
+                folderImpl.accessFolders().addAll(folderImpls);
             }
             folderImpl.resetFolders(true);
         }
@@ -872,7 +873,7 @@ public class DatabasePageManager extends
         {
             // query for pages
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
             Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -880,7 +881,9 @@ public class DatabasePageManager extends
             folderImpl.accessPages().clear();
             if (pages != null)
             {
-                folderImpl.accessPages().addAll(pages);
+                @SuppressWarnings("unchecked")
+                Collection<PageImpl> pageImpls = pages;
+                folderImpl.accessPages().addAll(pageImpls);
             }
             folderImpl.resetPages(true);
         }
@@ -929,7 +932,7 @@ public class DatabasePageManager extends
         {
             // query for page templates
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(PageTemplateImpl.class, filter);
             Collection pageTemplates = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -937,7 +940,9 @@ public class DatabasePageManager extends
             folderImpl.accessPageTemplates().clear();
             if (pageTemplates != null)
             {
-                folderImpl.accessPageTemplates().addAll(pageTemplates);
+                @SuppressWarnings("unchecked")
+                Collection<PageTemplateImpl> pageTemplateImpls = pageTemplates;
+                folderImpl.accessPageTemplates().addAll(pageTemplateImpls);
             }
             folderImpl.resetPageTemplates(true);
         }
@@ -986,7 +991,7 @@ public class DatabasePageManager extends
         {
             // query for dynamic pages
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(DynamicPageImpl.class, filter);
             Collection dynamicPages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -994,7 +999,9 @@ public class DatabasePageManager extends
             folderImpl.accessDynamicPages().clear();
             if (dynamicPages != null)
             {
-                folderImpl.accessDynamicPages().addAll(dynamicPages);
+                @SuppressWarnings("unchecked")
+                Collection<DynamicPageImpl> dynamicPageImpls = dynamicPages;
+                folderImpl.accessDynamicPages().addAll(dynamicPageImpls);
             }
             folderImpl.resetDynamicPages(true);
         }
@@ -1043,7 +1050,7 @@ public class DatabasePageManager extends
         {
             // query for fragment definition
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(FragmentDefinitionImpl.class, filter);
             Collection fragmentDefinitions = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -1051,7 +1058,9 @@ public class DatabasePageManager extends
             folderImpl.accessFragmentDefinitions().clear();
             if (fragmentDefinitions != null)
             {
-                folderImpl.accessFragmentDefinitions().addAll(fragmentDefinitions);
+                @SuppressWarnings("unchecked")
+                Collection<FragmentDefinitionImpl> fragmentDefinitionImpls = fragmentDefinitions;
+                folderImpl.accessFragmentDefinitions().addAll(fragmentDefinitionImpls);
             }
             folderImpl.resetFragmentDefinitions(true);
         }
@@ -1100,7 +1109,7 @@ public class DatabasePageManager extends
         {
             // query for links
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(LinkImpl.class, filter);
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
 
@@ -1108,7 +1117,9 @@ public class DatabasePageManager extends
             folderImpl.accessLinks().clear();
             if (links != null)
             {
-                folderImpl.accessLinks().addAll(links);
+                @SuppressWarnings("unchecked")
+                Collection<LinkImpl> linkImpls = links;
+                folderImpl.accessLinks().addAll(linkImpls);
             }
             folderImpl.resetLinks(true);
         }
@@ -1162,7 +1173,7 @@ public class DatabasePageManager extends
             {
                 // query for page security
                 Criteria filter = new Criteria();
-                filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+                filter.addEqualTo("parent", folderImpl.getIdentity());
                 QueryByCriteria query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
                 PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query);
 
@@ -1198,42 +1209,48 @@ public class DatabasePageManager extends
         try
         {
             // query for all nodes
-            List all = DatabasePageManagerUtils.createList();
+            List<Node> all = new ArrayList<Node>();
             
             // query for subfolders
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (folders != null)
             {
-                all.addAll(folders);
+                @SuppressWarnings("unchecked")
+                Collection<FolderImpl> folderImpls = folders;
+                all.addAll(folderImpls);
             }
 
             // polymorphic query for pages, page templates, dynamic pages,
             // and fragment definitions
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(BaseFragmentsElementImpl.class, filter);
             Collection baseFragments = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (baseFragments != null)
             {
-                all.addAll(baseFragments);
+                @SuppressWarnings("unchecked")
+                Collection<BaseFragmentsElementImpl> baseFragmentImpls = baseFragments;
+                all.addAll(baseFragmentImpls);
             }
 
             // query for links
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(LinkImpl.class, filter);
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (links != null)
             {
-                all.addAll(links);
+                @SuppressWarnings("unchecked")
+                Collection<LinkImpl> linkImpls = links;
+                all.addAll(linkImpls);
             }
 
             // query for page security
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
             PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query);
             if (document != null)
@@ -1688,7 +1705,7 @@ public class DatabasePageManager extends
      * 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
     {
@@ -1696,7 +1713,7 @@ public class DatabasePageManager extends
         {
             // update pages
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(PageImpl.class, filter);
             Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pages != null)
@@ -1710,7 +1727,7 @@ public class DatabasePageManager extends
 
             // update page templates
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(PageTemplateImpl.class, filter);
             Collection pageTemplates = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pageTemplates != null)
@@ -1724,7 +1741,7 @@ public class DatabasePageManager extends
 
             // update dynamic pages
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(DynamicPageImpl.class, filter);
             Collection dynamicPages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (dynamicPages != null)
@@ -1738,7 +1755,7 @@ public class DatabasePageManager extends
 
             // update fragment definitions
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(FragmentDefinitionImpl.class, filter);
             Collection fragmentDefinitions = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (fragmentDefinitions != null)
@@ -1752,7 +1769,7 @@ public class DatabasePageManager extends
 
             // update links
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(LinkImpl.class, filter);
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (links != null)
@@ -1766,7 +1783,7 @@ public class DatabasePageManager extends
 
             // update page security
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
             PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query);
             if (document != null)
@@ -1776,7 +1793,7 @@ public class DatabasePageManager extends
 
             // update folders last: breadth first recursion
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(FolderImpl.class, filter);
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (folders != null)
@@ -1855,7 +1872,7 @@ public class DatabasePageManager extends
      * removeFolderNodes - recursively remove all folder nodes
      *
      * @param folderImpl folder whose nodes are to be removed
-     * @param throws FolderNotRemovedException
+     * @throws FolderNotRemovedException
      */
     private void removeFolderNodes(FolderImpl folderImpl) throws FolderNotRemovedException
     {
@@ -1863,7 +1880,7 @@ public class DatabasePageManager extends
         {
             // remove folders first: depth first recursion
             Criteria filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
             Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (folders != null)
@@ -1877,7 +1894,7 @@ public class DatabasePageManager extends
 
             // remove pages
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(PageImpl.class, filter);
             Collection pages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pages != null)
@@ -1891,7 +1908,7 @@ public class DatabasePageManager extends
 
             // remove page templates
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(PageTemplateImpl.class, filter);
             Collection pageTemplates = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (pageTemplates != null)
@@ -1905,7 +1922,7 @@ public class DatabasePageManager extends
 
             // remove dynamic pages
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(DynamicPageImpl.class, filter);
             Collection dynamicPages = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (dynamicPages != null)
@@ -1919,7 +1936,7 @@ public class DatabasePageManager extends
 
             // remove fragment definitions
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(FragmentDefinitionImpl.class, filter);
             Collection fragmentDefinitions = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (fragmentDefinitions != null)
@@ -1933,7 +1950,7 @@ public class DatabasePageManager extends
 
             // remove links
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(LinkImpl.class, filter);
             Collection links = getPersistenceBrokerTemplate().getCollectionByQuery(query);
             if (links != null)
@@ -1947,7 +1964,7 @@ public class DatabasePageManager extends
 
             // remove page security
             filter = new Criteria();
-            filter.addEqualTo("parent", new Integer(folderImpl.getIdentity()));
+            filter.addEqualTo("parent", folderImpl.getIdentity());
             query = QueryFactory.newQuery(PageSecurityImpl.class, filter);
             PageSecurity document = (PageSecurity)getPersistenceBrokerTemplate().getObjectByQuery(query);
             if (document != null)
@@ -2702,9 +2719,9 @@ public class DatabasePageManager extends
         Subject subject = JSSubject.getSubject(AccessController.getContext());
         Principal userPrincipal = ((subject != null) ? SubjectHelper.getBestPrincipal(subject, User.class) : null);
         String fragmentListKey = getFragmentPropertyListKey(fragmentKey, userPrincipal);
-        Map threadLocalCache = (Map)fragmentPropertyListsCache.get();
-        WeakReference listReference = ((threadLocalCache != null) ? (WeakReference)threadLocalCache.get(fragmentListKey) : null);
-        FragmentPropertyList list = ((listReference != null) ? (FragmentPropertyList)listReference.get() : null);
+        Map<String,WeakReference<FragmentPropertyList>> threadLocalCache = fragmentPropertyListsCache.get();
+        WeakReference<FragmentPropertyList> listReference = ((threadLocalCache != null) ? threadLocalCache.get(fragmentListKey) : null);
+        FragmentPropertyList list = ((listReference != null) ? listReference.get() : null);
 
         // get and cache persistent list
         if (list == null)
@@ -2716,14 +2733,16 @@ public class DatabasePageManager extends
             {
                 globalFragmentPropertyList = new DatabasePageManagerCachedFragmentPropertyList(baseFragmentElementImpl.getBaseFragmentsElement().getPath());
                 Criteria filter = new Criteria();
-                filter.addEqualTo("fragment", new Integer(baseFragmentElementImpl.getIdentity()));
+                filter.addEqualTo("fragment", baseFragmentElementImpl.getIdentity());
                 filter.addIsNull("scope");
                 QueryByCriteria query = QueryFactory.newQuery(FragmentPropertyImpl.class, filter);
                 Collection fragmentProperties = getPersistenceBrokerTemplate().getCollectionByQuery(query);
-                globalFragmentPropertyList.addAll(fragmentProperties);
+                @SuppressWarnings("unchecked")
+                Collection<FragmentPropertyImpl> fragmentPropertyImpls = fragmentProperties;
+                globalFragmentPropertyList.addAll(fragmentPropertyImpls);
                 DatabasePageManagerCache.fragmentPropertyListCacheAdd(fragmentKey, globalFragmentPropertyList, false);
             }
-            Map principalFragmentPropertyLists = null;
+            Map<String,DatabasePageManagerCachedFragmentPropertyList> principalFragmentPropertyLists = null;
             DatabasePageManagerCachedFragmentPropertyList userFragmentPropertyList = null;
             if (subject != null)
             {
@@ -2759,14 +2778,16 @@ public class DatabasePageManager extends
                                 filter.addEqualTo("scopeValue", principal.getName());
                                 QueryByCriteria query = QueryFactory.newQuery(FragmentPropertyImpl.class, filter);
                                 Collection fragmentProperties = getPersistenceBrokerTemplate().getCollectionByQuery(query);
-                                principalFragmentPropertyList.addAll(fragmentProperties);
+                                @SuppressWarnings("unchecked")
+                                Collection<FragmentPropertyImpl> fragmentPropertyImpls = fragmentProperties;
+                                principalFragmentPropertyList.addAll(fragmentPropertyImpls);
                                 DatabasePageManagerCache.principalFragmentPropertyListCacheAdd(principalKey, principalFragmentPropertyList, false);
                             }
                             if (principalFragmentPropertyList != null)
                             {
                                 if (principalFragmentPropertyLists == null)
                                 {
-                                    principalFragmentPropertyLists = new HashMap();
+                                    principalFragmentPropertyLists = new HashMap<String,DatabasePageManagerCachedFragmentPropertyList>();
                                 }
                                 principalFragmentPropertyLists.put(principalKey, principalFragmentPropertyList);
                             }
@@ -2785,7 +2806,9 @@ public class DatabasePageManager extends
                         filter.addEqualTo("scopeValue", userPrincipal.getName());
                         QueryByCriteria query = QueryFactory.newQuery(FragmentPropertyImpl.class, filter);
                         Collection fragmentProperties = getPersistenceBrokerTemplate().getCollectionByQuery(query);
-                        userFragmentPropertyList.addAll(fragmentProperties);
+                        @SuppressWarnings("unchecked")
+                        Collection<FragmentPropertyImpl> fragmentPropertyImpls = fragmentProperties;
+                        userFragmentPropertyList.addAll(fragmentPropertyImpls);
                         DatabasePageManagerCache.principalFragmentPropertyListCacheAdd(principalKey, userFragmentPropertyList, false);
                     }
                 }
@@ -2801,7 +2824,7 @@ public class DatabasePageManager extends
                 {
                     if (principalFragmentPropertyLists != null)
                     {                        
-                        Set principals = subject.getPrincipals();
+                        Set<Principal> principals = subject.getPrincipals();
                         Iterator principalsIter = principals.iterator();
                         while (principalsIter.hasNext())
                         {
@@ -2823,7 +2846,7 @@ public class DatabasePageManager extends
                             {
                                 String principalKey = getFragmentPropertyListPrincipalKey(principalScope, principal.getName());
                                 DatabasePageManagerCachedFragmentPropertyList principalFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)principalFragmentPropertyLists.get(principalKey);
-                                List principalFragmentProperties = filterPrincipalFragmentPropertyList(principalFragmentPropertyList, baseFragmentElementImpl);
+                                List<FragmentProperty> principalFragmentProperties = filterPrincipalFragmentPropertyList(principalFragmentPropertyList, baseFragmentElementImpl);
                                 if (principalFragmentProperties != null)
                                 {
                                     list.getProperties().addAll(principalFragmentProperties);
@@ -2834,7 +2857,7 @@ public class DatabasePageManager extends
                 }
                 else if (userFragmentPropertyList != null)
                 {
-                    List userFragmentProperties = filterPrincipalFragmentPropertyList(userFragmentPropertyList, baseFragmentElementImpl);
+                    List<FragmentProperty> userFragmentProperties = filterPrincipalFragmentPropertyList(userFragmentPropertyList, baseFragmentElementImpl);
                     if (userFragmentProperties != null)
                     {
                         list.getProperties().addAll(userFragmentProperties);
@@ -2881,16 +2904,16 @@ public class DatabasePageManager extends
                 // create bounded LRU cache per thread to limit footprint
                 // of long running or pooled threads, (typically batch
                 // processes accessing the PageManager).
-                threadLocalCache = new LinkedHashMap(MIN_THREAD_CACHE_SIZE, 0.75F, true)
+                threadLocalCache = new LinkedHashMap<String,WeakReference<FragmentPropertyList>>(MIN_THREAD_CACHE_SIZE, 0.75F, true)
                 {
-                    protected boolean removeEldestEntry(Map.Entry eldest)
+                    protected boolean removeEldestEntry(Map.Entry<String,WeakReference<FragmentPropertyList>> eldest)
                     {
                         return (size() > maxThreadCacheSize);
                     }
                 };
                 fragmentPropertyListsCache.set(threadLocalCache);
             }
-            threadLocalCache.put(fragmentListKey, new WeakReference(list));
+            threadLocalCache.put(fragmentListKey, new WeakReference<FragmentPropertyList>(list));
         }
         return list;
     }
@@ -2922,14 +2945,14 @@ public class DatabasePageManager extends
                 // extents are fully represented in list).
                 boolean updateTransaction = false;
                 DatabasePageManagerCachedFragmentPropertyList globalFragmentPropertyList = null;
-                Map principalPartialFragmentPropertyLists = null;
+                Map<String,DatabasePageManagerCachedFragmentPropertyList> principalPartialFragmentPropertyLists = null;
                 String fragmentKey = getFragmentPropertyListFragmentKey(baseFragmentElementImpl);
-                List properties = list.getProperties();
-                List removedProperties = list.getRemovedProperties();
+                List<FragmentProperty> properties = list.getProperties();
+                List<FragmentProperty> removedProperties = list.getRemovedProperties();
                 
                 // construct scoped properties lists for cache updates from
                 // all properties, (add, update, and remove)
-                List allProperties = new ArrayList(properties);
+                List<FragmentProperty> allProperties = new ArrayList<FragmentProperty>(properties);
                 if (removedProperties != null)
                 {
                     allProperties.addAll(removedProperties);                    
@@ -2970,7 +2993,7 @@ public class DatabasePageManager extends
                             {
                                 if (principalPartialFragmentPropertyLists == null)
                                 {
-                                    principalPartialFragmentPropertyLists = new HashMap();
+                                    principalPartialFragmentPropertyLists = new HashMap<String,DatabasePageManagerCachedFragmentPropertyList>();
                                 }
                                 String principalKey = getFragmentPropertyListPrincipalKey(propertyScope, propertyScopeValue);
                                 DatabasePageManagerCachedFragmentPropertyList principalPartialFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)principalPartialFragmentPropertyLists.get(principalKey);
@@ -2987,7 +3010,7 @@ public class DatabasePageManager extends
                             {
                                 if (principalPartialFragmentPropertyLists == null)
                                 {
-                                    principalPartialFragmentPropertyLists = new HashMap();
+                                    principalPartialFragmentPropertyLists = new HashMap<String,DatabasePageManagerCachedFragmentPropertyList>();
                                 }
                                 DatabasePageManagerCachedFragmentPropertyList principalPartialFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)principalPartialFragmentPropertyLists.get(userPrincipalKey);
                                 if (principalPartialFragmentPropertyList == null)
@@ -3028,7 +3051,7 @@ public class DatabasePageManager extends
                             if (principalPartialFragmentPropertyLists != null)
                             {
                                 String principalKey = getFragmentPropertyListPrincipalKey(storePropertyScope, storePropertyScopeValue);
-                                DatabasePageManagerCachedFragmentPropertyList principalPartialFragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)principalPartialFragmentPropertyLists.get(principalKey);
+                                DatabasePageManagerCachedFragmentPropertyList principalPartialFragmentPropertyList = principalPartialFragmentPropertyLists.get(principalKey);
                                 if (principalPartialFragmentPropertyList != null)
                                 {
                                     principalPartialFragmentPropertyList.add(storeProperty);
@@ -3128,9 +3151,9 @@ public class DatabasePageManager extends
         Subject subject = JSSubject.getSubject(AccessController.getContext());
         Principal userPrincipal = ((subject != null) ? SubjectHelper.getBestPrincipal(subject, User.class) : null);
         String fragmentListKey = getFragmentPropertyListKey(fragmentKey, userPrincipal);
-        Map threadLocalCache = (Map)fragmentPropertyListsCache.get();
-        WeakReference listReference = ((threadLocalCache != null) ? (WeakReference)threadLocalCache.get(fragmentListKey) : null);
-        FragmentPropertyList list = ((listReference != null) ? (FragmentPropertyList)listReference.get() : null);
+        Map<String,WeakReference<FragmentPropertyList>> threadLocalCache = fragmentPropertyListsCache.get();
+        WeakReference<FragmentPropertyList> listReference = ((threadLocalCache != null) ? threadLocalCache.get(fragmentListKey) : null);
+        FragmentPropertyList list = ((listReference != null) ? listReference.get() : null);
 
         // remove cached persistent list
         if (list != null)
@@ -3147,7 +3170,7 @@ public class DatabasePageManager extends
         }
 
         // remove all fragment properties in list from database
-        Integer fragmentId = new Integer(baseFragmentElementImpl.getIdentity());
+        int fragmentId = baseFragmentElementImpl.getIdentity();
         Criteria filter = new Criteria();
         filter.addEqualTo("fragment", fragmentId);
         QueryByCriteria query = QueryFactory.newQuery(FragmentPropertyImpl.class, filter);
@@ -3204,9 +3227,9 @@ public class DatabasePageManager extends
      * @param baseFragmentElementImpl fragment property owning fragment
      * @return fragment property list for owning fragment
      */
-    private static List filterPrincipalFragmentPropertyList(DatabasePageManagerCachedFragmentPropertyList principalFragmentPropertyList, BaseFragmentElementImpl baseFragmentElementImpl)
+    private static List<FragmentProperty> filterPrincipalFragmentPropertyList(DatabasePageManagerCachedFragmentPropertyList principalFragmentPropertyList, BaseFragmentElementImpl baseFragmentElementImpl)
     {
-        List filteredList = null;
+        List<FragmentProperty> filteredList = null;
         synchronized (principalFragmentPropertyList)
         {
             for (Iterator iter = principalFragmentPropertyList.iterator(); iter.hasNext();)
@@ -3216,7 +3239,7 @@ public class DatabasePageManager extends
                 {
                     if (filteredList == null)
                     {
-                        filteredList = new ArrayList();
+                        filteredList = new ArrayList<FragmentProperty>();
                     }
                     filteredList.add(fragmentProperty);
                 }
@@ -3288,5 +3311,15 @@ public class DatabasePageManager extends
 	{
 		updateFragmentPropertyList((BaseFragmentElementImpl)baseFragmentElement, scope, transientList);
 	}
-        
+
+    /**
+     * Create list suitable for list model members.
+     *
+     * @param <T> list element type
+     * @return list
+     */
+    public <T> List<T> createList()
+    {
+        return DatabasePageManagerUtils.createList();
+    }
 }

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -16,16 +16,6 @@
  */
 package org.apache.jetspeed.page.impl;
 
-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;
-import java.util.Properties;
-import java.util.Set;
-
 import org.apache.jetspeed.cache.CacheElement;
 import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.cache.JetspeedCacheEventListener;
@@ -38,10 +28,19 @@ import org.apache.jetspeed.page.document
 import org.apache.ojb.broker.Identity;
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.cache.ObjectCache;
-
 import org.slf4j.Logger;
 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;
+import java.util.Properties;
+import java.util.Set;
+
 /**
  * DatabasePageManagerCache
  * 
@@ -58,17 +57,17 @@ public class DatabasePageManagerCache im
     
     private static JetspeedCache oidCache;
     private static JetspeedCache pathCache;
-    private static Map pathToOidMap;
+    private static Map<String,Identity> pathToOidMap;
     private static JetspeedCache propertiesCache;
     private static JetspeedCache propertiesPathCache;
     private static JetspeedCache principalPropertiesCache;
     private static JetspeedCache principalPropertiesPathCache;
-    private static Map propertiesCacheIndexMap;
+    private static Map<String,Set<String>> propertiesCacheIndexMap;
     private static boolean constraintsEnabled;
     private static boolean permissionsEnabled;
     private static PageManager pageManager;
-    private static List updatePathsList = new ArrayList();
-    private static ThreadLocal transactionedOperations = new ThreadLocal();
+    private static List<String> updatePathsList = new ArrayList<String>();
+    private static ThreadLocal<List<TransactionedOperation>> transactionedOperations = new ThreadLocal<List<TransactionedOperation>>();
 
     // Implementation
     
@@ -85,12 +84,12 @@ public class DatabasePageManagerCache im
         // initialize
         DatabasePageManagerCache.oidCache = oidCache;
         DatabasePageManagerCache.pathCache = pathCache;
-        DatabasePageManagerCache.pathToOidMap = new HashMap();
+        DatabasePageManagerCache.pathToOidMap = new HashMap<String,Identity>();
         DatabasePageManagerCache.propertiesCache = propertiesCache;
         DatabasePageManagerCache.propertiesPathCache = propertiesPathCache;
         DatabasePageManagerCache.principalPropertiesCache = principalPropertiesCache;
         DatabasePageManagerCache.principalPropertiesPathCache = principalPropertiesPathCache;
-        propertiesCacheIndexMap = new HashMap();
+        propertiesCacheIndexMap = new HashMap<String,Set<String>>();
         constraintsEnabled = pageManager.getConstraintsEnabled();
         permissionsEnabled = pageManager.getPermissionsEnabled();
         DatabasePageManagerCache.pageManager = pageManager;
@@ -227,12 +226,12 @@ public class DatabasePageManagerCache im
                             }
                             // remove all indexed fragment keys for page path from
                             // properties cache index
-                            Set index = (Set)propertiesCacheIndexMap.get(path);
+                            Set<String> index = propertiesCacheIndexMap.get(path);
                             if (index != null)
                             {
                                 // 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(index)).iterator();
+                                Iterator fragmentKeyIter = (new ArrayList<String>(index)).iterator();
                                 while (fragmentKeyIter.hasNext())
                                 {
                                     String fragmentKey = (String)fragmentKeyIter.next();
@@ -271,10 +270,10 @@ public class DatabasePageManagerCache im
                     String path = fragmentPropertyList.getBaseFragmentsElementPath();
                     synchronized (DatabasePageManagerCache.class)
                     {
-                        Set index = (Set)propertiesCacheIndexMap.get(path);
+                        Set<String> index = propertiesCacheIndexMap.get(path);
                         if (index == null)
                         {
-                            index = new HashSet();
+                            index = new HashSet<String>();
                             propertiesCacheIndexMap.put(path, index);
                         }
                         index.add(fragmentKey);
@@ -319,7 +318,7 @@ public class DatabasePageManagerCache im
                     String path = fragmentPropertyList.getBaseFragmentsElementPath();
                     synchronized (DatabasePageManagerCache.class)
                     {
-                        Set index = (Set)propertiesCacheIndexMap.get(path);
+                        Set<String> index = propertiesCacheIndexMap.get(path);
                         if (index != null)
                         {
                             index.remove(fragmentKeyOrPath);
@@ -335,7 +334,7 @@ public class DatabasePageManagerCache im
                     // remove all indexed cache keys from properties cache index
                     synchronized (DatabasePageManagerCache.class)
                     {
-                        Set index = (Set)propertiesCacheIndexMap.get(fragmentKeyOrPath);
+                        Set<String> index = propertiesCacheIndexMap.get(fragmentKeyOrPath);
                         if (index != null)
                         {
                             // remove all indexed cache keys
@@ -569,7 +568,7 @@ public class DatabasePageManagerCache im
         if (path != null)
         {
             // return valid object cached by path and oid
-            Identity oid = (Identity)pathToOidMap.get(path);
+            Identity oid = pathToOidMap.get(path);
             if (oid != null)
             {
                 return cacheLookup(oid, cacheRead);
@@ -596,7 +595,7 @@ public class DatabasePageManagerCache im
      * infuse nodes loaded by OJB with page manager configuration.
      *
      * @param oid object/node identity
-     * @param obj object/node to cache
+     * @param node object/node to cache
      */
     private synchronized static void cacheAdd(Identity oid, NodeImpl node)
     {
@@ -642,7 +641,7 @@ public class DatabasePageManagerCache im
      */
     public synchronized static void cacheClear()
     {
-        // clear localally managed mappings
+        // clear locally managed mappings
         pathToOidMap.clear();
         // remove all items from oid and properties caches
         // individually to ensure notifications are run to
@@ -785,7 +784,7 @@ public class DatabasePageManagerCache im
         if (path != null)
         {
             // remove from oid cache
-            Identity oid = (Identity)pathToOidMap.get(path);
+            Identity oid = pathToOidMap.get(path);
             if (oid != null)
             {
                 oidCache.remove(oid);
@@ -1006,12 +1005,12 @@ public class DatabasePageManagerCache im
      * 
      * @return transactions list
      */
-    public static List getTransactions()
+    public static List<TransactionedOperation> getTransactions()
     {
-        List operations = (List)transactionedOperations.get();
+        List<TransactionedOperation> operations = transactionedOperations.get();
         if (operations == null)
         {
-            operations = new LinkedList();
+            operations = new LinkedList<TransactionedOperation>();
             transactionedOperations.set(operations);
         }
         return operations;
@@ -1024,7 +1023,7 @@ public class DatabasePageManagerCache im
      */
     public static void addTransaction(TransactionedOperation operation)
     {
-        List transactions = getTransactions();        
+        List<TransactionedOperation> transactions = getTransactions();
         transactions.add(operation);
     }
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCachedFragmentPropertyList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCachedFragmentPropertyList.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCachedFragmentPropertyList.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCachedFragmentPropertyList.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,8 @@
  */
 package org.apache.jetspeed.page.impl;
 
+import org.apache.jetspeed.om.page.FragmentProperty;
+
 import java.util.ArrayList;
 
 /**
@@ -24,7 +26,7 @@ import java.util.ArrayList;
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id: $
 */
-public class DatabasePageManagerCachedFragmentPropertyList extends ArrayList
+public class DatabasePageManagerCachedFragmentPropertyList extends ArrayList<FragmentProperty>
 {
     private static final long serialVersionUID = 1L;
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerUtils.java Sat Mar 15 15:59:17 2014
@@ -16,12 +16,12 @@
  */
 package org.apache.jetspeed.page.impl;
 
-import java.util.Collection;
-import java.util.List;
-
+import org.apache.jetspeed.util.ojb.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jetspeed.util.ojb.CollectionUtils;
+
+import java.util.Collection;
+import java.util.List;
 
 /**
  * DatabasePageManagerUtils
@@ -39,12 +39,11 @@ public class DatabasePageManagerUtils
      * This issue on occurs when persisting newly create object collections
      * When persisting objects retrieved with OJB, this issue does not occur
      * 
-     * @see JS2-590
-     * @return
+     * See issue: JS2-590
      */
 
     @SuppressWarnings("unchecked")
-    public static final Collection createCollection()
+    public static <T> Collection<T> createCollection()
     {
         // return synchronized manageable/removal aware collection;
         // requires setting collection-class attributes for collection-
@@ -54,9 +53,9 @@ public class DatabasePageManagerUtils
         //
         return CollectionUtils.createSynchronizedCollection();
     }
-    
+
     @SuppressWarnings("unchecked")
-    public static final List createList()
+    public static <T> List<T> createList()
     {
         // return synchronized manageable/removal aware list;
         // requires setting collection-class attributes for collection-

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -17,11 +17,6 @@
 
 package org.apache.jetspeed.page.psml;
 
-import java.io.FileNotFoundException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.cache.file.FileCache;
 import org.apache.jetspeed.cache.file.FileCacheEntry;
@@ -82,6 +77,14 @@ import org.apache.jetspeed.page.document
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+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;
+
 /**
  * This service is responsible for loading and saving PSML pages serialized to
  * disk
@@ -94,7 +97,7 @@ public class CastorXmlPageManager extend
 {
     private final static Logger log = LoggerFactory.getLogger(CastorXmlPageManager.class);
 
-    private static Map modelClasses = new HashMap();
+    private static Map<String,Class<?>> modelClasses = new HashMap<String,Class<?>>();
     static
     {
         modelClasses.put("FragmentImpl", FragmentImpl.class);
@@ -1322,5 +1325,15 @@ public class CastorXmlPageManager extend
         }
         return pages.length;
     }
-    
+
+    /**
+     * Create list suitable for list model members.
+     *
+     * @param <T> list element type
+     * @return list
+     */
+    public <T> List<T> createList()
+    {
+        return Collections.synchronizedList(new ArrayList<T>());
+    }
 }

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=1577887&r1=1577886&r2=1577887&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 Sat Mar 15 15:59:17 2014
@@ -16,14 +16,14 @@
  */
 package org.apache.jetspeed.util.ojb;
 
+import org.apache.ojb.broker.accesslayer.conversions.ConversionException;
+import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
 
-import org.apache.ojb.broker.accesslayer.conversions.ConversionException;
-import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;
-
 /**
  * ACLFieldConversion 
  *
@@ -88,7 +88,7 @@ public class ACLFieldConversion implemen
     {
         if (arg0 instanceof String)
         {
-            List aclList = new ArrayList(4);
+            List<String> aclList = new ArrayList<String>(4);
             StringTokenizer tokens = new StringTokenizer((String) arg0, DELIM);
             while (tokens.hasMoreTokens())
             {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/DirectoryXMLTransform.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/DirectoryXMLTransform.java?rev=1577887&r1=1577886&r2=1577887&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/DirectoryXMLTransform.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/DirectoryXMLTransform.java Sat Mar 15 15:59:17 2014
@@ -16,6 +16,17 @@
 */
 package org.apache.jetspeed.page;
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.jetspeed.util.DirectoryHelper;
+
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FileInputStream;
@@ -27,18 +38,6 @@ import java.io.Writer;
 import java.nio.channels.FileChannel;
 import java.util.Map;
 
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.jetspeed.util.DirectoryHelper;
-
 
 /**
  * @author ddam
@@ -50,9 +49,9 @@ public class DirectoryXMLTransform exten
 
     private SAXParserFactory saxFactory;
     
-    private Map xsltMapping;
+    private Map<String,Object> xsltMapping;
     
-        public DirectoryXMLTransform(File base, Map extensionToXslt) {
+        public DirectoryXMLTransform(File base, Map<String,Object> extensionToXslt) {
           super(base);
           this.xsltMapping=extensionToXslt;
           System.setProperty("javax.xml.transform.TransformerFactory",
@@ -110,7 +109,7 @@ public class DirectoryXMLTransform exten
          * </p>
          *
          * @see org.apache.jetspeed.util.FileSystemHelper#copyFrom(java.io.File, java.io.FileFilter)
-         * @param directory
+         * @param srcDirectory
          * @param fileFilter
          * @throws IOException
          */



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