Author: tommaso
Date: Wed Sep  9 12:09:19 2015
New Revision: 1701984

URL: http://svn.apache.org/r1701984
Log:
SLING-5008 - applied fixes related to static code analysis report

Modified:
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/AbstractDistributionAgentFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionConfigurationManager.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentConstants.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/SettingsUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/impl/DefaultDistributionEventFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/CompositeDistributionResponse.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/DefaultDistributor.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/DistributionLog.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporterFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/AdvancedRemoteDistributionPackageImporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporter.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RepositoryDistributionPackageImporterFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueEntry.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItem.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueItemStatus.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/DistributionQueueStatus.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/DistributionQueueUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/PriorityPathQueueDispatchingStrategy.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDispatchingStrategy.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueue.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingDistributionQueueProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/jobhandling/JobHandlingUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/ScheduledDistributionQueueProcessorTask.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueue.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/queue/impl/simple/SimpleDistributionQueueProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/DistributionResourceTypes.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionConfigurationResourceProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionConfigurationResourceProviderFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionServiceResourceProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/DistributionServiceResourceProviderFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/ExtendedDistributionServiceResourceProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/OsgiUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractModifyingResourceProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/AbstractReadableResourceProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/resources/impl/common/SimpleReadableResource.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/AbstractDistributionPackageBuilder.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/DefaultDistributionPackageBuilderProvider.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/DistributionPackageWrapper.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackage.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/ResourceSharedDistributionPackageBuilder.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/SimpleDistributionPackage.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackage.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/FileVaultDistributionPackageBuilder.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/JcrVaultDistributionPackage.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/JcrVaultDistributionPackageBuilder.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VaultDistributionPackageBuilderFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VltUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentLogServlet.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentQueueServlet.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageExporterServlet.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/servlet/ServletJsonUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/core/DistributionTransport.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/AdvancedHttpDistributionTransport.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/HttpTransportUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/MultipleEndpointDistributionTransport.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/SimpleHttpDistributionTransport.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/transport/impl/TransportEndpointStrategyType.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/AbstractJcrEventTrigger.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/DistributionEventDistributeDistributionTrigger.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/DistributionEventDistributeDistributionTriggerFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/JcrEventDistributionTriggerFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/PersistedJcrEventDistributionTriggerFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/RemoteEventDistributionTriggerFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTrigger.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ResourceEventDistributionTriggerFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ScheduledDistributionTrigger.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/trigger/impl/ScheduledDistributionTriggerFactory.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/RequestUtils.java
    
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/util/package-info.java

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/DistributionAgent.java
 Wed Sep  9 12:09:19 2015
@@ -27,7 +27,6 @@ import org.apache.sling.distribution.Dis
 import org.apache.sling.distribution.DistributionResponse;
 import org.apache.sling.distribution.log.DistributionLog;
 import org.apache.sling.distribution.queue.DistributionQueue;
-import org.apache.sling.distribution.queue.DistributionQueueState;
 
 /**
  * A distribution agent is responsible for handling {@link 
org.apache.sling.distribution.DistributionRequest}s.

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/AbstractDistributionAgentFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/AbstractDistributionAgentFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/AbstractDistributionAgentFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/AbstractDistributionAgentFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,10 +18,16 @@
  */
 package org.apache.sling.distribution.agent.impl;
 
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.distribution.agent.DistributionAgent;
-import org.apache.sling.distribution.component.impl.DistributionComponentKind;
 import 
org.apache.sling.distribution.component.impl.DistributionComponentConstants;
+import org.apache.sling.distribution.component.impl.DistributionComponentKind;
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.resources.impl.OsgiUtils;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
@@ -31,12 +37,6 @@ import org.osgi.framework.ServiceRegistr
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
 /**
  * An abstract OSGi service factory for registering {@link 
org.apache.sling.distribution.agent.impl.SimpleDistributionAgent}s
  */
@@ -54,9 +54,7 @@ public abstract class AbstractDistributi
     protected static final String LOG_LEVEL = "log.level";
 
 
-
     private ServiceRegistration componentReg;
-    private BundleContext savedContext;
     private Map<String, Object> savedConfig;
     private String agentName;
     private List<DistributionTrigger> triggers = new 
CopyOnWriteArrayList<DistributionTrigger>();
@@ -67,22 +65,18 @@ public abstract class AbstractDistributi
     protected void activate(BundleContext context, Map<String, Object> config) 
{
         log.info("activating with config {}", 
OsgiUtils.osgiPropertyMapToString(config));
 
-
-        savedContext = context;
-        savedConfig = config;
-
         // inject configuration
         Dictionary<String, Object> props = new Hashtable<String, Object>();
 
         boolean enabled = PropertiesUtil.toBoolean(config.get(ENABLED), true);
         String triggersTarget = 
PropertiesUtil.toString(config.get(TRIGGERS_TARGET), null);
-        triggersEnabled = triggersTarget != null || 
triggersTarget.trim().length() > 0;
+        triggersEnabled = triggersTarget != null && 
triggersTarget.trim().length() > 0;
         agentName = PropertiesUtil.toString(config.get(NAME), null);
 
 
         if (enabled && agentName != null) {
 
-            for (Map.Entry<String, Object> entry: config.entrySet()) {
+            for (Map.Entry<String, Object> entry : config.entrySet()) {
                 // skip service and component related properties
                 if (entry.getKey().startsWith("service.") || 
entry.getKey().startsWith("component.")) {
                     continue;
@@ -106,8 +100,7 @@ public abstract class AbstractDistributi
                     DefaultDistributionLog distributionLog = new 
DefaultDistributionLog(DistributionComponentKind.AGENT, agentName, 
SimpleDistributionAgent.class, level);
 
                     agent = createAgent(agentName, context, config, 
distributionLog);
-                }
-                catch (IllegalArgumentException e) {
+                } catch (IllegalArgumentException e) {
                     log.warn("cannot create agent", e);
                 }
 
@@ -134,7 +127,7 @@ public abstract class AbstractDistributi
 
     protected void bindDistributionTrigger(DistributionTrigger 
distributionTrigger, Map<String, Object> config) {
         triggers.add(distributionTrigger);
-        if (agent != null  && triggersEnabled) {
+        if (agent != null && triggersEnabled) {
             agent.enableTrigger(distributionTrigger);
         }
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,6 +18,12 @@
  */
 package org.apache.sling.distribution.agent.impl;
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.ConfigurationPolicy;
@@ -55,14 +61,6 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
 /**
  * An OSGi service factory for {@link 
org.apache.sling.distribution.agent.DistributionAgent}s which references 
already existing OSGi services.
  */
@@ -97,7 +95,7 @@ public class ForwardDistributionAgentFac
     public static final String SERVICE_NAME = "serviceName";
 
     @Property(options = {
-            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"),  @PropertyOption(name = "warn", 
value = "warn"),
+            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"), @PropertyOption(name = "warn", 
value = "warn"),
             @PropertyOption(name = "error", value = "error")},
             value = "info",
             label = "Log Level", description = "The log level recorded in the 
transient log accessible via http."
@@ -209,7 +207,7 @@ public class ForwardDistributionAgentFac
 
 
         DistributionPackageExporter packageExporter = new 
LocalDistributionPackageExporter(packageBuilder);
-        DistributionQueueProvider queueProvider =  new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
+        DistributionQueueProvider queueProvider = new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
 
         DistributionQueueDispatchingStrategy exportQueueStrategy = null;
         DistributionQueueDispatchingStrategy importQueueStrategy = null;
@@ -237,7 +235,7 @@ public class ForwardDistributionAgentFac
             packageImporter = new 
RemoteDistributionPackageImporter(distributionLog, transportSecretProvider, 
importerEndpointsMap, TransportEndpointStrategyType.All);
         }
 
-        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[] { DistributionRequestType.ADD, 
DistributionRequestType.DELETE };
+        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[]{DistributionRequestType.ADD, 
DistributionRequestType.DELETE};
 
 
         String retryStrategy = 
SettingsUtils.removeEmptyEntry(PropertiesUtil.toString(config.get(RETRY_STRATEGY),
 null));

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/PrivilegeDistributionRequestAuthorizationStrategy.java
 Wed Sep  9 12:09:19 2015
@@ -45,15 +45,13 @@ public class PrivilegeDistributionReques
         Session session = resourceResolver.adaptTo(Session.class);
 
         try {
-           if 
(DistributionRequestType.ADD.equals(distributionRequest.getRequestType())) {
-               checkPermissionForAdd(session, distributionRequest.getPaths());
-           }
-           else if 
(DistributionRequestType.DELETE.equals(distributionRequest.getRequestType())) {
-               checkPermissionForDelete(session, 
distributionRequest.getPaths());
-           }
+            if 
(DistributionRequestType.ADD.equals(distributionRequest.getRequestType())) {
+                checkPermissionForAdd(session, distributionRequest.getPaths());
+            } else if 
(DistributionRequestType.DELETE.equals(distributionRequest.getRequestType())) {
+                checkPermissionForDelete(session, 
distributionRequest.getPaths());
+            }
 
-        }
-        catch (RepositoryException e) {
+        } catch (RepositoryException e) {
             throw new DistributionRequestAuthorizationException("Not enough 
privileges");
         }
 
@@ -63,9 +61,9 @@ public class PrivilegeDistributionReques
             throws RepositoryException, 
DistributionRequestAuthorizationException {
         AccessControlManager acMgr = session.getAccessControlManager();
 
-        Privilege[] privileges = new Privilege[] { 
acMgr.privilegeFromName(jcrPrivilege), 
acMgr.privilegeFromName(Privilege.JCR_READ) };
+        Privilege[] privileges = new 
Privilege[]{acMgr.privilegeFromName(jcrPrivilege), 
acMgr.privilegeFromName(Privilege.JCR_READ)};
         for (String path : paths) {
-            if(!acMgr.hasPrivileges(path, privileges)) {
+            if (!acMgr.hasPrivileges(path, privileges)) {
                 throw new DistributionRequestAuthorizationException("Not 
enough privileges");
             }
         }
@@ -76,7 +74,7 @@ public class PrivilegeDistributionReques
             throws RepositoryException, 
DistributionRequestAuthorizationException {
         AccessControlManager acMgr = session.getAccessControlManager();
 
-        Privilege[] privileges = new Privilege[] { 
acMgr.privilegeFromName(jcrPrivilege), 
acMgr.privilegeFromName(Privilege.JCR_REMOVE_NODE)  };
+        Privilege[] privileges = new 
Privilege[]{acMgr.privilegeFromName(jcrPrivilege), 
acMgr.privilegeFromName(Privilege.JCR_REMOVE_NODE)};
         for (String path : paths) {
 
             String closestParentPath = getClosestParent(session, path);

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/QueueDistributionAgentFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,6 +18,10 @@
  */
 package org.apache.sling.distribution.agent.impl;
 
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.ConfigurationPolicy;
@@ -37,8 +41,8 @@ import org.apache.sling.distribution.eve
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import 
org.apache.sling.distribution.packaging.impl.exporter.LocalDistributionPackageExporter;
-import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SingleQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.jobhandling.JobHandlingDistributionQueueProvider;
 import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
@@ -49,11 +53,6 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * An OSGi service factory for {@link 
org.apache.sling.distribution.agent.DistributionAgent}s which references 
already existing OSGi services.
  */
@@ -88,7 +87,7 @@ public class QueueDistributionAgentFacto
     public static final String SERVICE_NAME = "serviceName";
 
     @Property(options = {
-            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"),  @PropertyOption(name = "warn", 
value = "warn"),
+            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"), @PropertyOption(name = "warn", 
value = "warn"),
             @PropertyOption(name = "error", value = "error")},
             value = "info",
             label = "Log Level", description = "The log level recorded in the 
transient log accessible via http."
@@ -96,7 +95,6 @@ public class QueueDistributionAgentFacto
     public static final String LOG_LEVEL = 
AbstractDistributionAgentFactory.LOG_LEVEL;
 
 
-
     @Property(cardinality = 100, label = "Allowed roots", description = "If 
set the agent will allow only distribution requests under the specified roots.")
     private static final String ALLOWED_ROOTS = "allowed.roots";
 
@@ -157,12 +155,12 @@ public class QueueDistributionAgentFacto
         String[] allowedRoots = 
PropertiesUtil.toStringArray(config.get(ALLOWED_ROOTS), null);
         allowedRoots = SettingsUtils.removeEmptyEntries(allowedRoots);
 
-        DistributionQueueProvider queueProvider =  new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
+        DistributionQueueProvider queueProvider = new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
         DistributionQueueDispatchingStrategy exportQueueStrategy = new 
SingleQueueDispatchingStrategy();
         DistributionQueueDispatchingStrategy importQueueStrategy = null;
 
         DistributionPackageExporter packageExporter = new 
LocalDistributionPackageExporter(packageBuilder);
-        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[] { DistributionRequestType.ADD, 
DistributionRequestType.DELETE };
+        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[]{DistributionRequestType.ADD, 
DistributionRequestType.DELETE};
         Set<String> processingQueues = new HashSet<String>();
         processingQueues.addAll(exportQueueStrategy.getQueueNames());
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/ReverseDistributionAgentFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,6 +18,10 @@
  */
 package org.apache.sling.distribution.agent.impl;
 
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.ConfigurationPolicy;
@@ -53,12 +57,6 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * An OSGi service factory for {@link 
org.apache.sling.distribution.agent.DistributionAgent}s which references 
already existing OSGi services.
  */
@@ -93,7 +91,7 @@ public class ReverseDistributionAgentFac
     public static final String SERVICE_NAME = "serviceName";
 
     @Property(options = {
-            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"),  @PropertyOption(name = "warn", 
value = "warn"),
+            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"), @PropertyOption(name = "warn", 
value = "warn"),
             @PropertyOption(name = "error", value = "error")},
             value = "info",
             label = "Log Level", description = "The log level recorded in the 
transient log accessible via http."
@@ -189,17 +187,16 @@ public class ReverseDistributionAgentFac
         DistributionPackageExporter packageExporter = new 
RemoteDistributionPackageExporter(distributionLog, packageBuilder, 
transportSecretProvider, exporterEndpoints,
                 TransportEndpointStrategyType.All, pullItems);
         DistributionPackageImporter packageImporter = new 
LocalDistributionPackageImporter(packageBuilder);
-        DistributionQueueProvider queueProvider =  new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
+        DistributionQueueProvider queueProvider = new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
 
         DistributionQueueDispatchingStrategy exportQueueStrategy = new 
SingleQueueDispatchingStrategy();
         DistributionQueueDispatchingStrategy importQueueStrategy = null;
 
-        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[] { DistributionRequestType.PULL };
+        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[]{DistributionRequestType.PULL};
         Set<String> processingQueues = new HashSet<String>();
         processingQueues.addAll(exportQueueStrategy.getQueueNames());
 
 
-
         return new SimpleDistributionAgent(agentName, queueProcessingEnabled, 
processingQueues,
                 serviceName, packageImporter, packageExporter, 
requestAuthorizationStrategy,
                 queueProvider, exportQueueStrategy, importQueueStrategy, 
distributionEventFactory, resourceResolverFactory, distributionLog, 
allowedRequests, null, 0);

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgent.java
 Wed Sep  9 12:09:19 2015
@@ -32,19 +32,18 @@ import org.apache.sling.api.resource.Log
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
-import org.apache.sling.distribution.DistributionRequestType;
-import org.apache.sling.distribution.agent.DistributionAgent;
-import org.apache.sling.distribution.agent.DistributionAgentException;
-
 import org.apache.sling.distribution.DistributionRequest;
 import org.apache.sling.distribution.DistributionRequestState;
+import org.apache.sling.distribution.DistributionRequestType;
 import org.apache.sling.distribution.DistributionResponse;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.agent.DistributionAgentException;
 import org.apache.sling.distribution.agent.DistributionAgentState;
 import org.apache.sling.distribution.component.impl.DistributionComponentKind;
 import org.apache.sling.distribution.event.DistributionEventTopics;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
 import org.apache.sling.distribution.impl.CompositeDistributionResponse;
 import org.apache.sling.distribution.impl.SimpleDistributionResponse;
-import org.apache.sling.distribution.event.impl.DistributionEventFactory;
 import org.apache.sling.distribution.log.DistributionLog;
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.packaging.DistributionPackage;
@@ -56,14 +55,14 @@ import org.apache.sling.distribution.pac
 import org.apache.sling.distribution.packaging.impl.DistributionPackageUtils;
 import org.apache.sling.distribution.queue.DistributionQueue;
 import org.apache.sling.distribution.queue.DistributionQueueEntry;
-import org.apache.sling.distribution.queue.DistributionQueueItemState;
-import org.apache.sling.distribution.queue.DistributionQueueState;
-import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.DistributionQueueException;
 import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.apache.sling.distribution.queue.DistributionQueueItemStatus;
 import org.apache.sling.distribution.queue.DistributionQueueProcessor;
 import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.DistributionQueueState;
+import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.trigger.DistributionRequestHandler;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
 import org.apache.sling.distribution.trigger.DistributionTriggerException;
@@ -245,9 +244,7 @@ public class SimpleDistributionAgent imp
             log.error("an error happened during dispatching items to the 
queue(s)", e);
             distributionResponses.add(new 
SimpleDistributionResponse(DistributionRequestState.DROPPED, e.toString()));
         } finally {
-            if (distributionPackage != null) {
-                distributionPackage.close();
-            }
+            distributionPackage.close();
         }
 
         return distributionResponses;
@@ -295,9 +292,9 @@ public class SimpleDistributionAgent imp
         for (String queueName : getQueueNames()) {
             DistributionQueue queue = null;
             try {
-                 queue = getQueue(queueName);
+                queue = getQueue(queueName);
             } catch (DistributionAgentException e) {
-
+                log.warn("could not get queue {}", queueName);
             }
 
             if (queue != null) {
@@ -325,7 +322,7 @@ public class SimpleDistributionAgent imp
 
         if (!isPassive()) {
             try {
-                queueProvider.enableQueueProcessing(new 
PackageQueueProcessor(), processingQueues.toArray(new String[0]));
+                queueProvider.enableQueueProcessing(new 
PackageQueueProcessor(), processingQueues.toArray(new 
String[processingQueues.size()]));
             } catch (DistributionQueueException e) {
                 log.error("cannot enable queue processing", e);
             }
@@ -398,8 +395,7 @@ public class SimpleDistributionAgent imp
                     
DistributionPackageUtils.releaseOrDelete(distributionPackage, queueName);
                     
generatePackageEvent(DistributionEventTopics.AGENT_PACKAGE_DISTRIBUTED, 
distributionPackage);
                 } else if (importQueueStrategy != null && 
queueItemStatus.getAttempts() > retryAttempts) {
-                    success = true;
-                    reEnqueuePackage(agentResourceResolver, 
distributionPackage);
+                    success = reEnqueuePackage(distributionPackage);
                     
DistributionPackageUtils.releaseOrDelete(distributionPackage, queueName);
                 }
             } else {
@@ -430,7 +426,7 @@ public class SimpleDistributionAgent imp
         return true;
     }
 
-    private boolean reEnqueuePackage(ResourceResolver resourceResolver, 
DistributionPackage distributionPackage) {
+    private boolean reEnqueuePackage(DistributionPackage distributionPackage) {
 
         if (importQueueStrategy == null) {
             return false;
@@ -464,8 +460,7 @@ public class SimpleDistributionAgent imp
                 resourceResolver.commit();
             } catch (PersistenceException e) {
                 log.error("cannot commit changes to resource resolver", e);
-            }
-            finally {
+            } finally {
                 resourceResolver.close();
             }
         }
@@ -507,8 +502,8 @@ public class SimpleDistributionAgent imp
 
         for (String path : request.getPaths()) {
             boolean allowed = false;
-            for (String allowedRoot: allowedRoots) {
-                if(allowedRoot != null && allowedRoot.trim().length() != 0
+            for (String allowedRoot : allowedRoots) {
+                if (allowedRoot != null && allowedRoot.trim().length() != 0
                         && path.startsWith(allowedRoot)) {
                     allowed = true;
                 }
@@ -571,7 +566,6 @@ public class SimpleDistributionAgent imp
     }
 
 
-
     /* Convert the state of a certain item in the queue into a request state */
     private DistributionRequestState 
getRequestStateFromQueueState(DistributionQueueItemState itemState) {
         DistributionRequestState requestState;

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,9 +18,7 @@
  */
 package org.apache.sling.distribution.agent.impl;
 
-import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -36,13 +34,12 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import 
org.apache.sling.distribution.component.impl.DistributionComponentConstants;
-import org.apache.sling.distribution.component.impl.SettingsUtils;
 import org.apache.sling.distribution.event.impl.DistributionEventFactory;
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
-import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SingleQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.jobhandling.JobHandlingDistributionQueueProvider;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
@@ -87,7 +84,7 @@ public class SimpleDistributionAgentFact
     public static final String SERVICE_NAME = "serviceName";
 
     @Property(options = {
-            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"),  @PropertyOption(name = "warn", 
value = "warn"),
+            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"), @PropertyOption(name = "warn", 
value = "warn"),
             @PropertyOption(name = "error", value = "error")},
             value = "info",
             label = "Log Level", description = "The log level recorded in the 
transient log accessible via http."
@@ -142,7 +139,7 @@ public class SimpleDistributionAgentFact
     }
 
     protected void bindDistributionTrigger(DistributionTrigger 
distributionTrigger, Map<String, Object> config) {
-       super.bindDistributionTrigger(distributionTrigger, config);
+        super.bindDistributionTrigger(distributionTrigger, config);
 
     }
 
@@ -161,7 +158,7 @@ public class SimpleDistributionAgentFact
 
         boolean queueProcessingEnabled = 
PropertiesUtil.toBoolean(config.get(QUEUE_PROCESSING_ENABLED), true);
 
-        DistributionQueueProvider queueProvider =  new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
+        DistributionQueueProvider queueProvider = new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
         DistributionQueueDispatchingStrategy exportQueueStrategy = new 
SingleQueueDispatchingStrategy();
         DistributionQueueDispatchingStrategy importQueueStrategy = null;
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/agent/impl/SyncDistributionAgentFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,6 +18,12 @@
  */
 package org.apache.sling.distribution.agent.impl;
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.ConfigurationPolicy;
@@ -39,8 +45,8 @@ import org.apache.sling.distribution.pac
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
 import 
org.apache.sling.distribution.packaging.impl.exporter.RemoteDistributionPackageExporter;
 import 
org.apache.sling.distribution.packaging.impl.importer.RemoteDistributionPackageImporter;
-import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.ErrorQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.queue.impl.MultipleQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.impl.SingleQueueDispatchingStrategy;
@@ -55,14 +61,6 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
 /**
  * An OSGi service factory for {@link 
org.apache.sling.distribution.agent.DistributionAgent}s which references 
already existing OSGi services.
  */
@@ -96,7 +94,7 @@ public class SyncDistributionAgentFactor
     public static final String SERVICE_NAME = "serviceName";
 
     @Property(options = {
-            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"),  @PropertyOption(name = "warn", 
value = "warn"),
+            @PropertyOption(name = "debug", value = "debug"), 
@PropertyOption(name = "info", value = "info"), @PropertyOption(name = "warn", 
value = "warn"),
             @PropertyOption(name = "error", value = "error")},
             value = "info",
             label = "Log Level", description = "The log level recorded in the 
transient log accessible via http."
@@ -104,7 +102,6 @@ public class SyncDistributionAgentFactor
     public static final String LOG_LEVEL = 
AbstractDistributionAgentFactory.LOG_LEVEL;
 
 
-
     @Property(boolValue = true, label = "Queue Processing Enabled", 
description = "Whether or not the distribution agent should process packages in 
the queues.")
     public static final String QUEUE_PROCESSING_ENABLED = 
"queue.processing.enabled";
 
@@ -126,7 +123,6 @@ public class SyncDistributionAgentFactor
     public static final String IMPORTER_ENDPOINTS = 
"packageImporter.endpoints";
 
 
-
     @Property(boolValue = false, label = "Use multiple queues", description = 
"Whether or not to use an individual queue for each importer endpoint. " +
             "If the queue names are not specified by importer endpoints 
definition then they are autogenerated.")
     public static final String USE_MULTIPLE_QUEUES = "useMultipleQueues";
@@ -239,7 +235,7 @@ public class SyncDistributionAgentFactor
             processingQueues.addAll(importerEndpointsMap.keySet());
             processingQueues.removeAll(Arrays.asList(passiveQueues));
 
-            String[] queueNames = queuesMap.toArray(new String[0]);
+            String[] queueNames = queuesMap.toArray(new 
String[queuesMap.size()]);
             exportQueueStrategy = new 
MultipleQueueDispatchingStrategy(queueNames);
             packageImporter = new 
RemoteDistributionPackageImporter(distributionLog, transportSecretProvider, 
importerEndpointsMap, TransportEndpointStrategyType.One);
         } else {
@@ -249,15 +245,15 @@ public class SyncDistributionAgentFactor
         }
 
         DistributionPackageExporter packageExporter = new 
RemoteDistributionPackageExporter(distributionLog, packageBuilder, 
transportSecretProvider, exporterEndpoints, TransportEndpointStrategyType.All, 
pullItems);
-        DistributionQueueProvider queueProvider =  new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
-        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[] { DistributionRequestType.PULL };
+        DistributionQueueProvider queueProvider = new 
JobHandlingDistributionQueueProvider(agentName, jobManager, context);
+        DistributionRequestType[] allowedRequests = new 
DistributionRequestType[]{DistributionRequestType.PULL};
 
         String retryStrategy = 
SettingsUtils.removeEmptyEntry(PropertiesUtil.toString(config.get(RETRY_STRATEGY),
 null));
         int retryAttepts = 
PropertiesUtil.toInteger(config.get(RETRY_ATTEMPTS), 100);
 
 
         if ("errorQueue".equals(retryStrategy)) {
-            importQueueStrategy = new 
ErrorQueueDispatchingStrategy(processingQueues.toArray(new String[0]));
+            importQueueStrategy = new 
ErrorQueueDispatchingStrategy(processingQueues.toArray(new 
String[processingQueues.size()]));
         }
 
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
 Wed Sep  9 12:09:19 2015
@@ -34,15 +34,14 @@ import org.apache.sling.commons.osgi.Pro
 import org.apache.sling.distribution.agent.DistributionAgent;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.packaging.DistributionPackageImporter;
-import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
 import 
org.apache.sling.distribution.transport.DistributionTransportSecretProvider;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 @Component
 @Property(name = "name", value = "default")
 @References({
@@ -120,7 +119,7 @@ public class DefaultDistributionComponen
 
     private void bindDistributionQueueProvider(DistributionQueueProvider 
distributionQueueProvider, Map<String, Object> config) {
 
-       put(DistributionQueueProvider.class, distributionQueueProvider, config);
+        put(DistributionQueueProvider.class, distributionQueueProvider, 
config);
     }
 
     private void unbindDistributionQueueProvider(DistributionQueueProvider 
distributionQueueProvider, Map<String, Object> config) {
@@ -146,17 +145,17 @@ public class DefaultDistributionComponen
 
     private void 
unbindDistributionTransportSecretProvider(DistributionTransportSecretProvider 
distributionTransportSecretProvider, Map<String, Object> config) {
 
-       remove(DistributionTransportSecretProvider.class, 
distributionTransportSecretProvider, config);
+        remove(DistributionTransportSecretProvider.class, 
distributionTransportSecretProvider, config);
     }
 
     private void bindDistributionPackageImporter(DistributionPackageImporter 
distributionPackageImporter, Map<String, Object> config) {
 
-       put(DistributionPackageImporter.class, distributionPackageImporter, 
config);
+        put(DistributionPackageImporter.class, distributionPackageImporter, 
config);
     }
 
     private void unbindDistributionPackageImporter(DistributionPackageImporter 
distributionPackageImporter, Map<String, Object> config) {
 
-       remove(DistributionPackageImporter.class, distributionPackageImporter, 
config);
+        remove(DistributionPackageImporter.class, distributionPackageImporter, 
config);
     }
 
     private void bindDistributionPackageExporter(DistributionPackageExporter 
distributionPackageExporter, Map<String, Object> config) {
@@ -172,7 +171,7 @@ public class DefaultDistributionComponen
 
     private void bindDistributionAgent(DistributionAgent distributionAgent, 
Map<String, Object> config) {
 
-       put(DistributionAgent.class, distributionAgent, config);
+        put(DistributionAgent.class, distributionAgent, config);
     }
 
     private void unbindDistributionAgent(DistributionAgent distributionAgent, 
Map<String, Object> config) {
@@ -198,7 +197,7 @@ public class DefaultDistributionComponen
 
         String name = PropertiesUtil.toString(config.get(NAME), null);
         DistributionComponentKind kind = 
DistributionComponentKind.fromClass(typeClass);
-        if (name != null && kind!=null) {
+        if (name != null && kind != null) {
             componentMap.put(name, new 
DistributionComponent<ComponentType>(kind, name, service, config));
         }
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionConfigurationManager.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionConfigurationManager.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionConfigurationManager.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionConfigurationManager.java
 Wed Sep  9 12:09:19 2015
@@ -19,6 +19,16 @@
 package org.apache.sling.distribution.component.impl;
 
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
@@ -30,16 +40,6 @@ import org.osgi.service.cm.Configuration
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * {@link 
org.apache.sling.distribution.component.impl.DistributionComponentManager} 
implementation based on OSGI configs.
  * For each tree of properties a set of OSGI configs is generated and 
registered in ConfigurationAdmin.
@@ -63,7 +63,7 @@ public class DefaultDistributionConfigur
         }
 
 
-        for(Configuration configuration : configurations) {
+        for (Configuration configuration : configurations) {
             Dictionary propertiesDict = configuration.getProperties();
             Map<String, Object> properties = 
OsgiUtils.fromDictionary(propertiesDict);
 
@@ -150,7 +150,7 @@ public class DefaultDistributionConfigur
             allConfigurations.addAll(configurations);
         }
 
-       return allConfigurations;
+        return allConfigurations;
     }
 
 
@@ -160,8 +160,7 @@ public class DefaultDistributionConfigur
             Configuration configuration = null;
             if (configurations == null || configurations.size() == 0) {
                 configuration = 
configurationAdmin.createFactoryConfiguration(factoryPid);
-            }
-            else {
+            } else {
                 configuration = configurations.get(0);
             }
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentConstants.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentConstants.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentConstants.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentConstants.java
 Wed Sep  9 12:09:19 2015
@@ -19,13 +19,6 @@
 package org.apache.sling.distribution.component.impl;
 
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.sling.commons.osgi.PropertiesUtil;
-
 /**
  * Constants relevant for distribution components.
  */

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/DistributionComponentKind.java
 Wed Sep  9 12:09:19 2015
@@ -19,6 +19,11 @@
 package org.apache.sling.distribution.component.impl;
 
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.sling.distribution.agent.DistributionAgent;
 import 
org.apache.sling.distribution.agent.impl.DistributionRequestAuthorizationStrategy;
 import 
org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory;
@@ -47,11 +52,6 @@ import org.apache.sling.distribution.tri
 import 
org.apache.sling.distribution.trigger.impl.ResourceEventDistributionTriggerFactory;
 import 
org.apache.sling.distribution.trigger.impl.ScheduledDistributionTriggerFactory;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Enum that represents the main distribution component kinds that can be 
configured for distribution.
  */
@@ -68,8 +68,6 @@ public enum DistributionComponentKind {
     TRIGGER("trigger");
 
 
-
-
     private static Map<DistributionComponentKind, Class> classMap = new 
HashMap<DistributionComponentKind, Class>();
     private static Map<DistributionComponentKind, Map<String, Class>> 
factoryMap = new HashMap<DistributionComponentKind, Map<String, Class>>();
 
@@ -152,7 +150,6 @@ public enum DistributionComponentKind {
         return name;
     }
 
-
     private static void registerKind(DistributionComponentKind kind, Class 
kindClass) {
         classMap.put(kind, kindClass);
     }
@@ -168,7 +165,6 @@ public enum DistributionComponentKind {
         kindMap.put(type, factoryClass);
     }
 
-
     public String getFactory(String type) {
         Class factory = factoryMap.get(this).get(type);
         return factory.getName();

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/SettingsUtils.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/SettingsUtils.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/SettingsUtils.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/component/impl/SettingsUtils.java
 Wed Sep  9 12:09:19 2015
@@ -28,6 +28,7 @@ import java.util.TreeMap;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 
 //TODO: Consider removing it
+
 /**
  * Utility class that provides parsing from linear set of properties into a 
tree of properties
  */
@@ -64,10 +65,9 @@ public class SettingsUtils {
             String[] componentLines = var.toArray(new String[var.size()]);
 
             if (COMPONENT_ROOT.equals(componentName)) {
-                Map<String, String> map = PropertiesUtil.toMap(componentLines, 
new String [0]);
+                Map<String, String> map = PropertiesUtil.toMap(componentLines, 
new String[0]);
                 result.putAll(map);
-            }
-            else {
+            } else {
                 Map<String, Object> componentMap = parseLines(componentLines);
                 result.put(componentName, componentMap);
             }
@@ -127,17 +127,15 @@ public class SettingsUtils {
                 boolean isNumber = isNumber(partialKey);
 
                 if (!result.containsKey(newKey)) {
-                    result.put(newKey, isNumber? new ArrayList<Object>() : new 
HashMap<String, Object>());
+                    result.put(newKey, isNumber ? new ArrayList<Object>() : 
new HashMap<String, Object>());
                 }
 
                 Object existingObject = result.get(newKey);
                 if (existingObject instanceof Map) {
                     ((Map) existingObject).put(partialKey, value);
-                }
-                else if (existingObject instanceof List) {
+                } else if (existingObject instanceof List) {
                     ((List) existingObject).add(value);
-                }
-                else {
+                } else {
                     // skip if there is already something else in there
                 }
             } else {
@@ -153,8 +151,7 @@ public class SettingsUtils {
         try {
             Integer.parseInt(value);
             return true;
-        }
-        catch (NumberFormatException e) {
+        } catch (NumberFormatException e) {
             return false;
         }
     }
@@ -162,8 +159,8 @@ public class SettingsUtils {
 
     public static <AType> Map<String, AType> toMap(List<AType> aList, String 
prefix) {
         Map<String, AType> result = new TreeMap<String, AType>();
-        for (int i=0; i<aList.size(); i++) {
-            result.put(prefix+i, aList.get(i));
+        for (int i = 0; i < aList.size(); i++) {
+            result.put(prefix + i, aList.get(i));
         }
 
         return result;

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/impl/DefaultDistributionEventFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/impl/DefaultDistributionEventFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/impl/DefaultDistributionEventFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/event/impl/DefaultDistributionEventFactory.java
 Wed Sep  9 12:09:19 2015
@@ -18,11 +18,10 @@
  */
 package org.apache.sling.distribution.event.impl;
 
+import javax.annotation.Nonnull;
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import javax.annotation.Nonnull;
-
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/CompositeDistributionResponse.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/CompositeDistributionResponse.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/CompositeDistributionResponse.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/CompositeDistributionResponse.java
 Wed Sep  9 12:09:19 2015
@@ -20,12 +20,15 @@
 package org.apache.sling.distribution.impl;
 
 
-import org.apache.sling.distribution.DistributionRequestState;
-import org.apache.sling.distribution.DistributionResponse;
-
 import javax.annotation.Nonnull;
 import java.util.List;
 
+import org.apache.sling.distribution.DistributionRequestState;
+import org.apache.sling.distribution.DistributionResponse;
+
+/**
+ * A composite {@link SimpleDistributionResponse}.
+ */
 public class CompositeDistributionResponse extends SimpleDistributionResponse {
 
     private DistributionRequestState state;
@@ -75,7 +78,6 @@ public class CompositeDistributionRespon
     }
 
 
-
     /* Provide the aggregated state of two {@link 
org.apache.sling.distribution.DistributionRequestState}s */
     private DistributionRequestState aggregatedState(DistributionRequestState 
first, DistributionRequestState second) {
         DistributionRequestState aggregatedState;

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/DefaultDistributor.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/DefaultDistributor.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/DefaultDistributor.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/impl/DefaultDistributor.java
 Wed Sep  9 12:09:19 2015
@@ -19,6 +19,8 @@
 
 package org.apache.sling.distribution.impl;
 
+import javax.annotation.Nonnull;
+
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
@@ -33,8 +35,6 @@ import org.apache.sling.distribution.com
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.annotation.Nonnull;
-
 /**
  * Default implementation of Distributor interface that dispatches the request 
to available agents.
  */

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/DistributionLog.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/DistributionLog.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/DistributionLog.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/DistributionLog.java
 Wed Sep  9 12:09:19 2015
@@ -19,11 +19,18 @@
 
 package org.apache.sling.distribution.log;
 
-
-
+import java.util.Collection;
 import java.util.List;
 
+/**
+ * The log of a distribution component activity (e.g. a {@link 
org.apache.sling.distribution.agent.DistributionAgent})
+ */
 public interface DistributionLog {
 
+    /**
+     * get the text log lines
+     *
+     * @return a {@link Collection} of the log lines
+     */
     List<String> getLines();
 }

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/log/impl/DefaultDistributionLog.java
 Wed Sep  9 12:09:19 2015
@@ -19,13 +19,6 @@
 
 package org.apache.sling.distribution.log.impl;
 
-import org.apache.sling.distribution.component.impl.DistributionComponentKind;
-import org.apache.sling.distribution.log.DistributionLog;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.helpers.FormattingTuple;
-import org.slf4j.helpers.MessageFormatter;
-
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -33,10 +26,18 @@ import java.util.Calendar;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.sling.distribution.component.impl.DistributionComponentKind;
+import org.apache.sling.distribution.log.DistributionLog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.helpers.FormattingTuple;
+import org.slf4j.helpers.MessageFormatter;
 
+/**
+ * Default implementation of a {@link DistributionLog}
+ */
 public class DefaultDistributionLog implements DistributionLog {
 
-
     private final DistributionComponentKind kind;
     private final String name;
     private int maxLines = 1000;
@@ -106,7 +107,7 @@ public class DefaultDistributionLog impl
     }
 
     public void info(String fmt, Object... objects) {
-        String specificFmt =  getSpecificString(fmt);
+        String specificFmt = getSpecificString(fmt);
         logger.info(specificFmt, objects);
         internalLog(LogLevel.INFO, fmt, objects);
     }

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageImporter.java
 Wed Sep  9 12:09:19 2015
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.distribution.packaging;
 
-import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import java.io.InputStream;
 

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageInfo.java
 Wed Sep  9 12:09:19 2015
@@ -28,7 +28,6 @@ import java.util.Map;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.wrappers.ValueMapDecorator;
 import org.apache.sling.distribution.DistributionRequestType;
-import org.apache.sling.distribution.queue.DistributionQueueItem;
 
 /**
  * Additional information about a package.

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/SharedDistributionPackage.java
 Wed Sep  9 12:09:19 2015
@@ -28,7 +28,6 @@ import aQute.bnd.annotation.ConsumerType
 @ConsumerType
 public interface SharedDistributionPackage extends DistributionPackage {
 
-
     /**
      * acquire a reference to this package and increase the reference count.
      */

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java
 Wed Sep  9 12:09:19 2015
@@ -19,7 +19,6 @@
 
 package org.apache.sling.distribution.packaging.impl;
 
-
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import org.apache.sling.distribution.packaging.DistributionPackageInfo;
 import org.apache.sling.distribution.packaging.SharedDistributionPackage;
@@ -27,18 +26,29 @@ import org.apache.sling.distribution.que
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Package related utility methods
+ */
 public class DistributionPackageUtils {
 
     static Logger log = 
LoggerFactory.getLogger(DistributionPackageUtils.class);
 
-
+    /**
+     * Acquires the package if it's a {@link SharedDistributionPackage}, via 
{@link SharedDistributionPackage#acquire(String)}
+     * @param distributionPackage a distribution package
+     * @param queueName the name of the queue in which the package should be 
acquired
+     */
     public static void acquire(DistributionPackage distributionPackage, String 
queueName) {
         if (distributionPackage instanceof SharedDistributionPackage) {
             ((SharedDistributionPackage) 
distributionPackage).acquire(queueName);
         }
     }
 
-
+    /**
+     * Releases a distribution package if it's a {@link 
SharedDistributionPackage}, otherwise deletes it.
+     * @param distributionPackage a distribution package
+     * @param queueName the name of the queue from which it should be 
eventually released
+     */
     public static void releaseOrDelete(DistributionPackage 
distributionPackage, String queueName) {
         if (distributionPackage instanceof SharedDistributionPackage) {
             if (queueName != null) {
@@ -53,25 +63,36 @@ public class DistributionPackageUtils {
         }
     }
 
+    /**
+     * Delete a distribution package, if deletion fails, ignore it
+     * @param distributionPackage the package to delete
+     */
     public static void deleteSafely(DistributionPackage distributionPackage) {
-        if (distributionPackage == null) {
-            return;
-        }
-        try {
-            distributionPackage.delete();
-        } catch (Throwable t) {
-            log.error("error deleting package", t);
+        if (distributionPackage != null) {
+            try {
+                distributionPackage.delete();
+            } catch (Throwable t) {
+                log.error("error deleting package", t);
+            }
         }
     }
 
+    /**
+     * Create a queue item out of a package
+     * @param distributionPackage a distribution package
+     * @return a distribution queue item
+     */
     public static DistributionQueueItem toQueueItem(DistributionPackage 
distributionPackage) {
         return new DistributionQueueItem(distributionPackage.getId(), 
distributionPackage.getInfo());
     }
 
-
+    /**
+     * Create a {@link DistributionPackageInfo} from a queue item
+     * @param queueItem a distribution queue item
+     * @return a {@link DistributionPackageInfo}
+     */
     public static DistributionPackageInfo fromQueueItem(DistributionQueueItem 
queueItem) {
         return new DistributionPackageInfo(queueItem);
     }
 
-
 }

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporter.java
 Wed Sep  9 12:09:19 2015
@@ -23,9 +23,9 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.distribution.DistributionRequest;
 import org.apache.sling.distribution.DistributionRequestType;
 import org.apache.sling.distribution.agent.DistributionAgent;
-import org.apache.sling.distribution.DistributionRequest;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import 
org.apache.sling.distribution.packaging.DistributionPackageExportException;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporterFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporterFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporterFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/AgentDistributionPackageExporterFactory.java
 Wed Sep  9 12:09:19 2015
@@ -30,8 +30,8 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.osgi.PropertiesUtil;
-import org.apache.sling.distribution.agent.DistributionAgent;
 import org.apache.sling.distribution.DistributionRequest;
+import org.apache.sling.distribution.agent.DistributionAgent;
 import 
org.apache.sling.distribution.component.impl.DistributionComponentConstants;
 import org.apache.sling.distribution.packaging.DistributionPackage;
 import 
org.apache.sling.distribution.packaging.DistributionPackageExportException;
@@ -80,7 +80,7 @@ public class AgentDistributionPackageExp
 
     @Nonnull
     public List<DistributionPackage> exportPackages(@Nonnull ResourceResolver 
resourceResolver, @Nonnull DistributionRequest distributionRequest) throws 
DistributionPackageExportException {
-       return packageExporter.exportPackages(resourceResolver, 
distributionRequest);
+        return packageExporter.exportPackages(resourceResolver, 
distributionRequest);
     }
 
     public DistributionPackage getPackage(@Nonnull ResourceResolver 
resourceResolver, @Nonnull String distributionPackageId) {

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterFactory.java
 Wed Sep  9 12:09:19 2015
@@ -70,7 +70,6 @@ public class LocalDistributionPackageExp
         exporter = new LocalDistributionPackageExporter(packageBuilder);
     }
 
-
     @Nonnull
     public List<DistributionPackage> exportPackages(@Nonnull ResourceResolver 
resourceResolver, @Nonnull DistributionRequest distributionRequest) throws 
DistributionPackageExportException {
         return exporter.exportPackages(resourceResolver, distributionRequest);

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporter.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporter.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporter.java
 Wed Sep  9 12:09:19 2015
@@ -29,14 +29,12 @@ import org.apache.sling.distribution.pac
 import 
org.apache.sling.distribution.packaging.DistributionPackageExportException;
 import org.apache.sling.distribution.packaging.DistributionPackageExporter;
 import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
-import org.apache.sling.distribution.transport.core.DistributionTransport;
 import 
org.apache.sling.distribution.transport.DistributionTransportSecretProvider;
+import org.apache.sling.distribution.transport.core.DistributionTransport;
 import org.apache.sling.distribution.transport.impl.DistributionEndpoint;
 import 
org.apache.sling.distribution.transport.impl.MultipleEndpointDistributionTransport;
 import 
org.apache.sling.distribution.transport.impl.SimpleHttpDistributionTransport;
 import 
org.apache.sling.distribution.transport.impl.TransportEndpointStrategyType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Default implementation of {@link 
org.apache.sling.distribution.packaging.DistributionPackageExporter}

Modified: 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java?rev=1701984&r1=1701983&r2=1701984&view=diff
==============================================================================
--- 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java
 (original)
+++ 
sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterFactory.java
 Wed Sep  9 12:09:19 2015
@@ -33,8 +33,8 @@ import org.apache.felix.scr.annotations.
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.distribution.DistributionRequest;
-import org.apache.sling.distribution.component.impl.DistributionComponentKind;
 import 
org.apache.sling.distribution.component.impl.DistributionComponentConstants;
+import org.apache.sling.distribution.component.impl.DistributionComponentKind;
 import org.apache.sling.distribution.component.impl.SettingsUtils;
 import org.apache.sling.distribution.log.impl.DefaultDistributionLog;
 import org.apache.sling.distribution.packaging.DistributionPackage;


Reply via email to