jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r915339 [3/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
Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionManagerImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/observation/SubscriptionManagerImpl.java Tue Feb 23 13:37:38 2010
@@ -60,7 +60,7 @@
      */
     private final SubscriptionMap subscriptions = new SubscriptionMap();
 
-    private final Map transactionListenerById = new HashMap();
+    private final Map<String, List<TransactionListener>> transactionListenerById = new HashMap<String, List<TransactionListener>>();
 
     /**
      * Retrieve the {@link org.apache.jackrabbit.webdav.observation.SubscriptionDiscovery}
@@ -97,7 +97,7 @@
             SubscriptionImpl newSubs = new SubscriptionImpl(info, resource);
             registerSubscription(newSubs, resource);
 
-            // ajust references to this subscription
+            // adjust references to this subscription
             subscriptions.put(newSubs.getSubscriptionId(), newSubs);
             resource.getSession().addReference(newSubs.getSubscriptionId());
             subscription = newSubs;
@@ -213,7 +213,7 @@
 
         SubscriptionImpl subs;
         if (subscriptions.contains(subscriptionId)) {
-            subs = (SubscriptionImpl) subscriptions.get(subscriptionId);
+            subs = subscriptions.get(subscriptionId);
             if (!subs.isSubscribedToResource(resource)) {
                 throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "Attempt to operate on subscription with invalid resource path.");
             }
@@ -243,9 +243,9 @@
     public synchronized void beforeCommit(TransactionResource resource,
                                           String lockToken) {
         // suspend regular subscriptions during a commit
-        List transactionListeners = new ArrayList();
-        for (Iterator it = subscriptions.iterator(); it.hasNext(); ) {
-            SubscriptionImpl sub = (SubscriptionImpl) it.next();
+        List<TransactionListener> transactionListeners = new ArrayList<TransactionListener>();
+        for (Iterator<SubscriptionImpl> it = subscriptions.iterator(); it.hasNext(); ) {
+            SubscriptionImpl sub = it.next();
             TransactionListener tl = sub.createTransactionListener();
             tl.beforeCommit(resource, lockToken);
             transactionListeners.add(tl);
@@ -257,10 +257,9 @@
      * {@inheritDoc}
      */
     public void afterCommit(TransactionResource resource, String lockToken, boolean success) {
-        List transactionListeners = (List) transactionListenerById.remove(lockToken);
+        List<TransactionListener> transactionListeners = transactionListenerById.remove(lockToken);
         if (transactionListeners != null) {
-            for (Iterator it = transactionListeners.iterator(); it.hasNext(); ) {
-                TransactionListener txListener = (TransactionListener) it.next();
+            for (TransactionListener txListener : transactionListeners) {
                 txListener.afterCommit(resource, lockToken, success);
             }
         }
@@ -297,29 +296,29 @@
      */
     private class SubscriptionMap {
 
-        private HashMap subscriptions = new HashMap();
-        private HashMap ids = new HashMap();
+        private HashMap<String, SubscriptionImpl> subscriptions = new HashMap<String, SubscriptionImpl>();
+        private HashMap<DavResourceLocator, Set<String>> ids = new HashMap<DavResourceLocator, Set<String>>();
 
         private boolean contains(String subscriptionId) {
             return subscriptions.containsKey(subscriptionId);
         }
 
-        private Subscription get(String subscriptionId) {
-            return (Subscription) subscriptions.get(subscriptionId);
+        private SubscriptionImpl get(String subscriptionId) {
+            return subscriptions.get(subscriptionId);
         }
 
-        private Iterator iterator() {
+        private Iterator<SubscriptionImpl> iterator() {
             return subscriptions.values().iterator();
         }
 
         private void put(String subscriptionId, SubscriptionImpl subscription) {
             subscriptions.put(subscriptionId, subscription);
             DavResourceLocator key = subscription.getLocator();
-            Set idSet;
+            Set<String> idSet;
             if (ids.containsKey(key)) {
-                idSet = (Set) ids.get(key);
+                idSet = ids.get(key);
             } else {
-                idSet = new HashSet();
+                idSet = new HashSet<String>();
                 ids.put(key, idSet);
             }
             if (!idSet.contains(subscriptionId)) {
@@ -328,19 +327,19 @@
         }
 
         private void remove(String subscriptionId) {
-            SubscriptionImpl sub = (SubscriptionImpl) subscriptions.remove(subscriptionId);
-            ((Set)ids.get(sub.getLocator())).remove(subscriptionId);
+            SubscriptionImpl sub = subscriptions.remove(subscriptionId);
+            ids.get(sub.getLocator()).remove(subscriptionId);
         }
 
         private Subscription[] getByPath(DavResourceLocator locator) {
-            Set idSet = (Set) ids.get(locator);
+            Set<String> idSet = ids.get(locator);
             if (idSet != null && !idSet.isEmpty()) {
-                Iterator idIterator = idSet.iterator();
                 Subscription[] subsForResource = new Subscription[idSet.size()];
                 int i = 0;
-                while (idIterator.hasNext()) {
-                    SubscriptionImpl s = (SubscriptionImpl) subscriptions.get(idIterator.next());
+                for (String id : idSet) {
+                    SubscriptionImpl s = subscriptions.get(id);
                     subsForResource[i] = new WrappedSubscription(s);
+                    i++;
                 }
                 return subsForResource;
             } else {

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/LengthsProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/LengthsProperty.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/LengthsProperty.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/LengthsProperty.java Tue Feb 23 13:37:38 2010
@@ -27,7 +27,7 @@
  * utilities to handle the multiple lengths of the property item represented
  * by this resource.
  */
-public class LengthsProperty extends AbstractDavProperty implements ItemResourceConstants {
+public class LengthsProperty extends AbstractDavProperty<long[]> implements ItemResourceConstants {
 
     private final long[] value;
 
@@ -47,20 +47,21 @@
      *
      * @return an array of {@link long}s
      */
-    public Object getValue() {
+    public long[] getValue() {
         return value;
     }
 
     /**
      * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document)
      */
+    @Override
     public Element toXml(Document document) {
         Element elem = getName().toXml(document);
-        for (int i = 0; i < value.length; i++) {
-            String txtContent = String.valueOf(value[i]);
+        for (long length : value) {
+            String txtContent = String.valueOf(length);
             DomUtil.addChildElement(elem, XML_LENGTH, ItemResourceConstants.NAMESPACE, txtContent);
         }
         return elem;
     }
 
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/NamespacesProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/NamespacesProperty.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/NamespacesProperty.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/NamespacesProperty.java Tue Feb 23 13:37:38 2010
@@ -30,7 +30,6 @@
 
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
@@ -39,28 +38,27 @@
 /**
  * <code>NamespacesProperty</code>...
  */
-public class NamespacesProperty extends AbstractDavProperty implements ItemResourceConstants {
+public class NamespacesProperty extends AbstractDavProperty<Map<String, String>> implements ItemResourceConstants {
 
     private static Logger log = LoggerFactory.getLogger(NamespacesProperty.class);
 
-    private final Map value = new HashMap();
+    private final Map<String, String> value = new HashMap<String, String>();
 
     public NamespacesProperty(NamespaceRegistry nsReg) throws RepositoryException {
         super(JCR_NAMESPACES, false);
         if (nsReg != null) {
-            String[] prefixes = nsReg.getPrefixes();
-            for (int i = 0; i < prefixes.length; i++) {
-                value.put(prefixes[i], nsReg.getURI(prefixes[i]));
+            for (String prefix : nsReg.getPrefixes()) {
+                value.put(prefix, nsReg.getURI(prefix));
             }
         }
     }
 
-    public NamespacesProperty(Map namespaces) {
+    public NamespacesProperty(Map<String, String> namespaces) {
         super(JCR_NAMESPACES, false);
         value.putAll(namespaces);
     }
 
-    public NamespacesProperty(DavProperty property) throws DavException {
+    public NamespacesProperty(DavProperty<?> property) throws DavException {
         super(JCR_NAMESPACES, false);
         Object v = property.getValue();
         if (!(v instanceof List)) {
@@ -69,9 +67,7 @@
         }
         // retrieve list of prefix/uri pairs that build the new values of
         // the ns-registry
-        Iterator it = ((List)v).iterator();
-        while (it.hasNext()) {
-            Object listEntry = it.next();
+        for (Object listEntry : (List<?>) v) {
             if (listEntry instanceof Element) {
                 Element e = (Element)listEntry;
                 if (XML_NAMESPACE.equals(e.getLocalName())) {
@@ -85,23 +81,22 @@
         }
     }
 
-    public Map getNamespaces() {
+    public Map<String, String> getNamespaces() {
         return Collections.unmodifiableMap(value);
     }
 
-    public Object getValue() {
+    public Map<String, String> getValue() {
         return Collections.unmodifiableMap(value);
     }
 
     /**
      * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(Document)
      */
+    @Override
     public Element toXml(Document document) {
         Element elem = getName().toXml(document);
-        Iterator prefixes = value.keySet().iterator();
-        while (prefixes.hasNext()) {
-            String prefix = (String) prefixes.next();
-            String uri = (String) value.get(prefix);
+        for (String prefix : value.keySet()) {
+            String uri = value.get(prefix);
             Element nsElem = DomUtil.addChildElement(elem, XML_NAMESPACE, ItemResourceConstants.NAMESPACE);
             DomUtil.addChildElement(nsElem, XML_PREFIX, ItemResourceConstants.NAMESPACE, prefix);
             DomUtil.addChildElement(nsElem, XML_URI, ItemResourceConstants.NAMESPACE, uri);
@@ -109,4 +104,4 @@
         return elem;
     }
 
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/ValuesProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/ValuesProperty.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/ValuesProperty.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/property/ValuesProperty.java Tue Feb 23 13:37:38 2010
@@ -35,7 +35,6 @@
 import javax.jcr.ValueFormatException;
 import javax.jcr.ValueFactory;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -43,7 +42,7 @@
  * utilities to handle the multiple values of the property item represented
  * by this resource.
  */
-public class ValuesProperty extends AbstractDavProperty implements ItemResourceConstants {
+public class ValuesProperty extends AbstractDavProperty<Value[]> implements ItemResourceConstants {
 
     private static Logger log = LoggerFactory.getLogger(ValuesProperty.class);
 
@@ -82,7 +81,7 @@
      * @param valueFactory Factory used to retrieve JCR values from the value
      * of the given <code>DavProperty</code>.
      */
-    public ValuesProperty(DavProperty property, int defaultType,
+    public ValuesProperty(DavProperty<?> property, int defaultType,
                           ValueFactory valueFactory)
         throws RepositoryException, DavException {
         super(property.getName(), false);
@@ -92,32 +91,31 @@
         }
 
         // retrieve jcr-values from child 'value'-element(s)
-        List valueElements = new ArrayList();
+        List<Element> valueElements = new ArrayList<Element>();
         Object propValue = property.getValue();
         if (propValue == null) {
             jcrValues = new Value[0];
         } else { /* not null propValue */
             if (isValueElement(propValue)) {
-                valueElements.add(propValue);
+                valueElements.add((Element) propValue);
             } else if (propValue instanceof List) {
-                Iterator elemIt = ((List)property.getValue()).iterator();
-                while (elemIt.hasNext()) {
-                    Object el = elemIt.next();
+                for (Object el : ((List<?>) property.getValue())) {
                     /* make sure, only Elements with name 'value' are used for
                     * the 'value' field. any other content (other elements, text,
                     * comment etc.) is ignored. NO bad-request/conflict error is
                     * thrown.
                     */
                     if (isValueElement(el)) {
-                        valueElements.add(el);
+                        valueElements.add((Element) el);
                     }
                 }
             }
             /* fill the 'value' with the valid 'value' elements found before */
-            Element[] elems = (Element[])valueElements.toArray(new Element[valueElements.size()]);
-            jcrValues = new Value[elems.length];
-            for (int i = 0; i < elems.length; i++) {
-                jcrValues[i] = getJcrValue(elems[i], defaultType, valueFactory);
+            jcrValues = new Value[valueElements.size()];
+            int i = 0;
+            for (Element element : valueElements) {
+                jcrValues[i] = getJcrValue(element, defaultType, valueFactory);
+                i++;
             }
         }
     }
@@ -222,7 +220,7 @@
      * @see #getJcrValues()
      * @see #getJcrValue()
      */
-    public Object getValue() {
+    public Value[] getValue() {
         return jcrValues;
     }
 
@@ -231,11 +229,11 @@
      * @param document
      * @return the xml element
      */
+    @Override
     public Element toXml(Document document) {
         Element elem = getName().toXml(document);
         try {
-            for (int i = 0; i < jcrValues.length; i++) {
-                Value v = jcrValues[i];
+            for (Value v : jcrValues) {
                 String type = PropertyType.nameFromValue(v.getType());
                 String serializedValue = ValueHelper.serialize(v, true);
                 Element xmlValue = DomUtil.createElement(document, XML_VALUE, ItemResourceConstants.NAMESPACE, serializedValue);
@@ -247,4 +245,4 @@
         }
         return elem;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/search/SearchResultProperty.java Tue Feb 23 13:37:38 2010
@@ -39,7 +39,7 @@
  * <code>SearchResultProperty</code>...
  */
 // todo: find proper solution for transporting search results...
-public class SearchResultProperty extends AbstractDavProperty implements ItemResourceConstants {
+public class SearchResultProperty extends AbstractDavProperty<Value[]> implements ItemResourceConstants {
 
     private static Logger log = LoggerFactory.getLogger(SearchResultProperty.class);
 
@@ -78,18 +78,18 @@
      * required form.
      * @see #getValues()
      */
-    public SearchResultProperty(DavProperty property, ValueFactory valueFactory) throws RepositoryException {
+    public SearchResultProperty(DavProperty<?> property, ValueFactory valueFactory) throws RepositoryException {
         super(property.getName(), true);
         if (!SEARCH_RESULT_PROPERTY.equals(getName())) {
-	    throw new IllegalArgumentException("SearchResultProperty may only be created from a property named " + SEARCH_RESULT_PROPERTY.toString());
-	}
+            throw new IllegalArgumentException("SearchResultProperty may only be created from a property named " + SEARCH_RESULT_PROPERTY.toString());
+        }
 
         List<String> colList = new ArrayList<String>();
         List<String> selList = new ArrayList<String>();
         List<Value> valList = new ArrayList<Value>();
         Object propValue = property.getValue();
         if (propValue instanceof List) {
-            for (Object o : ((List) propValue)) {
+            for (Object o : ((List<?>) propValue)) {
                 if (o instanceof Element) {
                     parseColumnElement((Element) o, colList, selList, valList, valueFactory);
                 }
@@ -164,7 +164,7 @@
      *
      * @return Array of JCR Value object
      */
-    public Object getValue() {
+    public Value[] getValue() {
         return values;
     }
 
@@ -208,6 +208,7 @@
      *
      * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(org.w3c.dom.Document)
      */
+    @Override
     public Element toXml(Document document) {
         Element elem = getName().toXml(document);
         for (int i = 0; i < columnNames.length; i++) {

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/transaction/TxLockManagerImpl.java Tue Feb 23 13:37:38 2010
@@ -58,7 +58,7 @@
  //todo: removing all expired locks
  //todo: 'local' and 'global' are not accurate terms in the given context > replace
  /*todo: the usage of the 'global' transaction is not according to the JTA specification,
-   which explicitely requires any transaction present on a servlet to be completed before
+   which explicitly requires any transaction present on a servlet to be completed before
    the service method returns. Starting/completing transactions on the session object,
    which is possible with the jackrabbit implementation is a hack.*/
  /*todo: review of this transaction part is therefore required. Is there a use-case
@@ -67,9 +67,9 @@
 
     private static Logger log = LoggerFactory.getLogger(TxLockManagerImpl.class);
 
-    private TransactionMap map = new TransactionMap();
+    private final TransactionMap map = new TransactionMap();
 
-    private Map listeners = new IdentityHashMap();
+    private final Map<TransactionListener, TransactionListener> listeners = new IdentityHashMap<TransactionListener, TransactionListener>();
 
     /**
      * Create a new lock.
@@ -218,10 +218,10 @@
             if (lockInfo.isCommit()) {
                 TransactionListener[] txListeners;
                 synchronized (listeners) {
-                    txListeners = (TransactionListener[]) listeners.values().toArray(new TransactionListener[0]);
+                    txListeners = listeners.values().toArray(new TransactionListener[listeners.values().size()]);
                 }
-                for (int i = 0; i < txListeners.length; i++) {
-                    txListeners[i].beforeCommit(resource, lockToken);
+                for (TransactionListener txListener : txListeners) {
+                    txListener.beforeCommit(resource, lockToken);
                 }
                 DavException ex = null;
                 try {
@@ -229,8 +229,8 @@
                 } catch (DavException e) {
                     ex = e;
                 }
-                for (int i = 0; i < txListeners.length; i++) {
-                    txListeners[i].afterCommit(resource, lockToken, ex == null);
+                for (TransactionListener txListener : txListeners) {
+                    txListener.afterCommit(resource, lockToken, ex == null);
                 }
                 if (ex != null) {
                     throw ex;
@@ -336,11 +336,11 @@
             tx = m.get(lockToken);
         } else {
             // look through all the nested tx-maps (i.e. global txs) for the given txId
-            Iterator it = m.values().iterator();
+            Iterator<Transaction> it = m.values().iterator();
             while (it.hasNext() && tx == null) {
-                Transaction txMap = (Transaction) it.next();
+                Transaction txMap = it.next();
                 if (!txMap.isLocal()) {
-                    m = ((TransactionMap) txMap);
+                    m = (TransactionMap) txMap;
                     if (m.containsKey(lockToken)) {
                         tx = ((TransactionMap) txMap).get(lockToken);
                     }
@@ -418,7 +418,7 @@
      * @throws DavException
      */
     private static void addReferences(Transaction tx, TransactionMap responsibleMap,
-                                      TransactionResource resource) throws DavException {
+                                      TransactionResource resource) {
         log.debug("Adding transactionId '" + tx.getId() + "' as session lock token.");
         resource.getSession().addLockToken(tx.getId());
 
@@ -449,6 +449,7 @@
     private static Session getRepositorySession(TransactionResource resource) throws DavException {
         return JcrDavSession.getRepositorySession(resource.getSession());
     }
+
     //------------------------------------------< inner classes, interfaces >---
     /**
      * Internal <code>Transaction</code> interface
@@ -520,6 +521,7 @@
             this.lock = lock;
         }
 
+        //----------------------------------------------------< Transaction >---
         /**
          * @see #getLock()
          */
@@ -561,7 +563,7 @@
     }
 
     /**
-     *
+     * Local transaction
      */
     private final static class LocalTransaction extends AbstractTransaction {
 
@@ -569,10 +571,17 @@
             super(locator, lock);
         }
 
+        //----------------------------------------------------< Transaction >---        
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#isLocal() 
+         */
         public boolean isLocal() {
             return true;
         }
 
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#start(TransactionResource)
+         */
         public void start(TransactionResource resource) throws DavException {
             try {
                 // make sure, the given resource represents an existing repository item
@@ -585,6 +594,9 @@
             }
         }
 
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#commit(TransactionResource) 
+         */
         public void commit(TransactionResource resource) throws DavException {
             try {
                 getItem(resource).save();
@@ -593,6 +605,9 @@
             }
         }
 
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#rollback(TransactionResource)
+         */
         public void rollback(TransactionResource resource) throws DavException {
             try {
                 getItem(resource).refresh(false);
@@ -601,18 +616,35 @@
             }
         }
 
+        //-------------------------------------------------< TransactionMap >---
+        /**
+         * Always throws <code>DavException</code>.
+         * 
+         * @see TransactionMap#putTransaction(String, org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction) 
+         */
+        @Override
+        public Transaction putTransaction(String key, Transaction value) throws DavException {
+            throw new DavException(WebdavResponse.SC_PRECONDITION_FAILED, "Attempt to nest a new transaction into a local one.");
+        }
+
+        //--------------------------------------------------------< private >---
+        /**
+         * Retrieve the repository item from the given transaction resource.
+         *
+         * @param resource
+         * @return
+         * @throws PathNotFoundException
+         * @throws RepositoryException
+         * @throws DavException
+         */
         private Item getItem(TransactionResource resource) throws PathNotFoundException, RepositoryException, DavException {
             String itemPath = resource.getLocator().getRepositoryPath();
             return getRepositorySession(resource).getItem(itemPath);
         }
-
-        public Transaction put(String key, Transaction value) throws DavException {
-            throw new DavException(WebdavResponse.SC_PRECONDITION_FAILED, "Attempt to nest a new transaction into a local one.");
-        }
     }
 
     /**
-     *
+     * Global transaction
      */
     private static class GlobalTransaction extends AbstractTransaction {
 
@@ -623,10 +655,17 @@
             xid = new XidImpl(lock.getToken());
         }
 
+        //----------------------------------------------------< Transaction >---
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#isLocal()
+         */
         public boolean isLocal() {
             return false;
         }
 
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#start(TransactionResource)
+         */
         public void start(TransactionResource resource) throws DavException {
             XAResource xaRes = getXAResource(resource);
             try {
@@ -637,6 +676,9 @@
             }
         }
 
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#commit(TransactionResource)
+         */
         public void commit(TransactionResource resource) throws DavException {
             XAResource xaRes = getXAResource(resource);
             try {
@@ -647,6 +689,9 @@
             }
         }
 
+        /**
+         * @see org.apache.jackrabbit.webdav.jcr.transaction.TxLockManagerImpl.Transaction#rollback(TransactionResource)
+         */
         public void rollback(TransactionResource resource) throws DavException {
             XAResource xaRes = getXAResource(resource);
             try {
@@ -657,51 +702,53 @@
             }
         }
 
+        //-------------------------------------------------< TransactionMap >---
+        @Override
+        public Transaction putTransaction(String key, Transaction value) throws DavException {
+            if (!(value instanceof LocalTransaction)) {
+                throw new DavException(WebdavResponse.SC_PRECONDITION_FAILED, "Attempt to nest global transaction into a global one.");
+            }
+            return super.put(key, value);
+        }
+
+        //--------------------------------------------------------< private >---
         private XAResource getXAResource(TransactionResource resource) throws DavException {
             /*
-            // commented, since server should be jackrabbit independant
-	    Session session = resource.getSession().getRepositorySession();
-	    if (session instanceof XASession) {
-		return ((XASession)session).getXAResource();
-	    } else {
-		throw new DavException(DavServletResponse.SC_FORBIDDEN);
-	    }
+            // commented, since server should be jackrabbit independent
+            Session session = resource.getSession().getRepositorySession();
+            if (session instanceof XASession) {
+            return ((XASession)session).getXAResource();
+            } else {
+            throw new DavException(DavServletResponse.SC_FORBIDDEN);
+            }
             */
             throw new DavException(DavServletResponse.SC_FORBIDDEN);
         }
 
         private void removeLocalTxReferences(TransactionResource resource) {
-            Iterator it = values().iterator();
-            while (it.hasNext()) {
-                Transaction tx = (Transaction) it.next();
+            for (Object o : values()) {
+                Transaction tx = (Transaction) o;
                 removeReferences(tx, this, resource);
             }
         }
-
-        public Transaction put(String key, Transaction value) throws DavException {
-            if (!(value instanceof LocalTransaction)) {
-                throw new DavException(WebdavResponse.SC_PRECONDITION_FAILED, "Attempt to nest global transaction into a global one.");
-            }
-            return (Transaction) super.put(key, value);
-        }
     }
 
     /**
      *
      */
-    private static class TransactionMap extends HashMap {
+    private static class TransactionMap extends HashMap<String, Transaction> {
 
         public Transaction get(String key) {
             Transaction tx = null;
             if (containsKey(key)) {
-                tx = (Transaction) super.get(key);
+                tx = super.get(key);
             }
             return tx;
         }
 
-        public Transaction put(String key, Transaction value) throws DavException {
-            // any global an local transactions allowed.
-            return (Transaction) super.put(key, value);
+        public Transaction putTransaction(String key, Transaction value) throws DavException {
+            // any global and local transactions allowed.
+            return super.put(key, value);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionHistoryItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionHistoryItemCollection.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionHistoryItemCollection.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionHistoryItemCollection.java Tue Feb 23 13:37:38 2010
@@ -70,6 +70,7 @@
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getSupportedMethods()
      */
+    @Override
     public String getSupportedMethods() {
         StringBuffer sb = new StringBuffer(ItemResourceConstants.METHODS);
         sb.append(", ").append(VersionHistoryResource.METHODS);
@@ -84,6 +85,7 @@
      * while deleting.
      * @see DavResource#removeMember(org.apache.jackrabbit.webdav.DavResource)
      */
+    @Override
     public void removeMember(DavResource member) throws DavException {
         if (exists()) {
             VersionHistory versionHistory = (VersionHistory) item;
@@ -109,13 +111,13 @@
     public VersionResource[] getVersions() throws DavException {
         try {
             VersionIterator vIter = ((VersionHistory)item).getAllVersions();
-            ArrayList l = new ArrayList();
+            ArrayList<VersionResource> l = new ArrayList<VersionResource>();
             while (vIter.hasNext()) {
                 DavResourceLocator versionLoc = getLocatorFromItem(vIter.nextVersion());
-                DavResource vr = createResourceFromLocator(versionLoc);
+                VersionResource vr = (VersionResource) createResourceFromLocator(versionLoc);
                 l.add(vr);
             }
-            return (VersionResource[]) l.toArray(new VersionResource[l.size()]);
+            return l.toArray(new VersionResource[l.size()]);
         } catch (RepositoryException e) {
             throw new JcrDavException(e);
         }
@@ -125,15 +127,16 @@
     /**
      * Fill the property set for this resource.
      */
+    @Override
     protected void initProperties() {
         super.initProperties();
 
-        // change resourcetype defined by default item collection
+        // change resource type defined by default item collection
         properties.add(new ResourceType(ResourceType.VERSION_HISTORY));
 
         // jcr specific property pointing to the node this history belongs to
         try {
-            properties.add(new DefaultDavProperty(JCR_VERSIONABLEUUID, ((VersionHistory)item).getVersionableUUID()));
+            properties.add(new DefaultDavProperty<String>(JCR_VERSIONABLEUUID, ((VersionHistory)item).getVersionableIdentifier()));
         } catch (RepositoryException e) {
             log.error(e.getMessage());
         }
@@ -148,10 +151,10 @@
 
         // required, protected version-set property for version-history resource
         try {
-            VersionIterator vIter = ((VersionHistory)item).getAllVersions();
+            VersionIterator vIter = ((VersionHistory) item).getAllVersions();
             addHrefProperty(VersionHistoryResource.VERSION_SET, vIter, true);
         } catch (RepositoryException e) {
             log.error(e.getMessage());
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionItemCollection.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionItemCollection.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/VersionItemCollection.java Tue Feb 23 13:37:38 2010
@@ -77,6 +77,7 @@
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getSupportedMethods()
      */
+    @Override
     public String getSupportedMethods() {
         StringBuffer sb = new StringBuffer(ItemResourceConstants.METHODS);
         sb.append(", ").append(VersionResource.METHODS);
@@ -157,6 +158,7 @@
      *
      * @see org.apache.jackrabbit.webdav.version.report.SupportedReportSetProperty
      */
+    @Override
     protected void initSupportedReports() {
         super.initSupportedReports();
         if (exists()) {
@@ -167,6 +169,7 @@
     /**
      * Fill the property set for this resource.
      */
+    @Override
     protected void initProperties() {
         super.initProperties();
 
@@ -176,10 +179,10 @@
             try {
                 String creationDate = HttpDateFormat.creationDateFormat().format(v.getCreated().getTime());
                 // replace dummy creation date from default collection
-                properties.add(new DefaultDavProperty(DavPropertyName.CREATIONDATE, creationDate));
+                properties.add(new DefaultDavProperty<String>(DavPropertyName.CREATIONDATE, creationDate));
 
                 // required, protected DAV:version-name property
-                properties.add(new DefaultDavProperty(VERSION_NAME, v.getName(), true));
+                properties.add(new DefaultDavProperty<String>(VERSION_NAME, v.getName(), true));
 
                 // required, protected DAV:label-name-set property
                 String[] labels = getVersionHistoryItem().getVersionLabels(v);
@@ -195,7 +198,7 @@
 
                 // required DAV:checkout-set (computed) property
                 PropertyIterator it = v.getReferences();
-                List nodeList = new ArrayList();
+                List<Node> nodeList = new ArrayList<Node>();
                 while (it.hasNext()) {
                     Property p = it.nextProperty();
                     if (JcrConstants.JCR_BASEVERSION.equals(p.getName())) {
@@ -205,11 +208,11 @@
                         }
                     }
                 }
-                addHrefProperty(CHECKOUT_SET, (Node[]) nodeList.toArray(new Node[nodeList.size()]), true);
+                addHrefProperty(CHECKOUT_SET, nodeList.toArray(new Node[nodeList.size()]), true);
 
             } catch (RepositoryException e) {
                 log.error(e.getMessage());
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ExportViewReport.java Tue Feb 23 13:37:38 2010
@@ -95,6 +95,7 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
         // delegate validation to super class
         super.init(resource, info);
@@ -157,4 +158,4 @@
         }
         return null;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java Tue Feb 23 13:37:38 2010
@@ -85,6 +85,7 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
         // delegate basic validation to super class
         super.init(resource, info);
@@ -115,11 +116,11 @@
     private void addResponses(DavResourceLocator locator) {
         String repositoryPath = locator.getRepositoryPath();
         MultiStatusResponse resp = new MultiStatusResponse(locator.getHref(false), null);
-        List currentPrivs = new ArrayList();
-        for (int i = 0; i < PRIVS.length; i++) {
+        List<Privilege> currentPrivs = new ArrayList<Privilege>();
+        for (Privilege priv : PRIVS) {
             try {
-                getRepositorySession().checkPermission(repositoryPath, PRIVS[i].getName());
-                currentPrivs.add(PRIVS[i]);
+                getRepositorySession().checkPermission(repositoryPath, priv.getName());
+                currentPrivs.add(priv);
             } catch (AccessControlException e) {
                 // ignore
                 log.debug(e.toString());
@@ -128,7 +129,7 @@
                 log.debug(e.toString());
             }
         }
-        resp.add(new CurrentUserPrivilegeSetProperty((Privilege[])currentPrivs.toArray(new Privilege[currentPrivs.size()])));
+        resp.add(new CurrentUserPrivilegeSetProperty(currentPrivs.toArray(new Privilege[currentPrivs.size()])));
         ms.addResponse(resp);
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateByUuidReport.java Tue Feb 23 13:37:38 2010
@@ -82,6 +82,7 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
         // delegate basic validation to super class
         super.init(resource, info);
@@ -114,4 +115,4 @@
     public Element toXml(Document document) {
         return ms.toXml(document);
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java Tue Feb 23 13:37:38 2010
@@ -97,6 +97,7 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
         // general validation checks
         super.init(resource, info);
@@ -148,4 +149,4 @@
             throw new PathNotFoundException("Node with path " + itemPath + " does not exist.");
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java Tue Feb 23 13:37:38 2010
@@ -41,7 +41,6 @@
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.nodetype.PropertyDefinition;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -96,6 +95,7 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
         // delegate basic validation to super class
         super.init(resource, info);
@@ -133,25 +133,22 @@
             ntDef.setAttribute(ISQUERYABLE_ATTRIBUTE, Boolean.toString(nt.isQueryable()));
 
             // declared supertypes
-            NodeType[] snts = nt.getDeclaredSupertypes();
             Element supertypes = DomUtil.addChildElement(ntDef, SUPERTYPES_ELEMENT, null);
-            for (int i = 0; i < snts.length; i++) {
-                DomUtil.addChildElement(supertypes, SUPERTYPE_ELEMENT, null, snts[i].getName());
+            for (NodeType snt : nt.getDeclaredSupertypes()) {
+                DomUtil.addChildElement(supertypes, SUPERTYPE_ELEMENT, null, snt.getName());
             }
 
-            // declared childnode defs
-            NodeDefinition[] cnd = nt.getChildNodeDefinitions();
-            for (int i = 0; i < cnd.length; i++) {
-                if (cnd[i].getDeclaringNodeType().getName().equals(nt.getName())) {
-                    ntDef.appendChild(NodeDefinitionImpl.create(cnd[i]).toXml(document));
+            // declared child node definitions
+            for (NodeDefinition aCnd : nt.getChildNodeDefinitions()) {
+                if (aCnd.getDeclaringNodeType().getName().equals(nt.getName())) {
+                    ntDef.appendChild(NodeDefinitionImpl.create(aCnd).toXml(document));
                 }
             }
 
-            // declared propertyDefs
-            PropertyDefinition[] pd = nt.getPropertyDefinitions();
-            for (int i = 0; i < pd.length; i++) {
-                if (pd[i].getDeclaringNodeType().getName().equals(nt.getName())) {
-                    ntDef.appendChild(PropertyDefinitionImpl.create(pd[i]).toXml(document));
+            // declared property definitions
+            for (PropertyDefinition aPd : nt.getPropertyDefinitions()) {
+                if (aPd.getDeclaringNodeType().getName().equals(nt.getName())) {
+                    ntDef.appendChild(PropertyDefinitionImpl.create(aPd).toXml(document));
                 }
             }
 
@@ -185,17 +182,15 @@
         } else {
             // None of the simple types. test if a report for individual
             // nodetype was request. If not, the request body is not valid.
-            List elemList = info.getContentElements(XML_NODETYPE, NAMESPACE);
+            List<Element> elemList = info.getContentElements(XML_NODETYPE, NAMESPACE);
             if (elemList.isEmpty()) {
                 // throw exception if the request body does not contain a single nodetype element
                 throw new DavException(DavServletResponse.SC_BAD_REQUEST, "NodeTypes report: request body has invalid format.");
             }
 
             // todo: find better solution...
-            List ntList = new ArrayList();
-            Iterator elemIter = elemList.iterator();
-            while (elemIter.hasNext()) {
-                Element el = ((Element)elemIter.next());
+            List<NodeType> ntList = new ArrayList<NodeType>();
+            for (Element el : elemList) {
                 String nodetypeName = DomUtil.getChildTextTrim(el, XML_NODETYPENAME, NAMESPACE);
                 if (nodetypeName != null) {
                     ntList.add(ntMgr.getNodeType(nodetypeName));
@@ -204,4 +199,4 @@
             return new NodeTypeIteratorAdapter(ntList);
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RegisteredNamespacesReport.java Tue Feb 23 13:37:38 2010
@@ -84,6 +84,7 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
         // delegate validation to abstract super class
         super.init(resource, info);
@@ -105,11 +106,10 @@
     public Element toXml(Document document)  {
         Element report = DomUtil.createElement(document, "registerednamespaces-report", NAMESPACE);
         try {
-            String[] prefixes = nsReg.getPrefixes();
-            for (int i = 0; i < prefixes.length; i++) {
+            for (String prefix : nsReg.getPrefixes()) {
                 Element elem = DomUtil.addChildElement(report, XML_NAMESPACE, NAMESPACE);
-                DomUtil.addChildElement(elem, XML_PREFIX, NAMESPACE, prefixes[i]);
-                DomUtil.addChildElement(elem, XML_URI, NAMESPACE, nsReg.getURI(prefixes[i]));
+                DomUtil.addChildElement(elem, XML_PREFIX, NAMESPACE, prefix);
+                DomUtil.addChildElement(elem, XML_URI, NAMESPACE, nsReg.getURI(prefix));
             }
         } catch (RepositoryException e) {
             // should not occur.
@@ -118,4 +118,4 @@
         return report;
     }
 
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/RepositoryDescriptorsReport.java Tue Feb 23 13:37:38 2010
@@ -83,8 +83,9 @@
     /**
      * @see Report#init(DavResource, ReportInfo)
      */
+    @Override
     public void init(DavResource resource, ReportInfo info) throws DavException {
-        // delegate validation to abstract super classe
+        // delegate validation to abstract super class
         super.init(resource, info);
     }
 
@@ -118,4 +119,4 @@
         }
         return report;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java Tue Feb 23 13:37:38 2010
@@ -61,6 +61,7 @@
 import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
 import org.apache.jackrabbit.webdav.property.HrefProperty;
 import org.apache.jackrabbit.webdav.property.ResourceType;
+import org.apache.jackrabbit.webdav.property.PropEntry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -78,7 +79,6 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -288,7 +288,7 @@
     /**
      * @see DavResource#getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)
      */
-    public DavProperty getProperty(DavPropertyName name) {
+    public DavProperty<?> getProperty(DavPropertyName name) {
         initProperties();
         return properties.get(name);
     }
@@ -324,29 +324,29 @@
 
         // set (or reset) fundamental properties
         if (getDisplayName() != null) {
-            properties.add(new DefaultDavProperty(DavPropertyName.DISPLAYNAME, getDisplayName()));
+            properties.add(new DefaultDavProperty<String>(DavPropertyName.DISPLAYNAME, getDisplayName()));
         }
         if (isCollection()) {
             properties.add(new ResourceType(ResourceType.COLLECTION));
             // Windows XP support
-            properties.add(new DefaultDavProperty(DavPropertyName.ISCOLLECTION, "1"));
+            properties.add(new DefaultDavProperty<String>(DavPropertyName.ISCOLLECTION, "1"));
         } else {
             properties.add(new ResourceType(ResourceType.DEFAULT_RESOURCE));
             // Windows XP support
-            properties.add(new DefaultDavProperty(DavPropertyName.ISCOLLECTION, "0"));
+            properties.add(new DefaultDavProperty<String>(DavPropertyName.ISCOLLECTION, "0"));
         }
 
         if (rfc4122Uri != null) {
             properties.add(new HrefProperty(BindConstants.RESOURCEID, rfc4122Uri, true));
         }
 
-        Set parentElements = getParentElements();
+        Set<ParentElement> parentElements = getParentElements();
         if (!parentElements.isEmpty()) {
             properties.add(new ParentSet(parentElements));
         }
 
         /* set current lock information. If no lock is set to this resource,
-        an empty lockdiscovery will be returned in the response. */
+        an empty lock discovery will be returned in the response. */
         properties.add(new LockDiscovery(getLock(Type.WRITE, Scope.EXCLUSIVE)));
 
         /* lock support information: all locks are lockable. */
@@ -362,7 +362,7 @@
      * @throws DavException
      * @see DavResource#setProperty(org.apache.jackrabbit.webdav.property.DavProperty)
      */
-    public void setProperty(DavProperty property) throws DavException {
+    public void setProperty(DavProperty<?> property) throws DavException {
         alterProperty(property);
     }
 
@@ -375,7 +375,7 @@
         alterProperty(propertyName);
     }
 
-    private void alterProperty(Object prop) throws DavException {
+    private void alterProperty(PropEntry prop) throws DavException {
         if (isLocked(this)) {
             throw new DavException(DavServletResponse.SC_LOCKED);
         }
@@ -383,10 +383,9 @@
             throw new DavException(DavServletResponse.SC_NOT_FOUND);
         }
         try {
-            List l = new ArrayList(1);
-            l.add(prop);
-            alterProperties(l);
-            Map failure = config.getPropertyManager().alterProperties(getPropertyImportContext(l), isCollection());
+            List<? extends PropEntry> list = Collections.singletonList(prop);
+            alterProperties(list);
+            Map<? extends PropEntry, ?> failure = config.getPropertyManager().alterProperties(getPropertyImportContext(list), isCollection());
             if (failure.isEmpty()) {
                 node.save();
             } else {
@@ -406,7 +405,7 @@
         }
     }
 
-    public MultiStatusResponse alterProperties(List changeList) throws DavException {
+    public MultiStatusResponse alterProperties(List<? extends PropEntry> changeList) throws DavException {
         if (isLocked(this)) {
             throw new DavException(DavServletResponse.SC_LOCKED);
         }
@@ -415,7 +414,7 @@
         }
         MultiStatusResponse msr = new MultiStatusResponse(getHref(), null);
         try {
-            Map failures = config.getPropertyManager().alterProperties(getPropertyImportContext(changeList), isCollection());
+            Map<? extends PropEntry, ?> failures = config.getPropertyManager().alterProperties(getPropertyImportContext(changeList), isCollection());
             if (failures.isEmpty()) {
                 // save all changes together (reverted in case this fails)
                 node.save();
@@ -424,26 +423,24 @@
                 node.refresh(false);
             }
             /* loop over list of properties/names that were successfully altered
-               and them to the multistatus response respecting the resulte of the
+               and them to the multistatus response respecting the result of the
                complete action. in case of failure set the status to 'failed-dependency'
                in order to indicate, that altering those names/properties would
                have succeeded, if no other error occured.*/
-            Iterator it = changeList.iterator();
-            while (it.hasNext()) {
-                Object o = it.next();
+            for (PropEntry propEntry : changeList) {
                 int statusCode;
-                if (failures.containsKey(o)) {
-                    Object error = failures.get(o);
+                if (failures.containsKey(propEntry)) {
+                    Object error = failures.get(propEntry);
                     statusCode = (error instanceof RepositoryException)
-                        ? new JcrDavException((RepositoryException) error).getErrorCode()
-                        : DavServletResponse.SC_INTERNAL_SERVER_ERROR;
+                            ? new JcrDavException((RepositoryException) error).getErrorCode()
+                            : DavServletResponse.SC_INTERNAL_SERVER_ERROR;
                 } else {
                     statusCode = (failures.isEmpty()) ? DavServletResponse.SC_OK : DavServletResponse.SC_FAILED_DEPENDENCY;
                 }
-                if (o instanceof DavProperty) {
-                    msr.add(((DavProperty) o).getName(), statusCode);
+                if (propEntry instanceof DavProperty) {
+                    msr.add(((DavProperty<?>) propEntry).getName(), statusCode);
                 } else {
-                    msr.add((DavPropertyName) o, statusCode);
+                    msr.add((DavPropertyName) propEntry, statusCode);
                 }
             }
             return msr;
@@ -482,7 +479,7 @@
      * @see DavResource#getMembers()
      */
     public DavResourceIterator getMembers() {
-        ArrayList list = new ArrayList();
+        ArrayList<DavResource> list = new ArrayList<DavResource>();
         if (exists() && isCollection()) {
             try {
                 NodeIterator it = node.getNodes();
@@ -497,9 +494,9 @@
                     }
                 }
             } catch (RepositoryException e) {
-                // should not occure
+                // should not occur
             } catch (DavException e) {
-                // should not occure
+                // should not occur
             }
         }
         return new DavResourceIteratorImpl(list);
@@ -860,10 +857,10 @@
     /**
      * @see org.apache.jackrabbit.webdav.bind.BindableResource#getParentElements()
      */
-    public Set getParentElements() {
+    public Set<ParentElement> getParentElements() {
         try {
             if (node.getDepth() > 0) {
-                Set ps = new HashSet();
+                Set<ParentElement> ps = new HashSet<ParentElement>();
                 NodeIterator sharedSetIterator = node.getSharedSet();
                 while (sharedSetIterator.hasNext()) {
                     Node sharednode = sharedSetIterator.nextNode();
@@ -876,7 +873,7 @@
         } catch (RepositoryException e) {
             log.warn("unable to calculate parent set", e);
         }
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     /**
@@ -920,7 +917,7 @@
      * @param changeList
      * @return a new <code>PropertyImportContext</code>.
      */
-    protected PropertyImportContext getPropertyImportContext(List changeList) {
+    protected PropertyImportContext getPropertyImportContext(List<? extends PropEntry> changeList) {
         return new ProperyImportCtx(changeList);
     }
 
@@ -969,9 +966,8 @@
         if (lock == null) {
             return false;
         } else {
-            String[] sLockTokens = session.getLockTokens();
-            for (int i = 0; i < sLockTokens.length; i++) {
-                if (sLockTokens[i].equals(lock.getToken())) {
+            for (String sLockToken : session.getLockTokens()) {
+                if (sLockToken.equals(lock.getToken())) {
                     return false;
                 }
             }
@@ -1021,26 +1017,26 @@
 
         public void setContentLanguage(String contentLanguage) {
             if (contentLanguage != null) {
-                properties.add(new DefaultDavProperty(DavPropertyName.GETCONTENTLANGUAGE, contentLanguage));
+                properties.add(new DefaultDavProperty<String>(DavPropertyName.GETCONTENTLANGUAGE, contentLanguage));
             }
         }
 
         public void setContentLength(long contentLength) {
             if (contentLength > IOUtil.UNDEFINED_LENGTH) {
-                properties.add(new DefaultDavProperty(DavPropertyName.GETCONTENTLENGTH, contentLength + ""));
+                properties.add(new DefaultDavProperty<String>(DavPropertyName.GETCONTENTLENGTH, contentLength + ""));
             }
         }
 
         public void setContentType(String mimeType, String encoding) {
             String contentType = IOUtil.buildContentType(mimeType, encoding);
             if (contentType != null) {
-                properties.add(new DefaultDavProperty(DavPropertyName.GETCONTENTTYPE, contentType));
+                properties.add(new DefaultDavProperty<String>(DavPropertyName.GETCONTENTTYPE, contentType));
             }
         }
 
         public void setCreationTime(long creationTime) {
             String created = IOUtil.getCreated(creationTime);
-            properties.add(new DefaultDavProperty(DavPropertyName.CREATIONDATE, created));
+            properties.add(new DefaultDavProperty<String>(DavPropertyName.CREATIONDATE, created));
         }
 
         public void setModificationTime(long modTime) {
@@ -1050,12 +1046,12 @@
                 modificationTime = modTime;
             }
             String lastModified = IOUtil.getLastModified(modificationTime);
-            properties.add(new DefaultDavProperty(DavPropertyName.GETLASTMODIFIED, lastModified));
+            properties.add(new DefaultDavProperty<String>(DavPropertyName.GETLASTMODIFIED, lastModified));
         }
 
         public void setETag(String etag) {
             if (etag != null) {
-                properties.add(new DefaultDavProperty(DavPropertyName.GETETAG, etag));
+                properties.add(new DefaultDavProperty<String>(DavPropertyName.GETETAG, etag));
             }
         }
 
@@ -1066,7 +1062,7 @@
             }
 
             if (propertyValue instanceof DavProperty) {
-                properties.add((DavProperty)propertyValue);
+                properties.add((DavProperty<?>)propertyValue);
             } else {
                 DavPropertyName pName;
                 if (propertyName instanceof DavPropertyName) {
@@ -1075,7 +1071,7 @@
                     // create property name with default DAV: namespace
                     pName = DavPropertyName.create(propertyName.toString());
                 }
-                properties.add(new DefaultDavProperty(pName, propertyValue));
+                properties.add(new DefaultDavProperty<Object>(pName, propertyValue));
             }
         }
     }
@@ -1083,10 +1079,10 @@
     private class ProperyImportCtx implements PropertyImportContext {
 
         private final IOListener ioListener = new DefaultIOListener(log);
-        private final List changeList;
+        private final List<? extends PropEntry> changeList;
         private boolean completed;
 
-        private ProperyImportCtx(List changeList) {
+        private ProperyImportCtx(List<? extends PropEntry> changeList) {
             this.changeList = changeList;
         }
 
@@ -1100,7 +1096,7 @@
         /**
          * @see PropertyImportContext#getChangeList()
          */
-        public List getChangeList() {
+        public List<? extends PropEntry> getChangeList() {
             return Collections.unmodifiableList(changeList);
         }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionImpl.java Tue Feb 23 13:37:38 2010
@@ -29,7 +29,7 @@
 public class DavSessionImpl extends JcrDavSession {
 
     /** the lock tokens of this session */
-    private final HashSet lockTokens = new HashSet();
+    private final HashSet<String> lockTokens = new HashSet<String>();
 
     /**
      * Creates a new DavSession based on a jcr session
@@ -56,6 +56,7 @@
     /**
      * @see DavSession#addLockToken(String)
      */
+    @Override
     public void addLockToken(String token) {
         super.addLockToken(token);
         lockTokens.add(token);
@@ -64,13 +65,15 @@
     /**
      * @see DavSession#getLockTokens()
      */
+    @Override
     public String[] getLockTokens() {
-        return (String[]) lockTokens.toArray(new String[lockTokens.size()]);
+        return lockTokens.toArray(new String[lockTokens.size()]);
     }
 
     /**
      * @see DavSession#removeLockToken(String)
      */
+    @Override
     public void removeLockToken(String token) {
         super.removeLockToken(token);
         lockTokens.remove(token);

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionProviderImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionProviderImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavSessionProviderImpl.java Tue Feb 23 13:37:38 2010
@@ -116,9 +116,8 @@
         DavSession ds = request.getDavSession();
         if (ds != null && ds instanceof DavSessionImpl) {
             Session repSession = ((DavSessionImpl)ds).getRepositorySession();
-            String[] lockTokens = repSession.getLockTokens();
-            for (int i = 0; i < lockTokens.length; i++) {
-                repSession.removeLockToken(lockTokens[i]);
+            for (String lockToken : repSession.getLockTokens()) {
+                repSession.removeLockToken(lockToken);
             }
             sesProvider.releaseSession(repSession);
             log.debug("Releasing session '"+ ds + "' from request '" + request + "'");

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DefaultItemFilter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DefaultItemFilter.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DefaultItemFilter.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DefaultItemFilter.java Tue Feb 23 13:37:38 2010
@@ -34,9 +34,9 @@
 
     private static Logger log = LoggerFactory.getLogger(DefaultItemFilter.class);
 
-    private List prefixFilter = new ArrayList();
-    private List uriFilter = new ArrayList();
-    private List nodetypeFilter = new ArrayList();
+    private List<String> prefixFilter = new ArrayList<String>();
+    private List<String> uriFilter = new ArrayList<String>();
+    private List<String> nodetypeFilter = new ArrayList<String>();
 
     public DefaultItemFilter() {
     }
@@ -46,8 +46,8 @@
      */
     public void setFilteredURIs(String[] uris) {
         if (uris != null) {
-            for (int i = 0; i < uris.length; i++) {
-                uriFilter.add(uris[i]);
+            for (String uri : uris) {
+                uriFilter.add(uri);
             }
         }
     }
@@ -57,8 +57,8 @@
      */
     public void setFilteredPrefixes(String[] prefixes) {
         if (prefixes != null) {
-            for (int i = 0; i < prefixes.length; i++) {
-                prefixFilter.add(prefixes[i]);
+            for (String prefix : prefixes) {
+                prefixFilter.add(prefix);
             }
         }
     }
@@ -68,8 +68,8 @@
      */
     public void setFilteredNodetypes(String[] nodetypeNames) {
         if (nodetypeNames != null) {
-            for (int i = 0; i < nodetypeNames.length; i++) {
-                nodetypeFilter.add(nodetypeNames[i]);
+            for (String nodetypeName : nodetypeNames) {
+                nodetypeFilter.add(nodetypeName);
             }
         }
     }
@@ -155,4 +155,4 @@
         // nodetype info could not be retrieved
         return false;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java Tue Feb 23 13:37:38 2010
@@ -16,7 +16,6 @@
 package org.apache.jackrabbit.webdav.simple;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.jcr.Item;
@@ -76,6 +75,7 @@
     /**
      * @see org.apache.jackrabbit.webdav.DavResource#getComplianceClass()
      */
+    @Override
     public String getComplianceClass() {
         return DELTAV_COMPLIANCE_CLASSES;
     }
@@ -145,21 +145,19 @@
      * @see DeltaVResource#getReferenceResources(org.apache.jackrabbit.webdav.property.DavPropertyName)
      */
     public DavResource[] getReferenceResources(DavPropertyName hrefPropertyName) throws DavException {
-        DavProperty prop = getProperty(hrefPropertyName);
-        List resources = new ArrayList();
+        DavProperty<?> prop = getProperty(hrefPropertyName);
+        List<DavResource> resources = new ArrayList<DavResource>();
         if (prop != null && prop instanceof HrefProperty) {
             HrefProperty hp = (HrefProperty)prop;
             // process list of hrefs
-            List hrefs = hp.getHrefs();
-            for (Iterator iter = hrefs.iterator(); iter.hasNext();) {
-                String href = (String)iter.next();
+            for (String href : hp.getHrefs()) {
                 DavResourceLocator locator = getLocator().getFactory().createResourceLocator(getLocator().getPrefix(), href);
                 resources.add(createResourceFromLocator(locator));
             }
         } else {
             throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR);
         }
-        return (DavResource[])resources.toArray(new DavResource[0]);
+        return resources.toArray(new DavResource[resources.size()]);
     }
 
     /**
@@ -243,6 +241,7 @@
     /**
      * Fill the property set for this resource.
      */
+    @Override
     protected void initProperties() {
         if (!propsInitialized) {
             super.initProperties();

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImpl.java Tue Feb 23 13:37:38 2010
@@ -140,6 +140,7 @@
          *
          * @return the hash code
          */
+        @Override
         public int hashCode() {
             return href.hashCode();
         }
@@ -152,6 +153,7 @@
          * @return <code>true</code> if the 2 objects are equal;
          *         <code>false</code> otherwise
          */
+        @Override
         public boolean equals(Object obj) {
             if (obj instanceof DavResourceLocator) {
                 DavResourceLocator other = (DavResourceLocator) obj;

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImplEx.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImplEx.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImplEx.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/LocatorFactoryImplEx.java Tue Feb 23 13:37:38 2010
@@ -41,6 +41,7 @@
      *
      * @see AbstractLocatorFactory#getRepositoryPath(String, String)
      */
+    @Override
     protected String getRepositoryPath(String resourcePath, String wspPath) {
         if (resourcePath == null) {
             return resourcePath;
@@ -58,6 +59,7 @@
      *
      * @see AbstractLocatorFactory#getResourcePath(String, String)
      */
+    @Override
     protected String getResourcePath(String repositoryPath, String wspPath) {
         if (repositoryPath == null) {
             throw new IllegalArgumentException("Cannot build resource path from 'null' repository path");

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceConfig.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceConfig.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceConfig.java Tue Feb 23 13:37:38 2010
@@ -213,7 +213,7 @@
             try {
                 String className = DomUtil.getAttribute(classElem, "name", null);
                 if (className != null) {
-                    Class c = Class.forName(className);
+                    Class<?> c = Class.forName(className);
                     instance = c.newInstance();
                 } else {
                     log.error("Invalid configuration: missing 'class' element");
@@ -228,14 +228,14 @@
     private void parseNamespacesEntry(Element parent) {
         Element namespaces = DomUtil.getChildElement(parent, "namespaces", null);
         if (namespaces != null) {
-            List l = new ArrayList();
+            List<String> l = new ArrayList<String>();
             // retrieve prefix child elements
             ElementIterator it = DomUtil.getChildren(namespaces, "prefix", null);
             while (it.hasNext()) {
                 Element e = it.nextElement();
                 l.add(DomUtil.getText(e));
             }
-            String[] prefixes = (String[])l.toArray(new String[l.size()]);
+            String[] prefixes = l.toArray(new String[l.size()]);
             l.clear();
             // retrieve uri child elements
             it = DomUtil.getChildren(namespaces, "uri", null);
@@ -243,7 +243,7 @@
                 Element e = it.nextElement();
                 l.add(DomUtil.getText(e));
             }
-            String[] uris = (String[])l.toArray(new String[l.size()]);
+            String[] uris = l.toArray(new String[l.size()]);
             itemFilter.setFilteredPrefixes(prefixes);
             itemFilter.setFilteredURIs(uris);
         }
@@ -253,13 +253,13 @@
         String[] ntNames;
         Element nodetypes = DomUtil.getChildElement(parent, "nodetypes", null);
         if (nodetypes != null) {
-            List l = new ArrayList();
+            List<String> l = new ArrayList<String>();
             ElementIterator it = DomUtil.getChildren(nodetypes, "nodetype", null);
             while (it.hasNext()) {
                 Element e = it.nextElement();
                 l.add(DomUtil.getText(e));
             }
-            ntNames = (String[])l.toArray(new String[l.size()]);
+            ntNames = l.toArray(new String[l.size()]);
         } else {
             ntNames = new String[0];
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java Tue Feb 23 13:37:38 2010
@@ -203,6 +203,6 @@
      */
     private static boolean versioningSupported(Session repoSession) {
         String desc = repoSession.getRepository().getDescriptor(Repository.OPTION_VERSIONING_SUPPORTED);
-        return Boolean.valueOf(desc).booleanValue();
+        return Boolean.valueOf(desc);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java Tue Feb 23 13:37:38 2010
@@ -143,6 +143,7 @@
      *
      * @throws ServletException
      */
+    @Override
     public void init() throws ServletException {
         super.init();
 
@@ -211,6 +212,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     protected boolean isPreconditionValid(WebdavRequest request,
                                           DavResource resource) {
         return !resource.exists() || request.matchesIfHeader(resource);
@@ -244,6 +246,7 @@
      * @return the locator factory
      * @see AbstractWebdavServlet#getLocatorFactory()
      */
+    @Override
     public DavLocatorFactory getLocatorFactory() {
         if (locatorFactory == null) {
             locatorFactory = new LocatorFactoryImplEx(resourcePathPrefix);
@@ -257,6 +260,7 @@
      * @param locatorFactory
      * @see AbstractWebdavServlet#setLocatorFactory(DavLocatorFactory)
      */
+    @Override
     public void setLocatorFactory(DavLocatorFactory locatorFactory) {
         this.locatorFactory = locatorFactory;
     }
@@ -292,6 +296,7 @@
      * @return the resource factory
      * @see AbstractWebdavServlet#getResourceFactory()
      */
+    @Override
     public DavResourceFactory getResourceFactory() {
         if (resourceFactory == null) {
             resourceFactory = new ResourceFactoryImpl(getLockManager(), getResourceConfig());
@@ -305,6 +310,7 @@
      * @param resourceFactory
      * @see AbstractWebdavServlet#setResourceFactory(org.apache.jackrabbit.webdav.DavResourceFactory)
      */
+    @Override
     public void setResourceFactory(DavResourceFactory resourceFactory) {
         this.resourceFactory = resourceFactory;
     }
@@ -355,6 +361,7 @@
      * @return the session provider
      * @see AbstractWebdavServlet#getDavSessionProvider()
      */
+    @Override
     public synchronized DavSessionProvider getDavSessionProvider() {
         if (davSessionProvider == null) {
             davSessionProvider =
@@ -369,6 +376,7 @@
      * @param sessionProvider
      * @see AbstractWebdavServlet#setDavSessionProvider(org.apache.jackrabbit.webdav.DavSessionProvider)
      */
+    @Override
     public synchronized void setDavSessionProvider(DavSessionProvider sessionProvider) {
         this.davSessionProvider = sessionProvider;
     }
@@ -382,6 +390,7 @@
      * or {@link #DEFAULT_AUTHENTICATE_HEADER}.
      * @see AbstractWebdavServlet#getAuthenticateHeaderValue()
      */
+    @Override
     public String getAuthenticateHeaderValue() {
         return authenticate_header;
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionControlledResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionControlledResourceImpl.java?rev=915339&r1=915338&r2=915339&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionControlledResourceImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/VersionControlledResourceImpl.java Tue Feb 23 13:37:38 2010
@@ -96,6 +96,7 @@
      * @return the supported method names.
      * @see org.apache.jackrabbit.webdav.DavResource#getSupportedMethods()
      */
+    @Override
     public String getSupportedMethods() {
         StringBuffer sb = new StringBuffer(super.getSupportedMethods());
         // Versioning support
@@ -134,7 +135,7 @@
         if (isCollection()) {
             // since the version-controlled-collection feature is not supported
             // collections may not be put under dav version control even if
-            // the underlaying node was / could be made jcr versionable.
+            // the underlying node was / could be made jcr versionable.
             throw new DavException(DavServletResponse.SC_METHOD_NOT_ALLOWED);
         }
         if (!isVersionControlled()) {
@@ -301,6 +302,7 @@
      * @see SupportedReportSetProperty
      * @see DeltaVResourceImpl#initSupportedReports()
      */
+    @Override
     protected void initSupportedReports() {
         super.initSupportedReports();
         if (exists()) {
@@ -315,6 +317,7 @@
      * Fill the property set for this resource.
      * @see DavResourceImpl#initProperties()
      */
+    @Override
     protected void initProperties() {
         if (!propsInitialized) {
             super.initProperties();
@@ -337,7 +340,7 @@
                             Value[] pv = n.getProperty(JcrConstants.JCR_PREDECESSORS).getValues();
                             Node[] predecessors = new Node[pv.length];
                             for (int i = 0; i < pv.length; i++) {
-                                predecessors[i] = n.getSession().getNodeByUUID(pv[i].getString());
+                                predecessors[i] = n.getSession().getNodeByIdentifier(pv[i].getString());
                             }
                             properties.add(getHrefProperty(VersionResource.PREDECESSOR_SET, predecessors, false, false));
                         }
@@ -361,7 +364,7 @@
     private boolean isVersionControlled() {
         boolean vc = false;
         // since the version-controlled-collection feature is not supported
-        // all collection are excluded from version-controll even if the
+        // all collection are excluded from version-control even if the
         // underlying node was JCR versionable.
         if (exists() && !isCollection()) {
             Node item = getNode();



Mime
View raw message