continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r751594 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/dao/ continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/ continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/ co...
Date Mon, 09 Mar 2009 06:07:22 GMT
Author: evenisse
Date: Mon Mar  9 06:07:19 2009
New Revision: 751594

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

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionDao.java
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/DefaultBuildExecutorManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/DefaultNotifierManager.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionDao.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionDao.java?rev=751594&r1=751593&r2=751594&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionDao.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildDefinitionDao.java
Mon Mar  9 06:07:19 2009
@@ -48,7 +48,13 @@
     List<BuildDefinition> getAllBuildDefinitions()
         throws ContinuumStoreException;
 
-    Map getDefaultBuildDefinitions();
+    /**
+     * Returns the default build definition of all projects. The key is the project id and
the value is the build
+     * definition id.
+     *
+     * @return a map of all default build definitions
+     */
+    Map<Integer, Integer> getDefaultBuildDefinitions();
 
     /**
      * returns the default build definitions for the project group and there

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java?rev=751594&r1=751593&r2=751594&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/DaoUtils.java Mon
Mar  9 06:07:19 2009
@@ -34,12 +34,12 @@
 
     void eraseDatabase();
 
-    Map getProjectIdsAndBuildDefinitionsIdsBySchedule( int scheduleId )
+    Map<Integer, Integer> getProjectIdsAndBuildDefinitionsIdsBySchedule( int scheduleId
)
         throws ContinuumStoreException;
 
-    Map getProjectGroupIdsAndBuildDefinitionsIdsBySchedule( int scheduleId )
+    Map<Integer, Integer> getProjectGroupIdsAndBuildDefinitionsIdsBySchedule( int scheduleId
)
         throws ContinuumStoreException;
 
-    Map getAggregatedProjectIdsAndBuildDefinitionIdsBySchedule( int scheduleId )
+    Map<Integer, Integer> getAggregatedProjectIdsAndBuildDefinitionIdsBySchedule( int
scheduleId )
         throws ContinuumStoreException;
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/DefaultBuildExecutorManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/DefaultBuildExecutorManager.java?rev=751594&r1=751593&r2=751594&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/DefaultBuildExecutorManager.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager/DefaultBuildExecutorManager.java
Mon Mar  9 06:07:19 2009
@@ -43,7 +43,7 @@
     /**
      * @plexus.requirement role="org.apache.maven.continuum.execution.ContinuumBuildExecutor"
      */
-    private Map executors;
+    private Map<String, ContinuumBuildExecutor> executors;
 
     // ----------------------------------------------------------------------
     // Component Lifecycle
@@ -53,7 +53,7 @@
     {
         if ( executors == null )
         {
-            executors = new HashMap();
+            executors = new HashMap<String, ContinuumBuildExecutor>();
         }
 
         if ( executors.size() == 0 )
@@ -78,7 +78,7 @@
     public ContinuumBuildExecutor getBuildExecutor( String builderType )
         throws ContinuumException
     {
-        ContinuumBuildExecutor executor = (ContinuumBuildExecutor) executors.get( builderType
);
+        ContinuumBuildExecutor executor = executors.get( builderType );
 
         if ( executor == null )
         {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/DefaultNotifierManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/DefaultNotifierManager.java?rev=751594&r1=751593&r2=751594&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/DefaultNotifierManager.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/manager/DefaultNotifierManager.java
Mon Mar  9 06:07:19 2009
@@ -18,12 +18,12 @@
         return notifiers.get( notifierId );
     }
 
-    public Map getNotifiers()
+    public Map<String, Notifier> getNotifiers()
     {
         return notifiers;
     }
 
-    public void setNotifiers( Map notifiers )
+    public void setNotifiers( Map<String, Notifier> notifiers )
     {
         this.notifiers = notifiers;
     }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=751594&r1=751593&r2=751594&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Mon Mar  9 06:07:19 2009
@@ -80,7 +80,7 @@
 
         assertEquals( 1, result.getProjects().size() );
 
-        Project project = (Project) result.getProjects().get( 0 );
+        Project project = result.getProjects().get( 0 );
 
         assertNotNull( project );
 
@@ -94,7 +94,7 @@
 
         assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );
 
-        ProjectGroup pg = (ProjectGroup) result.getProjectGroups().get( 0 );
+        ProjectGroup pg = result.getProjectGroups().get( 0 );
 
         assertNotNull( pg );
 
@@ -121,7 +121,7 @@
 
         assertEquals( 1, result.getProjects().size() );
 
-        Project project = (Project) result.getProjects().get( 0 );
+        Project project = result.getProjects().get( 0 );
 
         assertNotNull( project );
 
@@ -135,7 +135,7 @@
 
         assertEquals( "foo@bar", notifier.getConfiguration().get( "address" ) );
 
-        ProjectGroup pg = (ProjectGroup) result.getProjectGroups().get( 0 );
+        ProjectGroup pg = result.getProjectGroups().get( 0 );
 
         assertNotNull( pg );
 
@@ -162,7 +162,7 @@
 
         assertEquals( 1, result.getProjects().size() );
 
-        ProjectGroup pg = (ProjectGroup) result.getProjectGroups().get( 0 );
+        ProjectGroup pg = result.getProjectGroups().get( 0 );
 
         assertNotNull( pg );
 
@@ -170,7 +170,7 @@
 
         String scmUrl = "scm:cvs:ext:${user.name}@company.org:/home/company/cvs:project/foo";
 
-        Project project = (Project) result.getProjects().get( 0 );
+        Project project = result.getProjects().get( 0 );
 
         scmUrl = StringUtils.replace( scmUrl, "${user.name}", username );
 
@@ -197,7 +197,7 @@
 
         assertEquals( 1, result.getErrors().size() );
 
-        assertEquals( ContinuumProjectBuildingResult.ERROR_POM_NOT_FOUND, result.getErrors().get(
0 ).toString() );
+        assertEquals( ContinuumProjectBuildingResult.ERROR_POM_NOT_FOUND, result.getErrors().get(
0 ) );
 
         // ----------------------------------------------------------------------
         // Assert the project group built
@@ -207,7 +207,7 @@
 
         assertEquals( 1, result.getProjectGroups().size() );
 
-        ProjectGroup projectGroup = (ProjectGroup) result.getProjectGroups().iterator().next();
+        ProjectGroup projectGroup = result.getProjectGroups().iterator().next();
 
         assertEquals( "projectGroup.groupId", "org.apache.maven.continuum", projectGroup.getGroupId()
);
 
@@ -225,12 +225,10 @@
 
         assertEquals( 9, result.getProjects().size() );
 
-        Map projects = new HashMap();
+        Map<String, Project> projects = new HashMap<String, Project>();
 
-        for ( Iterator it = result.getProjects().iterator(); it.hasNext(); )
+        for ( Project project : result.getProjects() )
         {
-            Project project = (Project) it.next();
-
             assertNotNull( project.getName() );
 
             assertNotNull( project.getDescription() );
@@ -251,10 +249,10 @@
         assertMavenTwoProject( "Continuum Jabber Notifier", projects );
 
         assertEquals( "continuum-parent-notifiers",
-                      ( (Project) projects.get( "Continuum IRC Notifier" ) ).getParent().getArtifactId()
);
+                      ( projects.get( "Continuum IRC Notifier" ) ).getParent().getArtifactId()
);
 
         assertEquals( "continuum-parent-notifiers",
-                      ( (Project) projects.get( "Continuum Jabber Notifier" ) ).getParent().getArtifactId()
);
+                      ( projects.get( "Continuum Jabber Notifier" ) ).getParent().getArtifactId()
);
 
         assertDependency( "Continuum Model", "Continuum Web", projects );
     }

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java?rev=751594&r1=751593&r2=751594&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
(original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
Mon Mar  9 06:07:19 2009
@@ -154,11 +154,11 @@
      *
      * @todo Move to a better place
      */
-    public Map getAggregatedProjectIdsAndBuildDefinitionIdsBySchedule( int scheduleId )
+    public Map<Integer, Integer> getAggregatedProjectIdsAndBuildDefinitionIdsBySchedule(
int scheduleId )
         throws ContinuumStoreException
     {
-        Map projectSource = getProjectIdsAndBuildDefinitionsIdsBySchedule( scheduleId );
-        Map projectGroupSource = getProjectGroupIdsAndBuildDefinitionsIdsBySchedule( scheduleId
);
+        Map<Integer, Integer> projectSource = getProjectIdsAndBuildDefinitionsIdsBySchedule(
scheduleId );
+        Map<Integer, Integer> projectGroupSource = getProjectGroupIdsAndBuildDefinitionsIdsBySchedule(
scheduleId );
 
         Map aggregate = new HashMap();
 
@@ -197,7 +197,7 @@
      * @throws ContinuumStoreException
      * @todo Move to a better place
      */
-    public Map getProjectIdsAndBuildDefinitionsIdsBySchedule( int scheduleId )
+    public Map<Integer, Integer> getProjectIdsAndBuildDefinitionsIdsBySchedule( int
scheduleId )
         throws ContinuumStoreException
     {
         PersistenceManager pm = getPersistenceManager();
@@ -271,7 +271,7 @@
      * @throws ContinuumStoreException
      * @todo Move to a better place
      */
-    public Map getProjectGroupIdsAndBuildDefinitionsIdsBySchedule( int scheduleId )
+    public Map<Integer, Integer> getProjectGroupIdsAndBuildDefinitionsIdsBySchedule(
int scheduleId )
         throws ContinuumStoreException
     {
         PersistenceManager pm = getPersistenceManager();



Mime
View raw message