You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by jz...@apache.org on 2009/04/20 09:03:38 UTC

svn commit: r766597 - in /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: CancelBuildAction.java ScheduleAction.java

Author: jzurbano
Date: Mon Apr 20 07:03:37 2009
New Revision: 766597

URL: http://svn.apache.org/viewvc?rev=766597&view=rev
Log:
removed duplicate execution

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=766597&r1=766596&r2=766597&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java Mon Apr 20 07:03:37 2009
@@ -109,10 +109,8 @@
             int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
             if ( index > 0 )
             {
-                getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
-
                 int projId = projectsId[index];
-                getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
+                getContinuum().getBuildsManager().cancelBuild( projId );
                 
                 AuditLog event = new AuditLog( "Project id=" + projId, AuditLogConstants.CANCEL_BUILD );
                 event.setCategory( AuditLogConstants.PROJECT );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=766597&r1=766596&r2=766597&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java Mon Apr 20 07:03:37 2009
@@ -240,15 +240,16 @@
                 logger.debug( "Unexpected error getting schedule" );
             }
         }
-        AuditLog event = null;
+        
+        AuditLog event = new AuditLog( getName(), AuditLogConstants.ADD_SCHEDULE );
+        event.setCategory( AuditLogConstants.SCHEDULE );
+        event.setCurrentUser( getPrincipal() );
+        
         if ( id == 0 )
         {
             try
             {
                 getContinuum().addSchedule( setFields( new Schedule() ) );
-                event = new AuditLog( getName(), AuditLogConstants.ADD_SCHEDULE );
-                event.setCategory( AuditLogConstants.SCHEDULE );
-                event.setCurrentUser( getPrincipal() );
                 event.log();
             }
             catch ( ContinuumException e )
@@ -263,9 +264,7 @@
             try
             {
                 getContinuum().updateSchedule( setFields( getContinuum().getSchedule( id ) ) );
-                event = new AuditLog( getName(), AuditLogConstants.MODIFY_SCHEDULE );
-                event.setCategory( AuditLogConstants.SCHEDULE );
-                event.setCurrentUser( getPrincipal() );
+                event.setAction( AuditLogConstants.MODIFY_SCHEDULE );
                 event.log();
             }
             catch ( ContinuumException e )



Re: svn commit: r766597 - in /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: CancelBuildAction.java ScheduleAction.java

Posted by Brett Porter <br...@apache.org>.
On 20/04/2009, at 5:35 PM, Jevica Arianne B. Zurbano wrote:

> Brett, this is related to the audit logs (continuum-1853) that I  
> have modified, missed these changes when I converted the logging to  
> use MDC.

If you want to change the issue comment to include that issue #, you  
can use:

svn pe svn:log --revprop -r 766597

But the comment looks like it's the removal of the duplicate call to  
cancel and the second class is the change for the logging. Is that  
correct, or is the cancel change related to that too?

- Brett


Re: svn commit: r766597 - in /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: CancelBuildAction.java ScheduleAction.java

Posted by "Jevica Arianne B. Zurbano" <jz...@g2ix.com>.
Brett, this is related to the audit logs (continuum-1853) that I have 
modified, missed these changes when I converted the logging to use MDC.


Brett Porter wrote:
> On 20/04/2009, at 5:03 PM, jzurbano@apache.org wrote:
>
>> Author: jzurbano
>> Date: Mon Apr 20 07:03:37 2009
>> New Revision: 766597
>>
>> URL: http://svn.apache.org/viewvc?rev=766597&view=rev
>> Log:
>> removed duplicate execution
>
> This seems like two different commits... and should they be attached 
> to a JIRA issue?
>
>>
>> Modified:
>>    
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java 
>>
>>    
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java 
>>
>>
>> Modified: 
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=766597&r1=766596&r2=766597&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java 
>> (original)
>> +++ 
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java 
>> Mon Apr 20 07:03:37 2009
>> @@ -109,10 +109,8 @@
>>             int index = ArrayUtils.indexOf( projectsId, 
>> getCurrentProjectIdBuilding() );
>>             if ( index > 0 )
>>             {
>> -                getContinuum().getBuildsManager().cancelBuild( 
>> projectsId[index] );
>> -
>>                 int projId = projectsId[index];
>> -                getContinuum().getBuildsManager().cancelBuild( 
>> projectsId[index] );
>> +                getContinuum().getBuildsManager().cancelBuild( 
>> projId );
>>
>>                 AuditLog event = new AuditLog( "Project id=" + 
>> projId, AuditLogConstants.CANCEL_BUILD );
>>                 event.setCategory( AuditLogConstants.PROJECT );
>>
>> Modified: 
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=766597&r1=766596&r2=766597&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java 
>> (original)
>> +++ 
>> continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java 
>> Mon Apr 20 07:03:37 2009
>> @@ -240,15 +240,16 @@
>>                 logger.debug( "Unexpected error getting schedule" );
>>             }
>>         }
>> -        AuditLog event = null;
>> +
>> +        AuditLog event = new AuditLog( getName(), 
>> AuditLogConstants.ADD_SCHEDULE );
>> +        event.setCategory( AuditLogConstants.SCHEDULE );
>> +        event.setCurrentUser( getPrincipal() );
>> +
>>         if ( id == 0 )
>>         {
>>             try
>>             {
>>                 getContinuum().addSchedule( setFields( new Schedule() 
>> ) );
>> -                event = new AuditLog( getName(), 
>> AuditLogConstants.ADD_SCHEDULE );
>> -                event.setCategory( AuditLogConstants.SCHEDULE );
>> -                event.setCurrentUser( getPrincipal() );
>>                 event.log();
>>             }
>>             catch ( ContinuumException e )
>> @@ -263,9 +264,7 @@
>>             try
>>             {
>>                 getContinuum().updateSchedule( setFields( 
>> getContinuum().getSchedule( id ) ) );
>> -                event = new AuditLog( getName(), 
>> AuditLogConstants.MODIFY_SCHEDULE );
>> -                event.setCategory( AuditLogConstants.SCHEDULE );
>> -                event.setCurrentUser( getPrincipal() );
>> +                event.setAction( AuditLogConstants.MODIFY_SCHEDULE );
>>                 event.log();
>>             }
>>             catch ( ContinuumException e )
>>
>>
>
>
>

-- 

Thanks,

Jev


Re: svn commit: r766597 - in /continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: CancelBuildAction.java ScheduleAction.java

Posted by Brett Porter <br...@apache.org>.
On 20/04/2009, at 5:03 PM, jzurbano@apache.org wrote:

> Author: jzurbano
> Date: Mon Apr 20 07:03:37 2009
> New Revision: 766597
>
> URL: http://svn.apache.org/viewvc?rev=766597&view=rev
> Log:
> removed duplicate execution

This seems like two different commits... and should they be attached  
to a JIRA issue?

>
> Modified:
>    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/ 
> continuum/web/action/CancelBuildAction.java
>    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/ 
> continuum/web/action/ScheduleAction.java
>
> Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/ 
> maven/continuum/web/action/CancelBuildAction.java
> URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=766597&r1=766596&r2=766597&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/ 
> continuum/web/action/CancelBuildAction.java (original)
> +++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/ 
> continuum/web/action/CancelBuildAction.java Mon Apr 20 07:03:37 2009
> @@ -109,10 +109,8 @@
>             int index = ArrayUtils.indexOf( projectsId,  
> getCurrentProjectIdBuilding() );
>             if ( index > 0 )
>             {
> -                 
> getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
> -
>                 int projId = projectsId[index];
> -                 
> getContinuum().getBuildsManager().cancelBuild( projectsId[index] );
> +                 
> getContinuum().getBuildsManager().cancelBuild( projId );
>
>                 AuditLog event = new AuditLog( "Project id=" +  
> projId, AuditLogConstants.CANCEL_BUILD );
>                 event.setCategory( AuditLogConstants.PROJECT );
>
> Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/ 
> maven/continuum/web/action/ScheduleAction.java
> URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?rev=766597&r1=766596&r2=766597&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/ 
> continuum/web/action/ScheduleAction.java (original)
> +++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/ 
> continuum/web/action/ScheduleAction.java Mon Apr 20 07:03:37 2009
> @@ -240,15 +240,16 @@
>                 logger.debug( "Unexpected error getting schedule" );
>             }
>         }
> -        AuditLog event = null;
> +
> +        AuditLog event = new AuditLog( getName(),  
> AuditLogConstants.ADD_SCHEDULE );
> +        event.setCategory( AuditLogConstants.SCHEDULE );
> +        event.setCurrentUser( getPrincipal() );
> +
>         if ( id == 0 )
>         {
>             try
>             {
>                 getContinuum().addSchedule( setFields( new  
> Schedule() ) );
> -                event = new AuditLog( getName(),  
> AuditLogConstants.ADD_SCHEDULE );
> -                event.setCategory( AuditLogConstants.SCHEDULE );
> -                event.setCurrentUser( getPrincipal() );
>                 event.log();
>             }
>             catch ( ContinuumException e )
> @@ -263,9 +264,7 @@
>             try
>             {
>                  
> getContinuum 
> ().updateSchedule( setFields( getContinuum().getSchedule( id ) ) );
> -                event = new AuditLog( getName(),  
> AuditLogConstants.MODIFY_SCHEDULE );
> -                event.setCategory( AuditLogConstants.SCHEDULE );
> -                event.setCurrentUser( getPrincipal() );
> +                event.setAction( AuditLogConstants.MODIFY_SCHEDULE );
>                 event.log();
>             }
>             catch ( ContinuumException e )
>
>