incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1325687 - in /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs: DefaultJobManager.java JobEvent.java
Date Fri, 13 Apr 2012 09:35:52 GMT
Author: cziegeler
Date: Fri Apr 13 09:35:52 2012
New Revision: 1325687

URL: http://svn.apache.org/viewvc?rev=1325687&view=rev
Log:
SLING-2456 : JobManager should ignore empty entries in application id array

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

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/DefaultJobManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/DefaultJobManager.java?rev=1325687&r1=1325686&r2=1325687&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/DefaultJobManager.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/DefaultJobManager.java
Fri Apr 13 09:35:52 2012
@@ -189,14 +189,23 @@ public class DefaultJobManager
             // check application ids
             final String[] enabledIds = PropertiesUtil.toStringArray(props.get(PROP_ENABLED_APP_IDS));
             if ( enabledIds != null && enabledIds.length > 0 ) {
+                // the array might only contain empty values (e.g. when edited through the
web console)
+                boolean hasValue = false;
                 boolean doEnable = false;
                 for(int i=0; i<enabledIds.length; i++) {
-                    if ( Environment.APPLICATION_ID.equals(enabledIds[i]) ) {
-                        doEnable = true;
-                        break;
+                    if ( enabledIds[i] != null && enabledIds[i].trim().length() >
0 ) {
+                        hasValue = true;
+                        if ( Environment.APPLICATION_ID.equals(enabledIds[i].trim()) ) {
+                            doEnable = true;
+                            break;
+                        }
                     }
                 }
-                this.enabled = doEnable;
+                if ( hasValue ) {
+                    this.enabled = doEnable;
+                } else {
+                    this.enabled = true;
+                }
             } else {
                 this.enabled = true;
             }

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobEvent.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobEvent.java?rev=1325687&r1=1325686&r2=1325687&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobEvent.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobEvent.java
Fri Apr 13 09:35:52 2012
@@ -61,7 +61,6 @@ public abstract class JobEvent {
 
     @Override
     public String toString() {
-        // TODO Auto-generated method stub
         return "JobEvent(" + uniqueId + ")";
     }
 }
\ No newline at end of file



Mime
View raw message