continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r765356 - in /continuum/trunk: continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/ continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/ continuum-builder/src/main/java...
Date Wed, 15 Apr 2009 21:01:24 GMT
Author: evenisse
Date: Wed Apr 15 21:01:24 2009
New Revision: 765356

URL: http://svn.apache.org/viewvc?rev=765356&view=rev
Log:
merge -r 764917:764918 from 1.3.x branch

Modified:
    continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/installation/DefaultInstallationService.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java

Modified: continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
(original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
Wed Apr 15 21:01:24 2009
@@ -43,7 +43,7 @@
 public class DefaultContinuumConfiguration
     implements ContinuumConfiguration
 {
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( DefaultContinuumConfiguration.class
);
 
     private File configurationFile;
 

Modified: continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
(original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/test/java/org/apache/continuum/configuration/TestDefaultContinuumConfiguration.java
Wed Apr 15 21:01:24 2009
@@ -19,15 +19,15 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.codehaus.plexus.util.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @version $Id$
@@ -36,9 +36,9 @@
 public class TestDefaultContinuumConfiguration
     extends PlexusInSpringTestCase
 {
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( TestDefaultContinuumConfiguration.class
);
 
-    private String confFile = "target/test-classes/conf/continuum.xml";
+    private static final String confFile = "target/test-classes/conf/continuum.xml";
 
     @Override
     protected void setUp()

Modified: continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
(original)
+++ continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
Wed Apr 15 21:01:24 2009
@@ -20,6 +20,7 @@
  */
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -79,7 +80,7 @@
     public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
 
     public static final String KEY_PROJECT_GROUP_NAME = "project-group-name";
-    
+
     public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";
 
     public static final String KEY_SCM_ERROR = "scm-error";
@@ -339,7 +340,7 @@
 
     public static String getGroupId( Map context )
     {
-        return getString( context, KEY_GROUP_ID);
+        return getString( context, KEY_GROUP_ID );
     }
 
     public static String getArtifactId( Map context )
@@ -350,7 +351,7 @@
     public static String getVersion( Map context )
     {
         return getString( context, KEY_PROJECT_VERSION );
-        
+
     }
 
     public static String getProjectName( Map context )
@@ -514,33 +515,26 @@
     protected static boolean getBoolean( Map context, String key )
     {
         Object obj = getObject( context, key, null );
-        
-        if ( obj == null )
-        {
-            return false;
-        }
-        else
-        {
-            return ( (Boolean) obj ).booleanValue();
-        }
+
+        return obj != null && (Boolean) obj;
     }
-    
+
     protected static boolean getBoolean( Map context, String key, boolean defaultValue )
     {
-        return ( (Boolean) getObject( context, key, Boolean.valueOf( defaultValue ) ) ).booleanValue();
-    }    
+        return (Boolean) getObject( context, key, defaultValue );
+    }
 
     protected static int getInteger( Map context, String key )
     {
         Object obj = getObject( context, key, null );
-        
+
         if ( obj == null )
         {
             return 0;
         }
         else
         {
-            return ( (Integer) obj ).intValue();
+            return (Integer) obj;
         }
     }
 
@@ -554,7 +548,7 @@
         }
         else
         {
-            return (Date)obj;
+            return (Date) obj;
         }
     }
 
@@ -568,20 +562,10 @@
         }
         else
         {
-            List list = new ArrayList();
+            List<Object> list = new ArrayList<Object>();
             Object[] objA = (Object[]) obj;
 
-            for ( Object o : objA )
-            {
-                if ( o instanceof Map )
-                {
-                    list.add( (Map) o );
-                }
-                else
-                {
-                    list.add( o );
-                }
-            }
+            list.addAll( Arrays.asList( objA ) );
 
             return list;
         }

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/installation/DefaultInstallationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/installation/DefaultInstallationService.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/installation/DefaultInstallationService.java
(original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/installation/DefaultInstallationService.java
Wed Apr 15 21:01:24 2009
@@ -62,7 +62,7 @@
 public class DefaultInstallationService
     implements InstallationService, Initializable
 {
-    private Logger log = LoggerFactory.getLogger( DefaultInstallationService.class );
+    private static final Logger log = LoggerFactory.getLogger( DefaultInstallationService.class
);
 
     @Resource
     private InstallationDao installationDao;
@@ -454,8 +454,9 @@
         List<Installation> all = getAllInstallations();
         for ( Installation install : all )
         {
-            if ( org.apache.commons.lang.StringUtils.equals( installation.getName(), install.getName()
)
-                && ( installation.getInstallationId() == 0 || installation.getInstallationId()
!= install.getInstallationId() ) )
+            if ( org.apache.commons.lang.StringUtils.equals( installation.getName(), install.getName()
) &&
+                ( installation.getInstallationId() == 0 ||
+                    installation.getInstallationId() != install.getInstallationId() ) )
             {
                 return true;
             }

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Wed Apr 15 21:01:24 2009
@@ -19,6 +19,13 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+
 import org.apache.continuum.buildqueue.BuildQueueService;
 import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.configuration.BuildAgentConfiguration;
@@ -37,13 +44,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
@@ -51,7 +51,7 @@
 public class DefaultConfigurationService
     implements ConfigurationService
 {
-    private Logger log = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger log = LoggerFactory.getLogger( DefaultConfigurationService.class
);
 
     // when adding a requirement, the template in spring-context.xml must be updated CONTINUUM-1207
 

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
(original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/profile/DefaultProfileServiceTest.java
Wed Apr 15 21:01:24 2009
@@ -1,5 +1,7 @@
 package org.apache.continuum.profile;
 
+import java.util.List;
+
 import org.apache.continuum.dao.DaoUtils;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.installation.InstallationService;
@@ -8,8 +10,6 @@
 import org.apache.maven.continuum.profile.AlreadyExistsProfileException;
 import org.apache.maven.continuum.profile.ProfileService;
 
-import java.util.List;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -40,35 +40,35 @@
 
     Installation jdk1;
 
-    String jdk1Name = "jdk1";
+    private static final String jdk1Name = "jdk1";
 
-    Installation jdk2;
+    private Installation jdk2;
 
-    String jdk2Name = "jdk2";
+    private static final String jdk2Name = "jdk2";
 
     Installation mvn205;
 
-    String mvn205Name = "mvn 2.0.5";
+    private static final String mvn205Name = "mvn 2.0.5";
 
     Installation mvn206;
 
-    String mvn206Name = "mvn 2.0.6";
+    private static final String mvn206Name = "mvn 2.0.6";
 
     Profile jdk1mvn205;
 
-    String jdk1mvn205Name = "jdk1 mvn 2.0.5";
+    private static final String jdk1mvn205Name = "jdk1 mvn 2.0.5";
 
     Profile jdk2mvn206;
 
-    String jdk2mvn206Name = "jdk2 mvn 2.0.6";
+    private static final String jdk2mvn206Name = "jdk2 mvn 2.0.6";
 
     Installation mvnOpts1;
 
-    String mvnOpts1Name = "mvnOpts1";
+    private static final String mvnOpts1Name = "mvnOpts1";
 
     Installation mvnOpts2;
 
-    String mvnOpts2Name = "mvnOpts2";
+    private static final String mvnOpts2Name = "mvnOpts2";
 
     protected void setUp()
         throws Exception

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java?rev=765356&r1=765355&r2=765356&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
(original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
Wed Apr 15 21:01:24 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.continuum.configuration.BuildAgentConfiguration;
 import org.apache.continuum.configuration.BuildAgentGroupConfiguration;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
@@ -26,8 +28,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
@@ -35,9 +35,9 @@
 public class ConfigurationServiceTest
     extends PlexusInSpringTestCase
 {
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( ConfigurationServiceTest.class
);
 
-    private String confFile = "target/test-classes/conf/continuum.xml";
+    private static final String confFile = "target/test-classes/conf/continuum.xml";
 
     @Override
     protected void setUp()



Mime
View raw message