continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r765358 - in /continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/ continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/ continuum-...
Date Wed, 15 Apr 2009 21:03:30 GMT
Author: evenisse
Date: Wed Apr 15 21:03:29 2009
New Revision: 765358

URL: http://svn.apache.org/viewvc?rev=765358&view=rev
Log:
merge -r 764924:764925 from 1.3.x branch

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/FormatterTool.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
    continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
    continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
    continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
    continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
    continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
    continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
    continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/main/java/org/apache/maven/continuum/notification/wagon/WagonContinuumNotifier.java

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=765358&r1=765357&r2=765358&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
Wed Apr 15 21:03:29 2009
@@ -117,7 +117,7 @@
 public class DefaultContinuum
     implements Continuum, Initializable, Startable
 {
-    private Logger log = LoggerFactory.getLogger( DefaultContinuum.class );
+    private static final Logger log = LoggerFactory.getLogger( DefaultContinuum.class );
 
     /**
      * @plexus.requirement
@@ -840,7 +840,7 @@
     public void buildProjectGroup( int projectGroupId )
         throws ContinuumException
     {
-        List<BuildDefinition> groupDefaultBDs = null;
+        List<BuildDefinition> groupDefaultBDs;
 
         if ( !isAnyProjectInGroupInReleaseStage( projectGroupId ) )
         {
@@ -1647,7 +1647,7 @@
 
             for ( Project project : projects )
             {
-                context = new HashMap();
+                context = new HashMap<String, Object>();
 
                 // CONTINUUM-1953 olamy : attached buildDefs from template here
                 // if no group creation

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/FormatterTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/FormatterTool.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/FormatterTool.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/FormatterTool.java
Wed Apr 15 21:03:29 2009
@@ -32,7 +32,7 @@
 {
     private final String timestampFormatString;
 
-    private ThreadLocal<SimpleDateFormat> timestampFormat = new ThreadLocal<SimpleDateFormat>();
+    private final ThreadLocal<SimpleDateFormat> timestampFormat = new ThreadLocal<SimpleDateFormat>();
 
     public FormatterTool( String timestampFormatString )
     {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
Wed Apr 15 21:03:29 2009
@@ -43,7 +43,7 @@
 public class CheckOutTaskExecutor
     implements TaskExecutor
 {
-    private Logger log = LoggerFactory.getLogger( CheckOutTaskExecutor.class );
+    private static final Logger log = LoggerFactory.getLogger( CheckOutTaskExecutor.class
);
 
     /**
      * @plexus.requirement

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
Wed Apr 15 21:03:29 2009
@@ -51,8 +51,7 @@
 public class MailContinuumNotifierTest
     extends AbstractContinuumTest
 {
-
-    protected Logger logger = LoggerFactory.getLogger( getClass() );
+    protected static final Logger logger = LoggerFactory.getLogger( MailContinuumNotifierTest.class
);
 
     public void testSuccessfulBuild()
         throws Exception

Modified: continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
(original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
Wed Apr 15 21:03:29 2009
@@ -19,27 +19,27 @@
  * under the License.
  */
 
+import com.atlassian.xmlrpc.AuthenticationInfo;
+import com.atlassian.xmlrpc.Binder;
+import com.atlassian.xmlrpc.BindingException;
+import com.atlassian.xmlrpc.DefaultBinder;
+
 import java.net.URL;
 import java.util.Map;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.atlassian.xmlrpc.AuthenticationInfo;
-import com.atlassian.xmlrpc.Binder;
-import com.atlassian.xmlrpc.BindingException;
-import com.atlassian.xmlrpc.DefaultBinder;
-
 /**
  * MasterBuildAgentTransportClient
  */
 public class MasterBuildAgentTransportClient
     implements MasterBuildAgentTransportService
 {
-    private Logger log = LoggerFactory.getLogger( this.getClass() );
-    
+    private static final Logger log = LoggerFactory.getLogger( MasterBuildAgentTransportClient.class
);
+
     MasterBuildAgentTransportService master;
-    
+
     public MasterBuildAgentTransportClient( URL serviceUrl )
         throws Exception
     {
@@ -51,23 +51,27 @@
     {
         Binder binder = new DefaultBinder();
         AuthenticationInfo authnInfo = new AuthenticationInfo( login, password );
-        
+
         try
         {
             master = binder.bind( MasterBuildAgentTransportService.class, serviceUrl, authnInfo
);
         }
         catch ( BindingException e )
         {
-            log.error( "Can't bind service interface " + MasterBuildAgentTransportService.class.getName()
+ " to " + serviceUrl.toExternalForm() + " using " + authnInfo.getUsername() + ", " + authnInfo.getPassword(),
e );
-            throw new Exception( "Can't bind service interface " + MasterBuildAgentTransportService.class.getName()
+ " to " + serviceUrl.toExternalForm() + " using " + authnInfo.getUsername() + ", " + authnInfo.getPassword(),
e);
+            log.error( "Can't bind service interface " + MasterBuildAgentTransportService.class.getName()
+ " to " +
+                serviceUrl.toExternalForm() + " using " + authnInfo.getUsername() + ", "
+ authnInfo.getPassword(), e );
+            throw new Exception(
+                "Can't bind service interface " + MasterBuildAgentTransportService.class.getName()
+ " to " +
+                    serviceUrl.toExternalForm() + " using " + authnInfo.getUsername() + ",
" + authnInfo.getPassword(),
+                e );
         }
     }
 
     public Boolean returnBuildResult( Map buildResult )
         throws Exception
     {
-        Boolean result = null;
-        
+        Boolean result;
+
         try
         {
             result = master.returnBuildResult( buildResult );
@@ -76,55 +80,55 @@
         catch ( Exception e )
         {
             log.error( "Failed to return the build result.", e );
-            throw new Exception( "Failed to return the build result", e);
+            throw new Exception( "Failed to return the build result", e );
         }
-        
+
         return result;
     }
 
     public Boolean ping()
         throws Exception
     {
-        Boolean result = null;
-        
+        Boolean result;
+
         try
         {
             result = master.ping();
-            log.info( "Ping " + ( result.booleanValue() ? "ok" : "failed" ) );
+            log.info( "Ping " + ( result ? "ok" : "failed" ) );
         }
         catch ( Exception e )
         {
             log.info( "Ping error" );
             throw new Exception( "Ping error", e );
         }
-        
+
         return result;
     }
 
     public Boolean prepareBuildFinished( Map prepareBuildResult )
         throws Exception
     {
-        Boolean result = null;
-        
+        Boolean result;
+
         try
         {
             result = master.prepareBuildFinished( prepareBuildResult );
-            log.info(  "Prepare build finished." );
+            log.info( "Prepare build finished." );
         }
         catch ( Exception e )
         {
             log.error( "Failed to finish prepare build" );
             throw new Exception( "Failed to finish prepare build", e );
         }
-        
+
         return result;
     }
 
     public Boolean startProjectBuild( Integer projectId )
         throws Exception
     {
-        Boolean result = null;
-        
+        Boolean result;
+
         try
         {
             result = master.startProjectBuild( projectId );
@@ -142,7 +146,7 @@
     public Boolean startPrepareBuild( Map prepareBuildResult )
         throws Exception
     {
-        Boolean result = null;
+        Boolean result;
 
         try
         {
@@ -161,7 +165,7 @@
     public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType
)
         throws Exception
     {
-        Map<String, String> result = null;
+        Map<String, String> result;
         try
         {
             result = master.getEnvironments( buildDefinitionId, installationType );
@@ -179,7 +183,7 @@
     public Boolean updateProject( Map project )
         throws Exception
     {
-        Boolean result = null;
+        Boolean result;
 
         try
         {
@@ -198,7 +202,7 @@
     public Boolean shouldBuild( Map context )
         throws Exception
     {
-        Boolean result = null;
+        Boolean result;
 
         try
         {

Modified: continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
(original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
Wed Apr 15 21:03:29 2009
@@ -22,7 +22,6 @@
 import java.util.Map;
 
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
-import org.apache.continuum.distributed.transport.master.MasterBuildAgentTransportService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,9 +31,9 @@
 public class MasterBuildAgentTransportServer
     implements MasterBuildAgentTransportService
 {
-    private Logger log = LoggerFactory.getLogger( this.getClass() );
+    private static final Logger log = LoggerFactory.getLogger( MasterBuildAgentTransportServer.class
);
 
-    private DistributedBuildManager distributedBuildManager;
+    private final DistributedBuildManager distributedBuildManager;
 
     public MasterBuildAgentTransportServer( DistributedBuildManager distributedBuildManager
)
     {
@@ -53,7 +52,7 @@
         throws Exception
     {
         log.info( "Ping ok" );
-        
+
         return Boolean.TRUE;
     }
 
@@ -69,7 +68,7 @@
         throws Exception
     {
         log.info( "Start project build." );
-        distributedBuildManager.startProjectBuild( projectId.intValue() );
+        distributedBuildManager.startProjectBuild( projectId );
         return Boolean.TRUE;
     }
 

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
(original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
Wed Apr 15 21:03:29 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.util.List;
+
+import javax.annotation.Resource;
+
 import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
@@ -38,18 +42,14 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-
-import javax.annotation.Resource;
-
 public abstract class AbstractContinuumNotifier
     implements Notifier
 {
-    public static String ADDRESS_FIELD = "address";
+    public static final String ADDRESS_FIELD = "address";
 
-    public static String COMMITTER_FIELD = "committers";
+    public static final String COMMITTER_FIELD = "committers";
 
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( AbstractContinuumNotifier.class
);
 
     @Resource
     private ConfigurationService configurationService;
@@ -118,8 +118,8 @@
                     buf.append( "/" );
                 }
 
-                buf.append( "buildResult.action?buildId=" ).append( build.getId() ).append(
"&projectId=" )
-                    .append( project.getId() );
+                buf.append( "buildResult.action?buildId=" ).append( build.getId() ).append(
"&projectId=" ).append(
+                    project.getId() );
             }
 
             return buf.toString();
@@ -134,7 +134,7 @@
         }
     }
 
-    public String getReportUrl( ProjectGroup projectGroup, ProjectScmRoot projectScmRoot,

+    public String getReportUrl( ProjectGroup projectGroup, ProjectScmRoot projectScmRoot,
                                 ConfigurationService configurationService )
         throws ContinuumException
     {
@@ -144,20 +144,20 @@
             {
                 configurationService.reload();
             }
-    
+
             StringBuffer buf = new StringBuffer( configurationService.getUrl() );
-    
+
             if ( projectGroup != null && projectScmRoot != null )
             {
-                if ( !buf.toString().endsWith( "/" ) )                
+                if ( !buf.toString().endsWith( "/" ) )
                 {
                     buf.append( "/" );
                 }
 
-                buf.append( "scmResult.action?projectScmRootId=" ).append( projectScmRoot.getId()
)
-                   .append( "&projectGroupId=" ).append( projectGroup.getId() );
+                buf.append( "scmResult.action?projectScmRootId=" ).append( projectScmRoot.getId()
).append(
+                    "&projectGroupId=" ).append( projectGroup.getId() );
             }
-    
+
             return buf.toString();
         }
         catch ( ConfigurationLoadingException e )
@@ -169,7 +169,7 @@
             throw new ContinuumException( "Can't obtain the base url from configuration.",
e );
         }
     }
-    
+
     /**
      * Determine if message must be sent
      *
@@ -223,12 +223,8 @@
                 return projectNotifier.isSendOnSuccess();
             }
 
-            if ( build.getState() == ContinuumProjectState.WARNING )
-            {
-                return projectNotifier.isSendOnWarning();
-            }
+            return build.getState() != ContinuumProjectState.WARNING || projectNotifier.isSendOnWarning();
 
-            return true;
         }
 
         // Send if the state has changed
@@ -255,12 +251,8 @@
                 return projectNotifier.isSendOnSuccess();
             }
 
-            if ( build.getState() == ContinuumProjectState.WARNING )
-            {
-                return projectNotifier.isSendOnWarning();
-            }
+            return build.getState() != ContinuumProjectState.WARNING || projectNotifier.isSendOnWarning();
 
-            return true;
         }
 
         log.info( "Same state, not sending message." );
@@ -275,25 +267,12 @@
             projectNotifier = new ProjectNotifier();
         }
 
-        if ( projectScmRoot == null )
-        {
-            return false;
-        }
-
-        if ( alwaysSend )
-        {
-            return true;
-        }
+        return projectScmRoot != null && ( alwaysSend ||
+            projectScmRoot.getState() == ContinuumProjectState.ERROR && projectNotifier.isSendOnScmFailure()
&&
+                projectScmRoot.getOldState() != projectScmRoot.getState() );
 
-        if ( projectScmRoot.getState() == ContinuumProjectState.ERROR && projectNotifier.isSendOnScmFailure()
-             && projectScmRoot.getOldState() != projectScmRoot.getState() )
-        {
-            return true;
-        }
-
-        return false;
     }
-    
+
     protected BuildResult getPreviousBuild( Project project, BuildDefinition buildDef, BuildResult
currentBuild )
         throws NotificationException
     {
@@ -352,19 +331,19 @@
             throw new NotificationException( "Unable to obtain project builds", e );
         }
     }
-    
+
     protected String generateMessage( Project project, BuildResult build, ConfigurationService
configurationService )
         throws NotificationException
     {
         int state = project.getState();
-    
+
         if ( build != null )
         {
             state = build.getState();
         }
-    
+
         String message;
-    
+
         if ( state == ContinuumProjectState.OK )
         {
             message = "BUILD SUCCESSFUL: " + project.getName();
@@ -380,10 +359,10 @@
         else
         {
             log.warn( "Unknown build state " + state + " for project " + project.getId()
);
-    
+
             message = "ERROR: Unknown build state " + state + " for " + project.getName()
+ " project";
         }
-    
+
         try
         {
             return message + " " + getReportUrl( project, build, configurationService );
@@ -393,15 +372,15 @@
             throw new NotificationException( "Cannot generate message", e );
         }
     }
-    
+
     protected String generateMessage( ProjectScmRoot projectScmRoot, ConfigurationService
configurationService )
         throws NotificationException
     {
         int state = projectScmRoot.getState();
         String scmRootAddress = projectScmRoot.getScmRootAddress();
-    
+
         String message;
-    
+
         if ( state == ContinuumProjectState.UPDATED )
         {
             message = "PREPARE BUILD SUCCESSFUL: " + scmRootAddress;
@@ -413,13 +392,14 @@
         else
         {
             log.warn( "Unknown prepare build state " + state + " for SCM root URL " + scmRootAddress
);
-    
+
             message = "ERROR: Unknown prepare build state " + state + " for SCM root URL"
+ scmRootAddress;
         }
-    
+
         try
         {
-            return message + " " + getReportUrl( projectScmRoot.getProjectGroup(), projectScmRoot,
configurationService );
+            return message + " " +
+                getReportUrl( projectScmRoot.getProjectGroup(), projectScmRoot, configurationService
);
         }
         catch ( ContinuumException e )
         {

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
(original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Wed Apr 15 21:03:29 2009
@@ -62,7 +62,7 @@
     extends AbstractContinuumNotifier
     implements Disposable
 {
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( IrcContinuumNotifier.class
);
 
     // ----------------------------------------------------------------------
     // Requirements

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
(original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-jabber/src/main/java/org/apache/maven/continuum/notification/jabber/JabberContinuumNotifier.java
Wed Apr 15 21:03:29 2009
@@ -19,6 +19,12 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -36,12 +42,6 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Resource;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -50,7 +50,7 @@
 public class JabberContinuumNotifier
     extends AbstractContinuumNotifier
 {
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( JabberContinuumNotifier.class
);
 
     // ----------------------------------------------------------------------
     // Requirements
@@ -115,7 +115,7 @@
         BuildResult build = context.getBuildResult();
         ProjectScmRoot projectScmRoot = context.getProjectScmRoot();
 
-        boolean isPrepareBuildComplete = 
+        boolean isPrepareBuildComplete =
             messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_PREPARE_BUILD_COMPLETE
);
 
         if ( projectScmRoot == null && isPrepareBuildComplete )
@@ -204,7 +204,7 @@
 
         sendMessage( notifier.getConfiguration(), generateMessage( projectScmRoot, configurationService
) );
     }
-    
+
     private void sendMessage( Map<String, String> configuration, String message )
         throws NotificationException
     {
@@ -226,9 +226,9 @@
 
             jabberClient.logon();
 
-            if ( configuration != null && StringUtils.isNotEmpty( (String) configuration.get(
ADDRESS_FIELD ) ) )
+            if ( configuration != null && StringUtils.isNotEmpty( configuration.get(
ADDRESS_FIELD ) ) )
             {
-                String address = (String) configuration.get( ADDRESS_FIELD );
+                String address = configuration.get( ADDRESS_FIELD );
                 String[] recipients = StringUtils.split( address, "," );
                 for ( String recipient : recipients )
                 {

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
(original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-msn/src/main/java/org/apache/maven/continuum/notification/msn/MsnContinuumNotifier.java
Wed Apr 15 21:03:29 2009
@@ -19,6 +19,12 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -36,12 +42,6 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Resource;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -50,7 +50,7 @@
 public class MsnContinuumNotifier
     extends AbstractContinuumNotifier
 {
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( MsnContinuumNotifier.class
);
 
     // ----------------------------------------------------------------------
     // Requirements
@@ -102,7 +102,7 @@
 
         ProjectScmRoot projectScmRoot = context.getProjectScmRoot();
 
-        boolean isPrepareBuildComplete = 
+        boolean isPrepareBuildComplete =
             messageId.equals( ContinuumNotificationDispatcher.MESSAGE_ID_PREPARE_BUILD_COMPLETE
);
 
         if ( projectScmRoot == null && isPrepareBuildComplete )
@@ -202,9 +202,9 @@
         {
             msnClient.login();
 
-            if ( configuration != null && StringUtils.isNotEmpty( (String) configuration.get(
ADDRESS_FIELD ) ) )
+            if ( configuration != null && StringUtils.isNotEmpty( configuration.get(
ADDRESS_FIELD ) ) )
             {
-                String address = (String) configuration.get( ADDRESS_FIELD );
+                String address = configuration.get( ADDRESS_FIELD );
                 String[] recipients = StringUtils.split( address, "," );
                 for ( String recipient : recipients )
                 {

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/main/java/org/apache/maven/continuum/notification/wagon/WagonContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/main/java/org/apache/maven/continuum/notification/wagon/WagonContinuumNotifier.java?rev=765358&r1=765357&r2=765358&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/main/java/org/apache/maven/continuum/notification/wagon/WagonContinuumNotifier.java
(original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-wagon/src/main/java/org/apache/maven/continuum/notification/wagon/WagonContinuumNotifier.java
Wed Apr 15 21:03:29 2009
@@ -19,6 +19,13 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
 import org.apache.maven.artifact.manager.WagonManager;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
@@ -69,13 +76,6 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Resource;
-
 /**
  * @author <a href="mailto:hisidro@exist.com">Henry Isidro</a>
  * @author <a href="mailto:nramirez@exist.com">Napoleon Esmundo C. Ramirez</a>
@@ -87,9 +87,7 @@
 {
     public static final String BUILD_OUTPUT_FILE_NAME = "buildresult.txt";
 
-    private static final String CONTEXT_MAVEN_PROJECT = "CONTEXT_MAVEN_PROJECT";
-
-    private Logger log = LoggerFactory.getLogger( getClass() );
+    private static final Logger log = LoggerFactory.getLogger( WagonContinuumNotifier.class
);
 
     @Resource
     private ConfigurationService configurationService;



Mime
View raw message