continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r671159 - in /continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-store/src/main/java/org/...
Date Tue, 24 Jun 2008 12:54:57 GMT
Author: evenisse
Date: Tue Jun 24 05:54:56 2008
New Revision: 671159

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

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=671159&r1=671158&r2=671159&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Tue Jun 24 05:54:56 2008
@@ -131,13 +131,13 @@
 
     BuildResult getLatestBuildResultForProject( int projectId );
 
-    Map getLatestBuildResults( int projectGroupId );
+    Map<Integer, BuildResult> getLatestBuildResults( int projectGroupId );
 
-    Map getLatestBuildResults();
+    Map<Integer, BuildResult> getLatestBuildResults();
 
-    Map getBuildResultsInSuccess( int projectGroupId );
+    Map<Integer, BuildResult> getBuildResultsInSuccess( int projectGroupId );
 
-    Map getBuildResultsInSuccess();
+    Map<Integer, BuildResult> getBuildResultsInSuccess();
 
     // ----------------------------------------------------------------------
     // Queues

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=671159&r1=671158&r2=671159&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Tue Jun 24 05:54:56 2008
@@ -311,9 +311,9 @@
 
     List<BuildResult> getBuildResultsForProject( int projectId, long fromDate );
 
-    Map getLatestBuildResultsByProjectGroupId( int projectGroupId );
+    Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId
);
 
-    Map getLatestBuildResults();
+    Map<Integer, BuildResult> getLatestBuildResults();
 
     List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
 
@@ -322,9 +322,9 @@
     List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId,
long startIndex,
                                                         long endIndex );
 
-    Map getBuildResultsInSuccess();
+    Map<Integer, BuildResult> getBuildResultsInSuccess();
 
-    Map getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
+    Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId
);
 
     void addBuildResult( Project project, BuildResult build )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=671159&r1=671158&r2=671159&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Tue Jun 24 05:54:56 2008
@@ -401,49 +401,49 @@
         return store.getAllProjectsByNameWithDependencies();
     }
 
-    public Map getLatestBuildResults( int projectGroupId )
+    public Map<Integer, BuildResult> getLatestBuildResults( int projectGroupId )
     {
-        Map result = store.getLatestBuildResultsByProjectGroupId( projectGroupId );
+        Map<Integer, BuildResult> result = store.getLatestBuildResultsByProjectGroupId(
projectGroupId );
 
         if ( result == null )
         {
-            result = new HashMap();
+            result = new HashMap<Integer, BuildResult>();
         }
 
         return result;
     }
 
-    public Map getLatestBuildResults()
+    public Map<Integer, BuildResult> getLatestBuildResults()
     {
-        Map result = store.getLatestBuildResults();
+        Map<Integer, BuildResult> result = store.getLatestBuildResults();
 
         if ( result == null )
         {
-            result = new HashMap();
+            result = new HashMap<Integer, BuildResult>();
         }
 
         return result;
     }
 
-    public Map getBuildResultsInSuccess( int projectGroupId )
+    public Map<Integer, BuildResult> getBuildResultsInSuccess( int projectGroupId )
     {
-        Map result = store.getBuildResultsInSuccessByProjectGroupId( projectGroupId );
+        Map<Integer, BuildResult> result = store.getBuildResultsInSuccessByProjectGroupId(
projectGroupId );
 
         if ( result == null )
         {
-            result = new HashMap();
+            result = new HashMap<Integer, BuildResult>();
         }
 
         return result;
     }
 
-    public Map getBuildResultsInSuccess()
+    public Map<Integer, BuildResult> getBuildResultsInSuccess()
     {
-        Map result = store.getBuildResultsInSuccess();
+        Map<Integer, BuildResult> result = store.getBuildResultsInSuccess();
 
         if ( result == null )
         {
-            result = new HashMap();
+            result = new HashMap<Integer, BuildResult>();
         }
 
         return result;
@@ -1071,14 +1071,12 @@
 
         for ( Project project : projectsList )
         {
-            List buildDefIds = (List) projectsMap.get( new Integer( project.getId() ) );
+            List<Integer> buildDefIds = (List<Integer>) projectsMap.get( new
Integer( project.getId() ) );
 
             if ( buildDefIds != null && !buildDefIds.isEmpty() )
             {
-                for ( Iterator buildDefinitionIterator = buildDefIds.iterator(); buildDefinitionIterator.hasNext();
)
+                for ( Integer buildDefId : buildDefIds )
                 {
-                    Integer buildDefId = (Integer) buildDefinitionIterator.next();
-
                     if ( buildDefId != null && !isInBuildingQueue( project.getId(),
buildDefId.intValue() ) &&
                         !isInCheckoutQueue( project.getId() ) )
                     {
@@ -1302,7 +1300,7 @@
 
         Collections.reverse( buildResults );
 
-        Iterator buildResultsIterator = buildResults.iterator();
+        Iterator<BuildResult> buildResultsIterator = buildResults.iterator();
 
         boolean stop = false;
 
@@ -1746,7 +1744,7 @@
         }
 
         // ----------------------------------------------------------------------
-        // Save any new project groups that we've found. Currenly all projects
+        // Save any new project groups that we've found. Currently all projects
         // will go into the first project group in the list.
         // ----------------------------------------------------------------------
 
@@ -2193,8 +2191,9 @@
 
         for ( BuildDefinition bd : buildDefinitions )
         {
-            if ( buildDefinition.getId() == buildDefinitionId )
+            if ( bd.getId() == buildDefinitionId )
             {
+            	buildDefinition = bd;
                 break;
             }
         }
@@ -2736,14 +2735,10 @@
 
         getLogger().info( "Showing all projects: " );
 
-        for ( Iterator it = store.getAllProjectsByNameWithBuildDetails().iterator(); it.hasNext();
)
+        for ( Project project : store.getAllProjectsByNameWithBuildDetails() )
         {
-            Project project = (Project) it.next();
-
-            for ( Iterator notifierIt = project.getNotifiers().iterator(); notifierIt.hasNext();
)
+            for ( ProjectNotifier notifier : (List<ProjectNotifier>)project.getNotifiers()
)
             {
-                ProjectNotifier notifier = (ProjectNotifier) notifierIt.next();
-
                 if ( StringUtils.isEmpty( notifier.getType() ) )
                 {
                     try
@@ -3128,7 +3123,7 @@
 
     public Collection<ProjectGroup> getAllProjectGroupsWithProjects()
     {
-        // todo check why this interface isn't throwing exceptions on this guy
+        //TODO: check why this interface isn't throwing exceptions on this guy
         return store.getAllProjectGroupsWithProjects();
     }
 
@@ -3175,11 +3170,6 @@
     // Private Utilities
     // ----------------------------------------------------------------------
 
-    private boolean convertBoolean( String value )
-    {
-        return "true".equalsIgnoreCase( value ) || "on".equalsIgnoreCase( value ) || "yes".equalsIgnoreCase(
value );
-    }
-
     private void startMessage()
     {
         getLogger().info( "Starting Continuum." );

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=671159&r1=671158&r2=671159&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Tue Jun 24 05:54:56 2008
@@ -460,9 +460,9 @@
 
             query.setFilter( "this.project.id == projectId && this.project.latestBuildId
== this.id" );
 
-            List result = (List) query.execute( projectId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId
);
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -501,9 +501,9 @@
             params[0] = projectId;
             params[1] = buildDefinitionId;
 
-            List result = (List) query.executeWithArray( params );
+            List<BuildResult> result = (List<BuildResult>) query.executeWithArray(
params );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -519,7 +519,7 @@
         return null;
     }
 
-    public Map getLatestBuildResultsByProjectGroupId( int projectGroupId )
+    public Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId
)
     {
         PersistenceManager pm = getPersistenceManager();
 
@@ -577,7 +577,7 @@
         return null;
     }
 
-    public Map getLatestBuildResults()
+    public Map<Integer, BuildResult> getLatestBuildResults()
     {
         return getLatestBuildResultsByProjectGroupId( -1 );
     }
@@ -1681,7 +1681,7 @@
         return results;
     }
 
-    public Map getBuildResultsInSuccessByProjectGroupId( int projectGroupId )
+    public Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int
projectGroupId )
     {
         PersistenceManager pm = getPersistenceManager();
 
@@ -1740,7 +1740,7 @@
         return null;
     }
 
-    public Map getBuildResultsInSuccess()
+    public Map<Integer, BuildResult> getBuildResultsInSuccess()
     {
         return getBuildResultsInSuccessByProjectGroupId( -1 );
     }



Mime
View raw message