jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r793283 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/persistence/db/ main/java/org/apache/jackrabbit/core/persistence/xml/ main/java/org/apache/jackrabbit/core/retention/ main/java/org/apache/jackrabbit/c...
Date Sun, 12 Jul 2009 07:39:32 GMT
Author: jukka
Date: Sun Jul 12 07:39:31 2009
New Revision: 793283

URL: http://svn.apache.org/viewvc?rev=793283&view=rev
Log:
JCR-2087: Upgrade to Java 5 as the base platform

Various cleanups here and there.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalActivity.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/Importer.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java Sun Jul 12 07:39:31 2009
@@ -88,7 +88,7 @@
      */
     private static Logger log = LoggerFactory.getLogger(OraclePersistenceManager.class);
 
-    private Class blobClass;
+    private Class<?> blobClass;
     private Integer durationSessionConstant;
     private Integer modeReadWriteConstant;
 
@@ -376,7 +376,7 @@
         open.invoke(blob, new Object[]{modeReadWriteConstant});
         Method getBinaryOutputStream =
                 blobClass.getMethod("getBinaryOutputStream", new Class[0]);
-        OutputStream out = (OutputStream) getBinaryOutputStream.invoke(blob, null);
+        OutputStream out = (OutputStream) getBinaryOutputStream.invoke(blob);
         try {
             IOUtils.copy(in, out);
         } finally {
@@ -387,7 +387,7 @@
             out.close();
         }
         Method close = blobClass.getMethod("close", new Class[0]);
-        close.invoke(blob, null);
+        close.invoke(blob);
         return (Blob) blob;
     }
 
@@ -397,7 +397,7 @@
     protected void freeTemporaryBlob(Object blob) throws Exception {
         // blob.freeTemporary();
         Method freeTemporary = blobClass.getMethod("freeTemporary", new Class[0]);
-        freeTemporary.invoke(blob, null);
+        freeTemporary.invoke(blob);
     }
 
     //--------------------------------------------------------< inner classes >

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java Sun Jul 12 07:39:31 2009
@@ -59,7 +59,6 @@
 import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 /**
@@ -254,7 +253,7 @@
 
         // mixin types
         if (walker.enterElement(MIXINTYPES_ELEMENT)) {
-            Set mixins = new HashSet();
+            Set<Name> mixins = new HashSet<Name>();
             while (walker.iterateElements(MIXINTYPE_ELEMENT)) {
                 mixins.add(factory.create(walker.getAttribute(NAME_ATTRIBUTE)));
             }
@@ -334,7 +333,7 @@
         state.setModCount(Short.parseShort(modCount));
 
         // values
-        ArrayList values = new ArrayList();
+        ArrayList<InternalValue> values = new ArrayList<InternalValue>();
         if (walker.enterElement(VALUES_ELEMENT)) {
             while (walker.iterateElements(VALUE_ELEMENT)) {
                 // read serialized value
@@ -574,18 +573,15 @@
 
                 // mixin types
                 writer.write("\t<" + MIXINTYPES_ELEMENT + ">\n");
-                Iterator iter = state.getMixinTypeNames().iterator();
-                while (iter.hasNext()) {
+                for (Name mixin : state.getMixinTypeNames()) {
                     writer.write("\t\t<" + MIXINTYPE_ELEMENT + " "
-                            + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(iter.next().toString()) + "\"/>\n");
+                            + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(mixin.toString()) + "\"/>\n");
                 }
                 writer.write("\t</" + MIXINTYPES_ELEMENT + ">\n");
 
                 // properties
                 writer.write("\t<" + PROPERTIES_ELEMENT + ">\n");
-                iter = state.getPropertyNames().iterator();
-                while (iter.hasNext()) {
-                    Name propName = (Name) iter.next();
+                for (Name propName : state.getPropertyNames()) {
                     writer.write("\t\t<" + PROPERTY_ELEMENT + " "
                             + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(propName.toString()) + "\">\n");
                     // @todo serialize type, definition id and values
@@ -595,9 +591,7 @@
 
                 // child nodes
                 writer.write("\t<" + NODES_ELEMENT + ">\n");
-                iter = state.getChildNodeEntries().iterator();
-                while (iter.hasNext()) {
-                    ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+                for (ChildNodeEntry entry : state.getChildNodeEntries()) {
                     writer.write("\t\t<" + NODE_ELEMENT + " "
                             + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(entry.getName().toString()) + "\" "
                             + UUID_ATTRIBUTE + "=\"" + entry.getId() + "\">\n");
@@ -843,9 +837,7 @@
                 writer.write("<" + NODEREFERENCES_ELEMENT + " "
                         + TARGETID_ATTRIBUTE + "=\"" + refs.getTargetId() + "\">\n");
                 // write references (i.e. the id's of the REFERENCE properties)
-                Iterator iter = refs.getReferences().iterator();
-                while (iter.hasNext()) {
-                    PropertyId propId = (PropertyId) iter.next();
+                for (PropertyId propId : refs.getReferences()) {
                     writer.write("\t<" + NODEREFERENCE_ELEMENT + " "
                             + PROPERTYID_ATTRIBUTE + "=\"" + propId + "\"/>\n");
                 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java Sun Jul 12 07:39:31 2009
@@ -133,7 +133,7 @@
             PropertyImpl p = n.getProperty(REP_HOLD);
             Value[] vls = p.getValues();
 
-            List newValues = new ArrayList(vls.length - 1);
+            List<Value> newValues = new ArrayList<Value>(vls.length - 1);
             for (int i = 0; i < vls.length; i++) {
                 if (!hold.equals(HoldImpl.createFromValue(vls[i], n.getNodeId(), session))) {
                     newValues.add(vls[i]);
@@ -143,7 +143,7 @@
                 if (newValues.size() == 0) {
                     removeItem(p);
                 } else {
-                    setProperty(n, REP_HOLD, (Value[]) newValues.toArray(new Value[newValues.size()]));
+                    setProperty(n, REP_HOLD, newValues.toArray(new Value[newValues.size()]));
                 }
             } else {
                 // no matching hold.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java Sun Jul 12 07:39:31 2009
@@ -52,7 +52,7 @@
      * Map used for lookup by name
      * (key=name, value=either a single entry or a list of sns entries)
      */
-    private Map nameMap;
+    private Map<Name, Object> nameMap;
 
     /**
      * Indicates whether the entries and nameMap are shared with another
@@ -73,7 +73,7 @@
         if (obj == null) {
             return Collections.emptyList();
         }
-        if (obj instanceof ArrayList) {
+        if (obj instanceof ArrayList<?>) {
             // map entry is a list of siblings
             return Collections.unmodifiableList((ArrayList<ChildNodeEntry>) obj);
         } else {
@@ -91,11 +91,11 @@
         if (obj == null) {
             return null;
         }
-        if (obj instanceof ArrayList) {
+        if (obj instanceof ArrayList<?>) {
             // map entry is a list of siblings
-            ArrayList siblings = (ArrayList) obj;
+            ArrayList<ChildNodeEntry> siblings = (ArrayList<ChildNodeEntry>) obj;
             if (index <= siblings.size()) {
-                return (ChildNodeEntry) siblings.get(index - 1);
+                return siblings.get(index - 1);
             }
         } else {
             // map entry is a single child node entry
@@ -108,13 +108,13 @@
 
     ChildNodeEntry add(Name nodeName, NodeId id) {
         ensureModifiable();
-        List siblings = null;
+        List<Object> siblings = null;
         int index = 0;
         Object obj = nameMap.get(nodeName);
         if (obj != null) {
-            if (obj instanceof ArrayList) {
+            if (obj instanceof ArrayList<?>) {
                 // map entry is a list of siblings
-                siblings = (ArrayList) obj;
+                siblings = (ArrayList<Object>) obj;
                 if (siblings.size() > 0) {
                     // reuse immutable Name instance from 1st same name sibling
                     // in order to help gc conserving memory
@@ -123,7 +123,7 @@
             } else {
                 // map entry is a single child node entry,
                 // convert to siblings list
-                siblings = new ArrayList();
+                siblings = new ArrayList<Object>();
                 siblings.add(obj);
                 nameMap.put(nodeName, siblings);
             }
@@ -143,10 +143,8 @@
         return entry;
     }
 
-    void addAll(List entriesList) {
-        Iterator iter = entriesList.iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+    void addAll(List<ChildNodeEntry> entriesList) {
+        for (ChildNodeEntry entry : entriesList) {
             // delegate to add(Name, String) to maintain consistency
             add(entry.getName(), entry.getId());
         }
@@ -175,19 +173,19 @@
         }
 
         // map entry is a list of siblings
-        List siblings = (ArrayList) obj;
+        List<ChildNodeEntry> siblings = (ArrayList<ChildNodeEntry>) obj;
         if (index > siblings.size()) {
             return null;
         }
 
         // remove from siblings list
-        ChildNodeEntry removedEntry = (ChildNodeEntry) siblings.remove(index - 1);
+        ChildNodeEntry removedEntry = siblings.remove(index - 1);
         // remove from ordered entries map
         entries.remove(removedEntry.getId());
 
         // update indices of subsequent same-name siblings
         for (int i = index - 1; i < siblings.size(); i++) {
-            ChildNodeEntry oldEntry = (ChildNodeEntry) siblings.get(i);
+            ChildNodeEntry oldEntry = siblings.get(i);
             ChildNodeEntry newEntry = new ChildNodeEntry(nodeName, oldEntry.getId(), oldEntry.getIndex() - 1);
             // overwrite old entry with updated entry in siblings list
             siblings.set(i, newEntry);
@@ -262,10 +260,8 @@
             return this;
         }
 
-        List result = new ArrayList();
-        Iterator iter = iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+        List<ChildNodeEntry> result = new ArrayList<ChildNodeEntry>();
+        for (ChildNodeEntry entry : this) {
             ChildNodeEntry otherEntry = other.get(entry.getId());
             if (entry == otherEntry) {
                 continue;
@@ -275,7 +271,6 @@
                 result.add(entry);
             }
         }
-
         return result;
     }
 
@@ -298,10 +293,8 @@
             return Collections.emptyList();
         }
 
-        List result = new ArrayList();
-        Iterator iter = iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+        List<ChildNodeEntry> result = new ArrayList<ChildNodeEntry>();
+        for (ChildNodeEntry entry : this) {
             ChildNodeEntry otherEntry = other.get(entry.getId());
             if (entry == otherEntry) {
                 result.add(entry);
@@ -310,7 +303,6 @@
                 result.add(entry);
             }
         }
-
         return result;
     }
 
@@ -358,15 +350,15 @@
         return new EntriesIterator();
     }
 
-    public ListIterator listIterator() {
+    public ListIterator<ChildNodeEntry> listIterator() {
         return new EntriesIterator();
     }
 
-    public ListIterator listIterator(int index) {
+    public ListIterator<ChildNodeEntry> listIterator(int index) {
         if (index < 0 || index >= entries.size()) {
             throw new IndexOutOfBoundsException();
         }
-        ListIterator iter = new EntriesIterator();
+        ListIterator<ChildNodeEntry> iter = new EntriesIterator();
         while (index-- > 0) {
             iter.next();
         }
@@ -377,9 +369,9 @@
         return entries.size();
     }
 
-    public List subList(int fromIndex, int toIndex) {
+    public List<ChildNodeEntry> subList(int fromIndex, int toIndex) {
         // @todo FIXME does not fulfill the contract of List.subList(int,int)
-        return Collections.unmodifiableList(new ArrayList(this).subList(fromIndex, toIndex));
+        return Collections.unmodifiableList(new ArrayList<ChildNodeEntry>(this).subList(fromIndex, toIndex));
     }
 
     public Object[] toArray() {
@@ -511,11 +503,11 @@
      */
     private void ensureModifiable() {
         if (nameMap == Collections.EMPTY_MAP) {
-            nameMap = new HashMap();
+            nameMap = new HashMap<Name, Object>();
             entries = new LinkedMap();
         } else if (shared) {
             entries = (LinkedMap) entries.clone();
-            nameMap = (Map) ((HashMap) nameMap).clone();
+            nameMap = (Map<Name, Object>) ((HashMap<Name, Object>) nameMap).clone();
             for (Iterator it = nameMap.entrySet().iterator(); it.hasNext(); ) {
                 Map.Entry entry = (Map.Entry) it.next();
                 Object value = entry.getValue();
@@ -528,7 +520,7 @@
     }
 
     //--------------------------------------------------------< inner classes >
-    class EntriesIterator implements ListIterator {
+    class EntriesIterator implements ListIterator<ChildNodeEntry> {
 
         private final OrderedMapIterator mapIter;
 
@@ -540,9 +532,9 @@
             return mapIter.hasNext();
         }
 
-        public Object next() {
+        public ChildNodeEntry next() {
             mapIter.next();
-            return mapIter.getValue();
+            return (ChildNodeEntry) mapIter.getValue();
         }
 
         public boolean hasPrevious() {
@@ -553,16 +545,16 @@
             return entries.indexOf(mapIter.getKey()) + 1;
         }
 
-        public Object previous() {
+        public ChildNodeEntry previous() {
             mapIter.previous();
-            return mapIter.getValue();
+            return (ChildNodeEntry) mapIter.getValue();
         }
 
         public int previousIndex() {
             return entries.indexOf(mapIter.getKey()) - 1;
         }
 
-        public void add(Object o) {
+        public void add(ChildNodeEntry o) {
             throw new UnsupportedOperationException();
         }
 
@@ -570,7 +562,7 @@
             throw new UnsupportedOperationException();
         }
 
-        public void set(Object o) {
+        public void set(ChildNodeEntry o) {
             throw new UnsupportedOperationException();
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalActivity.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalActivity.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalActivity.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalActivity.java Sun Jul 12 07:39:31 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.version;
 
-import java.util.Collection;
 import java.util.Map;
 
 import javax.jcr.RepositoryException;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java Sun Jul 12 07:39:31 2009
@@ -35,7 +35,6 @@
 import javax.jcr.version.OnParentVersionAction;
 import javax.jcr.version.VersionException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -103,10 +102,9 @@
         } catch (ItemStateException e) {
             throw new RepositoryException(e);
         }
-        List propList = new ArrayList();
+        List<PropertyState> propList = new ArrayList<PropertyState>();
 
-        for (int i = 0; i < props.length; i++) {
-            PropertyState prop = props[i];
+        for (PropertyState prop : props) {
             if (prop.getName().equals(NameConstants.JCR_FROZENUUID)) {
                 // special property
                 InternalValue value =
@@ -175,13 +173,11 @@
         if (frozenNodes == null) {
             try {
                 // maybe add iterator?
-                List entries = node.getState().getChildNodeEntries();
+                List<ChildNodeEntry> entries =
+                    node.getState().getChildNodeEntries();
                 frozenNodes = new InternalFreeze[entries.size()];
-                Iterator iter = entries.iterator();
                 int i = 0;
-                while (iter.hasNext()) {
-                    ChildNodeEntry entry =
-                            (ChildNodeEntry) iter.next();
+                for (ChildNodeEntry entry : entries) {
                     frozenNodes[i++] = (InternalFreeze) vMgr.getItem(entry.getId());
                 }
             } catch (RepositoryException e) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java Sun Jul 12 07:39:31 2009
@@ -24,7 +24,6 @@
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java Sun Jul 12 07:39:31 2009
@@ -256,7 +256,7 @@
      * @param store if <code>true</code> the node is stored
      * @throws RepositoryException if a repository error occurs
      */
-    private void storeXCessors(List/*<InternalVersion>*/ cessors, Name propname, boolean store)
+    private void storeXCessors(List<InternalVersion> cessors, Name propname, boolean store)
             throws RepositoryException {
         InternalValue[] values = new InternalValue[cessors.size()];
         for (int i = 0; i < values.length; i++) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java Sun Jul 12 07:39:31 2009
@@ -32,10 +32,8 @@
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -136,11 +134,10 @@
      * @return the properties of this node
      */
     public PropertyState[] getProperties() throws ItemStateException {
-        Set set = nodeState.getPropertyNames();
+        Set<Name> set = nodeState.getPropertyNames();
         PropertyState[] props = new PropertyState[set.size()];
         int i = 0;
-        for (Iterator iter = set.iterator(); iter.hasNext();) {
-            Name propName = (Name) iter.next();
+        for (Name propName : set) {
             PropertyId propId = new PropertyId(nodeState.getNodeId(), propName);
             props[i++] = (PropertyState) stateMgr.getItemState(propId);
         }
@@ -348,9 +345,7 @@
         NodeState state = (NodeState) stateMgr.getItemState(id);
 
         // remove properties
-        Iterator iter = state.getPropertyNames().iterator();
-        while (iter.hasNext()) {
-            Name name = (Name) iter.next();
+        for (Name name :  state.getPropertyNames()) {
             PropertyId propId = new PropertyId(id, name);
             PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
             stateMgr.destroy(propState);
@@ -358,9 +353,7 @@
         state.removeAllPropertyNames();
 
         // remove child nodes
-        iter = state.getChildNodeEntries().iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+        for (ChildNodeEntry entry : state.getChildNodeEntries()) {
             removeNode(entry.getId());
         }
         state.removeAllChildNodeEntries();
@@ -473,7 +466,7 @@
         NodeStateEx node = new NodeStateEx(stateMgr, ntReg, state, name);
         node.setPropertyValue(NameConstants.JCR_PRIMARYTYPE, InternalValue.create(nodeTypeName));
 
-        // add new child node entryn
+        // add new child node entry
         nodeState.addChildNodeEntry(name, id);
         if (nodeState.getStatus() == ItemState.STATUS_EXISTING) {
             nodeState.setStatus(ItemState.STATUS_EXISTING_MODIFIED);
@@ -489,12 +482,12 @@
      */
     public NodeStateEx[] getChildNodes() throws RepositoryException {
         try {
-            List entries = nodeState.getChildNodeEntries();
+            List<ChildNodeEntry> entries = nodeState.getChildNodeEntries();
             NodeStateEx[] children = new NodeStateEx[entries.size()];
-            for (int i = 0; i < entries.size(); i++) {
-                ChildNodeEntry entry = (ChildNodeEntry) entries.get(i);
+            int i = 0;
+            for (ChildNodeEntry entry : entries) {
                 NodeState state = (NodeState) stateMgr.getItemState(entry.getId());
-                children[i] = new NodeStateEx(stateMgr, ntReg, state, entry.getName());
+                children[i++] = new NodeStateEx(stateMgr, ntReg, state, entry.getName());
             }
             return children;
         } catch (ItemStateException e) {
@@ -526,9 +519,7 @@
 
         if (state.getStatus() != ItemState.STATUS_EXISTING) {
             // first store all transient properties
-            Set props = state.getPropertyNames();
-            for (Iterator iter = props.iterator(); iter.hasNext();) {
-                Name propName = (Name) iter.next();
+            for (Name propName : state.getPropertyNames()) {
                 PropertyState pstate = (PropertyState) stateMgr.getItemState(
                         new PropertyId(state.getNodeId(), propName));
                 if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
@@ -536,9 +527,7 @@
                 }
             }
             // now store all child node entries
-            List nodes = state.getChildNodeEntries();
-            for (int i = 0; i < nodes.size(); i++) {
-                ChildNodeEntry entry = (ChildNodeEntry) nodes.get(i);
+            for (ChildNodeEntry entry : state.getChildNodeEntries()) {
                 NodeState nstate = (NodeState) stateMgr.getItemState(entry.getId());
                 store(nstate);
             }
@@ -571,9 +560,7 @@
     private void reload(NodeState state) throws ItemStateException {
         if (state.getStatus() != ItemState.STATUS_EXISTING) {
             // first discard all all transient properties
-            Set props = state.getPropertyNames();
-            for (Iterator iter = props.iterator(); iter.hasNext();) {
-                Name propName = (Name) iter.next();
+            for (Name propName : state.getPropertyNames()) {
                 PropertyState pstate = (PropertyState) stateMgr.getItemState(
                         new PropertyId(state.getNodeId(), propName));
                 if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
@@ -581,9 +568,7 @@
                 }
             }
             // now reload all child node entries
-            List nodes = state.getChildNodeEntries();
-            for (int i = 0; i < nodes.size(); i++) {
-                ChildNodeEntry entry = (ChildNodeEntry) nodes.get(i);
+            for (ChildNodeEntry entry : state.getChildNodeEntries()) {
                 NodeState nstate = (NodeState) stateMgr.getItemState(entry.getId());
                 reload(nstate);
             }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Sun Jul 12 07:39:31 2009
@@ -39,6 +39,7 @@
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher;
+import org.apache.jackrabbit.core.observation.EventState;
 import org.apache.jackrabbit.core.observation.EventStateCollection;
 import org.apache.jackrabbit.core.observation.EventStateCollectionFactory;
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
@@ -643,7 +644,7 @@
     /**
      * {@inheritDoc}
      */
-    public void externalUpdate(ChangeLog changes, List events,
+    public void externalUpdate(ChangeLog changes, List<EventState> events,
                                long timestamp, String userData)
             throws RepositoryException {
         EventStateCollection esc = getEscFactory().createEventStateCollection(null);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java Sun Jul 12 07:39:31 2009
@@ -40,7 +40,6 @@
 import org.slf4j.LoggerFactory;
 
 import javax.jcr.RepositoryException;
-import java.util.Iterator;
 import java.util.Collection;
 
 /**
@@ -76,7 +75,8 @@
     /**
      * Listeners (weak references)
      */
-    private final transient Collection listeners = new WeakIdentityCollection(5);
+    private final transient Collection<ItemStateListener> listeners =
+        new WeakIdentityCollection(5);
 
     /**
      * Creates an abstract virtual item state provider
@@ -360,9 +360,7 @@
                 for (int i = 0; i < props.length; i++) {
                     props[i].notifyStateUpdated();
                 }
-                Iterator iter = state.getChildNodeEntries().iterator();
-                while (iter.hasNext()) {
-                    ChildNodeEntry pe = (ChildNodeEntry) iter.next();
+                for (ChildNodeEntry pe : state.getChildNodeEntries()) {
                     invalidateItem(pe.getId(), true);
                 }
             }
@@ -425,7 +423,7 @@
     public void stateCreated(ItemState created) {
         ItemStateListener[] la;
         synchronized (listeners) {
-            la = (ItemStateListener[]) listeners.toArray(new ItemStateListener[listeners.size()]);
+            la = listeners.toArray(new ItemStateListener[listeners.size()]);
         }
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {
@@ -440,7 +438,7 @@
     public void stateModified(ItemState modified) {
         ItemStateListener[] la;
         synchronized (listeners) {
-            la = (ItemStateListener[]) listeners.toArray(new ItemStateListener[listeners.size()]);
+            la = listeners.toArray(new ItemStateListener[listeners.size()]);
         }
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {
@@ -464,7 +462,7 @@
 
         ItemStateListener[] la;
         synchronized (listeners) {
-            la = (ItemStateListener[]) listeners.toArray(new ItemStateListener[listeners.size()]);
+            la = listeners.toArray(new ItemStateListener[listeners.size()]);
         }
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {
@@ -488,7 +486,7 @@
 
         ItemStateListener[] la;
         synchronized (listeners) {
-            la = (ItemStateListener[]) listeners.toArray(new ItemStateListener[listeners.size()]);
+            la = listeners.toArray(new ItemStateListener[listeners.size()]);
         }
         for (int i = 0; i < la.length; i++) {
             if (la[i] != null) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java Sun Jul 12 07:39:31 2009
@@ -41,12 +41,12 @@
 
     /**
      * map of property states of this node state
-     * key=propname, value={@link VirtualPropertyState}
      */
-    private final HashMap properties = new HashMap();
+    private final HashMap<Name, VirtualPropertyState> properties =
+        new HashMap<Name, VirtualPropertyState>();
 
     /** a set of hard references to child states */
-    private HashSet stateRefs = null;
+    private HashSet<NodeState> stateRefs = null;
 
     /**
      * creates a new virtual node state
@@ -78,7 +78,7 @@
      * @return the properties.
      */
     public VirtualPropertyState[] getProperties() {
-        return (VirtualPropertyState[]) properties.values().toArray(new VirtualPropertyState[properties.size()]);
+        return properties.values().toArray(new VirtualPropertyState[properties.size()]);
     }
 
 
@@ -191,7 +191,7 @@
      */
     public void setMixinNodeTypes(Name[] mixins) throws RepositoryException {
         if (mixins != null) {
-            HashSet set = new HashSet();
+            HashSet<Name> set = new HashSet<Name>();
             InternalValue[] values = new InternalValue[mixins.length];
             for (int i = 0; i < mixins.length; i++) {
                 set.add(mixins[i]);
@@ -208,7 +208,7 @@
      */
     public void addStateReference(NodeState state) {
         if (stateRefs == null) {
-            stateRefs = new HashSet();
+            stateRefs = new HashSet<NodeState>();
         }
         stateRefs.add(state);
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java Sun Jul 12 07:39:31 2009
@@ -51,7 +51,7 @@
      * in the startElement method and is popped from the stack in the
      * endElement method.
      */
-    private final Stack stack = new Stack();
+    private final Stack<NodeInfo> stack = new Stack<NodeInfo>();
     // buffer used to merge adjacent character data
     private BufferedStringValue textHandler = null;
 
@@ -156,10 +156,10 @@
                         new NodeInfo(NameConstants.JCR_XMLTEXT, null, null, null);
                 TextValue[] values =
                         new TextValue[]{textHandler};
-                ArrayList props = new ArrayList();
-                PropInfo prop = new PropInfo(
-                        NameConstants.JCR_XMLCHARACTERS, PropertyType.STRING, values);
-                props.add(prop);
+                ArrayList<PropInfo> props = new ArrayList<PropInfo>();
+                props.add(new PropInfo(
+                        NameConstants.JCR_XMLCHARACTERS,
+                        PropertyType.STRING, values));
                 // call Importer
                 importer.startNode(node, props);
                 importer.endNode(node);
@@ -230,7 +230,7 @@
             Name nodeTypeName = null;
             Name[] mixinTypes = null;
 
-            ArrayList props = new ArrayList(atts.getLength());
+            ArrayList<PropInfo> props = new ArrayList<PropInfo>(atts.getLength());
             for (int i = 0; i < atts.getLength(); i++) {
                 if (atts.getURI(i).equals(Name.NS_XMLNS_URI)) {
                     // skip namespace declarations reported as attributes

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/Importer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/Importer.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/Importer.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/Importer.java Sun Jul 12 07:39:31 2009
@@ -47,7 +47,7 @@
      *                  (list of {@link PropInfo} instances)
      * @throws RepositoryException on a repository error
      */
-    void startNode(NodeInfo nodeInfo, List propInfos)
+    void startNode(NodeInfo nodeInfo, List<PropInfo> propInfos)
             throws RepositoryException;
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/NamespaceContext.java Sun Jul 12 07:39:31 2009
@@ -20,7 +20,6 @@
 
 import javax.jcr.NamespaceException;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -44,12 +43,12 @@
     /**
      * The namespace prefix to namespace URI mapping.
      */
-    private final Map prefixToURI;
+    private final Map<String, String> prefixToURI;
 
     /**
      * The namespace URI to namespace prefix mapping.
      */
-    private final Map uriToPrefix;
+    private final Map<String, String> uriToPrefix;
 
     /**
      * Creates a NamespaceContext instance with the given parent context
@@ -58,14 +57,12 @@
      * @param parent parent context
      * @param mappings local namespace mappings (prefix -> URI)
      */
-    public NamespaceContext(NamespaceContext parent, Map mappings) {
+    public NamespaceContext(NamespaceContext parent, Map<String, String> mappings) {
         this.parent = parent;
-        this.prefixToURI = new HashMap();
-        this.uriToPrefix = new HashMap();
+        this.prefixToURI = new HashMap<String, String>();
+        this.uriToPrefix = new HashMap<String, String>();
 
-        Iterator iterator = mappings.entrySet().iterator();
-        while (iterator.hasNext()) {
-            Map.Entry mapping = (Map.Entry) iterator.next();
+        for (Map.Entry<String, String> mapping : mappings.entrySet()) {
             prefixToURI.put(mapping.getKey(), mapping.getValue());
             uriToPrefix.put(mapping.getValue(), mapping.getKey());
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java Sun Jul 12 07:39:31 2009
@@ -31,7 +31,6 @@
 import javax.jcr.ValueFactory;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.Stack;
 
 /**
@@ -45,7 +44,7 @@
      * the same instance is popped from the stack in the endElement method
      * when the corresponding sv:node element is encountered.
      */
-    private final Stack stack = new Stack();
+    private final Stack<ImportState> stack = new Stack<ImportState>();
 
     /**
      * fields used temporarily while processing sv:property and sv:value elements
@@ -53,7 +52,8 @@
     private Name currentPropName;
     private int currentPropType = PropertyType.UNDEFINED;
     // list of AppendableValue objects
-    private ArrayList currentPropValues = new ArrayList();
+    private ArrayList<BufferedStringValue> currentPropValues =
+        new ArrayList<BufferedStringValue>();
     private BufferedStringValue currentPropValue;
 
     /**
@@ -72,7 +72,7 @@
         }
         Name[] mixinNames = null;
         if (state.mixinNames != null) {
-            mixinNames = (Name[]) state.mixinNames.toArray(
+            mixinNames = state.mixinNames.toArray(
                     new Name[state.mixinNames.size()]);
         }
         NodeId id = null;
@@ -86,8 +86,7 @@
             if (start) {
                 importer.startNode(node, state.props);
                 // dispose temporary property values
-                for (Iterator iter = state.props.iterator(); iter.hasNext();) {
-                    PropInfo pi = (PropInfo) iter.next();
+                for (PropInfo pi : state.props) {
                     pi.dispose();
                 }
 
@@ -257,7 +256,7 @@
                 }
             } else if (currentPropName.equals(NameConstants.JCR_MIXINTYPES)) {
                 if (state.mixinNames == null) {
-                    state.mixinNames = new ArrayList(currentPropValues.size());
+                    state.mixinNames = new ArrayList<Name>(currentPropValues.size());
                 }
                 for (int i = 0; i < currentPropValues.size(); i++) {
                     BufferedStringValue val =
@@ -317,7 +316,7 @@
         /**
          * list of mixin types of current node
          */
-        ArrayList mixinNames;
+        ArrayList<Name> mixinNames;
         /**
          * uuid of current node
          */
@@ -326,7 +325,7 @@
         /**
          * list of PropInfo instances representing properties of current node
          */
-        ArrayList props = new ArrayList();
+        ArrayList<PropInfo> props = new ArrayList<PropInfo>();
 
         /**
          * flag indicating whether startNode() has been called for current node

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java Sun Jul 12 07:39:31 2009
@@ -71,7 +71,7 @@
     private final int uuidBehavior;
 
     private boolean aborted;
-    private Stack parents;
+    private Stack<NodeState> parents;
 
     /**
      * helper object that keeps track of remapped uuid's and imported reference
@@ -124,7 +124,7 @@
 
         refTracker = new ReferenceChangeTracker();
 
-        parents = new Stack();
+        parents = new Stack<NodeState>();
         parents.push(importTarget);
     }
 
@@ -242,7 +242,7 @@
             // => backup list of child node entries beforehand in order
             // to restore it afterwards
             ChildNodeEntry cneConflicting = parent.getChildNodeEntry(nodeInfo.getId());
-            List cneList = new ArrayList(parent.getChildNodeEntries());
+            List<ChildNodeEntry> cneList = new ArrayList<ChildNodeEntry>(parent.getChildNodeEntries());
             // do remove conflicting (recursive)
             itemOps.removeNodeState(conflicting);
             // create new with given uuid at same location as conflicting:
@@ -269,8 +269,7 @@
                 // replace child node entry with different name
                 // but preserving original position
                 parent.removeAllChildNodeEntries();
-                for (Iterator iter = cneList.iterator(); iter.hasNext();) {
-                    ChildNodeEntry cne = (ChildNodeEntry) iter.next();
+                for (ChildNodeEntry cne : cneList) {
                     if (cne.getId().equals(nodeInfo.getId())) {
                         // replace entry with different name
                         parent.addChildNodeEntry(nodeInfo.getName(), nodeInfo.getId());
@@ -388,7 +387,7 @@
     /**
      * {@inheritDoc}
      */
-    public void startNode(NodeInfo nodeInfo, List propInfos)
+    public void startNode(NodeInfo nodeInfo, List<PropInfo> propInfos)
             throws RepositoryException {
         if (aborted) {
             // the import has been aborted, get outta here...
@@ -516,9 +515,7 @@
             }
 
             // process properties
-            Iterator iter = propInfos.iterator();
-            while (iter.hasNext()) {
-                PropInfo pi = (PropInfo) iter.next();
+            for (PropInfo pi : propInfos) {
                 pi.apply(node, itemOps, ntReg, refTracker);
             }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java?rev=793283&r1=793282&r2=793283&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java Sun Jul 12 07:39:31 2009
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.state;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import junit.framework.TestCase;
@@ -51,7 +50,7 @@
     /**
      * List of change logs, each with a different modification for {@link #state}.
      */
-    protected List logs;
+    protected List<ChangeLog> logs;
 
     protected void setUp() throws Exception {
         super.setUp();
@@ -59,7 +58,7 @@
         NodeId id = new NodeId();
         state = new NodeState(id, NameConstants.NT_BASE, null, ItemState.STATUS_EXISTING, true);
         refs = new NodeReferences(state.getNodeId());
-        logs = new ArrayList();
+        logs = new ArrayList<ChangeLog>();
         ChangeLog log = new ChangeLog();
         log.added(state);
         logs.add(log);
@@ -88,8 +87,7 @@
      */
     public void testReadBlocksWrite() throws InterruptedException {
         ReadLock rLock = locking.acquireReadLock(state.getId());
-        for (Iterator it = logs.iterator(); it.hasNext();) {
-            ChangeLog changeLog = (ChangeLog) it.next();
+        for (ChangeLog changeLog : logs) {
             verifyBlocked(startWriterThread(locking, changeLog));
         }
         rLock.release();
@@ -104,8 +102,7 @@
      * @throws InterruptedException on interruption; this will err the test
      */
     public void testWriteBlocksRead() throws InterruptedException {
-        for (Iterator it = logs.iterator(); it.hasNext();) {
-            ChangeLog changeLog = (ChangeLog) it.next();
+        for (ChangeLog changeLog : logs) {
             WriteLock wLock = locking.acquireWriteLock(changeLog);
             verifyBlocked(startReaderThread(locking, state.getId()));
             wLock.release();
@@ -113,10 +110,8 @@
     }
 
     public void testWriteBlocksRead_notIfSameThread() throws InterruptedException {
-        for (Iterator it = logs.iterator(); it.hasNext();) {
-            final ChangeLog changeLog = (ChangeLog) it.next();
+        for (final ChangeLog changeLog : logs) {
             Thread t = new Thread(new Runnable() {
-
                 public void run() {
                     try {
                         WriteLock wLock = locking.acquireWriteLock(changeLog);
@@ -144,8 +139,7 @@
         ChangeLog cl = new ChangeLog();
         cl.added(state);
         WriteLock wLock = locking.acquireWriteLock(cl);
-        for (Iterator it = logs.iterator(); it.hasNext();) {
-            ChangeLog changeLog = (ChangeLog) it.next();
+        for (ChangeLog changeLog : logs) {
             verifyBlocked(startWriterThread(locking, changeLog));
         }
         wLock.release();
@@ -157,8 +151,7 @@
      * @throws InterruptedException on interruption; this will err the test
      */
     public void testDowngrade() throws InterruptedException {
-        for (Iterator it = logs.iterator(); it.hasNext();) {
-            ChangeLog changeLog = (ChangeLog) it.next();
+        for (ChangeLog changeLog : logs) {
             WriteLock wLock = locking.acquireWriteLock(changeLog);
             verifyBlocked(startReaderThread(locking, state.getId()));
             ReadLock rLock = wLock.downgrade();



Mime
View raw message