continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r164109 - /maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
Date Thu, 21 Apr 2005 19:46:43 GMT
Author: trygvis
Date: Thu Apr 21 12:46:42 2005
New Revision: 164109

URL: http://svn.apache.org/viewcvs?rev=164109&view=rev
Log:
o Supporting reading state from both projects and builds.

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

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java?rev=164109&r1=164108&r2=164109&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/codehaus/continuum/web/tool/ContinuumStateContentGenerator.java
Thu Apr 21 12:46:42 2005
@@ -5,6 +5,7 @@
 
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
+import org.apache.maven.continuum.project.ContinuumBuild;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -16,9 +17,16 @@
 {
     public String generate( Object item )
     {
-        ContinuumProject p = (ContinuumProject) item;
+        int state;
 
-        int state = p.getState();
+        if ( item instanceof ContinuumProject )
+        {
+            state = ( (ContinuumProject) item ).getState();
+        }
+        else
+        {
+            state = ( (ContinuumBuild) item ).getState();
+        }
 
         if ( state == ContinuumProjectState.NEW )
         {
@@ -46,7 +54,7 @@
         }
         else
         {
-            getLogger().warn( "Unknown project state '" + state + "' Project id '" + p.getId()
+ "'." );
+            getLogger().warn( "Unknown state '" + state + "'." );
 
             return "Unknown";
         }



Mime
View raw message