You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2017/02/17 12:21:35 UTC

svn commit: r1783382 - in /sling/trunk/installer/core: pom.xml src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java

Author: pauls
Date: Fri Feb 17 12:21:34 2017
New Revision: 1783382

URL: http://svn.apache.org/viewvc?rev=1783382&view=rev
Log:
Revert to previous version undoing SLING-6392 as there are some issues with it.

Modified:
    sling/trunk/installer/core/pom.xml
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java

Modified: sling/trunk/installer/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/pom.xml?rev=1783382&r1=1783381&r2=1783382&view=diff
==============================================================================
--- sling/trunk/installer/core/pom.xml (original)
+++ sling/trunk/installer/core/pom.xml Fri Feb 17 12:21:34 2017
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.installer.core</artifactId>
-    <version>3.8.5-SNAPSHOT</version>
+    <version>3.8.3-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Installer</name>

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java?rev=1783382&r1=1783381&r2=1783382&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java (original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/PersistentResourceList.java Fri Feb 17 12:21:34 2017
@@ -31,7 +31,6 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -225,20 +224,8 @@ public class PersistentResourceList {
                 t = new EntityResourceList(input.getEntityId(), this.listener);
                 this.data.put(input.getEntityId(), t);
             }
-            t.addOrUpdate(input);
 
-            // find stale resources (other entity ids with the same URL)
-            Collection<RegisteredResource> staleResources = getResourcesWithUrl(input.getURL(), input.getEntityId());
-            for (RegisteredResource staleResource : staleResources) {
-                // get according group
-                EntityResourceList group = this.data.get(staleResource.getEntityId());
-                if (group == null) {
-                    logger.error("Could not get group of stale resource {}", staleResource);
-                } else {
-                    group.remove(input.getURL());
-                    logger.warn("Removing stale resource {}, overwritten by {}", staleResource, input);
-                }
-            }
+            t.addOrUpdate(input);
         } else {
             // check if there is an old resource and remove it first
             if ( this.untransformedResources.contains(input) ) {
@@ -254,7 +241,6 @@ public class PersistentResourceList {
     public List<RegisteredResource> getUntransformedResources() {
         return this.untransformedResources;
     }
-   
 
     /**
      * Remove a resource by url.
@@ -297,27 +283,6 @@ public class PersistentResourceList {
     }
 
     /**
-     * 
-     * @param url the url of the resource to look for
-     * @param entityIdToSkip all resources having this entity id should in no case be returned
-     * @return the list of all registered resources with the given url, not having the entityId which should be skipped.
-     */
-    private Collection<RegisteredResource> getResourcesWithUrl(String url, String entityIdToSkip) {
-        Collection<RegisteredResource> foundResources = new LinkedList<>();
-        for(final EntityResourceList group : this.data.values()) {
-            if (group.getResourceId().equals(entityIdToSkip)) {
-                continue;
-            }
-            for (RegisteredResource resource : group.listResources()) {
-                if (resource.getURL().equals(url)) {
-                    foundResources.add(resource);
-                }
-            }
-        }
-        return foundResources;
-    }
-
-    /**
      * Compact the internal state and remove empty groups.
      * @return <code>true</code> if another cycle should be started.
      */