Author: olamy Date: Wed Jan 5 21:22:58 2011 New Revision: 1055646 URL: http://svn.apache.org/viewvc?rev=1055646&view=rev Log: [SCM-591] move to java 1.5 . list command
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListConsumer.java maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.java maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/CvsListConsumer.java maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.java maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListConsumer.java Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java (original) +++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java Wed Jan 5 21:22:58 2011 @@ -19,11 +19,12 @@ package org.apache.maven.scm.command.lis * under the License. */ -import org.apache.maven.scm.ScmResult; - import java.util.ArrayList; import java.util.List; +import org.apache.maven.scm.ScmFile; +import org.apache.maven.scm.ScmResult; + /** * Result of {...@link org.apache.maven.scm.provider.ScmProvider#list(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet, boolean, org.apache.maven.scm.ScmVersion)} operation @@ -34,32 +35,32 @@ import java.util.List; public class ListScmResult extends ScmResult { - // XXX List of what? - private List files; + + private static final long serialVersionUID = 5402161066844465281L; + private List<ScmFile> files; public ListScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); - files = new ArrayList( 0 ); + files = new ArrayList<ScmFile>( 0 ); } - public ListScmResult( String commandLine, List/*<ScmFile>*/ files ) + public ListScmResult( String commandLine, List<ScmFile> files ) { super( commandLine, null, null, true ); this.files = files; } - public ListScmResult( List/*<ScmFile>*/ files, ScmResult result ) + public ListScmResult( List<ScmFile> files, ScmResult result ) { super( result ); this.files = files; } - // XXX List of what? - public List/*<ScmFile>*/ getFiles() + public List<ScmFile> getFiles() { return files; } Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java (original) +++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java Wed Jan 5 21:22:58 2011 @@ -19,6 +19,9 @@ package org.apache.maven.scm.plugin; * under the License. */ +import java.io.File; +import java.io.IOException; + import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; @@ -26,10 +29,6 @@ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.repository.ScmRepository; -import java.io.File; -import java.io.IOException; -import java.util.Iterator; - /** * Get the list of project files. * @@ -78,9 +77,8 @@ public class ListMojo if ( result.getFiles() != null ) { - for ( Iterator i = result.getFiles().iterator(); i.hasNext(); ) + for ( ScmFile scmFile : result.getFiles() ) { - ScmFile scmFile = (ScmFile) i.next(); getLog().info( scmFile.getPath() ); } } Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListConsumer.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListConsumer.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListConsumer.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListConsumer.java Wed Jan 5 21:22:58 2011 @@ -37,7 +37,7 @@ public class HgListConsumer extends HgConsumer { - private List files = new ArrayList(); + private List<ScmFile> files = new ArrayList<ScmFile>(); public HgListConsumer( ScmLogger logger ) { @@ -50,7 +50,7 @@ public class HgListConsumer files.add( new ScmFile( trimmedLine, status ) ); } - public List getFiles() + public List<ScmFile> getFiles() { return files; } Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.java Wed Jan 5 21:22:58 2011 @@ -83,8 +83,8 @@ public class LocalListCommand } else { - List files = new ArrayList(); - Iterator it = fileSet.getFileList().iterator(); + List<ScmFile> files = new ArrayList<ScmFile>(); + Iterator<File> it = fileSet.getFileList().iterator(); while ( it.hasNext() ) { @@ -102,7 +102,7 @@ public class LocalListCommand } } - private List getFiles( File source, File directory, boolean recursive ) + private List<ScmFile> getFiles( File source, File directory, boolean recursive ) throws Exception { if ( !directory.exists() ) @@ -110,7 +110,7 @@ public class LocalListCommand throw new Exception( "Directory '" + directory.getAbsolutePath() + "' doesn't exist." ); } - List files = new ArrayList(); + List<ScmFile> files = new ArrayList<ScmFile>(); File[] filesArray = directory.listFiles(); Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.java Wed Jan 5 21:22:58 2011 @@ -65,7 +65,7 @@ public abstract class AbstractCvsListCom cl.createArg().setValue( "-R" ); } - for ( Iterator it = fileSet.getFileList().iterator(); it.hasNext(); ) + for ( Iterator<File> it = fileSet.getFileList().iterator(); it.hasNext(); ) { File target = (File) it.next(); String path = target.getPath(); Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/CvsListConsumer.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/CvsListConsumer.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/CvsListConsumer.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/CvsListConsumer.java Wed Jan 5 21:22:58 2011 @@ -47,7 +47,7 @@ public class CvsListConsumer { private ScmLogger logger; - private List entries; + private List<ScmFile> entries; /** * @param logger is a logger @@ -55,7 +55,7 @@ public class CvsListConsumer public CvsListConsumer( ScmLogger logger ) { this.logger = logger; - this.entries = new LinkedList(); + this.entries = new LinkedList<ScmFile>(); } /** {...@inheritdoc} */ @@ -86,7 +86,7 @@ public class CvsListConsumer /** * @return Parse result */ - public List getEntries() + public List<ScmFile> getEntries() { return entries; } Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java Wed Jan 5 21:22:58 2011 @@ -19,16 +19,16 @@ package org.apache.maven.scm.provider.cv * under the License. */ +import java.io.File; +import java.util.ArrayList; +import java.util.List; + import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - /** * @author <a href="mailto:br...@apache.org">Brett Porter</a> * @version $Id$ @@ -40,7 +40,7 @@ public class CvsStatusConsumer private File workingDirectory; - private List changedFiles = new ArrayList(); + private List<ScmFile> changedFiles = new ArrayList<ScmFile>(); // ---------------------------------------------------------------------- // @@ -128,7 +128,7 @@ public class CvsStatusConsumer changedFiles.add( new ScmFile( file, status ) ); } - public List getChangedFiles() + public List<ScmFile> getChangedFiles() { return changedFiles; } Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.java Wed Jan 5 21:22:58 2011 @@ -107,11 +107,11 @@ public class SvnListCommand } } - Iterator it = fileSet.getFileList().iterator(); + Iterator<File> it = fileSet.getFileList().iterator(); while ( it.hasNext() ) { - File file = (File) it.next(); + File file = it.next(); cl.createArg().setValue( repository.getUrl() + "/" + file.getPath().replace( '\\', '/' ) ); } Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListConsumer.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListConsumer.java?rev=1055646&r1=1055645&r2=1055646&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListConsumer.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListConsumer.java Wed Jan 5 21:22:58 2011 @@ -33,7 +33,7 @@ import java.util.List; public class SvnListConsumer implements StreamConsumer { - private List files = new ArrayList(); + private List<ScmFile> files = new ArrayList<ScmFile>(); // ---------------------------------------------------------------------- // StreamConsumer Implementation @@ -45,7 +45,7 @@ public class SvnListConsumer files.add( new ScmFile( line, ScmFileStatus.CHECKED_IN ) ); } - public List getFiles() + public List<ScmFile> getFiles() { return files; }