incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1565565 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
Date Fri, 07 Feb 2014 07:53:37 GMT
Author: cziegeler
Date: Fri Feb  7 07:53:37 2014
New Revision: 1565565

URL: http://svn.apache.org/r1565565
Log:
SLING-3381 : JobManager.getQueue() might not return queue

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java?rev=1565565&r1=1565564&r2=1565565&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
Fri Feb  7 07:53:37 2014
@@ -403,7 +403,8 @@ public class JobManagerImpl
 
     private void outdateQueue(final AbstractJobQueue queue) {
         // remove the queue with the old name
-        this.queues.remove(queue.getName());
+        final String oldName = ResourceHelper.filterName(queue.getName());
+        this.queues.remove(oldName);
         // check if we can close or have to rename
         if ( queue.tryToClose() ) {
             // copy statistics
@@ -413,10 +414,10 @@ public class JobManagerImpl
         } else {
             queue.outdate();
             // readd with new name
-            String newName = queue.getName();
+            String newName = ResourceHelper.filterName(queue.getName());
             int index = 0;
             while ( this.queues.containsKey(newName) ) {
-                newName = queue.getName() + '$' + String.valueOf(index++);
+                newName = ResourceHelper.filterName(queue.getName()) + '$' + String.valueOf(index++);
             }
             this.queues.put(newName, queue);
             // update mbeans
@@ -664,7 +665,7 @@ public class JobManagerImpl
      */
     @Override
     public Queue getQueue(final String name) {
-        return this.queues.get(name);
+        return this.queues.get(ResourceHelper.filterName(name));
     }
 
     /**



Mime
View raw message