continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r671540 - in /continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m...
Date Wed, 25 Jun 2008 13:03:07 GMT
Author: evenisse
Date: Wed Jun 25 06:03:06 2008
New Revision: 671540

URL: http://svn.apache.org/viewvc?rev=671540&view=rev
Log:
more java5

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/utils/ProjectSorterTest.java
    continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
    continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
Wed Jun 25 06:03:06 2008
@@ -30,7 +30,9 @@
 public class BuildProjectTask
     implements Task, Serializable
 {    
-    private int projectId;
+	private static final long serialVersionUID = 3647734422022017812L;
+
+	private int projectId;
 
     private int buildDefinitionId;
 

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
Wed Jun 25 06:03:06 2008
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.maven.continuum.ContinuumException;
@@ -142,17 +141,15 @@
      * @param buildDefinition
      * @throws ContinuumException
      */
-    protected BuildDefinition updateBuildDefinitionInList( List buildDefinitions, BuildDefinition
buildDefinition )
+    protected BuildDefinition updateBuildDefinitionInList( List<BuildDefinition> buildDefinitions,
BuildDefinition buildDefinition )
         throws ContinuumException
     {
         try
         {
             BuildDefinition storedDefinition = null;
 
-            for ( Iterator i = buildDefinitions.iterator(); i.hasNext(); )
+            for ( BuildDefinition bd : buildDefinitions )
             {
-                BuildDefinition bd = (BuildDefinition) i.next();
-
                 if ( bd.getId() == buildDefinition.getId() )
                 {
                     storedDefinition = bd;

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
Wed Jun 25 06:03:06 2008
@@ -33,7 +33,6 @@
 public class AddBuildDefinitionToProjectAction
     extends AbstractBuildDefinitionContinuumAction
 {
-
     public void execute( Map map )
         throws Exception
     {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Wed Jun 25 06:03:06 2008
@@ -209,12 +209,10 @@
 
         if ( mavenProject.getDevelopers() != null )
         {
-            List developers = new ArrayList();
+            List<ProjectDeveloper> developers = new ArrayList<ProjectDeveloper>();
 
-            for ( Iterator i = mavenProject.getDevelopers().iterator(); i.hasNext(); )
+            for ( Developer d : (List<Developer>)mavenProject.getDevelopers() )
             {
-                Developer d = (Developer) i.next();
-
                 ProjectDeveloper cd = new ProjectDeveloper();
 
                 cd.setScmId( d.getId() );
@@ -252,12 +250,10 @@
         // Dependencies
         // ----------------------------------------------------------------------
 
-        List dependencies = new ArrayList();
+        List<ProjectDependency> dependencies = new ArrayList<ProjectDependency>();
 
-        for ( Iterator i = mavenProject.getDependencies().iterator(); i.hasNext(); )
+        for ( Dependency dependency : (List<Dependency>)mavenProject.getDependencies()
)
         {
-            Dependency dependency = (Dependency) i.next();
-
             ProjectDependency cd = new ProjectDependency();
 
             cd.setGroupId( dependency.getGroupId() );
@@ -269,10 +265,8 @@
             dependencies.add( cd );
         }
 
-        for ( Iterator i = mavenProject.getBuildPlugins().iterator(); i.hasNext(); )
+        for ( Plugin dependency : (List<Plugin>)mavenProject.getBuildPlugins() )
         {
-            Plugin dependency = (Plugin) i.next();
-
             ProjectDependency cd = new ProjectDependency();
 
             cd.setGroupId( dependency.getGroupId() );
@@ -284,10 +278,8 @@
             dependencies.add( cd );
         }
 
-        for ( Iterator i = mavenProject.getReportPlugins().iterator(); i.hasNext(); )
+        for ( ReportPlugin dependency : (List<ReportPlugin>)mavenProject.getReportPlugins()
)
         {
-            ReportPlugin dependency = (ReportPlugin) i.next();
-
             ProjectDependency cd = new ProjectDependency();
 
             cd.setGroupId( dependency.getGroupId() );
@@ -299,10 +291,8 @@
             dependencies.add( cd );
         }
 
-        for ( Iterator i = mavenProject.getBuildExtensions().iterator(); i.hasNext(); )
+        for ( Extension dependency : (List<Extension>)mavenProject.getBuildExtensions()
)
         {
-            Extension dependency = (Extension) i.next();
-
             ProjectDependency cd = new ProjectDependency();
 
             cd.setGroupId( dependency.getGroupId() );
@@ -320,7 +310,7 @@
         // Notifiers
         // ----------------------------------------------------------------------
 
-        List userNotifiers = new ArrayList();
+        List<ProjectNotifier> userNotifiers = new ArrayList<ProjectNotifier>();
 
         if ( continuumProject.getNotifiers() != null )
         {
@@ -355,16 +345,14 @@
             }
         }
 
-        List notifiers = getNotifiers( result, mavenProject, continuumProject );
+        List<ProjectNotifier> notifiers = getNotifiers( result, mavenProject, continuumProject
);
         if ( notifiers != null )
         {
             continuumProject.setNotifiers( notifiers );
         }
 
-        for ( Iterator i = userNotifiers.iterator(); i.hasNext(); )
+        for ( ProjectNotifier notifier : userNotifiers )
         {
-            ProjectNotifier notifier = (ProjectNotifier) i.next();
-
             continuumProject.addNotifier( notifier );
         }
     }
@@ -418,9 +406,9 @@
 
                 if ( validationResult != null && validationResult.getMessageCount()
> 0 )
                 {
-                    for ( Iterator i = validationResult.getMessages().iterator(); i.hasNext();
)
+                    for ( Iterator<String> i = validationResult.getMessages().iterator();
i.hasNext(); )
                     {
-                        String valmsg = (String) i.next();
+                        String valmsg = i.next();
                         result.addError( ContinuumProjectBuildingResult.ERROR_VALIDATION,
valmsg );
                         messages.append( valmsg );
                         messages.append( "\n" );
@@ -517,17 +505,15 @@
         return project.getScm().getConnection();
     }
 
-    private List getNotifiers( ContinuumProjectBuildingResult result, MavenProject mavenProject,
+    private List<ProjectNotifier> getNotifiers( ContinuumProjectBuildingResult result,
MavenProject mavenProject,
                                Project continuumProject )
     {
-        List notifiers = new ArrayList();
+        List<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();
 
         if ( mavenProject.getCiManagement() != null && mavenProject.getCiManagement().getNotifiers()
!= null )
         {
-            for ( Iterator i = mavenProject.getCiManagement().getNotifiers().iterator();
i.hasNext(); )
+            for ( Notifier projectNotifier : (List<Notifier>)mavenProject.getCiManagement().getNotifiers()
)
             {
-                Notifier projectNotifier = (Notifier) i.next();
-
                 ProjectNotifier notifier = new ProjectNotifier();
 
                 if ( StringUtils.isEmpty( projectNotifier.getType() ) )
@@ -668,7 +654,7 @@
 
     private void writeActiveProfileStatement( MavenProject project )
     {
-        List profiles = project.getActiveProfiles();
+        List<Profile> profiles = project.getActiveProfiles();
 
         StringBuffer message = new StringBuffer();
 
@@ -687,10 +673,8 @@
         {
             message.append( "The following profiles are active:\n" );
 
-            for ( Iterator it = profiles.iterator(); it.hasNext(); )
+            for ( Profile profile : profiles )
             {
-                Profile profile = (Profile) it.next();
-
                 message.append( "\n - " ).append( profile.getId() ).append( " (source: "
)
                     .append( profile.getSource() ).append( ")" );
             }
@@ -729,9 +713,9 @@
                                        proxy.getPassword(), proxy.getNonProxyHosts() );
             }
 
-            for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
+            for ( Iterator<Server> i = settings.getServers().iterator(); i.hasNext();
)
             {
-                Server server = (Server) i.next();
+                Server server = i.next();
 
                 wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(),
server.getPassword(),
                                                     server.getPrivateKey(), server.getPassphrase()
);
@@ -745,9 +729,9 @@
                 }
             }
 
-            for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
+            for ( Iterator<Mirror> i = settings.getMirrors().iterator(); i.hasNext();
)
             {
-                Mirror mirror = (Mirror) i.next();
+                Mirror mirror = i.next();
 
                 wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl()
);
             }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/utils/ProjectSorterTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/utils/ProjectSorterTest.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/utils/ProjectSorterTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/utils/ProjectSorterTest.java
Wed Jun 25 06:03:06 2008
@@ -43,7 +43,7 @@
     public void testBasicNestedProjectStructure()
         throws Exception
     {
-        List list = new ArrayList();
+        List<Project> list = new ArrayList<Project>();
 
         Project top = getNewProject( "top" );
         list.add( top );
@@ -57,7 +57,7 @@
         c2.setDependencies( Collections.singletonList( generateProjectDependency( c1 ) )
);
         list.add( c2 );
 
-        List sortedList = ProjectSorter.getSortedProjects( list, null );
+        List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
 
         assertNotNull( sortedList );
 
@@ -78,7 +78,7 @@
     public void testIncompleteNestedProjectStructure()
         throws Exception
     {
-        List list = new ArrayList();
+        List<Project> list = new ArrayList<Project>();
 
         Project top = getNewProject( "top" );
         list.add( top );
@@ -92,7 +92,7 @@
         c2.setDependencies( Collections.singletonList( generateProjectDependency( c1 ) )
);
         list.add( c2 );
 
-        List sortedList = ProjectSorter.getSortedProjects( list, null );
+        List<Project> sortedList = ProjectSorter.getSortedProjects( list, null );
 
         assertNotNull( sortedList );
 

Modified: continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
(original)
+++ continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
Wed Jun 25 06:03:06 2008
@@ -477,7 +477,7 @@
         assertScheduleEquals( testSchedule2, store.getSchedule( testSchedule2.getId() ) );
         assertScheduleEquals( testSchedule3, store.getSchedule( testSchedule3.getId() ) );
 
-        Iterator iterator = store.getAllInstallations().iterator();
+        Iterator<Installation> iterator = store.getAllInstallations().iterator();
         assertInstallationEquals( testInstallationJava13, (Installation) iterator.next()
);
         assertInstallationEquals( testInstallationJava14, (Installation) iterator.next()
);
         assertInstallationEquals( testInstallationMaven20a3, (Installation) iterator.next()
);
@@ -692,7 +692,7 @@
     protected static ProjectNotifier createTestNotifier( int recipientType, boolean sendOnError,
boolean sendOnFailure,
                                                          boolean sendOnSuccess, String type
)
     {
-        Map configuration = new HashMap();
+        Map<String, String> configuration = new HashMap<String, String>();
         configuration.put( "key1", "value1" );
         configuration.put( "key2", "value2" );
 
@@ -721,7 +721,7 @@
         scmResult.setProviderMessage( providerMessage );
         scmResult.setSuccess( success );
 
-        List changes = new ArrayList();
+        List<ChangeSet> changes = new ArrayList<ChangeSet>();
         changes.add( createTestChangeSet( "author" + base + ".1", "comment" + base + ".1",
base + ".1" ) );
         changes.add( createTestChangeSet( "author" + base + ".2", "comment" + base + ".2",
base + ".2" ) );
         scmResult.setChanges( changes );
@@ -734,7 +734,7 @@
         changeSet.setAuthor( author );
         changeSet.setComment( comment );
         changeSet.setDate( System.currentTimeMillis() );
-        List files = new ArrayList();
+        List<ChangeFile> files = new ArrayList<ChangeFile>();
         files.add( createTestChangeFile( "name" + base + ".1", "rev" + base + ".1" ) );
         files.add( createTestChangeFile( "name" + base + ".2", "rev" + base + ".2" ) );
         files.add( createTestChangeFile( "name" + base + ".3", "rev" + base + ".3" ) );
@@ -824,7 +824,7 @@
 
     protected static Profile createTestProfile( String name, String description, int scmMode,
                                                 boolean buildWithoutChanges, boolean active,
Installation jdk,
-                                                Installation builder, List envVars )
+                                                Installation builder, List<Installation>
envVars )
     {
         Profile profile = new Profile();
         profile.setActive( active );
@@ -991,11 +991,11 @@
         assertEquals( "compare change file result - revision", expected.getRevision(), actual.getRevision()
);
     }
 
-    protected static void assertNotifiersEqual( List expected, List actual )
+    protected static void assertNotifiersEqual( List<ProjectNotifier> expected, List<ProjectNotifier>
actual )
     {
         for ( int i = 0; i < actual.size(); i++ )
         {
-            assertNotifierEquals( (ProjectNotifier) expected.get( i ), (ProjectNotifier)
actual.get( i ) );
+            assertNotifierEquals( expected.get( i ), actual.get( i ) );
         }
     }
 
@@ -1009,12 +1009,13 @@
         assertEquals( "compare notifier - send on error", expected.isSendOnError(), actual.isSendOnError()
);
     }
 
-    protected static void assertBuildDefinitionsEqual( List expectedBuildDefinitions, List
actualBuildDefinitions )
+    protected static void assertBuildDefinitionsEqual( List<BuildDefinition> expectedBuildDefinitions,
+    												   List<BuildDefinition> actualBuildDefinitions )
     {
         for ( int i = 0; i < expectedBuildDefinitions.size(); i++ )
         {
-            BuildDefinition expectedBuildDefinition = (BuildDefinition) expectedBuildDefinitions.get(
i );
-            BuildDefinition actualBuildDefinition = (BuildDefinition) actualBuildDefinitions.get(
i );
+            BuildDefinition expectedBuildDefinition = expectedBuildDefinitions.get( i );
+            BuildDefinition actualBuildDefinition = actualBuildDefinitions.get( i );
             assertBuildDefinitionEquals( expectedBuildDefinition, actualBuildDefinition );
             assertScheduleEquals( expectedBuildDefinition.getSchedule(), actualBuildDefinition.getSchedule()
);
             assertProfileEquals( expectedBuildDefinition.getProfile(), actualBuildDefinition.getProfile()
);
@@ -1036,7 +1037,8 @@
                       actualBuildDefinition.isDefaultForProject() );
     }
 
-    protected static void assertDevelopersEqual( List expectedDevelopers, List actualDevelopers
)
+    protected static void assertDevelopersEqual( List<ProjectDeveloper> expectedDevelopers,
+    		                                     List<ProjectDeveloper> actualDevelopers
)
     {
         for ( int i = 0; i < actualDevelopers.size(); i++ )
         {
@@ -1054,7 +1056,8 @@
             .getContinuumId() );
     }
 
-    protected static void assertDependenciesEqual( List expectedDependencies, List actualDependencies
)
+    protected static void assertDependenciesEqual( List<ProjectDependency> expectedDependencies,
+    		                                       List<ProjectDependency> actualDependencies
)
     {
         for ( int i = 0; i < actualDependencies.size(); i++ )
         {

Modified: continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java?rev=671540&r1=671539&r2=671540&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
(original)
+++ continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
Wed Jun 25 06:03:06 2008
@@ -489,7 +489,7 @@
         firstEnvVar = store.addInstallation( firstEnvVar );
         secondEnvVar = store.addInstallation( secondEnvVar );
 
-        List envVars = new ArrayList<Installation>( 2 );
+        List<Installation> envVars = new ArrayList<Installation>( 2 );
         envVars.add( firstEnvVar );
         envVars.add( secondEnvVar );
 



Mime
View raw message