]> source.dussan.org Git - archiva.git/commitdiff
format and debug infos
authorOlivier Lamy <olamy@apache.org>
Thu, 27 Nov 2014 04:32:24 +0000 (15:32 +1100)
committerOlivier Lamy <olamy@apache.org>
Thu, 27 Nov 2014 04:32:24 +0000 (15:32 +1100)
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java

index c6cc9530b165586b9598b91ffd513013e8d997e8..665c80ab231a3c691e34af663cdf0cbcd0f9458a 100644 (file)
@@ -89,7 +89,7 @@ import java.util.Set;
  * before reading it from the registry.
  * </p>
  */
-@Service( "archivaConfiguration#default" )
+@Service("archivaConfiguration#default")
 public class DefaultArchivaConfiguration
     implements ArchivaConfiguration, RegistryListener
 {
@@ -99,7 +99,7 @@ public class DefaultArchivaConfiguration
      * Plexus registry to read the configuration from.
      */
     @Inject
-    @Named( value = "commons-configuration" )
+    @Named(value = "commons-configuration")
     private Registry registry;
 
     @Inject
@@ -183,7 +183,7 @@ public class DefaultArchivaConfiguration
         return configuration;
     }
 
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     private Configuration load()
     {
         // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties)
@@ -439,7 +439,7 @@ public class DefaultArchivaConfiguration
         return registry.getSubset( KEY );
     }
 
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     @Override
     public synchronized void save( Configuration configuration )
         throws IndeterminateConfigurationException, RegistryException
@@ -464,10 +464,13 @@ public class DefaultArchivaConfiguration
 
                 // a little aggressive with the repositoryScanning and databaseScanning - should be no need to split
                 // that configuration
-                if ( key.startsWith( "repositories" ) || key.startsWith( "proxyConnectors" ) || key.startsWith(
-                    "networkProxies" ) || key.startsWith( "repositoryScanning" ) || key.startsWith(
-                    "remoteRepositories" ) || key.startsWith( "managedRepositories" ) || key.startsWith(
-                    "repositoryGroups" ) )
+                if ( key.startsWith( "repositories" ) //
+                    || key.startsWith( "proxyConnectors" ) //
+                    || key.startsWith( "networkProxies" ) //
+                    || key.startsWith( "repositoryScanning" ) //
+                    || key.startsWith( "remoteRepositories" ) //
+                    || key.startsWith( "managedRepositories" ) //
+                    || key.startsWith( "repositoryGroups" ) ) //
                 {
                     foundList = true;
                 }
@@ -537,8 +540,6 @@ public class DefaultArchivaConfiguration
         {
             c.setRefreshCronExpression( escapeCronExpression( c.getRefreshCronExpression() ) );
         }
-
-
     }
 
     private Registry createDefaultConfigurationFile()
@@ -558,8 +559,7 @@ public class DefaultArchivaConfiguration
                 throw new RegistryException(
                     "Unable to create configuration file in either user [" + userConfigFilename + "] or alternative ["
                         + altConfigFilename
-                        + "] locations on disk, usually happens when not allowed to write to those locations."
-                );
+                        + "] locations on disk, usually happens when not allowed to write to those locations." );
             }
         }
 
index 34ed1b606ef38016d1702bdf215f395a5ea92822..3da5a37ea5d7a904f1556dbef88929daab3b3e36 100644 (file)
@@ -731,7 +731,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
     {
         Collection<String> keys = userConfiguration.getKeys();
 
-        Set<String> keysSet = new HashSet<String>( keys );
+        Set<String> keysSet = new HashSet<>( keys );
 
         keysSet.addAll( getRedbackRuntimeConfiguration().getConfigurationProperties().keySet() );
 
index 89cd78be421c25a0cee8d3267d9d92454bcb5ae1..b0107cc384e7808c2c8f80108eaf1eba21c87dea 100644 (file)
@@ -77,7 +77,7 @@ import java.util.Map;
 public abstract class AbstractRestService
 {
 
-    protected Logger log = LoggerFactory.getLogger( getClass() );
+    protected final Logger log = LoggerFactory.getLogger( getClass() );
 
     @Inject
     private List<AuditListener> auditListeners = new ArrayList<>();
index 209c405c8889388243fbd2e77ad96fddecd75695..5d3aa8e40e2a2d3c47c6da80a19c7f7cca2ad837 100644 (file)
@@ -62,6 +62,7 @@ public class DefaultRedbackRuntimeConfigurationService
     extends AbstractRestService
     implements RedbackRuntimeConfigurationService
 {
+
     @Inject
     private RedbackRuntimeConfigurationAdmin redbackRuntimeConfigurationAdmin;
 
@@ -97,7 +98,12 @@ public class DefaultRedbackRuntimeConfigurationService
     {
         try
         {
-            return redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
+            RedbackRuntimeConfiguration redbackRuntimeConfiguration =
+                redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
+
+            log.debug( "getRedbackRuntimeConfiguration -> {}", redbackRuntimeConfiguration );
+
+            return redbackRuntimeConfiguration;
         }
         catch ( RepositoryAdminException e )
         {