diff options
author | Olivier Lamy <olamy@apache.org> | 2014-04-10 11:43:11 +1000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-04-10 11:43:11 +1000 |
commit | d9de8dc7afe4a1e22257a9437d68649eee8f3047 (patch) | |
tree | 89e49278beea7304252fd217a35a865986647a44 /archiva-modules/archiva-base/archiva-repository-scanner | |
parent | ff99d5a203756c31bcf4a8a98ec4c25cb423ad74 (diff) | |
download | archiva-d9de8dc7afe4a1e22257a9437d68649eee8f3047.tar.gz archiva-d9de8dc7afe4a1e22257a9437d68649eee8f3047.zip |
use diamond operator
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-scanner')
4 files changed, 30 insertions, 30 deletions
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<String> allExcludes = new ArrayList<String>(); - List<String> allIncludes = new ArrayList<String>(); + List<String> allExcludes = new ArrayList<>(); + List<String> allIncludes = new ArrayList<>(); if ( CollectionUtils.isNotEmpty( ignoredContentPatterns ) ) { @@ -147,7 +147,7 @@ public class DefaultRepositoryScanner private List<String> gatherIds( List<? extends RepositoryContentConsumer> consumers ) { - List<String> ids = new ArrayList<String>(); + List<String> 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<KnownRepositoryContentConsumer> ret = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> ret = new ArrayList<>(); List<String> knownSelected = getSelectedKnownConsumerIds(); @@ -195,7 +195,7 @@ public class RepositoryContentConsumers return selectedInvalidConsumers; } - List<InvalidRepositoryContentConsumer> ret = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> ret = new ArrayList<>(); List<String> invalidSelected = getSelectedInvalidConsumerIds(); @@ -219,7 +219,7 @@ public class RepositoryContentConsumers */ public List<KnownRepositoryContentConsumer> getAvailableKnownConsumers() { - return new ArrayList<KnownRepositoryContentConsumer>( + return new ArrayList<>( applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ).values() ); } @@ -232,7 +232,7 @@ public class RepositoryContentConsumers */ public List<InvalidRepositoryContentConsumer> getAvailableInvalidConsumers() { - return new ArrayList<InvalidRepositoryContentConsumer>( + 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<KnownRepositoryContentConsumer> clone = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> 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<String> includes = new ArrayList<String>(); + private List<String> 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<String> getIgnoreList() { - List<String> ignores = new ArrayList<String>(); + List<String> ignores = new ArrayList<>(); ignores.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); return ignores; } @@ -154,12 +154,12 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -181,12 +181,12 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -207,13 +207,13 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setProcessUnmodified( true ); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -234,14 +234,14 @@ public class RepositoryScannerTest { ManagedRepository repository = createDefaultRepository(); - List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> 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<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -259,7 +259,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryArtifactScanner() throws Exception { - List<String> actualArtifactPaths = new ArrayList<String>(); + List<String> 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -317,7 +317,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryMetadataScanner() throws Exception { - List<String> actualMetadataPaths = new ArrayList<String>(); + List<String> 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer knownConsumer = new KnownScanConsumer(); knownConsumer.setIncludes( new String[]{ "**/maven-metadata*.xml" } ); knownConsumers.add( knownConsumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -354,7 +354,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryProjectScanner() throws Exception { - List<String> actualProjectPaths = new ArrayList<String>(); + List<String> 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( new String[]{ "**/*.pom" } ); knownConsumers.add( consumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -391,7 +391,7 @@ public class RepositoryScannerTest public void testLegacyRepositoryArtifactScanner() throws Exception { - List<String> actualArtifactPaths = new ArrayList<String>(); + List<String> 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<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<KnownRepositoryContentConsumer>(); + List<KnownRepositoryContentConsumer> knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>(); + List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); |