]> source.dussan.org Git - archiva.git/commitdiff
clean up warnings in archiva-converter
authorBrett Porter <brett@apache.org>
Tue, 17 Mar 2009 13:46:17 +0000 (13:46 +0000)
committerBrett Porter <brett@apache.org>
Tue, 17 Mar 2009 13:46:17 +0000 (13:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755243 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java
archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java
archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java

index 4bb78efa1ff167952af66b1ea7b7dd92e230747a..1831fd1aee34ec2f85f81180f0bc3760a888b53c 100644 (file)
@@ -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<String> fileExclusionPatterns )
         throws RepositoryConversionException
     {
         try
@@ -85,11 +87,11 @@ public class DefaultLegacyRepositoryConverter
             legacyConverterConsumer.setExcludes( fileExclusionPatterns );
             legacyConverterConsumer.setDestinationRepository( repository );
 
-            List knownConsumers = new ArrayList();
+            List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>();
             knownConsumers.add( legacyConverterConsumer );
 
-            List invalidConsumers = Collections.EMPTY_LIST;
-            List ignoredContent = new ArrayList();
+            List<InvalidRepositoryContentConsumer> invalidConsumers = Collections.emptyList();
+            List<String> ignoredContent = new ArrayList<String>();
             ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) );
 
             repoScanner.scan( legacyRepository, knownConsumers, invalidConsumers, ignoredContent,
index 331f7784ff93e88e57681b31f673351bef760abf..0cd5bc3b29d5b8f08652784ddc868e45fbd8cea8 100644 (file)
@@ -69,13 +69,13 @@ public class LegacyConverterArtifactConsumer
     
     private ArtifactRepository destinationRepository;
 
-    private List includes;
+    private List<String> includes;
 
-    private List excludes;
+    private List<String> excludes;
 
     public LegacyConverterArtifactConsumer()
     {
-        includes = new ArrayList();
+        includes = new ArrayList<String>();
         includes.add( "**/*.jar" );
         includes.add( "**/*.ear" );
         includes.add( "**/*.war" );
@@ -93,12 +93,12 @@ public class LegacyConverterArtifactConsumer
 
     }
 
-    public List getExcludes()
+    public List<String> getExcludes()
     {
         return excludes;
     }
 
-    public List getIncludes()
+    public List<String> getIncludes()
     {
         return includes;
     }
@@ -139,12 +139,12 @@ public class LegacyConverterArtifactConsumer
         return false;
     }
 
-    public void setExcludes( List excludes )
+    public void setExcludes( List<String> excludes )
     {
         this.excludes = excludes;
     }
 
-    public void setIncludes( List includes )
+    public void setIncludes( List<String> includes )
     {
         this.includes = includes;
     }
index 7dad5bf62d5070a6ec545a1cf24cca9721023a8a..53db2980f4978da3c96c68320adf48fdbcf324f1 100644 (file)
@@ -42,6 +42,6 @@ public interface LegacyRepositoryConverter
      * @throws RepositoryConversionException 
      */
     void convertLegacyRepository( File legacyRepositoryDirectory, File destinationRepositoryDirectory,
-                                  List fileExclusionPatterns )
+                                  List<String> fileExclusionPatterns )
         throws RepositoryConversionException;
 }
index 763ba556bae3698fe030dd9f4e57d7a9a078aa46..e8da735505075479563b0d63d6ac533205dc810e 100644 (file)
@@ -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<String> excludes = new ArrayList<String>();
         repositoryConverter.convertLegacyRepository( legacyRepoDir, destRepoDir, excludes );
     }
 }