jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r816601 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
Date Fri, 18 Sep 2009 12:33:36 GMT
Author: reschke
Date: Fri Sep 18 12:33:36 2009
New Revision: 816601

URL: http://svn.apache.org/viewvc?rev=816601&view=rev
Log:
JCR-2087: parametrize generic types

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java?rev=816601&r1=816600&r2=816601&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
Fri Sep 18 12:33:36 2009
@@ -86,19 +86,19 @@
      * A cache for <code>NodeType</code> instances created by this
      * <code>NodeTypeManager</code>
      */
-    private final Map ntCache;
+    private final Map<Name, NodeTypeImpl> ntCache;
 
     /**
      * A cache for <code>PropertyDefinition</code> instances created by this
      * <code>NodeTypeManager</code>
      */
-    private final Map pdCache;
+    private final Map<QPropertyDefinition, PropertyDefinition> pdCache;
 
     /**
      * A cache for <code>NodeDefinition</code> instances created by this
      * <code>NodeTypeManager</code>
      */
-    private final Map ndCache;
+    private final Map<QNodeDefinition, NodeDefinition> ndCache;
 
     /**
      * Creates a new <code>NodeTypeManagerImpl</code> instance.
@@ -134,7 +134,7 @@
      */
     public NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException {
         synchronized (ntCache) {
-            NodeTypeImpl nt = (NodeTypeImpl) ntCache.get(name);
+            NodeTypeImpl nt = ntCache.get(name);
             if (nt == null) {
                 EffectiveNodeType ent = entProvider().getEffectiveNodeType(name);
                 QNodeTypeDefinition def = ntReg.getNodeTypeDefinition(name);
@@ -174,7 +174,7 @@
      */
     public NodeDefinition getNodeDefinition(QNodeDefinition def) {
         synchronized (ndCache) {
-            NodeDefinition ndi = (NodeDefinition) ndCache.get(def);
+            NodeDefinition ndi = ndCache.get(def);
             if (ndi == null) {
                 ndi = new NodeDefinitionImpl(def, this, getNamePathResolver());
                 ndCache.put(def, ndi);
@@ -192,7 +192,7 @@
      */
     public PropertyDefinition getPropertyDefinition(QPropertyDefinition def) {
         synchronized (pdCache) {
-            PropertyDefinition pdi = (PropertyDefinition) pdCache.get(def);
+            PropertyDefinition pdi = pdCache.get(def);
             if (pdi == null) {
                 pdi = new PropertyDefinitionImpl(def, this, getNamePathResolver(), valueFactory);
                 pdCache.put(def, pdi);
@@ -234,18 +234,18 @@
         try {
             String name = getNamePathResolver().getJCRName(ntName);
             synchronized (pdCache) {
-                Iterator iter = pdCache.values().iterator();
+                Iterator<PropertyDefinition> iter = pdCache.values().iterator();
                 while (iter.hasNext()) {
-                    PropertyDefinition pd = (PropertyDefinition) iter.next();
+                    PropertyDefinition pd = iter.next();
                     if (name.equals(pd.getDeclaringNodeType().getName())) {
                         iter.remove();
                     }
                 }
             }
             synchronized (ndCache) {
-                Iterator iter = ndCache.values().iterator();
+                Iterator<NodeDefinition> iter = ndCache.values().iterator();
                 while (iter.hasNext()) {
-                    NodeDefinition nd = (NodeDefinition) iter.next();
+                    NodeDefinition nd = iter.next();
                     if (name.equals(nd.getDeclaringNodeType().getName())) {
                         iter.remove();
                     }
@@ -271,18 +271,18 @@
         try {
             String name = getNamePathResolver().getJCRName(ntName);
             synchronized (pdCache) {
-                Iterator iter = pdCache.values().iterator();
+                Iterator<PropertyDefinition> iter = pdCache.values().iterator();
                 while (iter.hasNext()) {
-                    PropertyDefinition pd = (PropertyDefinition) iter.next();
+                    PropertyDefinition pd = iter.next();
                     if (name.equals(pd.getDeclaringNodeType().getName())) {
                         iter.remove();
                     }
                 }
             }
             synchronized (ndCache) {
-                Iterator iter = ndCache.values().iterator();
+                Iterator<NodeDefinition> iter = ndCache.values().iterator();
                 while (iter.hasNext()) {
-                    NodeDefinition nd = (NodeDefinition) iter.next();
+                    NodeDefinition nd = iter.next();
                     if (name.equals(nd.getDeclaringNodeType().getName())) {
                         iter.remove();
                     }
@@ -305,7 +305,7 @@
      */
     public NodeTypeIterator getAllNodeTypes() throws RepositoryException {
         Name[] ntNames = ntReg.getRegisteredNodeTypes();
-        ArrayList list = new ArrayList(ntNames.length);
+        ArrayList<NodeType> list = new ArrayList<NodeType>(ntNames.length);
         for (int i = 0; i < ntNames.length; i++) {
             list.add(getNodeType(ntNames[i]));
         }
@@ -317,7 +317,7 @@
      */
     public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException {
         Name[] ntNames = ntReg.getRegisteredNodeTypes();
-        ArrayList list = new ArrayList(ntNames.length);
+        ArrayList<NodeType> list = new ArrayList<NodeType>(ntNames.length);
         for (int i = 0; i < ntNames.length; i++) {
             NodeType nt = getNodeType(ntNames[i]);
             if (!nt.isMixin()) {
@@ -332,7 +332,7 @@
      */
     public NodeTypeIterator getMixinNodeTypes() throws RepositoryException {
         Name[] ntNames = ntReg.getRegisteredNodeTypes();
-        ArrayList list = new ArrayList(ntNames.length);
+        ArrayList<NodeType> list = new ArrayList<NodeType>(ntNames.length);
         for (int i = 0; i < ntNames.length; i++) {
             NodeType nt = getNodeType(ntNames[i]);
             if (nt.isMixin()) {
@@ -399,7 +399,7 @@
      * @see NodeTypeManager#unregisterNodeTypes(String[])
      */
     public void unregisterNodeTypes(String[] names) throws RepositoryException {
-        HashSet ntNames = new HashSet();
+        HashSet<Name> ntNames = new HashSet<Name>();
         for (String name : names) {
             ntNames.add(getNamePathResolver().getQName(name));
         }



Mime
View raw message