jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r915339 [1/4] - in /jackrabbit/trunk/jackrabbit-jcr-server/src: main/java/org/apache/jackrabbit/server/io/ main/java/org/apache/jackrabbit/server/jcr/ main/java/org/apache/jackrabbit/server/remoting/davex/ main/java/org/apache/jackrabbit/se...
Date Tue, 23 Feb 2010 13:37:40 GMT
Author: angela
Date: Tue Feb 23 13:37:38 2010
New Revision: 915339

URL: http://svn.apache.org/viewvc?rev=915339&view=rev
Log:
JCR-2509 : Reduce number of compiler warning by adding @Override and generics where appropriate [step 2: jackrabbit-jcr-server]

in addition:
- minor improvements in comments, typos
- use foreach loops where possible
- remove redundant Tika imports in server/io package
- remove redundant casts
- add missing index increment in SubscriptionManagerImpl.SubscriptionMap

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/BoundedInputStream.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultIOManager.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DirListingExportHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContextImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOUtil.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContext.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyImportContext.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManager.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHistoryHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/XmlHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ZipHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/jcr/JCRWebdavServer.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/BatchReadConfig.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/DiffParser.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JsonDiffHandler.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/RequestData.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DavLocatorFactoryImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JCRWebdavServerServlet.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavException.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/JcrDavSession.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/RootCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/lock/JcrActiveLock.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeDefinitionImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeProperty.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/PropertyDefinitionImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/LengthsProperty.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/NamespacesProperty.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/ValuesProperty.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionHistoryItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionProviderImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DefaultItemFilter.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImplEx.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceConfig.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionControlledResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionHistoryResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/BasicCredentialsProviderTest.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/remoting/davex/DiffParserTest.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/remoting/davex/JsonDiffHandlerTest.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImplExTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/BoundedInputStream.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/BoundedInputStream.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/BoundedInputStream.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/BoundedInputStream.java Tue Feb 23 13:37:38 2010
@@ -70,6 +70,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public int read() throws IOException {
         if (max>=0 && pos==max) {
             return -1;
@@ -82,6 +83,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public int read(byte[] b) throws IOException {
         return this.read(b, 0, b.length);
     }
@@ -89,6 +91,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         if (max>=0 && pos>=max) {
             return -1;
@@ -107,6 +110,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public long skip(long n) throws IOException {
         long toSkip = max>=0 ? Math.min(n, max-pos) : n;
         long skippedBytes = in.skip(toSkip);
@@ -117,6 +121,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public int available() throws IOException {
         if (max>=0 && pos>=max) {
             return 0;
@@ -127,6 +132,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public String toString() {
         return in.toString();
     }
@@ -134,6 +140,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public void close() throws IOException {
         if (propagateClose) {
             in.close();
@@ -143,6 +150,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public synchronized void reset() throws IOException {
         in.reset();
         pos = mark;
@@ -151,6 +159,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public synchronized void mark(int readlimit) {
         in.mark(readlimit);
         mark = pos;
@@ -159,6 +168,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean markSupported() {
         return in.markSupported();
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java Tue Feb 23 13:37:38 2010
@@ -24,6 +24,7 @@
 import org.apache.jackrabbit.webdav.xml.Namespace;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.DavProperty;
+import org.apache.jackrabbit.webdav.property.PropEntry;
 import org.apache.tika.metadata.Metadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,7 +44,6 @@
 import java.util.Map;
 import java.util.List;
 import java.util.HashMap;
-import java.util.Iterator;
 
 /**
  * <code>DefaultHandler</code> implements a simple IOHandler that creates 'file'
@@ -86,8 +86,6 @@
      * <li>Nodetype for Non-Collection: {@link JcrConstants#NT_FILE nt:file}</li>
      * <li>Nodetype for Non-Collection content: {@link JcrConstants#NT_UNSTRUCTURED nt:unstructured}</li>
      * </ul>
-     *
-     * @param ioManager the I/O manager
      */
     public DefaultHandler() {
         this(null);
@@ -439,7 +437,7 @@
         if (contentNode.hasProperty(JcrConstants.JCR_DATA)) {
             Property p = contentNode.getProperty(JcrConstants.JCR_DATA);
             IOUtil.spool(p.getStream(), context.getOutputStream());
-        } // else: stream undefined -> contentlength was not set
+        } // else: stream undefined -> content length was not set
     }
 
     /**
@@ -474,7 +472,7 @@
             }
             if (contentNode.hasProperty(JcrConstants.JCR_ENCODING)) {
                 encoding = contentNode.getProperty(JcrConstants.JCR_ENCODING).getString();
-                // ignore "" encodings (although this is avoided during import)
+                // ignore "" encoding (although this is avoided during import)
                 if ("".equals(encoding)) {
                     encoding = null;
                 }
@@ -604,15 +602,15 @@
         }
     }
 
-    public Map importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
+    public Map<? extends PropEntry, ?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
         if (!canImport(importContext, isCollection)) {
             throw new RepositoryException("PropertyHandler " + getName() + " failed import properties");
         }
 
         // loop over List and remember all properties and propertyNames
         // that failed to be imported (set or remove).
-        Map failures = new HashMap();
-        List changeList = importContext.getChangeList();
+        Map<PropEntry, RepositoryException> failures = new HashMap<PropEntry, RepositoryException>();
+        List<? extends PropEntry> changeList = importContext.getChangeList();
 
         // for collections the import-root is the target node where properties
         // are altered. in contrast 'non-collections' are with the handler
@@ -625,9 +623,7 @@
         }
 
         if (changeList != null) {
-            Iterator it = changeList.iterator();
-            while (it.hasNext()) {
-                Object propEntry = it.next();
+            for (PropEntry propEntry : changeList) {
                 try {
                     if (propEntry instanceof DavPropertyName) {
                         // remove
@@ -635,7 +631,7 @@
                         removeJcrProperty(propName, cn);
                     } else if (propEntry instanceof DavProperty) {
                         // add or modify property
-                        DavProperty prop = (DavProperty)propEntry;
+                        DavProperty<?> prop = (DavProperty<?>) propEntry;
                         setJcrProperty(prop, cn);
                     } else {
                         // ignore any other entry in the change list
@@ -726,7 +722,7 @@
      * @param contentNode the content node
      * @throws RepositoryException if an error during repository access occurs.
      */
-    private void setJcrProperty(DavProperty property, Node contentNode) throws RepositoryException {
+    private void setJcrProperty(DavProperty<?> property, Node contentNode) throws RepositoryException {
         // Retrieve the property value. Note, that a 'null' value is replaced
         // by empty string, since setting a jcr property value to 'null'
         // would be equivalent to its removal.

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultIOManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultIOManager.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultIOManager.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultIOManager.java Tue Feb 23 13:37:38 2010
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.server.io;
 
-import org.apache.tika.detect.Detector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DirListingExportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DirListingExportHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DirListingExportHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DirListingExportHandler.java Tue Feb 23 13:37:38 2010
@@ -19,6 +19,7 @@
 import org.apache.jackrabbit.util.Text;
 import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavResourceIterator;
+import org.apache.jackrabbit.webdav.property.PropEntry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -130,7 +131,7 @@
             throw new IOException(getName() + ": Cannot export " + context.getExportRoot());
         }
 
-        // properties (contentlength undefined)
+        // properties (content length undefined)
         context.setModificationTime(new Date().getTime());
         context.setContentType("text/html", "UTF-8");
         context.setETag("");
@@ -194,7 +195,7 @@
             throw new IOException(getName() + ": Cannot export " + context.getExportRoot());
         }
 
-        // properties (contentlength undefined)
+        // properties (content length undefined)
         context.setModificationTime(new Date().getTime());
         context.setContentType("text/html", "UTF-8");
         context.setETag("");
@@ -281,7 +282,7 @@
      * @see PropertyHandler#exportProperties(PropertyExportContext, boolean)
      */
     public boolean exportProperties(PropertyExportContext exportContext, boolean isCollection) throws RepositoryException {
-        // export-content facility only... no responsible for propfind.
+        // export-content facility only... no responsible for PROPFIND.
         throw new RepositoryException(getName() + ": Cannot export properties for context " + exportContext);
     }
 
@@ -292,8 +293,8 @@
     /**
      * @see PropertyHandler#importProperties(PropertyImportContext, boolean)
      */
-    public Map importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
+    public Map<? extends PropEntry, ?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
         // export facilities only -> throw
         throw new RepositoryException(getName() + ": Cannot import properties.");
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContextImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContextImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContextImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ExportContextImpl.java Tue Feb 23 13:37:38 2010
@@ -19,7 +19,6 @@
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.io.OutputContext;
-import org.apache.tika.detect.Detector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -31,7 +30,6 @@
 import java.io.OutputStream;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -48,7 +46,7 @@
 
     private static Logger log = LoggerFactory.getLogger(ExportContextImpl.class);
 
-    private final Map properties = new HashMap();
+    private final Map<String, String> properties = new HashMap<String, String>();
     private final OutputContext outputCtx;
 
     private File outFile;
@@ -75,7 +73,7 @@
         checkCompleted();
         if (hasStream()) {
             try {
-                // clean up the stream retrieved by the preceeding handler, that
+                // clean up the stream retrieved by the preceding handler, that
                 // did not behave properly and failed to export although initially
                 // willing to handle the export.
                 if (outStream != null) {
@@ -144,7 +142,9 @@
      * @see ExportContext#setProperty(Object, Object)
      */
     public void setProperty(Object propertyName, Object propertyValue) {
-        properties.put(propertyName, propertyValue);
+        if (propertyName != null && propertyValue != null) {
+            properties.put(propertyName.toString(), propertyValue.toString());
+        }
     }
 
     /**
@@ -154,6 +154,7 @@
      * @param success
      * @see ExportContext#informCompleted(boolean)
      */
+    @Override
     public void informCompleted(boolean success) {
         checkCompleted();
         completed = true;
@@ -170,14 +171,12 @@
             // write properties and data to the output-context
             if (outputCtx != null) {
                 boolean hasContentLength = false;
-                Iterator it = properties.keySet().iterator();
-                while (it.hasNext()) {
-                    Object name = it.next();
-                    Object value = properties.get(name);
+                for (String name : properties.keySet()) {
+                    String value = properties.get(name);
                     if (name != null && value != null) {
-                        outputCtx.setProperty(name.toString(), value.toString());
+                        outputCtx.setProperty(name, value);
                         // check for content-length
-                        hasContentLength = DavConstants.HEADER_CONTENT_LENGTH.equals(name.toString());
+                        hasContentLength = DavConstants.HEADER_CONTENT_LENGTH.equals(name);
                     }
                 }
 
@@ -200,4 +199,4 @@
             outFile.delete();
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManagerImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOManagerImpl.java Tue Feb 23 13:37:38 2010
@@ -39,7 +39,7 @@
      */
     private Detector detector;
 
-    private final List ioHandlers = new ArrayList();
+    private final List<IOHandler> ioHandlers = new ArrayList<IOHandler>();
 
     /**
      * Create a new <code>IOManager</code>.
@@ -66,7 +66,7 @@
      * @see IOManager#getIOHandlers()
      */
     public IOHandler[] getIOHandlers() {
-        return (IOHandler[]) ioHandlers.toArray(new IOHandler[ioHandlers.size()]);
+        return ioHandlers.toArray(new IOHandler[ioHandlers.size()]);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOUtil.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOUtil.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/IOUtil.java Tue Feb 23 13:37:38 2010
@@ -187,13 +187,12 @@
      * @throws RepositoryException
      */
     public static Node mkDirs(Node root, String relPath, String dirNodeType) throws RepositoryException {
-        String[] seg = Text.explode(relPath, '/');
-        for (int i=0; i< seg.length; i++) {
-            if (!root.hasNode(seg[i])) {
-                root.addNode(seg[i], dirNodeType);
+        for (String seg : Text.explode(relPath, '/')) {
+            if (!root.hasNode(seg)) {
+                root.addNode(seg, dirNodeType);
             }
-            root = root.getNode(seg[i]);
+            root = root.getNode(seg);
         }
         return root;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContext.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContext.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ImportContext.java Tue Feb 23 13:37:38 2010
@@ -17,9 +17,6 @@
 package org.apache.jackrabbit.server.io;
 
 import javax.jcr.Item;
-
-import org.apache.tika.detect.Detector;
-
 import java.io.InputStream;
 
 /**
@@ -99,4 +96,4 @@
      * @return
      */
     public Object getProperty(Object propertyName);
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyHandler.java Tue Feb 23 13:37:38 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.server.io;
 
+import org.apache.jackrabbit.webdav.property.PropEntry;
+
 import javax.jcr.RepositoryException;
 import java.util.Map;
 
@@ -79,6 +81,6 @@
      * error occured. Note, that normal failure of a property update must be
      * reported with the return value and should not result in an exception.
      */
-    public Map importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException;
+    public Map<? extends PropEntry, ?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException;
 
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyImportContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyImportContext.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyImportContext.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyImportContext.java Tue Feb 23 13:37:38 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.server.io;
 
+import org.apache.jackrabbit.webdav.property.PropEntry;
+
 import javax.jcr.Item;
 import java.util.List;
 
@@ -40,5 +42,5 @@
      *
      * @return list of properties to be modified
      */
-    public List getChangeList();
+    public List<? extends PropEntry> getChangeList();
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManager.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManager.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManager.java Tue Feb 23 13:37:38 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.server.io;
 
+import org.apache.jackrabbit.webdav.property.PropEntry;
+
 import javax.jcr.RepositoryException;
 import java.util.Map;
 
@@ -40,7 +42,7 @@
      * @return
      * @throws RepositoryException
      */
-    public Map alterProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException;
+    public Map<? extends PropEntry, ?> alterProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException;
 
     /**
      *
@@ -53,4 +55,4 @@
      * @return
      */
     public PropertyHandler[] getPropertyHandlers();
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManagerImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/PropertyManagerImpl.java Tue Feb 23 13:37:38 2010
@@ -18,12 +18,12 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.webdav.property.PropEntry;
 
 import javax.jcr.RepositoryException;
 import java.util.Map;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.HashMap;
 
 /**
  * <code>PropertyManagerImpl</code>...
@@ -34,7 +34,7 @@
 
     private static PropertyManager DEFAULT_MANAGER;
 
-    private final List propertyHandlers = new ArrayList();
+    private final List<PropertyHandler> propertyHandlers = new ArrayList<PropertyHandler>();
 
     /**
      * Create a new <code>PropertyManagerImpl</code>.
@@ -66,17 +66,15 @@
     /**
      * @see PropertyManager#alterProperties(PropertyImportContext, boolean)
      */
-    public Map alterProperties(PropertyImportContext context, boolean isCollection) throws RepositoryException {
-        boolean foundHandler = false;
-        Map failures = new HashMap(0);
-        PropertyHandler[] propertyHandlers = getPropertyHandlers();
-        for (int i = 0; i < propertyHandlers.length && !foundHandler; i++) {
-            PropertyHandler ph = propertyHandlers[i];
-            if ((foundHandler = ph.canImport(context, isCollection))) {
+    public Map<? extends PropEntry, ?> alterProperties(PropertyImportContext context, boolean isCollection) throws RepositoryException {
+        Map<? extends PropEntry, ?> failures = null;
+        for (PropertyHandler ph : getPropertyHandlers()) {
+            if (ph.canImport(context, isCollection)) {
                 failures = ph.importProperties(context, isCollection);
+                break;
             }
         }
-        if (!foundHandler) {
+        if (failures == null) {
             throw new RepositoryException("Unable to alter properties: No matching handler found.");
         }
         context.informCompleted(failures.isEmpty());
@@ -97,7 +95,7 @@
      * @see PropertyManager#getPropertyHandlers()
      */
     public PropertyHandler[] getPropertyHandlers() {
-        return (PropertyHandler[]) propertyHandlers.toArray(new PropertyHandler[propertyHandlers.size()]);
+        return propertyHandlers.toArray(new PropertyHandler[propertyHandlers.size()]);
     }
 
     /**
@@ -112,4 +110,4 @@
         }
         return DEFAULT_MANAGER;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHandler.java Tue Feb 23 13:37:38 2010
@@ -24,6 +24,7 @@
 
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.webdav.DavResource;
+import org.apache.jackrabbit.webdav.property.PropEntry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -39,21 +40,25 @@
     }
 
     //----------------------------------------------------------< IOHandler >---
+    @Override
     public boolean canImport(ImportContext context, boolean isCollection) {
         // version node is read only.
         return false;
     }
 
+    @Override
     public boolean canImport(ImportContext context, DavResource resource) {
         // version node is read only.
         return false;
     }
 
+    @Override
     public boolean importContent(ImportContext context, boolean isCollection) throws IOException {
         // version node is read only.
         return false;
     }
 
+    @Override
     public boolean importContent(ImportContext context, DavResource resource) throws IOException {
         // version node is read only.
         return false;
@@ -64,6 +69,7 @@
      * @param isCollection
      * @return true if the export root is a <code>Version</code> node. False otherwise.
      */
+    @Override
     public boolean canExport(ExportContext context, boolean isCollection) {
         if (context == null) {
             return false;
@@ -75,6 +81,7 @@
      * @return true if the export root is a <code>Version</code> node. False otherwise.
      * @see IOHandler#canExport(ExportContext, DavResource)
      */
+    @Override
     public boolean canExport(ExportContext context, DavResource resource) {
         if (context == null) {
             return false;
@@ -83,12 +90,14 @@
     }
 
     //----------------------------------------------------< PropertyHandler >---
+    @Override
     public boolean canImport(PropertyImportContext context, boolean isCollection) {
         // version is read only
         return false;
     }
 
-    public Map importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
+    @Override
+    public Map<? extends PropEntry, ?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
         // version is read only
         throw new RepositoryException("Properties cannot be imported");
     }
@@ -96,6 +105,7 @@
     /**
      * @see PropertyHandler#exportProperties(PropertyExportContext, boolean)
      */
+    @Override
     public boolean exportProperties(PropertyExportContext exportContext, boolean isCollection) throws RepositoryException {
         if (!canExport(exportContext, isCollection)) {
             throw new RepositoryException("PropertyHandler " + getName() + " failed to export properties.");
@@ -120,6 +130,7 @@
      * @return content node used for the export
      * @throws javax.jcr.RepositoryException
      */
+    @Override
     protected Node getContentNode(ExportContext context, boolean isCollection) throws RepositoryException {
         Node node = (Node)context.getExportRoot();
         Node frozenNode = node.getNode(JcrConstants.JCR_FROZENNODE);

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHistoryHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHistoryHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHistoryHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/VersionHistoryHandler.java Tue Feb 23 13:37:38 2010
@@ -19,6 +19,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.jackrabbit.webdav.DavResource;
+import org.apache.jackrabbit.webdav.property.PropEntry;
 
 import javax.jcr.version.VersionHistory;
 import javax.jcr.RepositoryException;
@@ -108,7 +109,7 @@
         return false;
     }
 
-    public Map importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
+    public Map<? extends PropEntry, ?> importProperties(PropertyImportContext importContext, boolean isCollection) throws RepositoryException {
         throw new UnsupportedOperationException();
     }
 
@@ -132,4 +133,4 @@
         exportContext.setModificationTime(IOUtil.UNDEFINED_TIME);
         return true;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/XmlHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/XmlHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/XmlHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/XmlHandler.java Tue Feb 23 13:37:38 2010
@@ -85,6 +85,7 @@
     /**
      * @see IOHandler#canImport(ImportContext, boolean)
      */
+    @Override
     public boolean canImport(ImportContext context, boolean isCollection) {
         if (context == null || context.isCompleted()) {
             return false;
@@ -99,6 +100,7 @@
     /**
      * @see DefaultHandler#importData(ImportContext, boolean, Node)
      */
+    @Override
     protected boolean importData(ImportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException {
         InputStream in = context.getInputStream();
         int uuidBehavior = (isCollection)
@@ -115,6 +117,7 @@
     /**
      * @see DefaultHandler#importProperties(ImportContext, boolean, Node)
      */
+    @Override
     protected boolean importProperties(ImportContext context, boolean isCollection, Node contentNode) {
         boolean success = super.importProperties(context, isCollection, contentNode);
         if (success) {
@@ -134,6 +137,7 @@
      *
      * @return <code>true</code>, always.
      */
+    @Override
     protected boolean forceCompatibleContentNodes() {
         return true;
     }
@@ -141,6 +145,7 @@
     /**
      * @see IOHandler#canExport(ExportContext, boolean)
      */
+    @Override
     public boolean canExport(ExportContext context, boolean isCollection) {
         if (super.canExport(context, isCollection)) {
             String mimeType = null;
@@ -162,6 +167,7 @@
     /**
      * @see DefaultHandler#exportData(ExportContext, boolean, Node)
      */
+    @Override
     protected void exportData(ExportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException {
         // first child of content is XML document root
         if (contentNode.getNodes().hasNext()) {
@@ -174,6 +180,7 @@
     /**
      * @see DefaultHandler#exportProperties(ExportContext, boolean, Node)
      */
+    @Override
     protected void exportProperties(ExportContext context, boolean isCollection, Node contentNode) throws IOException {
         super.exportProperties(context, isCollection, contentNode);
         // set mimetype if the content node did not provide the
@@ -187,4 +194,4 @@
             throw new IOException(e.getMessage());
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ZipHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ZipHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ZipHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/ZipHandler.java Tue Feb 23 13:37:38 2010
@@ -109,6 +109,7 @@
     /**
      * @see IOHandler#canImport(ImportContext, boolean)
      */
+    @Override
     public boolean canImport(ImportContext context, boolean isCollection) {
         if (context == null || context.isCompleted()) {
             return false;
@@ -120,6 +121,7 @@
     /**
      * @see DefaultHandler#importData(ImportContext, boolean, Node)
      */
+    @Override
     protected boolean importData(ImportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException {
         boolean success = true;
         InputStream in = context.getInputStream();
@@ -140,6 +142,7 @@
     /**
      * @see IOHandler#canExport(ExportContext, boolean)
      */
+    @Override
     public boolean canExport(ExportContext context, boolean isCollection) {
         if (super.canExport(context, isCollection)) {
             // mimetype must be application/zip
@@ -166,6 +169,7 @@
     /**
      * @see DefaultHandler#exportData(ExportContext,boolean,Node)
      */
+    @Override
     protected void exportData(ExportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException {
         ZipOutputStream zout = new ZipOutputStream(context.getOutputStream());
         zout.setMethod(ZipOutputStream.DEFLATED);
@@ -194,11 +198,11 @@
         try {
             if (node.isNodeType(getNodeType())) {
                 ZipEntryExportContext subctx = new ZipEntryExportContext(node, zout, context, pos);
-                // try if iomanager can treat node as zip entry otherwise recurse.
+                // try if iomanager can treat node as zip entry otherwise recurs.
                 zout.putNextEntry(subctx.entry);
                 getIOManager().exportContent(subctx, false);
             } else {
-                // recurse
+                // recurs
                 NodeIterator niter = node.getNodes();
                 while (niter.hasNext()) {
                     exportZipEntry(context, zout, niter.nextNode(), pos);
@@ -290,14 +294,17 @@
             importRoot = IOUtil.mkDirs(contentNode, Text.getRelativeParent(path, 1), getCollectionNodeType());
         }
 
+        @Override
         public Item getImportRoot() {
             return importRoot;
         }
 
+        @Override
         public long getModificationTime() {
             return entry.getTime();
         }
 
+        @Override
         public long getContentLength() {
             return entry.getSize();
         }
@@ -367,4 +374,4 @@
             // ignore
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/jcr/JCRWebdavServer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/jcr/JCRWebdavServer.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/jcr/JCRWebdavServer.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/jcr/JCRWebdavServer.java Tue Feb 23 13:37:38 2010
@@ -36,6 +36,8 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <code>JCRWebdavServer</code>...
@@ -140,8 +142,8 @@
      */
     private class SessionCache {
 
-        private SessionMap sessionMap = new SessionMap();
-        private HashMap referenceToSessionMap = new HashMap();
+        private Map<DavSession, Set<Object>> sessionMap = new HashMap<DavSession, Set<Object>>();
+        private Map<Object, DavSession> referenceToSessionMap = new HashMap<Object, DavSession>();
 
         /**
          * Try to retrieve <code>DavSession</code> if a TransactionId or
@@ -171,8 +173,8 @@
             if (session == null) {
                 // try tokens present in the if-header
                 IfHeader ifHeader = new IfHeader(request);
-                for (Iterator it = ifHeader.getAllTokens(); it.hasNext();) {
-                    String token = it.next().toString();
+                for (Iterator<String> it = ifHeader.getAllTokens(); it.hasNext();) {
+                    String token = it.next();
                     if (containsReference(token)) {
                         session = getSessionByReference(token);
                         break;
@@ -184,7 +186,7 @@
             if (session == null) {
                 Session repSession = getRepositorySession(request);
                 session = new DavSessionImpl(repSession);
-                sessionMap.put(session, new HashSet());
+                sessionMap.put(session, new HashSet<Object>());
                 log.debug("login: User '" + repSession.getUserID() + "' logged in.");
             } else {
                 log.debug("login: Retrieved cached session for user '" + getUserID(session) + "'");
@@ -200,7 +202,7 @@
          * @param reference
          */
         private void addReference(DavSession session, Object reference) {
-            HashSet referenceSet = sessionMap.get(session);
+            Set<Object> referenceSet = sessionMap.get(session);
             if (referenceSet != null) {
                 referenceSet.add(reference);
                 referenceToSessionMap.put(reference, session);
@@ -216,7 +218,7 @@
          * @param reference
          */
         private void removeReference(DavSession session, Object reference) {
-            HashSet referenceSet = sessionMap.get(session);
+            Set<Object> referenceSet = sessionMap.get(session);
             if (referenceSet != null) {
                 if (referenceSet.remove(reference)) {
                     log.debug("Removed reference " + reference + " to session " + session);
@@ -233,8 +235,8 @@
                         sessionProvider.releaseSession(repSession);
                         log.debug("Login: User '" + usr + "' logged out");
                     } catch (DavException e) {
-                        // should not occure, since we original built a DavSessionImpl
-                        // that wraps a repository session.
+                        // should not occur, since we originally built a
+                        // DavSessionImpl that wraps a repository session.
                         log.error("Unexpected error: " + e.getMessage(), e.getCause());
                     }
                 } else {
@@ -267,7 +269,7 @@
          * @see #containsReference(Object)
          */
         private DavSession getSessionByReference(Object reference) {
-            return (DavSession) referenceToSessionMap.get(reference);
+            return referenceToSessionMap.get(reference);
         }
 
         /**
@@ -306,22 +308,4 @@
             return session.toString();
         }
     }
-
-    /**
-     * Simple inner class extending the {@link HashMap}.
-     */
-    private static class SessionMap extends HashMap {
-
-        public HashSet get(DavSession key) {
-            return (HashSet) super.get(key);
-        }
-
-        public HashSet put(DavSession key, HashSet value) {
-            return (HashSet) super.put(key, value);
-        }
-
-        public HashSet remove(DavSession key) {
-            return (HashSet) super.remove(key);
-        }
-    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/BatchReadConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/BatchReadConfig.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/BatchReadConfig.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/BatchReadConfig.java Tue Feb 23 13:37:38 2010
@@ -42,7 +42,7 @@
     public static final int DEPTH_INFINITE = -1;
 
     private int defaultDepth = DEPTH_DEFAULT;
-    private final Map depthMap = new HashMap();
+    private final Map<String, Integer> depthMap = new HashMap<String, Integer>();
 
     /**
      * Create an empty batch-read config.
@@ -67,7 +67,7 @@
      * @param props
      */
     public void add(Properties props) {
-        for (Enumeration en = props.propertyNames(); en.hasMoreElements();) {
+        for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) {
             String name = en.nextElement().toString();
             String depthStr = props.getProperty(name);
             try {
@@ -102,7 +102,7 @@
      */
     public int getDepth(String ntName) {
         if (depthMap.containsKey(ntName)) {
-            return ((Integer) (depthMap.get(ntName))).intValue();
+            return depthMap.get(ntName);
         } else {
             return defaultDepth;
         }
@@ -122,7 +122,7 @@
         try {
             String ntName = node.getPrimaryNodeType().getName();
             if (depthMap.containsKey(ntName)) {
-                depth = ((Integer) (depthMap.get(ntName))).intValue();
+                depth = depthMap.get(ntName);
             }
         } catch (RepositoryException e) {
             // ignore and return default.
@@ -142,7 +142,7 @@
         if (ntName == null || depth < DEPTH_INFINITE) {
             throw new IllegalArgumentException();
         }
-        depthMap.put(ntName, new Integer(depth));
+        depthMap.put(ntName, depth);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/DiffParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/DiffParser.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/DiffParser.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/DiffParser.java Tue Feb 23 13:37:38 2010
@@ -30,7 +30,7 @@
     // TODO: ignored unless they are escaped in way the handler understands (e.g.
     // TODO: JSON does: \\r for \r).
     // TODO: in contrast line sep. at the end of the string are treated as value.
-    // TODO: ... similar: line sep. following by non-diff sybol.
+    // TODO: ... similar: line sep. following by non-diff symbol.
 
     private final DiffHandler handler;
 
@@ -188,7 +188,7 @@
             }
         }
 
-        // append eventual remaining line-searators to the value
+        // append eventual remaining line-separators to the value
         if (lineSeparator != null) {
             bf.append(lineSeparator);
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java Tue Feb 23 13:37:38 2010
@@ -216,6 +216,7 @@
 
     private BatchReadConfig brConfig;
 
+    @Override
     public void init() throws ServletException {
         super.init();
 
@@ -265,10 +266,12 @@
         super.setLocatorFactory(new DavLocatorFactoryImpl(getInitParameter(INIT_PARAM_RESOURCE_PATH_PREFIX)));
     }
 
+    @Override
     public DavResourceFactory getResourceFactory() {
         return new ResourceFactoryImpl(txMgr, subscriptionMgr);
     }
 
+    @Override
     protected void doGet(WebdavRequest webdavRequest,
                          WebdavResponse webdavResponse,
                          DavResource davResource) throws IOException, DavException {
@@ -300,6 +303,7 @@
         }
     }
 
+    @Override
     protected void doPost(WebdavRequest webdavRequest, WebdavResponse webdavResponse, DavResource davResource)
             throws IOException, DavException {
         if (canHandle(DavMethods.DAV_POST, webdavRequest, davResource)) {
@@ -370,10 +374,10 @@
     private static String clone(Session session, String[] cloneArgs, DavResourceLocator reqLocator) throws RepositoryException {
         Workspace wsp = session.getWorkspace();
         String destPath = null;
-        for (int i = 0; i < cloneArgs.length; i++) {
-            String[] args = cloneArgs[i].split(",");
+        for (String cloneArg : cloneArgs) {
+            String[] args = cloneArg.split(",");
             if (args.length == 4) {
-                wsp.clone(args[0], args[1], args[2], new Boolean(args[3]).booleanValue());
+                wsp.clone(args[0], args[1], args[2], new Boolean(args[3]));
                 destPath = args[2];
             } else {
                 throw new RepositoryException(":clone parameter must have a value consisting of the 4 args needed for a Workspace.clone() call.");
@@ -385,8 +389,8 @@
     private static String copy(Session session, String[] copyArgs, DavResourceLocator reqLocator) throws RepositoryException {
         Workspace wsp = session.getWorkspace();
         String destPath = null;
-        for (int i = 0; i < copyArgs.length; i++) {
-            String[] args = copyArgs[i].split(",");
+        for (String copyArg : copyArgs) {
+            String[] args = copyArg.split(",");
             switch (args.length) {
                 case 2:
                     wsp.copy(args[0], args[1]);
@@ -427,10 +431,9 @@
         DiffHandler handler = new JsonDiffHandler(session, targetPath, data);
         DiffParser parser = new DiffParser(handler);
 
-        for (int i = 0; i < diffs.length; i++) {
+        for (String diff : diffs) {
             boolean success = false;
             try {
-                String diff = diffs[i];
                 parser.parse(diff);
 
                 session.save();
@@ -459,8 +462,8 @@
         JsonDiffHandler dh = new JsonDiffHandler(session, targetPath, data);
         boolean success = false;
         try {
-            for (Iterator pNames = data.getParameterNames(); pNames.hasNext();) {
-                String paramName = pNames.next().toString();
+            for (Iterator<String> pNames = data.getParameterNames(); pNames.hasNext();) {
+                String paramName = pNames.next();
                 String propPath = dh.getItemPath(paramName);
                 String parentPath = Text.getRelativeParent(propPath, 1);
 
@@ -499,8 +502,7 @@
         Node parent = session.getRootNode();
         String[] smgts = Text.explode(nodePath, '/');
 
-        for (int i = 0; i < smgts.length; i++) {
-            String nodeName = smgts[i];
+        for (String nodeName : smgts) {
             if (parent.hasNode(nodeName)) {
                 parent = parent.getNode(nodeName);
             } else {
@@ -547,6 +549,7 @@
             super(s);
         }
 
+        @Override
         public DavResourceLocator createResourceLocator(String prefix, String href) {
             DavResourceLocator loc = super.createResourceLocator(prefix, href);
             if (endsWithJson(href)) {
@@ -555,6 +558,7 @@
             return loc;
         }
 
+        @Override
         public DavResourceLocator createResourceLocator(String prefix, String workspacePath, String path, boolean isResourcePath) {
             DavResourceLocator loc = super.createResourceLocator(prefix, workspacePath, path, isResourcePath);
             if (isResourcePath && endsWithJson(path)) {
@@ -669,6 +673,7 @@
             super(txMgr, subsMgr);
         }
 
+        @Override
         protected Item getItem(JcrDavSession sessionImpl, DavResourceLocator locator) throws PathNotFoundException, RepositoryException {
             if (locator instanceof WrappingLocator && ((WrappingLocator)locator).isJsonRequest) {
                 // check if the .json extension has been correctly interpreted.

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JsonDiffHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JsonDiffHandler.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JsonDiffHandler.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JsonDiffHandler.java Tue Feb 23 13:37:38 2010
@@ -42,7 +42,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Stack;
 import java.util.LinkedList;
@@ -274,23 +273,22 @@
             return path;
         }
         String[]  elems = Text.explode(path, '/', false);
-        LinkedList queue = new LinkedList();
+        LinkedList<String> queue = new LinkedList<String>();
         String last = "..";
-        for (int i = 0; i < elems.length; i++) {
-            String segm = elems[i];
+        for (String segm : elems) {
             if ("..".equals(segm) && !"..".equals(last)) {
                 queue.removeLast();
                 if (queue.isEmpty()) {
                     last = "..";
                 } else {
-                    last = queue.getLast().toString();
+                    last = queue.getLast();
                 }
             } else if (!".".equals(segm)) {
                 last = segm;
                 queue.add(last);
             }
         }
-        return "/" + Text.implode((String[]) queue.toArray(new String[queue.size()]), "/");
+        return "/" + Text.implode(queue.toArray(new String[queue.size()]), "/");
     }
     
     private static Node importNode(Node parent, String nodeName, String ntName,
@@ -364,24 +362,24 @@
         if (values.length == 0) {
             // remove all mixins
             NodeType[] mixins = n.getMixinNodeTypes();
-            for (int i = 0; i < mixins.length; i++) {
-                String mixinName = mixins[i].getName();
+            for (NodeType mixin : mixins) {
+                String mixinName = mixin.getName();
                 n.removeMixin(mixinName);
             }
         } else {
-            List newMixins = new ArrayList(values.length);
-            for (int i = 0; i < values.length; i++) {
-                newMixins.add(values[i].getString());
+            List<String> newMixins = new ArrayList<String>(values.length);
+            for (Value value : values) {
+                newMixins.add(value.getString());
             }
             NodeType[] mixins = n.getMixinNodeTypes();
-            for (int i = 0; i < mixins.length; i++) {
-                String mixinName = mixins[i].getName();
+            for (NodeType mixin : mixins) {
+                String mixinName = mixin.getName();
                 if (!newMixins.remove(mixinName)) {
                     n.removeMixin(mixinName);
                 }
             }
-            for (Iterator mixIt = newMixins.iterator(); mixIt.hasNext();) {
-                n.addMixin(mixIt.next().toString());
+            for (String newMixinName : newMixins) {
+                n.addMixin(newMixinName);
             }
         }
     }
@@ -413,7 +411,7 @@
             if (strs == null) {
                 vs = new Value[0];
             } else {
-                List valList = new ArrayList(strs.length);
+                List<Value> valList = new ArrayList<Value>(strs.length);
                 for (int i = 0; i < strs.length; i++) {
                     if (strs[i] != null) {
                         String[] types = data.getParameterTypes(paramName);
@@ -425,7 +423,7 @@
                         }
                     }
                 }
-                vs = (Value[]) valList.toArray(new Value[valList.size()]);
+                vs = valList.toArray(new Value[valList.size()]);
             }
         }
         return vs;
@@ -433,7 +431,7 @@
 
     private Value extractValue(String diffValue) throws RepositoryException, DiffException, IOException {
         ValueHandler hndlr = new ValueHandler();
-        // surround diffvalue { key : } to make it parsable
+        // surround diff value { key : } to make it parsable
         new JsonParser(hndlr).parse("{\"a\":"+diffValue+"}");
 
         return hndlr.getValue();
@@ -441,7 +439,7 @@
 
     private Value[] extractValues(String diffValue) throws RepositoryException, DiffException, IOException {
         ValuesHandler hndlr = new ValuesHandler();
-        // surround diffvalue { key : } to make it parsable
+        // surround diff value { key : } to make it parsable
         new JsonParser(hndlr).parse("{\"a\":"+diffValue+"}");
         
         return hndlr.getValues();
@@ -492,7 +490,7 @@
      * Inner class used to parse the values from a simple json array
      */
     private class ValuesHandler implements JsonHandler {
-        private List values = new ArrayList();
+        private List<Value> values = new ArrayList<Value>();
 
         public void object() throws IOException {
             // ignore
@@ -528,7 +526,7 @@
         }
 
         private Value[] getValues() {
-            return (Value[]) values.toArray(new Value[values.size()]);
+            return values.toArray(new Value[values.size()]);
         }
     }
 
@@ -540,7 +538,7 @@
         private Node parent;
         private String key;
 
-        private Stack st = new Stack();
+        private Stack<ImportItem> st = new Stack<ImportItem>();
 
         private NodeHandler(Node parent, String nodeName) throws IOException {
             this.parent = parent;
@@ -550,9 +548,9 @@
         public void object() throws IOException {
             ImportNode n = new ImportNode(key);
             if (!st.isEmpty()) {
-                Object obj = st.peek();
+                ImportItem obj = st.peek();
                 if (obj instanceof ImportNode) {
-                    ((ImportNode)obj).addNode(n);
+                    ((ImportNode) obj).addNode(n);
                 } else {
                     throw new IOException("Invalid DIFF format: The JSONArray may only contain simple values.");
                 }
@@ -563,14 +561,14 @@
         public void endObject() throws IOException {
             // element on stack must be ImportMvProp since array may only
             // contain simple values, no arrays/objects are allowed.
-            Object obj = st.pop();
+            ImportItem obj = st.pop();
             if (!((obj instanceof ImportNode))) {
                 throw new IOException("Invalid DIFF format.");
             }
             if (st.isEmpty()) {
                 // everything parsed -> start adding all nodes and properties
                 try {
-                    ((ImportNode) obj).createItem(parent);                    
+                    obj.createItem(parent);                    
                 } catch (RepositoryException e) {
                     log.error(e.getMessage());
                     throw new IOException("Invalid DIFF format");
@@ -580,7 +578,7 @@
 
         public void array() throws IOException {
             ImportMvProp prop = new ImportMvProp(key);
-            Object obj = st.peek();
+            ImportItem obj = st.peek();
             if (obj instanceof ImportNode) {
                 ((ImportNode)obj).addProp(prop);
             } else {
@@ -592,7 +590,7 @@
         public void endArray() throws IOException {
             // element on stack must be ImportMvProp since array may only
             // contain simple values, no arrays/objects are allowed.
-            Object obj = st.pop();
+            ImportItem obj = st.pop();
             if (!((obj instanceof ImportMvProp))) {
                 throw new IOException("Invalid DIFF format: The JSONArray may only contain simple values.");                
             }
@@ -621,7 +619,7 @@
         }
                 
         private void value(Value v) throws IOException {
-            Object obj = st.peek();
+            ImportItem obj = st.peek();
             if (obj instanceof ImportMvProp) {
                 ((ImportMvProp) obj).values.add(v);
             } else {
@@ -646,8 +644,8 @@
         private String ntName;
         private String uuid;
 
-        private List childN = new ArrayList();
-        private List childP = new ArrayList();
+        private List<ImportNode> childN = new ArrayList<ImportNode>();
+        private List<ImportItem> childP = new ArrayList<ImportItem>();
 
         private ImportNode(String name) throws IOException {
             super(name);
@@ -682,6 +680,7 @@
             childN.add(node);
         }
 
+        @Override
         void createItem(Node parent) throws RepositoryException {
             Node n;
             if (uuid == null) {
@@ -690,13 +689,11 @@
                 n = importNode(parent, name, ntName, uuid);
             }
             // create all properties
-            for (Iterator it = childP.iterator(); it.hasNext();) {
-                ImportItem obj = (ImportItem) it.next();
+            for (ImportItem obj : childP) {
                 obj.createItem(n);
             }
-            // recursivly create all child nodes
-            for (Iterator it = childN.iterator(); it.hasNext();) {
-                ImportItem obj = (ImportItem) it.next();
+            // recursively create all child nodes
+            for (ImportItem obj : childN) {
                 obj.createItem(n);
             }
         }
@@ -710,20 +707,22 @@
             this.value = v;
         }
 
+        @Override
         void createItem(Node parent) throws RepositoryException {
             parent.setProperty(name, value);
         }
     }
 
     private class ImportMvProp extends ImportItem  {
-        private List values = new ArrayList();
+        private List<Value> values = new ArrayList<Value>();
 
         private ImportMvProp(String name) throws IOException {
             super(name);
         }
 
+        @Override
         void createItem(Node parent) throws RepositoryException {
-            Value[] vls = (Value[]) values.toArray(new Value[values.size()]);
+            Value[] vls = values.toArray(new Value[values.size()]);
             if (JcrConstants.JCR_MIXINTYPES.equals(name)) {
                 setMixins(parent, vls);
             } else {

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java Tue Feb 23 13:37:38 2010
@@ -30,7 +30,6 @@
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -46,8 +45,8 @@
      */
     private static final Logger log = LoggerFactory.getLogger(HttpMultipartPost.class);
 
-    private final Map nameToItems = new LinkedHashMap();
-    private final Set fileParamNames = new HashSet();
+    private final Map<String, List<FileItem>> nameToItems = new LinkedHashMap<String, List<FileItem>>();
+    private final Set<String> fileParamNames = new HashSet<String>();
 
     private boolean initialized;
 
@@ -81,10 +80,9 @@
 
         ServletFileUpload upload = new ServletFileUpload(getFileItemFactory(tmpDir));
         try {
-            List fileItems = upload.parseRequest(request);
-            for (Iterator it = fileItems.iterator(); it.hasNext();) {
-                FileItem item = (FileItem) it.next();
-                addItem(item);
+            List<Object> fileItems = upload.parseRequest(request);
+            for (Object fileItem : fileItems) {
+                addItem((FileItem) fileItem);
             }
         } catch (FileUploadException e) {
             log.error("Error while processing multipart.", e);
@@ -101,15 +99,15 @@
      */
     private void addItem(FileItem item) {
         String name = item.getFieldName();
-        ArrayList l = (ArrayList) nameToItems.get(item.getFieldName());
+        List<FileItem> l = nameToItems.get(item.getFieldName());
         if (l == null) {
-            l = new ArrayList();
+            l = new ArrayList<FileItem>();
             nameToItems.put(name, l);
         }
         l.add(item);
 
-        // if file parameter, add name to the set of file params in order to
-        // be able to extract the file param values later on without iterating
+        // if file parameter, add name to the set of file parameters in order to
+        // be able to extract the file parameter values later on without iterating
         // over all keys.
         if (!item.isFormField()) {
             fileParamNames.add(name);
@@ -131,11 +129,9 @@
     synchronized void dispose() {
         checkInitialized();
 
-        for (Iterator it = nameToItems.values().iterator(); it.hasNext();) {
-            List fileItems = (List) it.next();
-            for (int i = 0; i < fileItems.size(); i++) {
-                FileItem item = (FileItem) fileItems.get(i);
-                item.delete();
+        for (List<FileItem> fileItems : nameToItems.values()) {
+            for (FileItem fileItem : fileItems) {
+                fileItem.delete();
             }
         }
 
@@ -149,7 +145,7 @@
      *
      * @return a set of strings.
      */
-    Set getParameterNames() {
+    Set<String> getParameterNames() {
         checkInitialized();
         return nameToItems.keySet();
     }
@@ -187,11 +183,11 @@
     String[] getParameterTypes(String name) {
         checkInitialized();
         String[] cts = null;
-        List l = (List) nameToItems.get(name);
+        List<FileItem> l = nameToItems.get(name);
         if (l != null && !l.isEmpty()) {
             cts = new String[l.size()];
             for (int i = 0; i < cts.length; i++) {
-                cts[i] = ((FileItem) l.get(i)).getContentType();
+                cts[i] = l.get(i).getContentType();
             }
         }
         return cts;
@@ -212,11 +208,11 @@
      */
     String getParameter(String name) {
         checkInitialized();
-        List l = (List) nameToItems.get(name);
+        List<FileItem> l = nameToItems.get(name);
         if (l == null || l.isEmpty()) {
             return null;
         } else {
-            FileItem item = ((FileItem) l.get(0));
+            FileItem item = l.get(0);
             if (item.isFormField()) {
                 return item.getString();
             } else {
@@ -240,13 +236,13 @@
      */
     String[] getParameterValues(String name) {
         checkInitialized();
-        List l = (List) nameToItems.get(name);
+        List<FileItem> l = nameToItems.get(name);
         if (l == null || l.isEmpty()) {
             return null;
         } else {
             String[] values = new String[l.size()];
             for (int i = 0; i < values.length; i++) {
-                FileItem item = ((FileItem) l.get(i));
+                FileItem item = l.get(i);
                 if (item.isFormField()) {
                     values[i] = item.getString();
                 } else {
@@ -264,7 +260,7 @@
      * @return an set of file item names representing the file
      * parameters available with the request.
      */
-    Set getFileParameterNames() {
+    Set<String> getFileParameterNames() {
         checkInitialized();
         return fileParamNames;
     }
@@ -281,16 +277,15 @@
         checkInitialized();
         InputStream[] values = null;
         if (fileParamNames.contains(name)) {
-            List l = (List) nameToItems.get(name);
+            List<FileItem> l = nameToItems.get(name);
             if (l != null && !l.isEmpty()) {
-                List ins = new ArrayList(l.size());
-                for (Iterator it = l.iterator(); it.hasNext();) {
-                    FileItem item = (FileItem) it.next();
+                List<InputStream> ins = new ArrayList<InputStream>(l.size());
+                for (FileItem item : l) {
                     if (!item.isFormField()) {
                         ins.add(item.getInputStream());
                     }
                 }
-                values = (InputStream[]) ins.toArray(new InputStream[ins.size()]);
+                values = ins.toArray(new InputStream[ins.size()]);
             }
         }
         return values;

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/RequestData.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/RequestData.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/RequestData.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/RequestData.java Tue Feb 23 13:37:38 2010
@@ -56,9 +56,9 @@
      * 
      * @return an iterator over strings.
      */
-    public Iterator getParameterNames() {
+    public Iterator<String> getParameterNames() {
         
-        HashSet names = new HashSet(request.getParameterMap().keySet());
+        HashSet<String> names = new HashSet<String>(request.getParameterMap().keySet());
         names.addAll(mpReq.getParameterNames());
         
         return names.iterator();
@@ -123,4 +123,4 @@
     public InputStream[] getFileParameters(String name) throws IOException {
         return mpReq.getFileParameterValues(name);
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java Tue Feb 23 13:37:38 2010
@@ -86,6 +86,7 @@
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getComplianceClass()
      */
+    @Override
     public String getComplianceClass() {
         return DavCompliance.concatComplianceClasses(
             new String[] {
@@ -140,15 +141,15 @@
         }
         // export properties
         outputContext.setModificationTime(getModificationTime());
-        DavProperty etag = getProperty(DavPropertyName.GETETAG);
+        DavProperty<?> etag = getProperty(DavPropertyName.GETETAG);
         if (etag != null) {
             outputContext.setETag(String.valueOf(etag.getValue()));
         }
-        DavProperty contentType = getProperty(DavPropertyName.GETCONTENTTYPE);
+        DavProperty<?> contentType = getProperty(DavPropertyName.GETCONTENTTYPE);
         if (contentType != null) {
             outputContext.setContentType(String.valueOf(contentType.getValue()));
         }
-        DavProperty contentLength = getProperty(DavPropertyName.GETCONTENTLENGTH);
+        DavProperty<?> contentLength = getProperty(DavPropertyName.GETCONTENTLENGTH);
         if (contentLength != null) {
             try {
                 long length = Long.parseLong(contentLength.getValue() + "");
@@ -159,7 +160,7 @@
                 log.error("Could not build content length from property value '" + contentLength.getValue() + "'");
             }
         }
-        DavProperty contentLanguage = getProperty(DavPropertyName.GETCONTENTLANGUAGE);
+        DavProperty<?> contentLanguage = getProperty(DavPropertyName.GETCONTENTLANGUAGE);
         if (contentLanguage != null) {
             outputContext.setContentLanguage(contentLanguage.getValue().toString());
         }
@@ -197,6 +198,7 @@
      * @see DavResource#move(DavResource)
      * @see javax.jcr.Session#move(String, String)
      */
+    @Override
     public void move(DavResource destination) throws DavException {
         if (!exists()) {
             throw new DavException(DavServletResponse.SC_NOT_FOUND);
@@ -210,7 +212,7 @@
             String itemPath = getLocator().getRepositoryPath();
             String destItemPath = destination.getLocator().getRepositoryPath();
             if (getTransactionId() == null) {
-                // if not part of a transaction directely import on workspace
+                // if not part of a transaction directly import on workspace
                 getRepositorySession().getWorkspace().move(itemPath, destItemPath);
             } else {
                 // changes will not be persisted unless the tx is completed.
@@ -240,6 +242,7 @@
      * @see Workspace#copy(String, String)
      * @see Workspace#copy(String, String, String)
      */
+    @Override
     public void copy(DavResource destination, boolean shallow) throws DavException {
         if (!exists()) {
             throw new DavException(DavServletResponse.SC_NOT_FOUND);
@@ -309,9 +312,11 @@
      * @see org.apache.jackrabbit.webdav.transaction.TxLockEntry
      * @see AbstractResource#initLockSupport()
      */
+    @Override
     protected void initLockSupport() {
         if (exists()) {
-            // add supportedlock entries for local and eventually for global transaction locks
+            // add supported lock entries for local and eventually for global
+            // transaction locks
             supportedLock.addEntry(new TxLockEntry(true));
             supportedLock.addEntry(new TxLockEntry(false));
         }
@@ -320,13 +325,14 @@
     /**
      * Fill the property set for this resource.
      */
+    @Override
     protected void initProperties() {
         super.initProperties();
         if (exists()) {
             try {
-                properties.add(new DefaultDavProperty(JCR_NAME, item.getName()));
-                properties.add(new DefaultDavProperty(JCR_PATH, item.getPath()));
-                properties.add(new DefaultDavProperty(JCR_DEPTH, String.valueOf(item.getDepth())));
+                properties.add(new DefaultDavProperty<String>(JCR_NAME, item.getName()));
+                properties.add(new DefaultDavProperty<String>(JCR_PATH, item.getPath()));
+                properties.add(new DefaultDavProperty<String>(JCR_DEPTH, String.valueOf(item.getDepth())));
                 // add href-property for the items parent unless its the root item
                 if (item.getDepth() > 0) {
                     String parentHref = getLocatorFromItem(item.getParent()).getHref(true);
@@ -339,7 +345,7 @@
                 } else {
                     val = PropertyDefinitionImpl.create(((Property)item).getDefinition());
                 }
-                properties.add(new DefaultDavProperty(JCR_DEFINITION, val, true));
+                properties.add(new DefaultDavProperty<ItemDefinitionImpl>(JCR_DEFINITION, val, true));
             } catch (RepositoryException e) {
                 // should not get here
                 log.error("Error while accessing jcr properties: " + e.getMessage());
@@ -347,9 +353,9 @@
 
             // transaction resource additional protected properties
             if (item.isNew()) {
-                properties.add(new DefaultDavProperty(JCR_ISNEW, null, true));
+                properties.add(new DefaultDavProperty<String>(JCR_ISNEW, null, true));
             } else if (item.isModified()) {
-                properties.add(new DefaultDavProperty(JCR_ISMODIFIED, null, true));
+                properties.add(new DefaultDavProperty<String>(JCR_ISMODIFIED, null, true));
             }
         }
 
@@ -362,11 +368,12 @@
                                                 PRIVILEGE_JCR_ADD_NODE,
                                                 PRIVILEGE_JCR_SET_PROPERTY,
                                                 PRIVILEGE_JCR_REMOVE};
-        List currentPrivs = new ArrayList();
-        for (int i = 0; i < allPrivs.length; i++) {
+        List<Privilege> currentPrivs = new ArrayList<Privilege>();
+        for (Privilege priv : allPrivs) {
             try {
-                getRepositorySession().checkPermission(getLocator().getRepositoryPath(), allPrivs[i].getName());
-                currentPrivs.add(allPrivs[i]);
+                String path = getLocator().getRepositoryPath();
+                getRepositorySession().checkPermission(path, priv.getName());
+                currentPrivs.add(priv);
             } catch (AccessControlException e) {
                 // ignore
                 log.debug(e.toString());
@@ -375,7 +382,7 @@
                 log.debug(e.toString());
             }
         }
-        properties.add(new CurrentUserPrivilegeSetProperty((Privilege[])currentPrivs.toArray(new Privilege[currentPrivs.size()])));
+        properties.add(new CurrentUserPrivilegeSetProperty(currentPrivs.toArray(new Privilege[currentPrivs.size()])));
     }
 
     /**
@@ -384,6 +391,7 @@
      *
      * @see AbstractResource#getWorkspaceHref()
      */
+    @Override
     protected String getWorkspaceHref() {
         String workspaceHref = null;
         DavResourceLocator locator = getLocator();
@@ -441,4 +449,4 @@
         }
         return name;
     }
-}
\ No newline at end of file
+}



Mime
View raw message