maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r685710 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev: ./ commands/add/ commands/checkout/
Date Wed, 13 Aug 2008 22:27:31 GMT
Author: olamy
Date: Wed Aug 13 15:27:31 2008
New Revision: 685710

URL: http://svn.apache.org/viewvc?rev=685710&view=rev
Log:
fix checkstyle issues

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AccuRevAddCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AddCommandStreamConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java?rev=685710&r1=685709&r2=685710&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.java
Wed Aug 13 15:27:31 2008
@@ -41,166 +41,200 @@
  * @version $Id$
  * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="accurev"
  */
-public class AccuRevScmProvider extends AbstractScmProvider {
+public class AccuRevScmProvider
+    extends AbstractScmProvider
+{
     private final String accurevExecutable;
 
     private AccuRevAddCommand addCommand;
+
     private AccuRevLoginCommand loginCommand;
+
     private BaseAccuRevCheckOutCommand[] checkOutCommands;
 
     private static final String CHECKOUT_METHOD_PARAM_NAME = "checkoutMethod";
+
     private static final String CHECKOUT_METHOD_SYS_PROPERTY = "accurev.checkout.method";
 
-    public AccuRevScmProvider() {
-        boolean isWindows = System.getProperty("os.name").toLowerCase()
-                .indexOf("windows") != -1;
-        this.accurevExecutable = resolveAccurevExecutable(isWindows);
+    public AccuRevScmProvider()
+    {
+        boolean isWindows = System.getProperty( "os.name" ).toLowerCase().indexOf( "windows"
) != -1;
+        this.accurevExecutable = resolveAccurevExecutable( isWindows );
     }
 
     /** {@inheritDoc} */
-    public String getScmType() {
+    public String getScmType()
+    {
         return "accurev";
     }
 
-    protected String getAccurevExecutable() {
+    protected String getAccurevExecutable()
+    {
         return this.accurevExecutable;
     }
 
     /** {@inheritDoc} */
-    public ScmProviderRepository makeProviderScmRepository(String scmSpecificUrl, char delimiter)
-            throws ScmRepositoryException {
+    public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter
)
+        throws ScmRepositoryException
+    {
         AccuRevScmProviderRepository rep = new AccuRevScmProviderRepository();
 
-        int atSignIdx = scmSpecificUrl.indexOf('@');
-        if (atSignIdx != -1) {
+        int atSignIdx = scmSpecificUrl.indexOf( '@' );
+        if ( atSignIdx != -1 )
+        {
             //User, password, host and port are specified
-            String beforeAt = scmSpecificUrl.substring(0, atSignIdx);
-            String afterAt = scmSpecificUrl.substring(atSignIdx + 1);
+            String beforeAt = scmSpecificUrl.substring( 0, atSignIdx );
+            String afterAt = scmSpecificUrl.substring( atSignIdx + 1 );
 
-            LinkedList parts = splitString(beforeAt, delimiter, true);
-            if (parts.isEmpty()) {
-                throw new ScmRepositoryException("Username is required");
+            LinkedList parts = splitString( beforeAt, delimiter, true );
+            if ( parts.isEmpty() )
+            {
+                throw new ScmRepositoryException( "Username is required" );
             }
-            rep.setUser((String) parts.removeFirst());
-            if (!parts.isEmpty()) {
-                rep.setPassword((String) parts.removeFirst());
+            rep.setUser( (String) parts.removeFirst() );
+            if ( !parts.isEmpty() )
+            {
+                rep.setPassword( (String) parts.removeFirst() );
             }
-            int hostEndIdx = afterAt.indexOf(delimiter);
-            if (hostEndIdx == -1) {
-                throw new ScmRepositoryException("Invalid SCM URL");
+            int hostEndIdx = afterAt.indexOf( delimiter );
+            if ( hostEndIdx == -1 )
+            {
+                throw new ScmRepositoryException( "Invalid SCM URL" );
             }
-            String host = afterAt.substring(0, hostEndIdx);
-            rep.setHost(host);
+            String host = afterAt.substring( 0, hostEndIdx );
+            rep.setHost( host );
 
-            int idx = afterAt.indexOf(delimiter, hostEndIdx + 1);
-            if (idx == -1) {
-                throw new ScmRepositoryException("Invalid SCM URL");
+            int idx = afterAt.indexOf( delimiter, hostEndIdx + 1 );
+            if ( idx == -1 )
+            {
+                throw new ScmRepositoryException( "Invalid SCM URL" );
+            }
+            String eitherPortOrNextToken = afterAt.substring( hostEndIdx + 1, idx );
+            try
+            {
+                rep.setPort( Integer.parseInt( eitherPortOrNextToken ) );
             }
-            String eitherPortOrNextToken = afterAt.substring(hostEndIdx + 1, idx);
-            try {
-                rep.setPort(Integer.parseInt(eitherPortOrNextToken));
-            } catch (NumberFormatException e) {
+            catch ( NumberFormatException e )
+            {
                 idx = hostEndIdx;
             }
-            scmSpecificUrl = afterAt.substring(idx + 1);
+            scmSpecificUrl = afterAt.substring( idx + 1 );
         }
-        int paramStartIdx = scmSpecificUrl.indexOf('?');
-        if (paramStartIdx != -1) {
-            String params = scmSpecificUrl.substring(paramStartIdx + 1);
-            scmSpecificUrl = scmSpecificUrl.substring(0, paramStartIdx);
-            processParams(params, rep);
+        int paramStartIdx = scmSpecificUrl.indexOf( '?' );
+        if ( paramStartIdx != -1 )
+        {
+            String params = scmSpecificUrl.substring( paramStartIdx + 1 );
+            scmSpecificUrl = scmSpecificUrl.substring( 0, paramStartIdx );
+            processParams( params, rep );
 
         }
-        processDepotStreamAndWorkspace(scmSpecificUrl, delimiter, rep);
+        processDepotStreamAndWorkspace( scmSpecificUrl, delimiter, rep );
 
-        String checkoutMethodParam = (String) rep.getParams().get(CHECKOUT_METHOD_PARAM_NAME);
-        if (StringUtils.isNotEmpty(checkoutMethodParam)) {
+        String checkoutMethodParam = (String) rep.getParams().get( CHECKOUT_METHOD_PARAM_NAME
);
+        if ( StringUtils.isNotEmpty( checkoutMethodParam ) )
+        {
             //Set checkout method from the SCM URL parameter
-            rep.setCheckoutMethod(checkoutMethodParam.trim());
+            rep.setCheckoutMethod( checkoutMethodParam.trim() );
         }
-        if (rep.getCheckoutMethod() == null) {
+        if ( rep.getCheckoutMethod() == null )
+        {
             //Get from system property or use "pop" by default
-            rep.setCheckoutMethod(System.getProperty(CHECKOUT_METHOD_SYS_PROPERTY, "pop"));
+            rep.setCheckoutMethod( System.getProperty( CHECKOUT_METHOD_SYS_PROPERTY, "pop"
) );
         }
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Repository created: " + rep.toString());
+        if ( getLogger().isDebugEnabled() )
+        {
+            getLogger().debug( "Repository created: " + rep.toString() );
         }
         return rep;
     }
 
-    private void processParams(String params, AccuRevScmProviderRepository rep) {
+    private void processParams( String params, AccuRevScmProviderRepository rep )
+    {
         //Parse params
-        String[] paramKeyValuePairs = StringUtils.split(params, "&");
-        for (int i = 0; i < paramKeyValuePairs.length; i++) {
+        String[] paramKeyValuePairs = StringUtils.split( params, "&" );
+        for ( int i = 0; i < paramKeyValuePairs.length; i++ )
+        {
             String keyValuePair = paramKeyValuePairs[i];
-            int delimiterIdx = keyValuePair.indexOf('=');
-            if (delimiterIdx == -1) {
-                getLogger().warn("Invalid parameter \"" + keyValuePair + "\" at position
" + i);
+            int delimiterIdx = keyValuePair.indexOf( '=' );
+            if ( delimiterIdx == -1 )
+            {
+                getLogger().warn( "Invalid parameter \"" + keyValuePair + "\" at position
" + i );
                 continue;
             }
-            String key = keyValuePair.substring(0, delimiterIdx);
-            String value = keyValuePair.substring(delimiterIdx + 1);
+            String key = keyValuePair.substring( 0, delimiterIdx );
+            String value = keyValuePair.substring( delimiterIdx + 1 );
             //Store parameter
-            rep.getParams().put(key, value);
+            rep.getParams().put( key, value );
         }
     }
 
-
     /**
      * @see AbstractScmProvider#login(ScmProviderRepository, ScmFileSet, CommandParameters)
      */
-    protected LoginScmResult login(ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters)
-            throws ScmException {
-        if (null == this.loginCommand) { //Lazy command instantiation
-            this.loginCommand = new AccuRevLoginCommand(this.accurevExecutable);
-            this.loginCommand.setLogger(getLogger());
+    protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
+        throws ScmException
+    {
+        if ( null == this.loginCommand )
+        { //Lazy command instantiation
+            this.loginCommand = new AccuRevLoginCommand( this.accurevExecutable );
+            this.loginCommand.setLogger( getLogger() );
         }
-        return (LoginScmResult) this.loginCommand.execute(repository, fileSet, parameters);
+        return (LoginScmResult) this.loginCommand.execute( repository, fileSet, parameters
);
     }
 
     /**
      * @see AbstractScmProvider#checkout(ScmProviderRepository, ScmFileSet, CommandParameters)
      */
-    protected CheckOutScmResult checkout(ScmProviderRepository repository, ScmFileSet fileSet,
-                                         CommandParameters parameters) throws ScmException
{
+    protected CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
+                                          CommandParameters parameters )
+        throws ScmException
+    {
 
         AccuRevScmProviderRepository rep = (AccuRevScmProviderRepository) repository;
-        getLogger().debug("accurev.checkout.method = " + rep.getCheckoutMethod());
+        getLogger().debug( "accurev.checkout.method = " + rep.getCheckoutMethod() );
         BaseAccuRevCheckOutCommand[] checkOutCmds = getCheckoutCommands();
         //Find check-out command that supports specified method
-        for (int i = 0; i < checkOutCmds.length; i++) {
+        for ( int i = 0; i < checkOutCmds.length; i++ )
+        {
             BaseAccuRevCheckOutCommand checkOutCommand = checkOutCmds[i];
-            if (checkOutCommand.getMethodName().equalsIgnoreCase(rep.getCheckoutMethod()))
{
-                return (CheckOutScmResult) checkOutCommand.execute(repository, fileSet, parameters);
+            if ( checkOutCommand.getMethodName().equalsIgnoreCase( rep.getCheckoutMethod()
) )
+            {
+                return (CheckOutScmResult) checkOutCommand.execute( repository, fileSet,
parameters );
             }
         }
-        throw new ScmRepositoryException("accurev.checkout.method=" + rep.getCheckoutMethod()
+ " is not supported");
+        throw new ScmRepositoryException( "accurev.checkout.method=" + rep.getCheckoutMethod()
+ " is not supported" );
     }
 
-    protected AddScmResult add(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters) throws ScmException {
+    protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
         //Lazy command creation
-        if (null == addCommand) {
-            addCommand = new AccuRevAddCommand(this.accurevExecutable);
-            addCommand.setLogger(getLogger());
-        }
-        return (AddScmResult) addCommand.execute(repository, fileSet, parameters);
+        if ( null == addCommand )
+        {
+            addCommand = new AccuRevAddCommand( this.accurevExecutable );
+            addCommand.setLogger( getLogger() );
+        }
+        return (AddScmResult) addCommand.execute( repository, fileSet, parameters );
     }
 
-    private BaseAccuRevCheckOutCommand[] getCheckoutCommands() {
-        if (null == this.checkOutCommands) { //Lazy command instantiation
+    private BaseAccuRevCheckOutCommand[] getCheckoutCommands()
+    {
+        if ( null == this.checkOutCommands )
+        { //Lazy command instantiation
             this.checkOutCommands = buildCheckOutCommands();
         }
         return this.checkOutCommands;
     }
 
-    protected BaseAccuRevCheckOutCommand[] buildCheckOutCommands() {
+    protected BaseAccuRevCheckOutCommand[] buildCheckOutCommands()
+    {
         BaseAccuRevCheckOutCommand[] commands = {
-                new AccuRevCheckOutUsingPopCommand(this.accurevExecutable),
-                new AccuRevCheckOutWorkspaceCommand(this.accurevExecutable)
-        };
-        for (int i = 0; i < commands.length; i++) {
+            new AccuRevCheckOutUsingPopCommand( this.accurevExecutable ),
+            new AccuRevCheckOutWorkspaceCommand( this.accurevExecutable ) };
+        for ( int i = 0; i < commands.length; i++ )
+        {
             BaseAccuRevCheckOutCommand command = commands[i];
-            command.setLogger(getLogger());
+            command.setLogger( getLogger() );
         }
         return commands;
     }
@@ -211,10 +245,12 @@
      * @param repository AccuRevScmProviderRepository
      * @param params     Parameters
      */
-    public static void appendHostToParamsIfNeeded(AccuRevScmProviderRepository repository,
List params) {
-        if (repository.getHost() != null) {
-            params.add("-H");
-            params.add(repository.getHost() + ":" + String.valueOf(repository.getPort()));
+    public static void appendHostToParamsIfNeeded( AccuRevScmProviderRepository repository,
List params )
+    {
+        if ( repository.getHost() != null )
+        {
+            params.add( "-H" );
+            params.add( repository.getHost() + ":" + String.valueOf( repository.getPort()
) );
         }
     }
 
@@ -225,15 +261,18 @@
      * @return AccuRev executable
      * @throws IllegalStateException If the executable cannot be resolved
      */
-    private static String resolveAccurevExecutable(boolean windows) {
+    private static String resolveAccurevExecutable( boolean windows )
+    {
         String executable = "accurev";
         //Append ".exe" suffix if the OS is Windows
-        if (windows) {
+        if ( windows )
+        {
             executable += ".exe";
         }
         //Grab exeucutable from system variable if specified
-        String accurevExecutable = System.getProperty("accurevExecutable");
-        if (accurevExecutable != null) {
+        String accurevExecutable = System.getProperty( "accurevExecutable" );
+        if ( accurevExecutable != null )
+        {
             executable = accurevExecutable;
         }
         return executable;
@@ -247,14 +286,16 @@
      * @param blankIsNull   If the parameter is true then if the substring is blank then
it will be considered as null
      * @return Linked list which contains strings
      */
-    private static LinkedList splitString(String string, char separatorChar, boolean blankIsNull)
{
+    private static LinkedList splitString( String string, char separatorChar, boolean blankIsNull
)
+    {
         LinkedList parts = new LinkedList();
         int fromIdx = 0;
-        for (int idx; (idx = string.indexOf(separatorChar, fromIdx)) != -1; fromIdx = ++idx)
{
-            parts.add(getSubstring(string, fromIdx, idx, blankIsNull));
+        for ( int idx; ( idx = string.indexOf( separatorChar, fromIdx ) ) != -1; fromIdx
= ++idx )
+        {
+            parts.add( getSubstring( string, fromIdx, idx, blankIsNull ) );
         }
         //Add last token
-        parts.add(getSubstring(string, fromIdx, string.length(), blankIsNull));
+        parts.add( getSubstring( string, fromIdx, string.length(), blankIsNull ) );
         return parts;
     }
 
@@ -269,9 +310,10 @@
      * @see String#substring(int,int)
      * @see StringUtils#isBlank(String)
      */
-    private static String getSubstring(String string, int fromIdx, int toIdx, boolean blankIsNull)
{
-        String substring = string.substring(fromIdx, toIdx);
-        return (blankIsNull && StringUtils.isEmpty(substring)) ? null : substring;
+    private static String getSubstring( String string, int fromIdx, int toIdx, boolean blankIsNull
)
+    {
+        String substring = string.substring( fromIdx, toIdx );
+        return ( blankIsNull && StringUtils.isEmpty( substring ) ) ? null : substring;
     }
 
     /**
@@ -282,35 +324,44 @@
      * @param repRef               AccuRevScmProviderRepository reference where the information
will be stored
      * @throws ScmRepositoryException If there was a validation error while processing the
URL
      */
-    private void processDepotStreamAndWorkspace(final String depotStreamWorkspace,
-                                                final char delimeter,
-                                                final AccuRevScmProviderRepository repRef)
-            throws ScmRepositoryException {
-        LinkedList parts = splitString(depotStreamWorkspace, delimeter, true);
-        if (parts.size() < 2) {
-            throw new ScmRepositoryException("Invalid scmUrl. Depot and stream names are
required");
+    private void processDepotStreamAndWorkspace( final String depotStreamWorkspace, final
char delimeter,
+                                                 final AccuRevScmProviderRepository repRef
)
+        throws ScmRepositoryException
+    {
+        LinkedList parts = splitString( depotStreamWorkspace, delimeter, true );
+        if ( parts.size() < 2 )
+        {
+            throw new ScmRepositoryException( "Invalid scmUrl. Depot and stream names are
required" );
         }
         //Set depot
         String depot = (String) parts.removeFirst();
-        if (null == depot) throw new ScmRepositoryException("Depot name is missing");
-        repRef.setDepot(depot);
+        if ( null == depot )
+        {
+            throw new ScmRepositoryException( "Depot name is missing" );
+        }
+        repRef.setDepot( depot );
 
         //Set stream
         String streamName = (String) parts.removeFirst();
-        if (null == streamName) throw new ScmRepositoryException("Stream name is missing");
-        repRef.setStreamName(streamName);
+        if ( null == streamName )
+        {
+            throw new ScmRepositoryException( "Stream name is missing" );
+        }
+        repRef.setStreamName( streamName );
 
         //Set workspace if specified
-        if (!parts.isEmpty()) {
-            repRef.setWorkspaceName((String) parts.removeFirst());
+        if ( !parts.isEmpty() )
+        {
+            repRef.setWorkspaceName( (String) parts.removeFirst() );
         }
 
-        if (!parts.isEmpty()) {
-            throw new ScmRepositoryException("Invalid workspace assosiation path: " +
-                    depotStreamWorkspace + ". Should be in format \"<depot>" + delimeter
+
-                    "<stream>" + delimeter + "<workspace>\"");
+        if ( !parts.isEmpty() )
+        {
+            throw new ScmRepositoryException( "Invalid workspace assosiation path: " + depotStreamWorkspace
+                + ". Should be in format \"<depot>" + delimeter + "<stream>"
+ delimeter + "<workspace>\"" );
         }
-        if (repRef.getWorkspaceName() == null) {
+        if ( repRef.getWorkspaceName() == null )
+        {
             //TODO Use 'accurev show wspaces' to resolve the workspace name by the workspace
path
         }
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepository.java?rev=685710&r1=685709&r2=685710&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepository.java
Wed Aug 13 15:27:31 2008
@@ -24,7 +24,9 @@
 /**
  * @version $Id$
  */
-public class AccuRevScmProviderRepository extends ScmProviderRepository {
+public class AccuRevScmProviderRepository
+    extends ScmProviderRepository
+{
     public static final int DEFAULT_PORT = 5050;
 
     private String depot;
@@ -41,72 +43,82 @@
 
     private Map params = new HashMap();
 
-    public String getDepot() {
+    public String getDepot()
+    {
         return depot;
     }
 
-    public void setDepot(String depot) {
+    public void setDepot( String depot )
+    {
         this.depot = depot;
     }
 
-    public String getStreamName() {
+    public String getStreamName()
+    {
         return streamName;
     }
 
-    public void setStreamName(String streamName) {
+    public void setStreamName( String streamName )
+    {
         this.streamName = streamName;
     }
 
-    public String getWorkspaceName() {
+    public String getWorkspaceName()
+    {
         return workspaceName;
     }
 
-    public void setWorkspaceName(String workspaceName) {
+    public void setWorkspaceName( String workspaceName )
+    {
         this.workspaceName = workspaceName;
     }
 
-    public String getHost() {
+    public String getHost()
+    {
         return host;
     }
 
-    public void setHost(String host) {
+    public void setHost( String host )
+    {
         this.host = host;
     }
 
-    public int getPort() {
+    public int getPort()
+    {
         return port;
     }
 
-    public void setPort(int port) {
+    public void setPort( int port )
+    {
         this.port = port;
     }
 
-    public String getCheckoutMethod() {
+    public String getCheckoutMethod()
+    {
         return checkoutMethod;
     }
 
-    public void setCheckoutMethod(String checkoutMethod) {
+    public void setCheckoutMethod( String checkoutMethod )
+    {
         this.checkoutMethod = checkoutMethod;
     }
 
-    public Map getParams() {
+    public Map getParams()
+    {
         return params;
     }
 
-    public void setParams(Map params) {
+    public void setParams( Map params )
+    {
         this.params = params;
     }
 
     /** {@inheritDoc} */
-    public String toString() {
-        return new StringBuffer()
-                .append("host:").append(this.host)
-                .append(", port:").append(this.port)
-                .append(", depot:").append(this.depot)
-                .append(", streamName:").append(this.streamName)
-                .append(", workspaceName:").append(this.workspaceName)
-                .append(", checkoutMethod:").append(this.checkoutMethod)
-                .append(", params:").append(this.params)
-                .toString();
+    public String toString()
+    {
+        return new StringBuffer().append( "host:" ).append( this.host ).append( ", port:"
).append( this.port )
+            .append( ", depot:" ).append( this.depot ).append( ", streamName:" ).append(
this.streamName )
+            .append( ", workspaceName:" ).append( this.workspaceName ).append( ", checkoutMethod:"
)
+            .append( this.checkoutMethod ).append( ", params:" ).append( this.params ).toString();
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AccuRevAddCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AccuRevAddCommand.java?rev=685710&r1=685709&r2=685710&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AccuRevAddCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AccuRevAddCommand.java
Wed Aug 13 15:27:31 2008
@@ -38,11 +38,11 @@
  */
 public class AccuRevAddCommand extends AbstractAddCommand
 {
-    private final String _accurevExecutable;
+    private final String accurevExecutable;
 
-    public AccuRevAddCommand( String accurevExecutable )
+    public AccuRevAddCommand( String accurevExec )
     {
-        _accurevExecutable = accurevExecutable;
+        accurevExecutable = accurevExec;
     }
 
     /** {@inheritDoc} */
@@ -50,7 +50,7 @@
                                            String message, boolean binary ) throws ScmException
     {
         Commandline cl = new Commandline();
-        cl.setExecutable( _accurevExecutable );
+        cl.setExecutable( accurevExecutable );
         cl.setWorkingDirectory( fileSet.getBasedir().getPath() );
         cl.addArguments( new String[]{"add"} );
         ArrayList params = new ArrayList();

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AddCommandStreamConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AddCommandStreamConsumer.java?rev=685710&r1=685709&r2=685710&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AddCommandStreamConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AddCommandStreamConsumer.java
Wed Aug 13 15:27:31 2008
@@ -27,11 +27,13 @@
  *
  * @version $Id$
  */
-class AddCommandStreamConsumer implements StreamConsumer
+class AddCommandStreamConsumer
+    implements StreamConsumer
 {
-    private static final Pattern pattern = Pattern.compile( "Added and kept element\\s*(.*)"
);
+    private static final Pattern PATTERN = Pattern.compile( "Added and kept element\\s*(.*)"
);
 
     private final StreamConsumer stdout;
+
     private final List filesAdded;
 
     /**
@@ -49,7 +51,7 @@
     {
         stdout.consumeLine( line );
 
-        Matcher m = pattern.matcher( line );
+        Matcher m = PATTERN.matcher( line );
         if ( m.matches() )
         {
             String element = m.group( 1 );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java?rev=685710&r1=685709&r2=685710&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.java
Wed Aug 13 15:27:31 2008
@@ -39,7 +39,9 @@
 /**
  * @version $Id$
  */
-public class AccuRevCheckOutUsingPopCommand extends AbstractCheckOutCommand implements BaseAccuRevCheckOutCommand
+public class AccuRevCheckOutUsingPopCommand
+    extends AbstractCheckOutCommand
+    implements BaseAccuRevCheckOutCommand
 {
     private String accuRevExecutable;
 
@@ -56,7 +58,8 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version ) throws ScmException
+                                                        ScmVersion version )
+        throws ScmException
     {
         try
         {
@@ -92,13 +95,14 @@
             //Check if the update command successeed
             if ( exitCode != 0 )
             {
-                return new CheckOutScmResult( popCommandline.toString(),
-                    "The AccuRev command failed", stdout.getOutput(), false );
+                return new CheckOutScmResult( popCommandline.toString(), "The AccuRev command
failed", stdout
+                    .getOutput(), false );
             }
             if ( getLogger().isInfoEnabled() )
             {
-                getLogger().info( "Checked out stream \"" + accurevRepository.getStreamName()
+
-                    "\" contents to folder " + fileSet.getBasedir() );
+                getLogger().info(
+                                  "Checked out stream \"" + accurevRepository.getStreamName()
+                                      + "\" contents to folder " + fileSet.getBasedir() );
                 //TODO notify user that the checked files are not in workspace and no changes
can be propagated to SCM
             }
             return new CheckOutScmResult( popCommandline.toString(), checkedFiles );
@@ -109,8 +113,8 @@
         }
     }
 
-    protected Commandline createPopStreamCommand( AccuRevScmProviderRepository repository,
-                                                  ScmFileSet fileSet, ScmVersion version
)
+    protected Commandline createPopStreamCommand( AccuRevScmProviderRepository repository,
ScmFileSet fileSet,
+                                                  ScmVersion version )
     {
         //TODO Implement support of fileSet, version if applyable
         Commandline commandline = new Commandline();
@@ -123,9 +127,9 @@
         //Set command parameters
         commandline.addArguments( (String[]) params.toArray( new String[params.size()] )
);
         //Append command parameters
-        commandline.addArguments( new String[]{
-            "-v", repository.getStreamName(), //name of the stream
-            "-L", fileSet.getBasedir().getAbsolutePath(), //into folder
+        commandline.addArguments( new String[] { "-v", repository.getStreamName(), //name
of the stream
+            "-L",
+            fileSet.getBasedir().getAbsolutePath(), //into folder
             "-R" //get files recursively
         } );
         List fileSetArguments = new ArrayList();

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java?rev=685710&r1=685709&r2=685710&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.java
Wed Aug 13 15:27:31 2008
@@ -37,7 +37,9 @@
 /**
  * @version $Id$
  */
-public class AccuRevCheckOutWorkspaceCommand extends AbstractCheckOutCommand implements BaseAccuRevCheckOutCommand
+public class AccuRevCheckOutWorkspaceCommand
+    extends AbstractCheckOutCommand
+    implements BaseAccuRevCheckOutCommand
 {
     private String accuRevExecutable;
 
@@ -54,7 +56,8 @@
 
     /** {@inheritDoc} */
     protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository,
ScmFileSet fileSet,
-                                                        ScmVersion version ) throws ScmException
+                                                        ScmVersion version )
+        throws ScmException
     {
         try
         {
@@ -75,8 +78,8 @@
             if ( exitCode != 0 )
             {
                 return new CheckOutScmResult( makeCommandline.toString(),
-                    "The AccuRev command failed. Cannot create workspace: " +
-                        stdout.getOutput(), stdout.getOutput(), false );
+                                              "The AccuRev command failed. Cannot create
workspace: "
+                                                  + stdout.getOutput(), stdout.getOutput(),
false );
             }
             //Update the workspace
             Commandline updateCommandline = createUpdateWorkspaceCommand( accurevRepository,
fileSet, version );
@@ -102,10 +105,11 @@
             if ( exitCode != 0 )
             {
                 return new CheckOutScmResult( updateCommandline.toString(),
-                    "The AccuRev command failed. Cannot update workspace", stdout.getOutput(),
false );
+                                              "The AccuRev command failed. Cannot update
workspace",
+                                              stdout.getOutput(), false );
             }
             return new CheckOutScmResult( makeCommandline.toString() + " & " + updateCommandline.toString(),
-                checkedFiles );
+                                          checkedFiles );
         }
         catch ( CommandLineException e )
         {
@@ -113,8 +117,8 @@
         }
     }
 
-    protected Commandline createUpdateWorkspaceCommand( AccuRevScmProviderRepository repository,
-                                                        ScmFileSet fileSet, ScmVersion version
)
+    protected Commandline createUpdateWorkspaceCommand( AccuRevScmProviderRepository repository,
ScmFileSet fileSet,
+                                                        ScmVersion version )
     {
         //TODO Implement support of fileSet, version if applyable
         Commandline commandline = new Commandline();
@@ -132,24 +136,26 @@
         return commandline;
     }
 
-    protected Commandline createMakeWorkspaceCommandLine( AccuRevScmProviderRepository repository,
-                                                          ScmFileSet fileSet, ScmVersion
version )
+    protected Commandline createMakeWorkspaceCommandLine( AccuRevScmProviderRepository repository,
ScmFileSet fileSet,
+                                                          ScmVersion version )
     {
         //TODO Implement support of fileSet, version if applyable
         Commandline cmd = new Commandline();
         cmd.setExecutable( this.accuRevExecutable );
         //Append command name
-        cmd.addArguments( new String[]{"mkws"} );
+        cmd.addArguments( new String[] { "mkws" } );
         //Append host param if needed
         List params = new ArrayList();
         AccuRevScmProvider.appendHostToParamsIfNeeded( repository, params );
         cmd.addArguments( (String[]) params.toArray( new String[params.size()] ) );
         //Append command arguments
-        cmd.addArguments( new String[]{
-            "-w", repository.getWorkspaceName(),
-            "-b", repository.getStreamName(),
-            "-l", fileSet.getBasedir().getAbsolutePath()
-        } );
+        cmd.addArguments( new String[] {
+            "-w",
+            repository.getWorkspaceName(),
+            "-b",
+            repository.getStreamName(),
+            "-l",
+            fileSet.getBasedir().getAbsolutePath() } );
         return cmd;
     }
 }



Mime
View raw message