Author: cziegeler
Date: Thu Apr 29 09:14:17 2010
New Revision: 939237

URL: http://svn.apache.org/viewvc?rev=939237&view=rev
Log:
Fix rewriter config logic

Modified:
    
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java

Modified: 
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java?rev=939237&r1=939236&r2=939237&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
 Thu Apr 29 09:14:17 2010
@@ -173,20 +173,20 @@ public class ProcessorManagerImpl
                     if ( slashPos != -1 ) {
                         path = path.substring(0, slashPos);
                     }
+                    // we should do the update async as we don't want to block 
the event delivery
+                    final String configPath = path;
+                    final Thread t = new Thread() {
+                        public void run() {
+                            if ( 
event.getTopic().equals(SlingConstants.TOPIC_RESOURCE_REMOVED) ) {
+                                removeProcessor(configPath);
+                            } else {
+                                updateProcessor(configPath);
+                            }
+                        }
+                    };
+                    t.start();
                 }
             }
-            // we should do the update async as we don't want to block the 
event delivery
-            final String configPath = path;
-            final Thread t = new Thread() {
-                public void run() {
-                    if ( 
event.getTopic().equals(SlingConstants.TOPIC_RESOURCE_REMOVED) ) {
-                        removeProcessor(configPath);
-                    } else {
-                        updateProcessor(configPath);
-                    }
-                }
-            };
-            t.start();
         }
     }
 
@@ -411,7 +411,7 @@ public class ProcessorManagerImpl
                         this.orderedProcessors.add(configs[1].config);
                         Collections.sort(this.orderedProcessors, new 
ProcessorConfiguratorComparator());
                     }
-                    ConfigEntry[] newArray = new ConfigEntry[configs.length];
+                    ConfigEntry[] newArray = new ConfigEntry[configs.length - 
1];
                     int index = 0;
                     for(final ConfigEntry current : configs) {
                         if ( current != found ) {


Reply via email to