From: Brett Porter Date: Tue, 17 Mar 2009 13:46:17 +0000 (+0000) Subject: clean up warnings in archiva-converter X-Git-Tag: archiva-1.2~52 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2846805437e35d255d876339abf03ee3aa378017;p=archiva.git clean up warnings in archiva-converter git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755243 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java index 4bb78efa1..1831fd1ae 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java @@ -21,6 +21,8 @@ package org.apache.maven.archiva.converter.legacy; import org.apache.maven.archiva.common.utils.PathUtil; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.converter.RepositoryConversionException; import org.apache.maven.archiva.repository.RepositoryException; import org.apache.maven.archiva.repository.scanner.RepositoryScanner; @@ -65,7 +67,7 @@ public class DefaultLegacyRepositoryConverter private RepositoryScanner repoScanner; public void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, - List fileExclusionPatterns ) + List fileExclusionPatterns ) throws RepositoryConversionException { try @@ -85,11 +87,11 @@ public class DefaultLegacyRepositoryConverter legacyConverterConsumer.setExcludes( fileExclusionPatterns ); legacyConverterConsumer.setDestinationRepository( repository ); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList(); knownConsumers.add( legacyConverterConsumer ); - List invalidConsumers = Collections.EMPTY_LIST; - List ignoredContent = new ArrayList(); + List invalidConsumers = Collections.emptyList(); + List ignoredContent = new ArrayList(); ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); repoScanner.scan( legacyRepository, knownConsumers, invalidConsumers, ignoredContent, diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java index 331f7784f..0cd5bc3b2 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java @@ -69,13 +69,13 @@ public class LegacyConverterArtifactConsumer private ArtifactRepository destinationRepository; - private List includes; + private List includes; - private List excludes; + private List excludes; public LegacyConverterArtifactConsumer() { - includes = new ArrayList(); + includes = new ArrayList(); includes.add( "**/*.jar" ); includes.add( "**/*.ear" ); includes.add( "**/*.war" ); @@ -93,12 +93,12 @@ public class LegacyConverterArtifactConsumer } - public List getExcludes() + public List getExcludes() { return excludes; } - public List getIncludes() + public List getIncludes() { return includes; } @@ -139,12 +139,12 @@ public class LegacyConverterArtifactConsumer return false; } - public void setExcludes( List excludes ) + public void setExcludes( List excludes ) { this.excludes = excludes; } - public void setIncludes( List includes ) + public void setIncludes( List includes ) { this.includes = includes; } diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java index 7dad5bf62..53db2980f 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java @@ -42,6 +42,6 @@ public interface LegacyRepositoryConverter * @throws RepositoryConversionException */ void convertLegacyRepository( File legacyRepositoryDirectory, File destinationRepositoryDirectory, - List fileExclusionPatterns ) + List fileExclusionPatterns ) throws RepositoryConversionException; } diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java index 763ba556b..e8da73550 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java +++ b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java @@ -19,21 +19,19 @@ package org.apache.maven.archiva.converter; * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter; -import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.codehaus.plexus.i18n.I18N; import org.codehaus.plexus.spring.PlexusInSpringTestCase; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - /** * Test the repository converter. * @@ -51,12 +49,6 @@ public class RepositoryConverterTest private LegacyRepositoryConverter repositoryConverter; - private ArtifactFactory artifactFactory; - - private static final int SLEEP_MILLIS = 100; - - private I18N i18n; - protected void setUp() throws Exception { @@ -82,10 +74,6 @@ public class RepositoryConverterTest targetRepository.setLayout( "default" ); repositoryConverter = (LegacyRepositoryConverter) lookup( LegacyRepositoryConverter.ROLE, "default" ); - - artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); - - i18n = (I18N) lookup( I18N.ROLE ); } protected void tearDown() @@ -146,7 +134,7 @@ public class RepositoryConverterTest { File legacyRepoDir = new File( sourceRepository.getBasedir() ); File destRepoDir = new File( targetRepository.getLocation() ); - List excludes = new ArrayList(); + List excludes = new ArrayList(); repositoryConverter.convertLegacyRepository( legacyRepoDir, destRepoDir, excludes ); } }