diff options
Diffstat (limited to 'archiva-modules/archiva-web')
29 files changed, 69 insertions, 71 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/SearchRequest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/SearchRequest.java index 209e1ccd2..e38706ca0 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/SearchRequest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/SearchRequest.java @@ -62,7 +62,7 @@ public class SearchRequest /** * repositories */ - private List<String> repositories = new ArrayList<String>(); + private List<String> repositories = new ArrayList<>(); /** diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java index c586e3844..c05da22ca 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java @@ -77,7 +77,7 @@ public abstract class AbstractRestService protected Logger log = LoggerFactory.getLogger( getClass() ); @Inject - private List<AuditListener> auditListeners = new ArrayList<AuditListener>(); + private List<AuditListener> auditListeners = new ArrayList<>(); @Inject protected UserRepositories userRepositories; @@ -272,7 +272,7 @@ public abstract class AbstractRestService { if ( artifactMetadatas != null && !artifactMetadatas.isEmpty() ) { - List<Artifact> artifacts = new ArrayList<Artifact>( artifactMetadatas.size() ); + List<Artifact> artifacts = new ArrayList<>( artifactMetadatas.size() ); for ( ArtifactMetadata artifact : artifactMetadatas ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index 855d3d67e..df86ba443 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -144,7 +144,7 @@ public class DefaultBrowseService repositorySession.close(); } - List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<BrowseResultEntry>( namespaces.size() ); + List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<>( namespaces.size() ); for ( String namespace : namespaces ) { browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ) ); @@ -196,7 +196,7 @@ public class DefaultBrowseService repositorySession.close(); } List<BrowseResultEntry> browseGroupResultEntries = - new ArrayList<BrowseResultEntry>( namespaces.size() + projects.size() ); + new ArrayList<>( namespaces.size() + projects.size() ); for ( String namespace : namespaces ) { browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ).groupId( namespace ) ); @@ -219,7 +219,7 @@ public class DefaultBrowseService try { Collection<String> versions = getVersions( selectedRepos, groupId, artifactId ); - return new VersionsList( new ArrayList<String>( versions ) ); + return new VersionsList( new ArrayList<>( versions ) ); } catch ( MetadataResolutionException e ) { @@ -247,7 +247,7 @@ public class DefaultBrowseService versions.addAll( projectVersions ); } - List<String> sortedVersions = new ArrayList<String>( versions ); + List<String> sortedVersions = new ArrayList<>( versions ); Collections.sort( sortedVersions, VersionComparator.getInstance() ); @@ -499,7 +499,7 @@ public class DefaultBrowseService public List<Artifact> getDependees( String groupId, String artifactId, String version, String repositoryId ) throws ArchivaRestServiceException { - List<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>(); + List<ProjectVersionReference> references = new ArrayList<>(); // TODO: what if we get duplicates across repositories? RepositorySession repositorySession = repositorySessionFactory.createSession(); try @@ -523,7 +523,7 @@ public class DefaultBrowseService repositorySession.close(); } - List<Artifact> artifacts = new ArrayList<Artifact>( references.size() ); + List<Artifact> artifacts = new ArrayList<>( references.size() ); for ( ProjectVersionReference projectVersionReference : references ) { @@ -549,7 +549,7 @@ public class DefaultBrowseService return Collections.emptyList(); } Map<String, String> map = metadataFacet.toProperties(); - List<Entry> entries = new ArrayList<Entry>( map.size() ); + List<Entry> entries = new ArrayList<>( map.size() ); for ( Map.Entry<String, String> entry : map.entrySet() ) { @@ -711,7 +711,7 @@ public class DefaultBrowseService { List<String> selectedRepos = getSelectedRepos( repositoryId ); - List<Artifact> artifactDownloadInfos = new ArrayList<Artifact>(); + List<Artifact> artifactDownloadInfos = new ArrayList<>(); RepositorySession session = repositorySessionFactory.createSession(); @@ -721,7 +721,7 @@ public class DefaultBrowseService { for ( String repoId : selectedRepos ) { - List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( + List<ArtifactMetadata> artifacts = new ArrayList<>( metadataResolver.resolveArtifacts( session, repoId, groupId, artifactId, version ) ); Collections.sort( artifacts, ArtifactMetadataVersionComparator.INSTANCE ); if ( artifacts != null && !artifacts.isEmpty() ) @@ -1037,7 +1037,7 @@ public class DefaultBrowseService jarFile.close(); } } - List<ArtifactContentEntry> sorted = new ArrayList<ArtifactContentEntry>( artifactContentEntryMap.values() ); + List<ArtifactContentEntry> sorted = new ArrayList<>( artifactContentEntryMap.values() ); Collections.sort( sorted, ArtifactContentEntryComparator.INSTANCE ); return sorted; } @@ -1060,7 +1060,7 @@ public class DefaultBrowseService if ( currentList == null ) { - currentList = new ArrayList<ArtifactContentEntry>(); + currentList = new ArrayList<>(); currentList.add( current ); perDepthList.put( current.getDepth(), currentList ); } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java index d309c9889..dc187afe9 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java @@ -197,7 +197,7 @@ public class DefaultMergeRepositoriesService String sourceRepoId, String repoid ) throws RepositoryMergerException { - List<ArtifactMetadata> artifactsWithOutSnapshots = new ArrayList<ArtifactMetadata>(); + List<ArtifactMetadata> artifactsWithOutSnapshots = new ArrayList<>(); for ( ArtifactMetadata metadata : sourceArtifacts ) { if ( VersionUtil.isSnapshot( metadata.getProjectVersion() ) ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java index a7c1c494a..4cab81d47 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultPluginsServices.java @@ -42,9 +42,9 @@ public class DefaultPluginsServices implements PluginsService { - private List<String> repositoryType = new ArrayList<String>(); + private List<String> repositoryType = new ArrayList<>(); - private List<String> adminFeatures = new ArrayList<String>(); + private List<String> adminFeatures = new ArrayList<>(); private ApplicationContext appCont; diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java index aa1a7bdea..fa1861c70 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java @@ -49,7 +49,7 @@ public class DefaultProxyConnectorService @Inject public DefaultProxyConnectorService( ApplicationContext applicationContext ) { - allPolicies = new ArrayList<Policy>( getBeansOfType( applicationContext, Policy.class ).values() ); + allPolicies = new ArrayList<>( getBeansOfType( applicationContext, Policy.class ).values() ); } public List<ProxyConnector> getProxyConnectors() @@ -146,7 +146,7 @@ public class DefaultProxyConnectorService public List<PolicyInformation> getAllPolicyInformations() throws ArchivaRestServiceException { - List<PolicyInformation> policyInformations = new ArrayList<PolicyInformation>( allPolicies.size() ); + List<PolicyInformation> policyInformations = new ArrayList<>( allPolicies.size() ); for ( Policy policy : allPolicies ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java index 1b214be22..c47e1d3bb 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRedbackRuntimeConfigurationService.java @@ -200,8 +200,7 @@ public class DefaultRedbackRuntimeConfigurationService return Collections.emptyList(); } - List<UserManagerImplementationInformation> informations = - new ArrayList<UserManagerImplementationInformation>( beans.size() ); + List<UserManagerImplementationInformation> informations = new ArrayList<>( beans.size() ); for ( Map.Entry<String, UserManager> entry : beans.entrySet() ) { @@ -229,8 +228,7 @@ public class DefaultRedbackRuntimeConfigurationService return Collections.emptyList(); } - List<RBACManagerImplementationInformation> informations = - new ArrayList<RBACManagerImplementationInformation>( beans.size() ); + List<RBACManagerImplementationInformation> informations = new ArrayList<>( beans.size() ); for ( Map.Entry<String, RBACManager> entry : beans.entrySet() ) { @@ -314,12 +312,12 @@ public class DefaultRedbackRuntimeConfigurationService } catch ( InvalidNameException e ) { - log.warn( "fail to get ldapConnection: {}", e.getMessage(), e); + log.warn( "fail to get ldapConnection: {}", e.getMessage(), e ); throw new ArchivaRestServiceException( e.getMessage(), e ); } catch ( LdapException e ) { - log.warn( "fail to get ldapConnection: {}", e.getMessage(), e); + log.warn( "fail to get ldapConnection: {}", e.getMessage(), e ); throw new ArchivaRestServiceException( e.getMessage(), e ); } finally diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java index dfdfc433c..08c7c1d13 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultReportRepositoriesService.java @@ -73,7 +73,7 @@ public class DefaultReportRepositoriesService try { MetadataRepository metadataRepository = repositorySession.getRepository(); - List<RepositoryStatistics> stats = new ArrayList<RepositoryStatistics>(); + List<RepositoryStatistics> stats = new ArrayList<>(); for ( String repo : repositoriesId ) { try @@ -140,10 +140,10 @@ public class DefaultReportRepositoriesService if ( !ALL_REPOSITORIES.equals( repository ) ) { - observableRepositories = Collections.<String>singletonList( repository ); + observableRepositories = Collections.singletonList( repository ); } - List<RepositoryProblemFacet> problemArtifacts = new ArrayList<RepositoryProblemFacet>(); + List<RepositoryProblemFacet> problemArtifacts = new ArrayList<>(); MetadataRepository metadataRepository = repositorySession.getRepository(); for ( String repoId : observableRepositories ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java index 1f682bc75..c90589ce9 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java @@ -554,7 +554,7 @@ public class DefaultRepositoriesService boolean fixChecksums, ArtifactTransferRequest artifactTransferRequest ) throws RepositoryMetadataException { - List<String> availableVersions = new ArrayList<String>(); + List<String> availableVersions = new ArrayList<>(); String latestVersion = artifactTransferRequest.getVersion(); File projectDir = new File( targetPath ).getParentFile(); @@ -1123,7 +1123,7 @@ public class DefaultRepositoriesService Artifact artifact ) throws RepositoryMetadataException { - List<String> availableVersions = new ArrayList<String>(); + List<String> availableVersions = new ArrayList<>(); String latestVersion = ""; if ( metadataFile.exists() ) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java index afabd6676..8269e763e 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java @@ -48,10 +48,10 @@ public class DefaultRepositoryGroupService try { List<RepositoryGroup> repositoriesGroups = - new ArrayList<RepositoryGroup>( repositoryGroupAdmin.getRepositoriesGroups().size() ); + new ArrayList<>( repositoryGroupAdmin.getRepositoriesGroups().size() ); for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() ) { - repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<String>( + repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<>( repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl( repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ) ); } @@ -82,7 +82,7 @@ public class DefaultRepositoryGroupService try { return repositoryGroupAdmin.addRepositoryGroup( - new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>( + new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<>( repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl( repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ), getAuditInformation() ); @@ -99,7 +99,7 @@ public class DefaultRepositoryGroupService try { return repositoryGroupAdmin.updateRepositoryGroup( - new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>( + new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<>( repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ).mergedIndexTtl( repoGroup.getMergedIndexTtl() ).cronExpression( repoGroup.getCronExpression() ), getAuditInformation() ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java index bc1f2cc57..f17137365 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSearchService.java @@ -170,7 +170,7 @@ public class DefaultSearchService } try { - return new GroupIdList( new ArrayList<String>( repositorySearch.getAllGroupIds( getPrincipal(), repos ) ) ); + return new GroupIdList( new ArrayList<>( repositorySearch.getAllGroupIds( getPrincipal(), repos ) ) ); } catch ( RepositorySearchException e ) { @@ -209,7 +209,7 @@ public class DefaultSearchService { return Collections.emptyList(); } - List<Artifact> artifacts = new ArrayList<Artifact>( searchResults.getReturnedHitsCount() ); + List<Artifact> artifacts = new ArrayList<>( searchResults.getReturnedHitsCount() ); for ( SearchResultHit hit : searchResults.getHits() ) { // duplicate Artifact one per available version diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/AddAdminRepoConsumerClosure.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/AddAdminRepoConsumerClosure.java index 7bd92c0e1..21d329f78 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/AddAdminRepoConsumerClosure.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/AddAdminRepoConsumerClosure.java @@ -34,7 +34,7 @@ import java.util.List; public class AddAdminRepoConsumerClosure implements Closure { - private List<AdminRepositoryConsumer> list = new ArrayList<AdminRepositoryConsumer>(); + private List<AdminRepositoryConsumer> list = new ArrayList<>(); private List<String> selectedIds; diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java index e51ec85dc..e0d337920 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java @@ -72,7 +72,7 @@ public class RssFeedGenerator private List<SyndEntry> getEntries( List<RssFeedEntry> dataEntries ) { - List<SyndEntry> entries = new ArrayList<SyndEntry>(); + List<SyndEntry> entries = new ArrayList<>(); SyndEntry entry; SyndContent description; diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java index 90d983a5f..776274ae7 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java @@ -102,7 +102,7 @@ public class NewArtifactsRssFeedProcessor long tmp = 0; RssFeedEntry entry = null; - List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>(); + List<RssFeedEntry> entries = new ArrayList<>(); String description = ""; int idx = 0; for ( ArtifactMetadata artifact : artifacts ) diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java index a41c0df5c..eb315d296 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java @@ -81,7 +81,7 @@ public class NewVersionsOfArtifactRssFeedProcessor MetadataRepository metadataRepository ) throws FeedException { - List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>(); + List<ArtifactMetadata> artifacts = new ArrayList<>(); try { for ( String repoId : metadataRepository.getRepositories() ) @@ -106,7 +106,7 @@ public class NewVersionsOfArtifactRssFeedProcessor long tmp = 0; RssFeedEntry entry = null; - List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>(); + List<RssFeedEntry> entries = new ArrayList<>(); String description = ""; int idx = 0; for ( ArtifactMetadata artifact : artifacts ) diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java index c011fb894..40cab4f52 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java @@ -57,7 +57,7 @@ public class RssFeedGeneratorTest public void testNewFeed() throws Exception { - List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>(); + List<RssFeedEntry> entries = new ArrayList<>(); RssFeedEntry entry = new RssFeedEntry( "Item 1" ); Date whenGathered = new Date( System.currentTimeMillis() ); @@ -95,7 +95,7 @@ public class RssFeedGeneratorTest public void testNoDataEntries() throws Exception { - List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>(); + List<RssFeedEntry> entries = new ArrayList<>(); SyndFeed feed = generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries ); diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java index a83f38301..ad06d3dd6 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java @@ -72,7 +72,7 @@ public class NewArtifactsRssFeedProcessorTest public void testProcess() throws Exception { - List<ArtifactMetadata> newArtifacts = new ArrayList<ArtifactMetadata>(); + List<ArtifactMetadata> newArtifacts = new ArrayList<>(); Date whenGathered = Calendar.getInstance().getTime(); newArtifacts.add( createArtifact( "artifact-one", "1.0", whenGathered ) ); diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java index d266b528c..cb13c7e41 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/DefaultUserRepositories.java @@ -81,7 +81,7 @@ public class DefaultUserRepositories { List<ManagedRepository> managedRepositories = getAccessibleRepositories( principal, operation ); - List<String> repoIds = new ArrayList<String>( managedRepositories.size() ); + List<String> repoIds = new ArrayList<>( managedRepositories.size() ); for ( ManagedRepository managedRepository : managedRepositories ) { repoIds.add( managedRepository.getId() ); @@ -101,7 +101,7 @@ public class DefaultUserRepositories { SecuritySession securitySession = createSession( principal ); - List<ManagedRepository> managedRepositories = new ArrayList<ManagedRepository>(); + List<ManagedRepository> managedRepositories = new ArrayList<>(); try { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java index 59c352b25..936e1598f 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java @@ -604,7 +604,7 @@ public class DefaultFileUploadService String artifactId, String version, String packaging ) throws RepositoryMetadataException { - List<String> availableVersions = new ArrayList<String>(); + List<String> availableVersions = new ArrayList<>(); String latestVersion = version; File projectDir = new File( targetPath ).getParentFile(); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java index e822c6b1d..cc9ae88db 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/rss/RssFeedServlet.java @@ -240,7 +240,7 @@ public class RssFeedServlet UnauthorizedException { String auth = req.getHeader( "Authorization" ); - List<String> repoIds = new ArrayList<String>(); + List<String> repoIds = new ArrayList<>(); if ( repositoryId != null ) { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java index 652b5d088..d2aae47ba 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java @@ -259,7 +259,7 @@ public class ArchivaConfigurableUsersManager public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending ) throws UserManagerException { - List<User> users = new ArrayList<User>(); + List<User> users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -275,7 +275,7 @@ public class ArchivaConfigurableUsersManager public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscending ) throws UserManagerException { - List<User> users = new ArrayList<User>(); + List<User> users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -291,7 +291,7 @@ public class ArchivaConfigurableUsersManager public List<User> findUsersByQuery( UserQuery query ) throws UserManagerException { - List<User> users = new ArrayList<User>(); + List<User> users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -307,7 +307,7 @@ public class ArchivaConfigurableUsersManager public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscending ) throws UserManagerException { - List<User> users = new ArrayList<User>(); + List<User> users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -328,7 +328,7 @@ public class ArchivaConfigurableUsersManager public List<User> getUsers() throws UserManagerException { - List<User> users = new ArrayList<User>(); + List<User> users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -344,7 +344,7 @@ public class ArchivaConfigurableUsersManager public List<User> getUsers( boolean orderAscending ) throws UserManagerException { - List<User> users = new ArrayList<User>(); + List<User> users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLdapRoleMapperConfiguration.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLdapRoleMapperConfiguration.java index 0cf358328..ec129a515 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLdapRoleMapperConfiguration.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLdapRoleMapperConfiguration.java @@ -155,7 +155,7 @@ public class ArchivaLdapRoleMapperConfiguration RedbackRuntimeConfiguration redbackRuntimeConfiguration = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration(); - List<LdapGroupMapping> ldapGroupMappings = new ArrayList<LdapGroupMapping>( mappings.size() ); + List<LdapGroupMapping> ldapGroupMappings = new ArrayList<>( mappings.size() ); for ( Map.Entry<String, List<String>> entry : mappings.entrySet() ) { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java index a6090cec1..2b14fe227 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaLockedAdminEnvironmentCheck.java @@ -75,7 +75,7 @@ public class ArchivaLockedAdminEnvironmentCheck List<String> userManagerImpls = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls(); - userManagers = new ArrayList<UserManager>( userManagerImpls.size() ); + userManagers = new ArrayList<>( userManagerImpls.size() ); for ( String beanId : userManagerImpls ) { @@ -100,7 +100,7 @@ public class ArchivaLockedAdminEnvironmentCheck { continue; } - List<String> roles = new ArrayList<String>(); + List<String> roles = new ArrayList<>(); roles.add( RedbackRoleConstants.SYSTEM_ADMINISTRATOR_ROLE ); List<UserAssignment> systemAdminstrators; diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java index 7320d5a99..c511b0274 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java @@ -250,7 +250,7 @@ public class ArchivaRbacManager throw new RbacManagerException( lastException.getMessage(), lastException ); } - return new ArrayList<Role>( allRoles.values() ); + return new ArrayList<>( allRoles.values() ); } public void removeRole( Role role ) @@ -381,7 +381,7 @@ public class ArchivaRbacManager { throw new RbacManagerException( lastException.getMessage(), lastException ); } - return new ArrayList<Permission>( allPermissions.values() ); + return new ArrayList<>( allPermissions.values() ); } public void removePermission( Permission permission ) @@ -505,7 +505,7 @@ public class ArchivaRbacManager { throw new RbacManagerException( lastException.getMessage(), lastException ); } - return new ArrayList<Operation>( allOperations.values() ); + return new ArrayList<>( allOperations.values() ); } public void removeOperation( Operation operation ) @@ -629,7 +629,7 @@ public class ArchivaRbacManager { throw new RbacManagerException( lastException.getMessage(), lastException ); } - return new ArrayList<Resource>( allResources.values() ); + return new ArrayList<>( allResources.values() ); } public void removeResource( Resource resource ) @@ -820,13 +820,13 @@ public class ArchivaRbacManager { throw new RbacManagerException( lastException.getMessage(), lastException ); } - return new ArrayList<UserAssignment>( allUserAssignments.values() ); + return new ArrayList<>( allUserAssignments.values() ); } public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames ) throws RbacManagerException { - List<UserAssignment> allUserAssignments = new ArrayList<UserAssignment>(); + List<UserAssignment> allUserAssignments = new ArrayList<>(); boolean allFailed = true; Exception lastException = null; for ( RBACManager rbacManager : rbacManagersPerId.values() ) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaUserManagerAuthenticator.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaUserManagerAuthenticator.java index e54a503b0..4707c322e 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaUserManagerAuthenticator.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaUserManagerAuthenticator.java @@ -78,7 +78,7 @@ public class ArchivaUserManagerAuthenticator List<String> userManagerImpls = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls(); - userManagers = new ArrayList<UserManager>( userManagerImpls.size() ); + userManagers = new ArrayList<>( userManagerImpls.size() ); for ( String beanId : userManagerImpls ) { @@ -99,7 +99,7 @@ public class ArchivaUserManagerAuthenticator String username = null; Exception resultException = null; PasswordBasedAuthenticationDataSource source = (PasswordBasedAuthenticationDataSource) ds; - List<AuthenticationFailureCause> authnResultErrors = new ArrayList<AuthenticationFailureCause>(); + List<AuthenticationFailureCause> authnResultErrors = new ArrayList<>(); for ( UserManager userManager : userManagers ) { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java index 3f4c20909..7d7ac0b75 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java @@ -181,12 +181,12 @@ public class SecuritySynchronization stopWatch.reset(); stopWatch.start(); - List<String> violations = new ArrayList<String>(); + List<String> violations = new ArrayList<>(); for ( Entry<String, EnvironmentCheck> entry : checkers.entrySet() ) { EnvironmentCheck check = entry.getValue(); - List<String> v = new ArrayList<String>(); + List<String> v = new ArrayList<>(); check.validateEnvironment( v ); log.info( "Environment Check: {} -> {} violation(s)", entry.getKey(), v.size() ); for ( String s : v ) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java index 03dd1d229..2e35ba670 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/AbstractDownloadTest.java @@ -294,7 +294,7 @@ public abstract class AbstractDownloadTest { try { - List<String> entriesNames = new ArrayList<String>(); + List<String> entriesNames = new ArrayList<>(); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while ( entries.hasMoreElements() ) { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java index f38a0d6a6..e9e717d4c 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java @@ -52,7 +52,7 @@ public class SecuritySystemStub { Map<String, String> users = new HashMap<String, String>(); - List<String> repoIds = new ArrayList<String>(); + List<String> repoIds = new ArrayList<>(); public SecuritySystemStub() { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java index 8f9fc13bd..940fa6e15 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java @@ -40,9 +40,9 @@ public class TestMetadataRepository private static final String TEST_NAMESPACE = "org.apache.archiva"; - private List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>(); + private List<ArtifactMetadata> artifacts = new ArrayList<>(); - private List<String> versions = new ArrayList<String>(); + private List<String> versions = new ArrayList<>(); public TestMetadataRepository() { |