continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r671517 - in /continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/build/settings/ continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/ continuum-core/src/main/java/org/apache/maven/continuum/installa...
Date Wed, 25 Jun 2008 11:46:14 GMT
Author: evenisse
Date: Wed Jun 25 04:46:13 2008
New Revision: 671517

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

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
    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/installation/DefaultInstallationService.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
Wed Jun 25 04:46:13 2008
@@ -37,7 +37,6 @@
 import java.text.ParseException;
 import java.util.Collection;
 import java.util.Date;
-import java.util.Iterator;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -66,12 +65,10 @@
     {
         getLogger().info( "Activating schedules ..." );
 
-        Collection schedules = store.getAllSchedulesByName();
+        Collection<Schedule> schedules = store.getAllSchedulesByName();
 
-        for ( Iterator i = schedules.iterator(); i.hasNext(); )
+        for ( Schedule schedule : schedules )
         {
-            Schedule schedule = (Schedule) i.next();
-
             if ( StringUtils.isEmpty( schedule.getCronExpression() ) )
             {
                 // TODO: this can possibly be removed but it's here now to

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=671517&r1=671516&r2=671517&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
Wed Jun 25 04:46:13 2008
@@ -47,7 +47,7 @@
 
     private ScmResult oldScmResult;
 
-    private Map actionContext;
+    private Map<String, Object> actionContext;
 
     private ScmResult scmResult;
 
@@ -127,11 +127,11 @@
         return scmResult;
     }
 
-    public Map getActionContext()
+    public Map<String, Object> getActionContext()
     {
         if ( actionContext == null )
         {
-            actionContext = new HashMap();
+            actionContext = new HashMap<String, Object>();
         }
         return actionContext;
     }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
Wed Jun 25 04:46:13 2008
@@ -365,9 +365,8 @@
         }
         if ( profile.getEnvironmentVariables() != null )
         {
-            for ( Iterator iterator = profile.getEnvironmentVariables().iterator(); iterator.hasNext();
)
+            for ( Installation installation: (List<Installation>)profile.getEnvironmentVariables()
)
             {
-                Installation installation = (Installation) iterator.next();
                 environnments.put( installation.getVarName(), installation.getVarValue()
);
             }
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/manager/DefaultContinuumProjectBuilderManager.java
Wed Jun 25 04:46:13 2008
@@ -37,7 +37,7 @@
     /**
      * @plexus.requirement role="org.apache.maven.continuum.project.builder.ContinuumProjectBuilder"
      */
-    private Map projectBuilders;
+    private Map<String, ContinuumProjectBuilder> projectBuilders;
 
     // ----------------------------------------------------------------------
     // ProjectCreatorManager Implementation

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
Wed Jun 25 04:46:13 2008
@@ -44,7 +44,6 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -78,7 +77,7 @@
     /**
      * @plexus.configuration
      */
-    private List excludedPackagingTypes = new ArrayList();
+    private List<String> excludedPackagingTypes = new ArrayList<String>();
 
     // ----------------------------------------------------------------------
     // AbstractContinuumProjectBuilder Implementation
@@ -279,7 +278,7 @@
             result.addProject( continuumProject, MavenTwoBuildExecutor.ID );
         }
 
-        List modules = mavenProject.getModules();
+        List<String> modules = mavenProject.getModules();
 
         String prefix = url.toExternalForm();
 
@@ -303,10 +302,8 @@
         prefix = prefix.substring( 0, lastSlash );
         if ( loadRecursiveProjects )
         {
-            for ( Iterator it = modules.iterator(); it.hasNext(); )
+            for ( String module : modules )
             {
-                String module = (String) it.next();
-
                 if ( StringUtils.isNotEmpty( module ) )
                 {
                     String urlString = prefix + "/" + module + POM_PART + suffix;
@@ -345,9 +342,8 @@
         throws ContinuumProjectBuilderException, BuildDefinitionServiceException
     {
         List<BuildDefinition> buildDefinitions = new ArrayList<BuildDefinition>();
-        for ( Iterator<BuildDefinition> iterator = template.getBuildDefinitions().iterator();
iterator.hasNext(); )
+        for ( BuildDefinition buildDefinition : (List<BuildDefinition>)template.getBuildDefinitions()
)
         {
-            BuildDefinition buildDefinition = iterator.next();
             // due to CONTINUUM-1207 CONTINUUM-1436 user can do what they want with arguments
             // we must remove if exists --non-recursive or -N
             if ( !loadRecursiveProjects )

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
Wed Jun 25 04:46:13 2008
@@ -78,7 +78,7 @@
 
         String workingDirectory = task.getWorkingDirectory().getAbsolutePath();
 
-        Map context = new HashMap();
+        Map<String, Object> context = new HashMap<String, Object>();
 
         context.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId ) );
 

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
(original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Wed Jun 25 04:46:13 2008
@@ -84,7 +84,7 @@
      */
     private Map<String, IRCConnection> hostConnections = new HashMap<String, IRCConnection>();
 
-    private Map<String, List> channelConnections = new HashMap<String, List>();
+    private Map<String, List<String>> channelConnections = new HashMap<String,
List<String>>();
 
 
     // ----------------------------------------------------------------------
@@ -170,12 +170,11 @@
             }
 
             //join to all channels
-            List channels = channelConnections.get( key );
+            List<String> channels = channelConnections.get( key );
             if ( channels != null )
             {
-                for ( Iterator i = channels.iterator(); i.hasNext(); )
+                for ( String channel : channels )
                 {
-                    String channel = (String) i.next();
                     connectToChannel( conn, channel );
                 }
             }
@@ -184,20 +183,19 @@
 
     private void checkChannel( IRCConnection conn, String key, String channel )
     {
-        List channels = channelConnections.get( key );
+        List<String> channels = channelConnections.get( key );
         if ( channels == null )
         {
             connectToChannel( conn, channel );
-            channels = new ArrayList();
+            channels = new ArrayList<String>();
             channels.add( channel );
             channelConnections.put( key, channels );
         }
         else
         {
             boolean found = false;
-            for ( Iterator i = channels.iterator(); i.hasNext(); )
+            for ( String c : channels )
             {
-                String c = (String) i.next();
                 if ( c.equalsIgnoreCase( channel ) )
                 {
                     found = true;

Modified: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=671517&r1=671516&r2=671517&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Wed Jun 25 04:46:13 2008
@@ -67,7 +67,7 @@
 
         setUpConfigurationService( (ConfigurationService) lookup( ConfigurationService.ROLE
) );
 
-        Collection projectGroups = store.getAllProjectGroupsWithProjects();
+        Collection<ProjectGroup> projectGroups = store.getAllProjectGroupsWithProjects();
 
         assertEquals( 0, projectGroups.size() );
 
@@ -225,7 +225,7 @@
 
         makeProject( project, name, version );
 
-        List notifiers = createMailNotifierList( emailAddress );
+        List<ProjectNotifier> notifiers = createMailNotifierList( emailAddress );
 
         project.setNotifiers( notifiers );
 
@@ -259,7 +259,7 @@
         return project;
     }
 
-    protected static List createMailNotifierList( String emailAddress )
+    protected static List<ProjectNotifier> createMailNotifierList( String emailAddress
)
     {
         if ( emailAddress == null )
         {
@@ -276,7 +276,7 @@
 
         notifier.setConfiguration( props );
 
-        List notifiers = new ArrayList();
+        List<ProjectNotifier> notifiers = new ArrayList<ProjectNotifier>();
 
         notifiers.add( notifier );
 
@@ -349,7 +349,7 @@
         assertProjectEquals( name, createMailNotifierList( emailAddress ), version, actual
);
     }
 
-    public void assertProjectEquals( String name, List notifiers, String version, Project
actual )
+    public void assertProjectEquals( String name, List<ProjectNotifier> notifiers,
String version, Project actual )
     {
         assertEquals( "project.name", name, actual.getName() );
 



Mime
View raw message