continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r670782 - in /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum: buildcontroller/BuildContext.java buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java execution/maven/m1/DefaultMavenOneMetadataHelper.java
Date Mon, 23 Jun 2008 22:07:57 GMT
Author: evenisse
Date: Mon Jun 23 15:07:57 2008
New Revision: 670782

URL: http://svn.apache.org/viewvc?rev=670782&view=rev
Log:
java 5

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java?rev=670782&r1=670781&r2=670782&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
Mon Jun 23 15:07:57 2008
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectDependency;
 import org.apache.maven.continuum.model.scm.ScmResult;
 
 import java.util.ArrayList;
@@ -54,7 +55,7 @@
 
     private BuildResult buildResult;
 
-    private List modifiedDependencies;
+    private List<ProjectDependency> modifiedDependencies;
 
     public void setStartTime( long startTime )
     {
@@ -145,16 +146,16 @@
         this.trigger = trigger;
     }
 
-    public List getModifiedDependencies()
+    public List<ProjectDependency> getModifiedDependencies()
     {
         if ( modifiedDependencies == null )
         {
-            modifiedDependencies = new ArrayList();
+            modifiedDependencies = new ArrayList<ProjectDependency>();
         }
         return modifiedDependencies;
     }
 
-    public void setModifiedDependencies( List modifiedDependencies )
+    public void setModifiedDependencies( List<ProjectDependency> modifiedDependencies
)
     {
         this.modifiedDependencies = modifiedDependencies;
     }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java?rev=670782&r1=670781&r2=670782&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
Mon Jun 23 15:07:57 2008
@@ -60,7 +60,7 @@
      * @param tasks A list of queued tasks to evaluate
      * @return a list of tasks with duplicates removed
      */
-    public Collection evaluate( Collection tasks )
+    public Collection<BuildProjectTask> evaluate( Collection tasks )
     {
         // ----------------------------------------------------------------------
         // This code makes a Map with Lists with one list per project. For each
@@ -69,19 +69,17 @@
         // checked for validity and a list of tasks to remove is returned.
         // ----------------------------------------------------------------------
 
-        Map projects = new HashMap();
+        Map<Integer, List<BuildProjectTask>> projects = new HashMap<Integer,
List<BuildProjectTask>>();
 
-        for ( Iterator it = tasks.iterator(); it.hasNext(); )
+        for ( BuildProjectTask task : (Collection<BuildProjectTask>) tasks )
         {
-            BuildProjectTask task = (BuildProjectTask) it.next();
-
             Integer key = new Integer( task.getProjectId() );
 
-            List projectTasks = (List) projects.get( key );
+            List<BuildProjectTask> projectTasks = (List<BuildProjectTask>) projects.get(
key );
 
             if ( projectTasks == null )
             {
-                projectTasks = new ArrayList();
+                projectTasks = new ArrayList<BuildProjectTask>();
 
                 projects.put( key, projectTasks );
             }
@@ -89,7 +87,7 @@
             projectTasks.add( task );
         }
 
-        List toBeRemoved = new ArrayList();
+        List<BuildProjectTask> toBeRemoved = new ArrayList<BuildProjectTask>();
 
         for ( Iterator it = projects.values().iterator(); it.hasNext(); )
         {
@@ -103,18 +101,14 @@
     //
     // ----------------------------------------------------------------------
 
-    private List checkTasks( List list )
+    private List<BuildProjectTask> checkTasks( List<BuildProjectTask> list )
     {
-        List toBeRemoved = new ArrayList();
+        List<BuildProjectTask> toBeRemoved = new ArrayList<BuildProjectTask>();
 
-        for ( Iterator it = list.iterator(); it.hasNext(); )
+        for ( BuildProjectTask buildProjectTask : list )
         {
-            BuildProjectTask buildProjectTask = (BuildProjectTask) it.next();
-
-            for ( Iterator it2 = list.iterator(); it2.hasNext(); )
+            for ( BuildProjectTask task : list )
             {
-                BuildProjectTask task = (BuildProjectTask) it2.next();
-
                 // check if it's the same task
                 if ( buildProjectTask == task ||
                     buildProjectTask.getBuildDefinitionId() != task.getBuildDefinitionId()
)

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java?rev=670782&r1=670781&r2=670782&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
Mon Jun 23 15:07:57 2008
@@ -36,7 +36,6 @@
 import java.io.FileReader;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 
@@ -234,12 +233,10 @@
         {
             Xpp3Dom[] developersList = developers.getChildren();
 
-            List cds = new ArrayList();
+            List<ProjectDeveloper> cds = new ArrayList<ProjectDeveloper>();
 
-            for ( int i = 0; i < developersList.length; i++ )
+            for ( Xpp3Dom developer : developersList )
             {
-                Xpp3Dom developer = developersList[i];
-
                 ProjectDeveloper cd = new ProjectDeveloper();
 
                 cd.setScmId( getValue( developer, "id", null ) );
@@ -264,12 +261,10 @@
         {
             Xpp3Dom[] dependenciesList = dependencies.getChildren();
 
-            List deps = new ArrayList();
+            List<ProjectDependency> deps = new ArrayList<ProjectDependency>();
 
-            for ( int i = 0; i < dependenciesList.length; i++ )
+            for ( Xpp3Dom dependency : dependenciesList )
             {
-                Xpp3Dom dependency = dependenciesList[i];
-
                 ProjectDependency cd = new ProjectDependency();
 
                 if ( getValue( dependency, "groupId", null ) != null )
@@ -299,7 +294,7 @@
 
         Xpp3Dom build = mavenProject.getChild( "build" );
 
-        List notifiers = new ArrayList();
+        List<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();
 
         // Add project Notifier
         if ( build != null )
@@ -325,10 +320,8 @@
         // Add all user notifiers
         if ( project.getNotifiers() != null && !project.getNotifiers().isEmpty()
)
         {
-            for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); )
+            for ( ProjectNotifier notif : (List<ProjectNotifier>) project.getNotifiers()
)
             {
-                ProjectNotifier notif = (ProjectNotifier) i.next();
-
                 if ( notif.isFromUser() )
                 {
                     notifiers.add( notif );



Mime
View raw message