continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r233301 - /maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
Date Thu, 18 Aug 2005 08:32:16 GMT
Author: brett
Date: Thu Aug 18 01:32:10 2005
New Revision: 233301

URL: http://svn.apache.org/viewcvs?rev=233301&view=rev
Log:
use project state directly

Modified:
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java?rev=233301&r1=233300&r2=233301&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
Thu Aug 18 01:32:10 2005
@@ -17,7 +17,6 @@
  */
 
 import org.apache.maven.continuum.Continuum;
-import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.project.ContinuumProjectState;
@@ -39,34 +38,17 @@
 
     public String generate( Object item )
     {
-        int state = 0;
+        int state;
 
         if ( item instanceof Project )
         {
             Project project = (Project) item;
-
-            // TODO: can't we just use project.getState()?
-            try
-            {
-                BuildResult build = continuum.getLatestBuildResultForProject( project.getId()
);
-
-                if ( build == null )
-                {
-                    return "New";
-                }
-
-                state = build.getState();
-            }
-            catch ( ContinuumException e )
-            {
-                getLogger().warn( "Error while getting latest build for project '" + project.getId()
+ "'.", e );
-
-                return "Unknown";
-            }
+            state = project.getState();
         }
         else
         {
-            state = ( (BuildResult) item ).getState();
+            BuildResult buildResult = (BuildResult) item;
+            state = buildResult.getState();
         }
 
         if ( state == ContinuumProjectState.NEW )



Mime
View raw message