From d9de8dc7afe4a1e22257a9437d68649eee8f3047 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 10 Apr 2014 11:43:11 +1000 Subject: use diamond operator --- .../scanner/DefaultRepositoryScanner.java | 6 ++-- .../scanner/RepositoryContentConsumers.java | 10 +++--- .../repository/scanner/KnownScanConsumer.java | 2 +- .../repository/scanner/RepositoryScannerTest.java | 42 +++++++++++----------- 4 files changed, 30 insertions(+), 30 deletions(-) (limited to 'archiva-modules/archiva-base/archiva-repository-scanner') diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java index c9bf80352..d485bd8e3 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java @@ -99,8 +99,8 @@ public class DefaultRepositoryScanner // Setup Includes / Excludes. - List allExcludes = new ArrayList(); - List allIncludes = new ArrayList(); + List allExcludes = new ArrayList<>(); + List allIncludes = new ArrayList<>(); if ( CollectionUtils.isNotEmpty( ignoredContentPatterns ) ) { @@ -147,7 +147,7 @@ public class DefaultRepositoryScanner private List gatherIds( List consumers ) { - List ids = new ArrayList(); + List ids = new ArrayList<>(); for ( RepositoryContentConsumer consumer : consumers ) { ids.add( consumer.getId() ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java index 3ba6a25c4..c45d815dc 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java @@ -164,7 +164,7 @@ public class RepositoryContentConsumers { return selectedKnownConsumers; } - List ret = new ArrayList(); + List ret = new ArrayList<>(); List knownSelected = getSelectedKnownConsumerIds(); @@ -195,7 +195,7 @@ public class RepositoryContentConsumers return selectedInvalidConsumers; } - List ret = new ArrayList(); + List ret = new ArrayList<>(); List invalidSelected = getSelectedInvalidConsumerIds(); @@ -219,7 +219,7 @@ public class RepositoryContentConsumers */ public List getAvailableKnownConsumers() { - return new ArrayList( + return new ArrayList<>( applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ).values() ); } @@ -232,7 +232,7 @@ public class RepositoryContentConsumers */ public List getAvailableInvalidConsumers() { - return new ArrayList( + return new ArrayList<>( applicationContext.getBeansOfType( InvalidRepositoryContentConsumer.class ).values() ); } @@ -261,7 +261,7 @@ public class RepositoryContentConsumers // - do not create missing/fix invalid checksums and update metadata when deploying from webdav since these are uploaded by maven if ( !updateRelatedArtifacts ) { - List clone = new ArrayList(); + List clone = new ArrayList<>(); clone.addAll( selectedKnownConsumers ); for ( KnownRepositoryContentConsumer consumer : clone ) diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java index bb88c7195..c75e6e5b3 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java @@ -42,7 +42,7 @@ public class KnownScanConsumer { private int processCount = 0; - private List includes = new ArrayList(); + private List includes = new ArrayList<>(); private boolean processUnmodified = false; diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java index fb5c87181..a19b16db7 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java @@ -143,7 +143,7 @@ public class RepositoryScannerTest private List getIgnoreList() { - List ignores = new ArrayList(); + List ignores = new ArrayList<>(); ignores.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); return ignores; } @@ -154,12 +154,12 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -181,12 +181,12 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -207,13 +207,13 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setProcessUnmodified( true ); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -234,14 +234,14 @@ public class RepositoryScannerTest { ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( new String[]{ "**/*.jar", "**/*.war", "**/*.pom", "**/maven-metadata.xml", "**/*-site.xml", "**/*.zip", "**/*.tar.gz", "**/*.sha1", "**/*.md5" } ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -259,7 +259,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryArtifactScanner() throws Exception { - List actualArtifactPaths = new ArrayList(); + List actualArtifactPaths = new ArrayList<>(); actualArtifactPaths.add( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar" ); actualArtifactPaths.add( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar" ); @@ -295,12 +295,12 @@ public class RepositoryScannerTest ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -317,7 +317,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryMetadataScanner() throws Exception { - List actualMetadataPaths = new ArrayList(); + List actualMetadataPaths = new ArrayList<>(); actualMetadataPaths.add( "org/apache/maven/some-ejb/1.0/maven-metadata.xml" ); actualMetadataPaths.add( "org/apache/maven/update/test-not-updated/maven-metadata.xml" ); @@ -332,12 +332,12 @@ public class RepositoryScannerTest ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer knownConsumer = new KnownScanConsumer(); knownConsumer.setIncludes( new String[]{ "**/maven-metadata*.xml" } ); knownConsumers.add( knownConsumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -354,7 +354,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryProjectScanner() throws Exception { - List actualProjectPaths = new ArrayList(); + List actualProjectPaths = new ArrayList<>(); actualProjectPaths.add( "org/apache/maven/A/1.0/A-1.0.pom" ); actualProjectPaths.add( "org/apache/maven/B/2.0/B-2.0.pom" ); @@ -369,12 +369,12 @@ public class RepositoryScannerTest ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( new String[]{ "**/*.pom" } ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -391,7 +391,7 @@ public class RepositoryScannerTest public void testLegacyRepositoryArtifactScanner() throws Exception { - List actualArtifactPaths = new ArrayList(); + List actualArtifactPaths = new ArrayList<>(); actualArtifactPaths.add( "invalid/jars/1.0/invalid-1.0.jar" ); actualArtifactPaths.add( "invalid/jars/invalid-1.0.rar" ); @@ -410,12 +410,12 @@ public class RepositoryScannerTest ManagedRepository repository = createLegacyRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); -- cgit v1.2.3