aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-04-10 16:36:21 +1000
committerOlivier Lamy <olamy@apache.org>2014-04-10 16:36:21 +1000
commit5fa4ceb731b5440b7d7439c2d924f299dc109384 (patch)
tree06952be8c970f4f3ecf6a1769907c0d4dc678eae /archiva-modules/plugins
parent03601570ef70ec4c1ae9f2b992333b8200c016d5 (diff)
downloadarchiva-5fa4ceb731b5440b7d7439c2d924f299dc109384.tar.gz
archiva-5fa4ceb731b5440b7d7439c2d924f299dc109384.zip
more diamond
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r--archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/DefaultAuditManager.java6
-rw-r--r--archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java8
-rw-r--r--archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java4
-rw-r--r--archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java16
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java6
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java2
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java4
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java4
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java16
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java12
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java10
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java2
-rw-r--r--archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java34
-rw-r--r--archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java2
-rw-r--r--archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java6
-rw-r--r--archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java30
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java16
-rw-r--r--archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java2
-rw-r--r--archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java2
-rw-r--r--archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java10
-rw-r--r--archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java4
-rw-r--r--archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java6
22 files changed, 101 insertions, 101 deletions
diff --git a/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/DefaultAuditManager.java b/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/DefaultAuditManager.java
index ad3cfdf0b..07adab737 100644
--- a/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/DefaultAuditManager.java
+++ b/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/DefaultAuditManager.java
@@ -53,7 +53,7 @@ public class DefaultAuditManager
throws MetadataRepositoryException
{
// TODO: consider a more efficient implementation that directly gets the last ten from the content repository
- List<AuditRecord> records = new ArrayList<AuditRecord>();
+ List<AuditRecord> records = new ArrayList<>();
for ( String repositoryId : repositoryIds )
{
List<String> names = metadataRepository.getMetadataFacets( repositoryId, AuditEvent.FACET_ID );
@@ -65,7 +65,7 @@ public class DefaultAuditManager
Collections.sort( records );
records = records.subList( 0, records.size() < NUM_RECENT_EVENTS ? records.size() : NUM_RECENT_EVENTS );
- List<AuditEvent> events = new ArrayList<AuditEvent>( records.size() );
+ List<AuditEvent> events = new ArrayList<>( records.size() );
for ( AuditRecord record : records )
{
AuditEvent auditEvent = (AuditEvent) metadataRepository.getMetadataFacet( record.repositoryId,
@@ -104,7 +104,7 @@ public class DefaultAuditManager
Date endTime )
throws MetadataRepositoryException
{
- List<AuditEvent> results = new ArrayList<AuditEvent>();
+ List<AuditEvent> results = new ArrayList<>();
for ( String repositoryId : repositoryIds )
{
List<String> list = metadataRepository.getMetadataFacets( repositoryId, AuditEvent.FACET_ID );
diff --git a/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java b/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java
index e377346ca..0505562a0 100644
--- a/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java
+++ b/archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java
@@ -96,7 +96,7 @@ public class AuditManagerTest
throws Exception
{
int numEvents = 11;
- List<AuditEvent> expectedEvents = new ArrayList<AuditEvent>( numEvents );
+ List<AuditEvent> expectedEvents = new ArrayList<>( numEvents );
for ( int i = 0; i < numEvents; i++ )
{
AuditEvent event = createEvent( AUDIT_EVENT_BASE + MILLIS_FORMAT.format( i ) );
@@ -134,7 +134,7 @@ public class AuditManagerTest
throws Exception
{
int numEvents = 5;
- List<AuditEvent> expectedEvents = new ArrayList<AuditEvent>( numEvents );
+ List<AuditEvent> expectedEvents = new ArrayList<>( numEvents );
for ( int i = 0; i < numEvents; i++ )
{
expectedEvents.add( createEvent( AUDIT_EVENT_BASE + MILLIS_FORMAT.format( i ) ) );
@@ -171,7 +171,7 @@ public class AuditManagerTest
{
int numEvents = 11;
Map<String, List<String>> eventNames = new LinkedHashMap<String, List<String>>();
- List<AuditEvent> events = new ArrayList<AuditEvent>();
+ List<AuditEvent> events = new ArrayList<>();
eventNames.put( TEST_REPO_ID, new ArrayList<String>() );
eventNames.put( TEST_REPO_ID_2, new ArrayList<String>() );
for ( int i = 0; i < numEvents; i++ )
@@ -604,7 +604,7 @@ public class AuditManagerTest
private List<String> getEventNames( List<AuditEvent> events )
{
- List<String> names = new ArrayList<String>( events.size() );
+ List<String> names = new ArrayList<>( events.size() );
for ( AuditEvent event : events )
{
names.add( event.getName() );
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
index 3f050e3ab..74bc3d9d7 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
@@ -146,7 +146,7 @@ public class Maven3DependencyTreeBuilder
return;
}
- List<RemoteRepository> remoteRepositories = new ArrayList<RemoteRepository>();
+ List<RemoteRepository> remoteRepositories = new ArrayList<>();
Map<String, NetworkProxy> networkProxies = new HashMap<String, NetworkProxy>();
try
@@ -197,7 +197,7 @@ public class Maven3DependencyTreeBuilder
throws DependencyTreeBuilderException
{
- List<TreeEntry> treeEntries = new ArrayList<TreeEntry>();
+ List<TreeEntry> treeEntries = new ArrayList<>();
TreeDependencyNodeVisitor treeDependencyNodeVisitor = new TreeDependencyNodeVisitor( treeEntries );
buildDependencyTree( repositoryIds, groupId, artifactId, version, treeDependencyNodeVisitor );
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
index 47f34d266..0628b055a 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
@@ -232,7 +232,7 @@ public class Maven2RepositoryStorage
// TODO: this is a workaround until we can properly resolve using proxies as well - this doesn't cache
// anything locally!
- List<RemoteRepository> remoteRepositories = new ArrayList<RemoteRepository>();
+ List<RemoteRepository> remoteRepositories = new ArrayList<>();
Map<String, NetworkProxy> networkProxies = new HashMap<String, NetworkProxy>();
Map<String, List<ProxyConnector>> proxyConnectorsMap = proxyConnectorAdmin.getProxyConnectorAsMap();
@@ -399,7 +399,7 @@ public class Maven2RepositoryStorage
private List<org.apache.archiva.metadata.model.Dependency> convertDependencies( List<Dependency> dependencies )
{
List<org.apache.archiva.metadata.model.Dependency> l =
- new ArrayList<org.apache.archiva.metadata.model.Dependency>();
+ new ArrayList<>();
for ( Dependency dependency : dependencies )
{
org.apache.archiva.metadata.model.Dependency newDependency =
@@ -444,7 +444,7 @@ public class Maven2RepositoryStorage
private List<org.apache.archiva.metadata.model.License> convertLicenses( List<License> licenses )
{
- List<org.apache.archiva.metadata.model.License> l = new ArrayList<org.apache.archiva.metadata.model.License>();
+ List<org.apache.archiva.metadata.model.License> l = new ArrayList<>();
for ( License license : licenses )
{
org.apache.archiva.metadata.model.License newLicense = new org.apache.archiva.metadata.model.License();
@@ -458,7 +458,7 @@ public class Maven2RepositoryStorage
private List<org.apache.archiva.metadata.model.MailingList> convertMailingLists( List<MailingList> mailingLists )
{
List<org.apache.archiva.metadata.model.MailingList> l =
- new ArrayList<org.apache.archiva.metadata.model.MailingList>();
+ new ArrayList<>();
for ( MailingList mailingList : mailingLists )
{
org.apache.archiva.metadata.model.MailingList newMailingList =
@@ -512,7 +512,7 @@ public class Maven2RepositoryStorage
String[] files = dir.list( new DirectoryFilter( filter ) );
if ( files != null )
{
- fileNames = new ArrayList<String>( Arrays.asList( files ) );
+ fileNames = new ArrayList<>( Arrays.asList( files ) );
Collections.sort( fileNames );
}
else
@@ -543,7 +543,7 @@ public class Maven2RepositoryStorage
File dir = pathTranslator.toFile( getRepositoryBasedir( repoId ), namespace );
// scan all the directories which are potential namespaces. Any directories known to be projects are excluded
- List<String> namespaces = new ArrayList<String>();
+ List<String> namespaces = new ArrayList<>();
File[] files = dir.listFiles( new DirectoryFilter( filter ) );
if ( files != null )
{
@@ -565,7 +565,7 @@ public class Maven2RepositoryStorage
File dir = pathTranslator.toFile( getRepositoryBasedir( repoId ), namespace );
// scan all directories in the namespace, and only include those that are known to be projects
- List<String> projects = new ArrayList<String>();
+ List<String> projects = new ArrayList<>();
File[] files = dir.listFiles( new DirectoryFilter( filter ) );
if ( files != null )
{
@@ -601,7 +601,7 @@ public class Maven2RepositoryStorage
// all files that are not metadata and not a checksum / signature are considered artifacts
File[] files = dir.listFiles( new ArtifactDirectoryFilter( readMetadataRequest.getFilter() ) );
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> artifacts = new ArrayList<>();
if ( files != null )
{
for ( File file : files )
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
index eeb7b1c71..9ea29d728 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java
@@ -59,7 +59,7 @@ public class MockRepoAdmin
throws RepositoryAdminException
{
List<RemoteRepository> remoteRepositories =
- new ArrayList<RemoteRepository>( archivaConfiguration.getConfiguration().getRemoteRepositories().size() );
+ new ArrayList<>( archivaConfiguration.getConfiguration().getRemoteRepositories().size() );
for ( RemoteRepositoryConfiguration repositoryConfiguration : archivaConfiguration.getConfiguration().getRemoteRepositories() )
{
RemoteRepository remoteRepository =
@@ -186,7 +186,7 @@ public class MockRepoAdmin
{
List<ProxyConnectorConfiguration> proxyConnectorConfigurations =
archivaConfiguration.getConfiguration().getProxyConnectors();
- List<ProxyConnector> proxyConnectors = new ArrayList<ProxyConnector>( proxyConnectorConfigurations.size() );
+ List<ProxyConnector> proxyConnectors = new ArrayList<>( proxyConnectorConfigurations.size() );
for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations )
{
proxyConnectors.add( getProxyConnector( configuration ) );
@@ -233,7 +233,7 @@ public class MockRepoAdmin
List<ProxyConnector> connectors = proxyConnectorMap.get( key );
if ( connectors == null )
{
- connectors = new ArrayList<ProxyConnector>( 1 );
+ connectors = new ArrayList<>( 1 );
proxyConnectorMap.put( key, connectors );
}
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
index 251232738..c8f7942dd 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
@@ -63,7 +63,7 @@ public class TestMetadataRepository
public List<String> getMetadataFacets( String repoId, String facetId )
{
- return new ArrayList<String>( facets.keySet() );
+ return new ArrayList<>( facets.keySet() );
}
public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
index 0c583a059..c4025116d 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedDefaultRepositoryContentTest.java
@@ -187,7 +187,7 @@ public class ManagedDefaultRepositoryContentTest
Set<String> testedVersionSet = repoContent.getVersions( reference );
// Sort the list (for asserts)
- List<String> testedVersions = new ArrayList<String>();
+ List<String> testedVersions = new ArrayList<>();
testedVersions.addAll( testedVersionSet );
Collections.sort( testedVersions, new VersionComparator() );
@@ -212,7 +212,7 @@ public class ManagedDefaultRepositoryContentTest
Set<String> testedVersionSet = repoContent.getVersions( reference );
// Sort the list (for asserts later)
- List<String> testedVersions = new ArrayList<String>();
+ List<String> testedVersions = new ArrayList<>();
testedVersions.addAll( testedVersionSet );
Collections.sort( testedVersions, new VersionComparator() );
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
index 440aa2415..3bdbea0f7 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/ManagedLegacyRepositoryContentTest.java
@@ -98,7 +98,7 @@ public class ManagedLegacyRepositoryContentTest
Set<String> testedVersionSet = repoContent.getVersions( reference );
// Sort the list (for asserts later)
- List<String> testedVersions = new ArrayList<String>();
+ List<String> testedVersions = new ArrayList<>();
testedVersions.addAll( testedVersionSet );
Collections.sort( testedVersions, new VersionComparator() );
@@ -124,7 +124,7 @@ public class ManagedLegacyRepositoryContentTest
Set<String> testedVersionSet = repoContent.getVersions( reference );
// Sort the list (for asserts later)
- List<String> testedVersions = new ArrayList<String>();
+ List<String> testedVersions = new ArrayList<>();
testedVersions.addAll( testedVersionSet );
Collections.sort( testedVersions, new VersionComparator() );
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
index f30c8a283..e7538de36 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411RepoGroupTest.java
@@ -147,7 +147,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
proxyConnectors.setDisabled( false );
c.addProxyConnector( proxyConnectors );
- List<String> repos = new ArrayList<String>();
+ List<String> repos = new ArrayList<>();
repos.add( TEST_REPO_ID );
repos.add( TEST_SNAP_REPO_ID );
@@ -210,7 +210,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
assertDependency( dependencies.get( 0 ), "commons-io", "commons-io", "1.4" );
assertDependency( dependencies.get( 1 ), "junit", "junit", "3.8.1", "test" );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-artifact-parent" );
paths.add( "target/test-repository/com/example/test/test-artifact-root" );
@@ -244,7 +244,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
assertEquals( "test-artifact-module-a", facet.getArtifactId() );
assertEquals( "jar", facet.getPackaging() );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-artifact-parent" );
paths.add( "target/test-repository/com/example/test/test-artifact-root" );
@@ -273,7 +273,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
assertEquals( "missing-parent", facet.getArtifactId() );
assertEquals( "jar", facet.getPackaging() );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-artifact-parent" );
paths.add( "target/test-repository/com/example/test/test-artifact-root" );
@@ -320,7 +320,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
assertDependency( dependencies.get( 0 ), "commons-io", "commons-io", "1.4" );
assertDependency( dependencies.get( 1 ), "junit", "junit", "3.8.1", "test" );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repositorys/com/example/test/test-snapshot-artifact-module-a" );
paths.add( "target/test-repositorys/com/example/test/test-snapshot-artifact-root" );
deleteTestArtifactWithParent( paths );
@@ -362,7 +362,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
assertDependency( dependencies.get( 0 ), "commons-io", "commons-io", "1.4" );
assertDependency( dependencies.get( 1 ), "junit", "junit", "3.8.1", "test" );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repositorys/com/example/test/test-snapshot-artifact-module-a" );
paths.add( "target/test-repositorys/com/example/test/test-snapshot-artifact-root" );
@@ -406,7 +406,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
assertDependency( dependencies.get( 0 ), "commons-io", "commons-io", "1.4" );
assertDependency( dependencies.get( 1 ), "junit", "junit", "3.8.1", "test" );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-b" );
paths.add( "target/test-repository/com/example/test/test-snapshot-artifact-root" );
@@ -464,7 +464,7 @@ public class Maven2RepositoryMetadataResolverMRM1411RepoGroupTest
private void assertMailingList( String prefix, MailingList mailingList, String name, boolean allowPost,
String nabbleUrl )
{
- List<String> otherArchives = new ArrayList<String>();
+ List<String> otherArchives = new ArrayList<>();
otherArchives.add( "http://www.mail-archive.com/" + prefix + "@archiva.apache.org" );
if ( nabbleUrl != null )
{
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
index b302db3c4..43aed4be4 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverMRM1411Test.java
@@ -177,7 +177,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
assertDependency( dependencies.get( 0 ), "commons-io", "commons-io", "1.4" );
assertDependency( dependencies.get( 1 ), "junit", "junit", "3.8.1", "test" );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-artifact-parent" );
paths.add( "target/test-repository/com/example/test/test-artifact-root" );
@@ -209,7 +209,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
assertEquals( "test-artifact-module-a", facet.getArtifactId() );
assertEquals( "jar", facet.getPackaging() );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-artifact-parent" );
paths.add( "target/test-repository/com/example/test/test-artifact-root" );
@@ -235,7 +235,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
assertEquals( "missing-parent", facet.getArtifactId() );
assertEquals( "jar", facet.getPackaging() );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-artifact-parent" );
paths.add( "target/test-repository/com/example/test/test-artifact-root" );
@@ -282,7 +282,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
assertDependency( dependencies.get( 0 ), "commons-io", "commons-io", "1.4" );
assertDependency( dependencies.get( 1 ), "junit", "junit", "3.8.1", "test" );
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-snapshot-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-snapshot-artifact-root" );
@@ -310,7 +310,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
{
}
- List<String> paths = new ArrayList<String>();
+ List<String> paths = new ArrayList<>();
paths.add( "target/test-repository/com/example/test/test-snapshot-artifact-module-a" );
paths.add( "target/test-repository/com/example/test/test-snapshot-artifact-root" );
@@ -368,7 +368,7 @@ public class Maven2RepositoryMetadataResolverMRM1411Test
private void assertMailingList( String prefix, MailingList mailingList, String name, boolean allowPost,
String nabbleUrl )
{
- List<String> otherArchives = new ArrayList<String>();
+ List<String> otherArchives = new ArrayList<>();
otherArchives.add( "http://www.mail-archive.com/" + prefix + "@archiva.apache.org" );
if ( nabbleUrl != null )
{
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
index a46cbefd0..5fff0d532 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
@@ -217,7 +217,7 @@ public class Maven2RepositoryMetadataResolverTest
{
Collection<ArtifactMetadata> springArtifacts = storage.readArtifactsMetadata(
new ReadMetadataRequest( TEST_REPO_ID, "org.codehaus.plexus", "plexus-spring", "1.2", ALL ) );
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( springArtifacts );
+ List<ArtifactMetadata> artifacts = new ArrayList<>( springArtifacts );
Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
{
public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
@@ -259,7 +259,7 @@ public class Maven2RepositoryMetadataResolverTest
{
Collection<ArtifactMetadata> testArtifacts = storage.readArtifactsMetadata(
new ReadMetadataRequest( TEST_REPO_ID, "com.example.test", "test-artifact", "1.0-SNAPSHOT", ALL ) );
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( testArtifacts );
+ List<ArtifactMetadata> artifacts = new ArrayList<>( testArtifacts );
Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
{
public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
@@ -559,7 +559,7 @@ public class Maven2RepositoryMetadataResolverTest
public void testGetArtifacts()
throws Exception
{
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( storage.readArtifactsMetadata(
+ List<ArtifactMetadata> artifacts = new ArrayList<>( storage.readArtifactsMetadata(
new ReadMetadataRequest( TEST_REPO_ID, "org.codehaus.plexus", "plexus-spring", "1.2", ALL ) ) );
assertEquals( 3, artifacts.size() );
Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
@@ -582,7 +582,7 @@ public class Maven2RepositoryMetadataResolverTest
{
ExcludesFilter<String> filter =
new ExcludesFilter<String>( Collections.singletonList( "plexus-spring-1.2.pom" ) );
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( storage.readArtifactsMetadata(
+ List<ArtifactMetadata> artifacts = new ArrayList<>( storage.readArtifactsMetadata(
new ReadMetadataRequest( TEST_REPO_ID, "org.codehaus.plexus", "plexus-spring", "1.2", filter ) ) );
assertEquals( 2, artifacts.size() );
Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
@@ -646,7 +646,7 @@ public class Maven2RepositoryMetadataResolverTest
private void assertMailingList( String prefix, MailingList mailingList, String name, boolean allowPost,
String nabbleUrl )
{
- List<String> otherArchives = new ArrayList<String>();
+ List<String> otherArchives = new ArrayList<>();
otherArchives.add( "http://www.mail-archive.com/" + prefix + "@archiva.apache.org" );
if ( nabbleUrl != null )
{
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
index baa103946..f7876cd86 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/repository/metadata/MetadataToolsTest.java
@@ -369,7 +369,7 @@ public class MetadataToolsTest
Set<String> testedVersionSet = tools.gatherSnapshotVersions( repoContent, reference );
// Sort the list (for asserts)
- List<String> testedVersions = new ArrayList<String>();
+ List<String> testedVersions = new ArrayList<>();
testedVersions.addAll( testedVersionSet );
Collections.sort( testedVersions, new VersionComparator() );
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
index fa46ea0fb..67a17cd5a 100644
--- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
@@ -374,7 +374,7 @@ public class CassandraMetadataRepository
{
// TODO use cql queries to delete all
- List<String> namespacesKey = new ArrayList<String>();
+ List<String> namespacesKey = new ArrayList<>();
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
@@ -465,7 +465,7 @@ public class CassandraMetadataRepository
.setRange( null, null, false, Integer.MAX_VALUE ) //
.execute();
- List<String> repoIds = new ArrayList<String>( cResult.get().getCount() );
+ List<String> repoIds = new ArrayList<>( cResult.get().getCount() );
for ( Row<String, String, String> row : cResult.get() )
{
@@ -517,7 +517,7 @@ public class CassandraMetadataRepository
.addEqualsExpression( "repositoryName", repoId ) //
.execute();
- List<String> namespaces = new ArrayList<String>( result.get().getCount() );
+ List<String> namespaces = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
@@ -553,7 +553,7 @@ public class CassandraMetadataRepository
.addEqualsExpression( "repositoryName", repoId ) //
.execute();
- List<String> namespaces = new ArrayList<String>( result.get().getCount() );
+ List<String> namespaces = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
@@ -1125,7 +1125,7 @@ public class CassandraMetadataRepository
protected List<MailingList> getMailingLists( String projectVersionMetadataKey )
{
- List<MailingList> mailingLists = new ArrayList<MailingList>();
+ List<MailingList> mailingLists = new ArrayList<>();
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
@@ -1146,7 +1146,7 @@ public class CassandraMetadataRepository
mailingList.setSubscribeAddress( columnFamilyResult.getString( "subscribeAddress" ) );
mailingList.setUnsubscribeAddress( columnFamilyResult.getString( "unsubscribeAddress" ) );
- List<String> otherArchives = new ArrayList<String>();
+ List<String> otherArchives = new ArrayList<>();
for ( String columnName : columnFamilyResult.getColumnNames() )
{
@@ -1207,7 +1207,7 @@ public class CassandraMetadataRepository
protected List<License> getLicenses( String projectVersionMetadataKey )
{
- List<License> licenses = new ArrayList<License>();
+ List<License> licenses = new ArrayList<>();
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
@@ -1289,7 +1289,7 @@ public class CassandraMetadataRepository
protected List<Dependency> getDependencies( String projectVersionMetadataKey )
{
- List<Dependency> dependencies = new ArrayList<Dependency>();
+ List<Dependency> dependencies = new ArrayList<>();
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
@@ -1536,7 +1536,7 @@ public class CassandraMetadataRepository
.addEqualsExpression( "facetId", facetId ) //
.execute();
- final List<String> facets = new ArrayList<String>();
+ final List<String> facets = new ArrayList<>();
for ( Row<String, String, String> row : result.get() )
{
@@ -1715,7 +1715,7 @@ public class CassandraMetadataRepository
}
QueryResult<OrderedRows<String, String, Long>> result = query.execute();
- List<ArtifactMetadata> artifactMetadatas = new ArrayList<ArtifactMetadata>( result.get().getCount() );
+ List<ArtifactMetadata> artifactMetadatas = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, Long> row : result.get() )
{
@@ -1902,7 +1902,7 @@ public class CassandraMetadataRepository
QueryResult<OrderedRows<String, String, String>> result = query.execute();
- List<ArtifactMetadata> artifactMetadatas = new ArrayList<ArtifactMetadata>( result.get().getCount() );
+ List<ArtifactMetadata> artifactMetadatas = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
@@ -1931,14 +1931,14 @@ public class CassandraMetadataRepository
.addEqualsExpression( "version", projectVersion ) //
.execute();
- List<String> dependenciesIds = new ArrayList<String>( result.get().getCount() );
+ List<String> dependenciesIds = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get().getList() )
{
dependenciesIds.add( getStringValue( row.getColumnSlice(), "projectVersionMetadataModel.key" ) );
}
- List<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>( result.get().getCount() );
+ List<ProjectVersionReference> references = new ArrayList<>( result.get().getCount() );
for ( String key : dependenciesIds )
{
@@ -2019,7 +2019,7 @@ public class CassandraMetadataRepository
return Collections.emptyList();
}
- List<ArtifactMetadata> artifactMetadatas = new ArrayList<ArtifactMetadata>( result.get().getCount() );
+ List<ArtifactMetadata> artifactMetadatas = new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
@@ -2059,7 +2059,7 @@ public class CassandraMetadataRepository
}
final List<MetadataFacetModel> metadataFacetModels =
- new ArrayList<MetadataFacetModel>( result.get().getCount() );
+ new ArrayList<>( result.get().getCount() );
for ( Row<String, String, String> row : result.get() )
{
@@ -2093,14 +2093,14 @@ public class CassandraMetadataRepository
} );
Iterator<MetadataFacetModel> iterator = metadataFacetModelIterable.iterator();
Map<String, List<MetadataFacetModel>> metadataFacetValuesPerFacetId =
- new HashMap<String, List<MetadataFacetModel>>();
+ new HashMap<>();
while ( iterator.hasNext() )
{
MetadataFacetModel metadataFacetModel = iterator.next();
List<MetadataFacetModel> values = metadataFacetValuesPerFacetId.get( metadataFacetModel.getName() );
if ( values == null )
{
- values = new ArrayList<MetadataFacetModel>();
+ values = new ArrayList<>();
metadataFacetValuesPerFacetId.put( metadataFacetModel.getFacetId(), values );
}
values.add( metadataFacetModel );
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
index e7445e198..9d0db4b1b 100644
--- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
+++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
@@ -137,7 +137,7 @@ public class DefaultCassandraArchivaManager
consistencyLevelPolicy.setDefaultWriteConsistencyLevel( HConsistencyLevel.valueOf( writeConsistencyLevel ) );
keyspace = HFactory.createKeyspace( keyspaceName, cluster, consistencyLevelPolicy );
- List<ColumnFamilyDefinition> cfds = new ArrayList<ColumnFamilyDefinition>();
+ List<ColumnFamilyDefinition> cfds = new ArrayList<>();
// namespace table
{
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
index 2f1b8115d..5b508b12b 100644
--- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
+++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java
@@ -57,11 +57,11 @@ public class ProjectVersionMetadataModel
private CiManagement ciManagement;
- private List<License> licenses = new ArrayList<License>();
+ private List<License> licenses = new ArrayList<>();
- private List<MailingList> mailingLists = new ArrayList<MailingList>();
+ private List<MailingList> mailingLists = new ArrayList<>();
- private List<Dependency> dependencies = new ArrayList<Dependency>();
+ private List<Dependency> dependencies = new ArrayList<>();
private boolean incomplete;
diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
index 7bc605f67..848e4a2f8 100644
--- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
@@ -132,7 +132,7 @@ public class FileMetadataRepository
Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY );
// remove properties that are not references or artifacts
- for ( Object key : new ArrayList<Object>( properties.keySet() ) )
+ for ( Object key : properties.keySet() )
{
String name = (String) key;
if ( !name.contains( ":" ) && !name.equals( "facetIds" ) )
@@ -240,7 +240,7 @@ public class FileMetadataRepository
private static void clearMetadataFacetProperties( Collection<MetadataFacet> facetList, Properties properties,
String prefix )
{
- List<Object> propsToRemove = new ArrayList<Object>();
+ List<Object> propsToRemove = new ArrayList<>();
for ( MetadataFacet facet : facetList )
{
for ( Object key : properties.keySet() )
@@ -303,7 +303,7 @@ public class FileMetadataRepository
public List<String> getMetadataFacets( String repoId, String facetId )
{
File directory = getMetadataDirectory( repoId, facetId );
- List<String> facets = new ArrayList<String>();
+ List<String> facets = new ArrayList<>();
recurse( facets, "", directory );
return facets;
}
@@ -409,7 +409,7 @@ public class FileMetadataRepository
// TODO: this is quite slow - if we are to persist with this repository implementation we should build an index
// of this information (eg. in Lucene, as before)
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> artifacts = new ArrayList<>();
for ( String ns : getRootNamespaces( repoId ) )
{
getArtifactsByDateRange( artifacts, repoId, ns, startTime, endTime );
@@ -580,7 +580,7 @@ public class FileMetadataRepository
public Collection<String> getRepositories()
{
- List<String> repositories = new ArrayList<String>();
+ List<String> repositories = new ArrayList<>();
for ( ManagedRepositoryConfiguration managedRepositoryConfiguration : configuration.getConfiguration().getManagedRepositories() )
{
repositories.add( managedRepositoryConfiguration.getId() );
@@ -595,7 +595,7 @@ public class FileMetadataRepository
// alternatively, we could build a referential tree in the content repository, however it would need some levels
// of depth to avoid being too broad to be useful (eg. /repository/checksums/a/ab/abcdef1234567)
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> artifacts = new ArrayList<>();
for ( String ns : getRootNamespaces( repositoryId ) )
{
getArtifactsByChecksum( artifacts, repositoryId, ns, checksum );
@@ -642,7 +642,7 @@ public class FileMetadataRepository
properties.remove( "artifact:facetIds:" + id );
String prefix = "artifact:facet:" + id + ":";
- for ( Object key : new ArrayList<Object>( properties.keySet() ) )
+ for ( Object key : properties.keySet() )
{
String property = (String) key;
if ( property.startsWith( prefix ) )
@@ -679,7 +679,7 @@ public class FileMetadataRepository
properties.remove( "artifact:facetIds:" + id );
String prefix = "artifact:facet:" + id + ":";
- for ( Object key : new ArrayList<Object>( properties.keySet() ) )
+ for ( Object key : properties.keySet() )
{
String property = (String) key;
if ( property.startsWith( prefix ) )
@@ -1077,7 +1077,7 @@ public class FileMetadataRepository
Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY );
int numberOfRefs = Integer.parseInt( properties.getProperty( "ref:lastReferenceNum", "-1" ) ) + 1;
- List<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>();
+ List<ProjectVersionReference> references = new ArrayList<>();
for ( int i = 0; i < numberOfRefs; i++ )
{
ProjectVersionReference reference = new ProjectVersionReference();
@@ -1098,7 +1098,7 @@ public class FileMetadataRepository
public Collection<String> getNamespaces( String repoId, String baseNamespace )
{
- List<String> allNamespaces = new ArrayList<String>();
+ List<String> allNamespaces = new ArrayList<>();
File directory = getDirectory( repoId );
File[] files = directory.listFiles();
if ( files != null )
@@ -1112,7 +1112,7 @@ public class FileMetadataRepository
}
}
- Set<String> namespaces = new LinkedHashSet<String>();
+ Set<String> namespaces = new LinkedHashSet<>();
int fromIndex = baseNamespace != null ? baseNamespace.length() + 1 : 0;
for ( String namespace : allNamespaces )
{
@@ -1129,12 +1129,12 @@ public class FileMetadataRepository
}
}
}
- return new ArrayList<String>( namespaces );
+ return new ArrayList<>( namespaces );
}
public Collection<String> getProjects( String repoId, String namespace )
{
- List<String> projects = new ArrayList<String>();
+ List<String> projects = new ArrayList<>();
File directory = new File( getDirectory( repoId ), namespace );
File[] files = directory.listFiles();
if ( files != null )
@@ -1152,7 +1152,7 @@ public class FileMetadataRepository
public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
{
- List<String> projectVersions = new ArrayList<String>();
+ List<String> projectVersions = new ArrayList<>();
File directory = new File( getDirectory( repoId ), namespace + "/" + projectId );
File[] files = directory.listFiles();
if ( files != null )
@@ -1240,7 +1240,7 @@ public class FileMetadataRepository
public List<ArtifactMetadata> getArtifacts( String repoId )
{
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> artifacts = new ArrayList<>();
for ( String ns : getRootNamespaces( repoId ) )
{
getArtifacts( artifacts, repoId, ns );
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
index bd80b15f4..2acdbaab8 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
@@ -423,7 +423,7 @@ public class JcrMetadataRepository
public List<String> getMetadataFacets( String repositoryId, String facetId )
throws MetadataRepositoryException
{
- List<String> facets = new ArrayList<String>();
+ List<String> facets = new ArrayList<>();
try
{
@@ -625,7 +625,7 @@ public class JcrMetadataRepository
}
QueryResult result = query.execute();
- artifacts = new ArrayList<ArtifactMetadata>();
+ artifacts = new ArrayList<>();
for ( Node n : JcrUtils.getNodes( result ) )
{
artifacts.add( getArtifactFromNode( repoId, n ) );
@@ -650,7 +650,7 @@ public class JcrMetadataRepository
{
Node node = root.getNode( "repositories" );
- repositories = new ArrayList<String>();
+ repositories = new ArrayList<>();
NodeIterator i = node.getNodes();
while ( i.hasNext() )
{
@@ -684,7 +684,7 @@ public class JcrMetadataRepository
query.bindValue( "checksum", valueFactory.createValue( checksum ) );
QueryResult result = query.execute();
- artifacts = new ArrayList<ArtifactMetadata>();
+ artifacts = new ArrayList<>();
for ( Node n : JcrUtils.getNodes( result ) )
{
artifacts.add( getArtifactFromNode( repositoryId, n ) );
@@ -728,7 +728,7 @@ public class JcrMetadataRepository
Query query = getJcrSession().getWorkspace().getQueryManager().createQuery( q, Query.JCR_SQL2 );
QueryResult result = query.execute();
- artifacts = new ArrayList<ArtifactMetadata>();
+ artifacts = new ArrayList<>();
for ( Node n : JcrUtils.getNodes( result ) )
{
if ( n.isNodeType( ARTIFACT_NODE_TYPE ) )
@@ -988,7 +988,7 @@ public class JcrMetadataRepository
throws MetadataResolutionException
{
- List<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>();
+ List<ProjectVersionReference> references = new ArrayList<>();
// TODO: bind variables instead
String q = "SELECT * FROM [archiva:dependency] WHERE ISDESCENDANTNODE([/repositories/" + repositoryId +
@@ -1200,7 +1200,7 @@ public class JcrMetadataRepository
String projectVersion )
throws MetadataResolutionException
{
- List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> artifacts = new ArrayList<>();
try
{
@@ -1377,7 +1377,7 @@ public class JcrMetadataRepository
private Collection<String> getNodeNames( String path, String nodeType )
throws MetadataResolutionException
{
- List<String> names = new ArrayList<String>();
+ List<String> names = new ArrayList<>();
try
{
diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java
index e4cd0a902..7d6fa86ce 100644
--- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java
+++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java
@@ -83,7 +83,7 @@ public class DuplicateArtifactsConsumer
@Inject
private RepositorySessionFactory repositorySessionFactory;
- private List<String> includes = new ArrayList<String>();
+ private List<String> includes = new ArrayList<>();
private File repositoryDir;
diff --git a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
index 1ce90027d..efa26c5d6 100644
--- a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
+++ b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
@@ -272,7 +272,7 @@ public class DefaultRepositoryStatisticsManager
Date startTime, Date endTime )
throws MetadataRepositoryException
{
- List<RepositoryStatistics> results = new ArrayList<RepositoryStatistics>();
+ List<RepositoryStatistics> results = new ArrayList<>();
List<String> list = metadataRepository.getMetadataFacets( repositoryId, RepositoryStatistics.FACET_ID );
Collections.sort( list, Collections.reverseOrder() );
for ( String name : list )
diff --git a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
index c0632261f..2ec08e6b5 100644
--- a/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
+++ b/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
@@ -255,7 +255,7 @@ public class RepositoryStatisticsManagerTest
addStats( new Date( current.getTime() - 3000 ), new Date( current.getTime() - 2000 ) );
addStats( new Date( current.getTime() - 1000 ), current );
- ArrayList<String> keys = new ArrayList<String>( statsCreated.keySet() );
+ ArrayList<String> keys = new ArrayList<>( statsCreated.keySet() );
expect( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryStatistics.FACET_ID ) ).andReturn( keys );
@@ -299,7 +299,7 @@ public class RepositoryStatisticsManagerTest
addStats( new Date( current.getTime() - 3000 ), new Date( current.getTime() - 2000 ) );
addStats( new Date( current.getTime() - 1000 ), current );
- List<String> keys = new ArrayList<String>( statsCreated.keySet() );
+ List<String> keys = new ArrayList<>( statsCreated.keySet() );
expect( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryStatistics.FACET_ID ) ).andReturn( keys );
@@ -347,7 +347,7 @@ public class RepositoryStatisticsManagerTest
addStats( new Date( current.getTime() - 3000 ), new Date( current.getTime() - 2000 ) );
addStats( new Date( current.getTime() - 1000 ), current );
- List<String> keys = new ArrayList<String>( statsCreated.keySet() );
+ List<String> keys = new ArrayList<>( statsCreated.keySet() );
expect( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryStatistics.FACET_ID ) ).andReturn( keys );
@@ -395,7 +395,7 @@ public class RepositoryStatisticsManagerTest
addStats( new Date( current.getTime() - 3000 ), new Date( current.getTime() - 2000 ) );
addStats( new Date( current.getTime() - 1000 ), current );
- ArrayList<String> keys = new ArrayList<String>( statsCreated.keySet() );
+ ArrayList<String> keys = new ArrayList<>( statsCreated.keySet() );
expect( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryStatistics.FACET_ID ) ).andReturn( keys );
@@ -447,7 +447,7 @@ public class RepositoryStatisticsManagerTest
addStats( new Date( current.getTime() - 3000 ), new Date( current.getTime() - 2000 ) );
addStats( new Date( current.getTime() - 1000 ), current );
- ArrayList<String> keys = new ArrayList<String>( statsCreated.keySet() );
+ ArrayList<String> keys = new ArrayList<>( statsCreated.keySet() );
expect( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryStatistics.FACET_ID ) ).andReturn( keys );
diff --git a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
index aaaaf2977..ffc7921e5 100644
--- a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
+++ b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java
@@ -285,7 +285,7 @@ public class Maven2RepositoryMerger
Date lastUpdatedTimestamp, String timestamp )
throws RepositoryMetadataException
{
- ArrayList<String> availableVersions = new ArrayList<String>();
+ ArrayList<String> availableVersions = new ArrayList<>();
String latestVersion = artifactMetadata.getProjectVersion();
ArchivaRepositoryMetadata projectMetadata = getMetadata( projectMetaDataFileIntargetRepo );
@@ -376,7 +376,7 @@ public class Maven2RepositoryMerger
{
List<ArtifactMetadata> targetArtifacts = metadataRepository.getArtifacts( targetRepo );
List<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( sourceRepo );
- List<ArtifactMetadata> conflictsArtifacts = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> conflictsArtifacts = new ArrayList<>();
for ( ArtifactMetadata targetArtifact : targetArtifacts )
{
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java b/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
index 282aad882..08e0f01c0 100644
--- a/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
+++ b/archiva-modules/plugins/stage-repository-merge/src/test/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMergerTest.java
@@ -68,7 +68,7 @@ public class Maven2RepositoryMergerTest
private List<ArtifactMetadata> getArtifacts()
{
- List<ArtifactMetadata> metadata = new ArrayList<ArtifactMetadata>();
+ List<ArtifactMetadata> metadata = new ArrayList<>();
ArtifactMetadata artifact1 = new ArtifactMetadata();
artifact1.setNamespace( "com.example.test" );
artifact1.setProject( "test-artifact" );
@@ -102,7 +102,7 @@ public class Maven2RepositoryMergerTest
testRepo.setLocation( "target" + File.separatorChar + "test-repository" );
RepositoryScanningConfiguration repoScanConfig = new RepositoryScanningConfiguration();
- List<String> knownContentConsumers = new ArrayList<String>();
+ List<String> knownContentConsumers = new ArrayList<>();
knownContentConsumers.add( "metadata-updater12" );
repoScanConfig.setKnownContentConsumers( knownContentConsumers );
c.setRepositoryScanning( repoScanConfig );
@@ -151,7 +151,7 @@ public class Maven2RepositoryMergerTest
testRepoWithConflicts.setLocation( sourceRepo );
RepositoryScanningConfiguration repoScanConfig = new RepositoryScanningConfiguration();
- List<String> knownContentConsumers = new ArrayList<String>();
+ List<String> knownContentConsumers = new ArrayList<>();
knownContentConsumers.add( "metadata-updater" );
repoScanConfig.setKnownContentConsumers( knownContentConsumers );
c.setRepositoryScanning( repoScanConfig );