diff options
Diffstat (limited to 'archiva-modules/metadata')
3 files changed, 30 insertions, 30 deletions
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java index 9fad3857e..1ff3401fe 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java @@ -46,11 +46,11 @@ public class ProjectVersionMetadata 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/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index 5c921d68b..06b4bb532 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -213,7 +213,7 @@ public class DefaultMetadataResolver } session.markDirty(); - namespaces = new ArrayList<String>( namespaces ); + namespaces = new ArrayList<>( namespaces ); namespaces.addAll( storageNamespaces ); } @@ -240,7 +240,7 @@ public class DefaultMetadataResolver namespaces = metadataRepository.getNamespaces( repoId, namespace ); namespacesCache.put( cacheKey, namespaces ); } - Collection<String> exclusions = new ArrayList<String>( namespaces ); + Collection<String> exclusions = new ArrayList<>( namespaces ); exclusions.addAll( metadataRepository.getProjects( repoId, namespace ) ); Collection<String> storageNamespaces = repositoryStorage.listNamespaces( repoId, namespace, new ExcludesFilter<String>( exclusions ) ); @@ -265,7 +265,7 @@ public class DefaultMetadataResolver } session.markDirty(); - namespaces = new ArrayList<String>( namespaces ); + namespaces = new ArrayList<>( namespaces ); namespaces.addAll( storageNamespaces ); } return namespaces; @@ -283,7 +283,7 @@ public class DefaultMetadataResolver { MetadataRepository metadataRepository = session.getRepository(); Collection<String> projects = metadataRepository.getProjects( repoId, namespace ); - Collection<String> exclusions = new ArrayList<String>( projects ); + Collection<String> exclusions = new ArrayList<>( projects ); String cacheKey = repoId + "-" + namespace; Collection<String> namespaces = namespacesCache.get( cacheKey ); @@ -319,7 +319,7 @@ public class DefaultMetadataResolver } session.markDirty(); - projects = new ArrayList<String>( projects ); + projects = new ArrayList<>( projects ); projects.addAll( storageProjects ); } return projects; @@ -387,7 +387,7 @@ public class DefaultMetadataResolver } session.markDirty(); - projectVersions = new ArrayList<String>( projectVersions ); + projectVersions = new ArrayList<>( projectVersions ); projectVersions.addAll( storageProjectVersions ); } return projectVersions; @@ -433,7 +433,7 @@ public class DefaultMetadataResolver } session.markDirty(); - artifacts = new ArrayList<ArtifactMetadata>( artifacts ); + artifacts = new ArrayList<>( artifacts ); artifacts.addAll( storageArtifacts ); } return artifacts; @@ -450,7 +450,7 @@ public class DefaultMetadataResolver private Collection<String> createArtifactIdList( Collection<ArtifactMetadata> artifacts ) { - Collection<String> artifactIds = new ArrayList<String>(); + Collection<String> artifactIds = new ArrayList<>(); for ( ArtifactMetadata artifact : artifacts ) { artifactIds.add( artifact.getId() ); diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java index 27eef207b..5f7f8c0a2 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java @@ -204,7 +204,7 @@ public abstract class AbstractMetadataRepositoryTest public void testGetArtifactOnly() throws Exception { - assertThat( new ArrayList<ArtifactMetadata>( + assertThat( new ArrayList<>( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) ).isNotNull().isEmpty(); assertThat( @@ -508,19 +508,19 @@ public abstract class AbstractMetadataRepositoryTest Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<ArtifactMetadata>( artifacts ) ); + assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); artifacts = repository.getArtifacts( TEST_REPO_ID ); - assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<ArtifactMetadata>( artifacts ) ); + assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); artifacts = repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ); - assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<ArtifactMetadata>( artifacts ) ); + assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); artifacts = repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ); - assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<ArtifactMetadata>( artifacts ) ); + assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ); - assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<ArtifactMetadata>( artifacts ) ); + assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); } @Test @@ -812,7 +812,7 @@ public abstract class AbstractMetadataRepositoryTest Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - ArrayList<ArtifactMetadata> actual = new ArrayList<ArtifactMetadata>( artifacts ); + ArrayList<ArtifactMetadata> actual = new ArrayList<>( artifacts ); Collections.sort( actual, new Comparator<ArtifactMetadata>() { public int compare( ArtifactMetadata o1, ArtifactMetadata o2 ) @@ -1028,13 +1028,13 @@ public abstract class AbstractMetadataRepositoryTest // test it restricts to the appropriate repository assertEquals( Collections.singletonList( artifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); - assertEquals( Collections.singletonList( secondArtifact ), new ArrayList<ArtifactMetadata>( + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); + assertEquals( Collections.singletonList( secondArtifact ), new ArrayList<>( repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_SHA1 ) ) ); assertEquals( Collections.singletonList( artifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); assertEquals( Collections.singletonList( secondArtifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_MD5 ) ) ); } @Test @@ -1121,7 +1121,7 @@ public abstract class AbstractMetadataRepositoryTest repository.save(); assertEquals( Collections.singletonList( artifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); } @Test @@ -1133,7 +1133,7 @@ public abstract class AbstractMetadataRepositoryTest repository.save(); assertEquals( Collections.singletonList( artifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); } @Test @@ -1147,9 +1147,9 @@ public abstract class AbstractMetadataRepositoryTest repository.save(); assertEquals( Collections.singletonList( artifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); assertEquals( Collections.singletonList( artifact ), - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); } @Test @@ -1166,11 +1166,11 @@ public abstract class AbstractMetadataRepositoryTest repository.save(); List<ArtifactMetadata> artifacts = - new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ); + new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ); Collections.sort( artifacts, new ArtifactMetadataComparator() ); assertEquals( Arrays.asList( artifact2, artifact1 ), artifacts ); - artifacts = new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ); + artifacts = new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ); Collections.sort( artifacts, new ArtifactMetadataComparator() ); assertEquals( Arrays.asList( artifact2, artifact1 ), artifacts ); } @@ -1215,7 +1215,7 @@ public abstract class AbstractMetadataRepositoryTest Collections.sort( expected, new ArtifactMetadataComparator() ); List<ArtifactMetadata> actual = - new ArrayList<ArtifactMetadata>( repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) ); + new ArrayList<>( repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) ); Collections.sort( actual, new ArtifactMetadataComparator() ); assertEquals( expected, actual ); @@ -1276,7 +1276,7 @@ public abstract class AbstractMetadataRepositoryTest Collection<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>( artifacts ) ); + assertEquals( Collections.singletonList( artifact ), new ArrayList<>( artifacts ) ); repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() ); |