From d9de8dc7afe4a1e22257a9437d68649eee8f3047 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 10 Apr 2014 11:43:11 +1000 Subject: [PATCH] use diamond operator --- .../org/apache/archiva/cli/ArchivaCli.java | 15 +++--- .../archiva/cli/ArtifactCountConsumer.java | 2 +- .../artifact/LegacyToDefaultConverter.java | 17 +------ .../LegacyToDefaultConverterTest.java | 2 +- .../archiva/checksum/ChecksummedFile.java | 6 +-- .../apache/archiva/checksum/ChecksumTest.java | 2 +- .../common/utils/VersionComparator.java | 4 +- .../common/utils/VersionComparatorTest.java | 6 +-- .../DefaultArchivaConfiguration.java | 8 +-- .../archiva/configuration/FileTypes.java | 2 +- ...ectorConfigurationOrderComparatorTest.java | 6 +-- .../ArtifactMissingChecksumsConsumer.java | 2 +- .../consumers/core/AutoRemoveConsumer.java | 2 +- .../consumers/core/AutoRenameConsumer.java | 2 +- .../core/MetadataUpdaterConsumer.java | 2 +- .../core/ValidateChecksumConsumer.java | 4 +- ...eanupReleasedSnapshotsRepositoryPurge.java | 2 +- .../repository/DaysOldRepositoryPurge.java | 2 +- .../repository/RepositoryPurgeConsumer.java | 14 +----- .../RetentionCountRepositoryPurge.java | 2 +- .../lucene/NexusIndexerConsumer.java | 2 +- .../ArchivaMetadataCreationConsumer.java | 12 +---- .../DefaultLegacyRepositoryConverter.java | 2 +- .../LegacyConverterArtifactConsumer.java | 2 +- .../converter/RepositoryConverterTest.java | 2 +- .../indexer/search/MavenRepositorySearch.java | 4 +- .../archiva/indexer/search/SearchFields.java | 2 +- .../indexer/search/SearchResultHit.java | 2 +- .../archiva/indexer/search/SearchResults.java | 2 +- .../search/MavenRepositorySearchTest.java | 50 +++++++++---------- .../archiva/maven2/model/TreeEntry.java | 2 +- .../archiva/model/ArchivaModelCloner.java | 4 +- .../policies/AbstractUpdatePolicy.java | 2 +- .../policies/CachedFailuresPolicy.java | 5 +- .../archiva/policies/ChecksumPolicy.java | 2 +- .../PropagateErrorsDownloadPolicy.java | 2 +- ...PropagateErrorsOnUpdateDownloadPolicy.java | 2 +- .../DefaultRepositoryProxyConnectors.java | 8 +-- .../archiva/proxy/AbstractProxyTestCase.java | 6 +-- .../archiva/proxy/MetadataTransferTest.java | 6 +-- .../model/AbstractRepositoryConnector.java | 8 +-- .../archiva/admin/model/beans/FileType.java | 2 +- .../admin/model/beans/LdapConfiguration.java | 2 +- .../admin/model/beans/ProxyConnectorRule.java | 2 +- .../beans/RedbackRuntimeConfiguration.java | 4 +- .../admin/model/beans/RemoteRepository.java | 4 +- .../admin/model/beans/RepositoryGroup.java | 2 +- .../repository/AbstractRepositoryAdmin.java | 3 +- .../admin/DefaultArchivaAdministration.java | 8 +-- .../group/DefaultRepositoryGroupAdmin.java | 6 +-- .../DefaultManagedRepositoryAdmin.java | 4 +- .../DefaultNetworkProxyAdmin.java | 2 +- .../DefaultProxyConnectorAdmin.java | 6 +-- .../DefaultProxyConnectorRuleAdmin.java | 10 ++-- .../remote/DefaultRemoteRepositoryAdmin.java | 9 ++-- ...faultRedbackRuntimeConfigurationAdmin.java | 14 +++--- .../archiva/admin/mock/MockAuditListener.java | 2 +- .../repository/metadata/MetadataTools.java | 16 +++--- .../metadata/RepositoryMetadataMerge.java | 2 +- .../scanner/DefaultRepositoryScanner.java | 6 +-- .../scanner/RepositoryContentConsumers.java | 10 ++-- .../repository/scanner/KnownScanConsumer.java | 2 +- .../scanner/RepositoryScannerTest.java | 42 ++++++++-------- .../archiva/test/utils/ListGenerator.java | 2 +- .../transaction/AbstractTransactionEvent.java | 10 ++-- .../archiva/transaction/FileTransaction.java | 2 +- ...DefaultRepositoryArchivaTaskScheduler.java | 4 +- .../mock/MockArchivaAdministration.java | 4 +- .../mock/MockManagedRepositoryAdmin.java | 2 +- .../TestRepositoryStatisticsManager.java | 2 +- .../archiva/rest/api/model/SearchRequest.java | 2 +- .../rest/services/AbstractRestService.java | 4 +- .../rest/services/DefaultBrowseService.java | 22 ++++---- .../DefaultMergeRepositoriesService.java | 2 +- .../rest/services/DefaultPluginsServices.java | 4 +- .../DefaultProxyConnectorService.java | 4 +- ...ultRedbackRuntimeConfigurationService.java | 10 ++-- .../DefaultReportRepositoriesService.java | 6 +-- .../services/DefaultRepositoriesService.java | 4 +- .../DefaultRepositoryGroupService.java | 8 +-- .../rest/services/DefaultSearchService.java | 4 +- .../utils/AddAdminRepoConsumerClosure.java | 2 +- .../apache/archiva/rss/RssFeedGenerator.java | 2 +- .../NewArtifactsRssFeedProcessor.java | 2 +- ...NewVersionsOfArtifactRssFeedProcessor.java | 4 +- .../archiva/rss/RssFeedGeneratorTest.java | 4 +- .../NewArtifactsRssFeedProcessorTest.java | 2 +- .../security/DefaultUserRepositories.java | 4 +- .../web/api/DefaultFileUploadService.java | 2 +- .../archiva/web/rss/RssFeedServlet.java | 2 +- .../ArchivaConfigurableUsersManager.java | 12 ++--- .../ArchivaLdapRoleMapperConfiguration.java | 2 +- .../ArchivaLockedAdminEnvironmentCheck.java | 4 +- .../web/security/ArchivaRbacManager.java | 12 ++--- .../ArchivaUserManagerAuthenticator.java | 4 +- .../web/startup/SecuritySynchronization.java | 4 +- .../remotedownload/AbstractDownloadTest.java | 2 +- .../archiva/web/rss/SecuritySystemStub.java | 2 +- .../memory/TestMetadataRepository.java | 4 +- 99 files changed, 252 insertions(+), 301 deletions(-) diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java index a65049597..73662e6b5 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java @@ -24,17 +24,16 @@ import com.sampullara.cli.Argument; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; +import org.apache.archiva.consumers.ConsumerException; +import org.apache.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.archiva.consumers.RepositoryContentConsumer; import org.apache.archiva.converter.RepositoryConversionException; import org.apache.archiva.converter.legacy.LegacyRepositoryConverter; import org.apache.archiva.repository.scanner.RepositoryScanStatistics; import org.apache.archiva.repository.scanner.RepositoryScanner; import org.apache.archiva.repository.scanner.RepositoryScannerException; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; -import org.apache.archiva.consumers.ConsumerException; -import org.apache.archiva.consumers.InvalidRepositoryContentConsumer; -import org.apache.archiva.consumers.KnownRepositoryContentConsumer; -import org.apache.archiva.consumers.RepositoryContentConsumer; import org.apache.maven.artifact.manager.WagonManager; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -167,13 +166,13 @@ public class ArchivaCli repo.setName( "Archiva CLI Provided Repo" ); repo.setLocation( path ); - List knownConsumerList = new ArrayList(); + List knownConsumerList = new ArrayList<>(); knownConsumerList.addAll( getConsumerList( consumers ) ); List invalidConsumerList = Collections.emptyList(); - List ignoredContent = new ArrayList(); + List ignoredContent = new ArrayList<>(); ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); RepositoryScanner scanner = lookup( RepositoryScanner.class ); @@ -201,7 +200,7 @@ public class ArchivaCli private List getConsumerList( String[] consumers ) throws ConsumerException, PlexusSisuBridgeException { - List consumerList = new ArrayList(); + List consumerList = new ArrayList<>(); Map availableConsumers = getConsumers(); diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java index a0404edbc..7efde1622 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java @@ -52,7 +52,7 @@ public class ArtifactCountConsumer public ArtifactCountConsumer() { // TODO: shouldn't this use filetypes? - includes = new ArrayList(); + includes = new ArrayList<>(); includes.add( "**/*.pom" ); includes.add( "**/*.jar" ); includes.add( "**/*.war" ); diff --git a/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java b/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java index 4fe0536a9..f55e1e523 100644 --- a/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java +++ b/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java @@ -82,29 +82,14 @@ public class LegacyToDefaultConverter @Inject private DigesterUtils digesterUtils; - /** - * - */ private ModelConverter translator; - /** - * - */ private ArtifactFactory artifactFactory; - /** - * - */ private ArtifactHandlerManager artifactHandlerManager; - /** - * default-value="false" - */ private boolean force; - /** - * default-value="false" - */ private boolean dryrun; private Map> warnings = new HashMap>(); @@ -686,7 +671,7 @@ public class LegacyToDefaultConverter List messages = warnings.get( artifact ); if ( messages == null ) { - messages = new ArrayList( 1 ); + messages = new ArrayList<>( 1 ); } messages.add( message ); warnings.put( artifact, messages ); diff --git a/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java b/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java index 2ab82c6a9..6333b4d9e 100644 --- a/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java +++ b/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java @@ -813,7 +813,7 @@ public class LegacyToDefaultConverterTest { // test multiple artifacts are converted - List artifacts = new ArrayList(); + List artifacts = new ArrayList<>(); artifacts.add( createArtifact( "test", "artifact-one", "1.0.0" ) ); artifacts.add( createArtifact( "test", "artifact-two", "1.0.0" ) ); artifacts.add( createArtifact( "test", "artifact-three", "1.0.0" ) ); diff --git a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java index b505494d2..9e9378e3b 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java @@ -20,14 +20,12 @@ package org.apache.archiva.checksum; */ import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -143,7 +141,7 @@ public class ChecksummedFile try (FileInputStream fis = new FileInputStream( referenceFile )) { - List checksums = new ArrayList( algorithms.length ); + List checksums = new ArrayList<>( algorithms.length ); // Create checksum object for each algorithm. for ( ChecksumAlgorithm checksumAlgorithm : algorithms ) { @@ -215,7 +213,7 @@ public class ChecksummedFile */ public boolean fixChecksums( ChecksumAlgorithm[] algorithms ) { - List checksums = new ArrayList( algorithms.length ); + List checksums = new ArrayList<>( algorithms.length ); // Create checksum object for each algorithm. for ( ChecksumAlgorithm checksumAlgorithm : algorithms ) { diff --git a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java index 7f66f16d4..11df7b9b5 100644 --- a/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java +++ b/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java @@ -71,7 +71,7 @@ public class ChecksumTest { Checksum checksumSha1 = new Checksum( ChecksumAlgorithm.SHA1 ); Checksum checksumMd5 = new Checksum( ChecksumAlgorithm.MD5 ); - List checksums = new ArrayList(); + List checksums = new ArrayList<>(); checksums.add( checksumSha1 ); checksums.add( checksumMd5 ); diff --git a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java index 73d0cd752..bbdbbd3b7 100644 --- a/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java +++ b/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/archiva/common/utils/VersionComparator.java @@ -60,7 +60,7 @@ public class VersionComparator public VersionComparator() { - specialWords = new ArrayList( 23 ); + specialWords = new ArrayList<>( 23 ); // ids that refer to LATEST specialWords.add( "final" ); @@ -204,7 +204,7 @@ public class VersionComparator int modeDigit = 1; int modeText = 2; - List parts = new ArrayList(); + List parts = new ArrayList<>(); int len = version.length(); int i = 0; int start = 0; diff --git a/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/VersionComparatorTest.java b/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/VersionComparatorTest.java index 59e9dde72..d21d5fe4e 100644 --- a/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/VersionComparatorTest.java +++ b/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/archiva/common/utils/VersionComparatorTest.java @@ -19,13 +19,13 @@ package org.apache.archiva.common.utils; * under the License. */ +import junit.framework.TestCase; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import junit.framework.TestCase; - /** * VersionComparatorTest * @@ -97,7 +97,7 @@ public class VersionComparatorTest private void assertSort( String[] rawVersions, String[] expectedSort ) { - List versions = new ArrayList(); + List versions = new ArrayList<>(); versions.addAll( Arrays.asList( rawVersions ) ); Collections.sort( versions, VersionComparator.getInstance() ); diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java index 757a116ad..1fd14aa57 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java @@ -270,7 +270,7 @@ public class DefaultArchivaConfiguration // Create a copy of the list to read from (to prevent concurrent modification exceptions) List proxyConnectorList = - new ArrayList( config.getProxyConnectors() ); + new ArrayList<>( config.getProxyConnectors() ); // Remove the old connector list. config.getProxyConnectors().clear(); @@ -727,7 +727,7 @@ public class DefaultArchivaConfiguration { List knowContentConsumers = - new ArrayList( configuration.getRepositoryScanning().getKnownContentConsumers().size() ); + new ArrayList<>( configuration.getRepositoryScanning().getKnownContentConsumers().size() ); for ( String knowContentConsumer : configuration.getRepositoryScanning().getKnownContentConsumers() ) { if ( !dbConsumers.contains( knowContentConsumer ) ) @@ -743,7 +743,7 @@ public class DefaultArchivaConfiguration if ( !configuration.getRepositoryScanning().getKnownContentConsumers().contains( "create-archiva-metadata" ) ) { List knowContentConsumers = - new ArrayList( configuration.getRepositoryScanning().getKnownContentConsumers() ); + new ArrayList<>( configuration.getRepositoryScanning().getKnownContentConsumers() ); knowContentConsumers.add( "create-archiva-metadata" ); configuration.getRepositoryScanning().setKnownContentConsumers( knowContentConsumers ); } @@ -752,7 +752,7 @@ public class DefaultArchivaConfiguration if ( !configuration.getRepositoryScanning().getKnownContentConsumers().contains( "duplicate-artifacts" ) ) { List knowContentConsumers = - new ArrayList( configuration.getRepositoryScanning().getKnownContentConsumers() ); + new ArrayList<>( configuration.getRepositoryScanning().getKnownContentConsumers() ); knowContentConsumers.add( "duplicate-artifacts" ); configuration.getRepositoryScanning().setKnownContentConsumers( knowContentConsumers ); } diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java index 31f645f7a..7ad6d762c 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileTypes.java @@ -226,7 +226,7 @@ public class FileTypes List patterns = defaultTypeMap.get( filetype.getId() ); if ( patterns == null ) { - patterns = new ArrayList( filetype.getPatterns().size() ); + patterns = new ArrayList<>( filetype.getPatterns().size() ); } patterns.addAll( filetype.getPatterns() ); diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java index 2e23b5afd..9bac5bf28 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java @@ -40,7 +40,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest @Test public void testSortOfAllZeros() { - List proxies = new ArrayList(); + List proxies = new ArrayList<>(); proxies.add( createConnector( "corporate", 0 ) ); proxies.add( createConnector( "snapshots", 0 ) ); @@ -55,7 +55,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest @Test public void testSortNormal() { - List proxies = new ArrayList(); + List proxies = new ArrayList<>(); proxies.add( createConnector( "corporate", 3 ) ); proxies.add( createConnector( "snapshots", 1 ) ); @@ -70,7 +70,7 @@ public class ProxyConnectorConfigurationOrderComparatorTest @Test public void testSortPartial() { - List proxies = new ArrayList(); + List proxies = new ArrayList<>(); proxies.add( createConnector( "corporate", 3 ) ); proxies.add( createConnector( "snapshots", 0 ) ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java index da32e74d4..576723147 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java @@ -70,7 +70,7 @@ public class ArtifactMissingChecksumsConsumer private File repositoryDir; - private List includes = new ArrayList( 0 ); + private List includes = new ArrayList<>( 0 ); @Inject public ArtifactMissingChecksumsConsumer( ArchivaConfiguration configuration, FileTypes filetypes ) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java index 264d65748..cc8b19d05 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java @@ -73,7 +73,7 @@ public class AutoRemoveConsumer private File repositoryDir; - private List includes = new ArrayList( 0 ); + private List includes = new ArrayList<>( 0 ); public String getId() { diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java index 9ef7b5c6d..d996e1046 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java @@ -61,7 +61,7 @@ public class AutoRenameConsumer private File repositoryDir; - private List includes = new ArrayList( 3 ); + private List includes = new ArrayList<>( 3 ); private Map extensionRenameMap = new HashMap(); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java index 9c13706b4..521a92299 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java @@ -109,7 +109,7 @@ public class MetadataUpdaterConsumer private File repositoryDir; - private List includes = new ArrayList( 0 ); + private List includes = new ArrayList<>( 0 ); private long scanStartTimestamp = 0; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java index 5e1983c3d..69e590c75 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java @@ -174,8 +174,8 @@ public class ValidateChecksumConsumer throws PlexusSisuBridgeException { checksum = plexusSisuBridge.lookup( ChecksumFile.class ); - List allDigesters = new ArrayList( digesterUtils.getAllDigesters() ); - includes = new ArrayList( allDigesters.size() ); + List allDigesters = new ArrayList<>( digesterUtils.getAllDigesters() ); + includes = new ArrayList<>( allDigesters.size() ); for ( Digester digester : allDigesters ) { includes.add( "**/*" + digester.getFilenameExtension() ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java index 86a58445b..f81248297 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java @@ -112,7 +112,7 @@ public class CleanupReleasedSnapshotsRepositoryPurge reference.setArtifactId( artifactRef.getArtifactId() ); // Gether the released versions - List releasedVersions = new ArrayList(); + List releasedVersions = new ArrayList<>(); List repos = managedRepositoryAdmin.getManagedRepositories(); for ( ManagedRepository repo : repos ) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java index 7902d6852..5262bff28 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurge.java @@ -86,7 +86,7 @@ public class DaysOldRepositoryPurge reference.setArtifactId( artifact.getArtifactId() ); reference.setVersion( artifact.getVersion() ); - List versions = new ArrayList( repository.getVersions( reference ) ); + List versions = new ArrayList<>( repository.getVersions( reference ) ); Collections.sort( versions, VersionComparator.getInstance() ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java index 33fd3ee0d..06f872f6a 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java @@ -68,9 +68,6 @@ public class RepositoryPurgeConsumer */ private String description = "Purge repository of old snapshots"; - /** - * - */ @Inject @Named( value = "archivaConfiguration#default" ) private ArchivaConfiguration configuration; @@ -78,27 +75,18 @@ public class RepositoryPurgeConsumer @Inject private ManagedRepositoryAdmin managedRepositoryAdmin; - /** - * - */ @Inject @Named( value = "repositoryContentFactory#default" ) private RepositoryContentFactory repositoryContentFactory; - /** - * - */ @Inject private MetadataTools metadataTools; - /** - * - */ @Inject @Named( value = "fileTypes" ) private FileTypes filetypes; - private List includes = new ArrayList(); + private List includes = new ArrayList<>(); private RepositoryPurge repoPurge; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java index 8636f386a..85deca331 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java @@ -71,7 +71,7 @@ public class RetentionCountRepositoryPurge reference.setArtifactId( artifact.getArtifactId() ); reference.setVersion( artifact.getVersion() ); - List versions = new ArrayList( repository.getVersions( reference ) ); + List versions = new ArrayList<>( repository.getVersions( reference ) ); Collections.sort( versions, VersionComparator.getInstance() ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java index 8e1b28669..e5f8b90ab 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java @@ -76,7 +76,7 @@ public class NexusIndexerConsumer private NexusIndexer nexusIndexer; - private List includes = new ArrayList( 0 ); + private List includes = new ArrayList<>( 0 ); private ManagedRepository repository; diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java index 12a7d1054..39e5a944c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java @@ -62,29 +62,19 @@ public class ArchivaMetadataCreationConsumer extends AbstractMonitoredConsumer implements KnownRepositoryContentConsumer, RegistryListener { - /** - * default-value="create-archiva-metadata" - */ private String id = "create-archiva-metadata"; - /** - * default-value="Create basic metadata for Archiva to be able to reference the artifact" - */ private String description = "Create basic metadata for Archiva to be able to reference the artifact"; - /** - */ @Inject private ArchivaConfiguration configuration; - /** - */ @Inject private FileTypes filetypes; private Date whenGathered; - private List includes = new ArrayList( 0 ); + private List includes = new ArrayList<>( 0 ); /** * FIXME: this could be multiple implementations and needs to be configured. diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java index 1e9ce7b64..216bc4758 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java @@ -101,7 +101,7 @@ public class DefaultLegacyRepositoryConverter legacyConverterConsumer.setExcludes( fileExclusionPatterns ); legacyConverterConsumer.setDestinationRepository( repository ); - List knownConsumers = new ArrayList( 1 ); + List knownConsumers = new ArrayList<>( 1 ); knownConsumers.add( legacyConverterConsumer ); List invalidConsumers = Collections.emptyList(); diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java index 8d1d93ebd..cdff8738c 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java @@ -81,7 +81,7 @@ public class LegacyConverterArtifactConsumer public LegacyConverterArtifactConsumer( PlexusSisuBridge plexusSisuBridge ) throws PlexusSisuBridgeException { - includes = new ArrayList( 3 ); + includes = new ArrayList<>( 3 ); includes.add( "**/*.jar" ); includes.add( "**/*.ear" ); includes.add( "**/*.war" ); diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/archiva/converter/RepositoryConverterTest.java b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/archiva/converter/RepositoryConverterTest.java index 3b9e6a917..893b9df29 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/archiva/converter/RepositoryConverterTest.java +++ b/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/archiva/converter/RepositoryConverterTest.java @@ -154,7 +154,7 @@ public class RepositoryConverterTest { File legacyRepoDir = new File( sourceRepository.getBasedir() ); File destRepoDir = new File( targetRepository.getLocation() ); - List excludes = new ArrayList(); + List excludes = new ArrayList<>(); repositoryConverter.convertLegacyRepository( legacyRepoDir, destRepoDir, excludes ); } } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java index 45b5db0cc..7e2fb57e2 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java @@ -288,7 +288,7 @@ public class MavenRepositorySearch private List getIndexingContexts( List ids ) { - List contexts = new ArrayList( ids.size() ); + List contexts = new ArrayList<>( ids.size() ); for ( String id : ids ) { @@ -363,7 +363,7 @@ public class MavenRepositorySearch } } - return new ArrayList( indexingContextIds ); + return new ArrayList<>( indexingContextIds ); } diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchFields.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchFields.java index cd34f701e..fd2353423 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchFields.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchFields.java @@ -52,7 +52,7 @@ public class SearchFields /** * repositories */ - private List repositories = new ArrayList(); + private List repositories = new ArrayList<>(); /** diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java index 7d61679cc..a493431c8 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java @@ -42,7 +42,7 @@ public class SearchResultHit private String repositoryId = ""; - private List versions = new ArrayList(); + private List versions = new ArrayList<>(); private String packaging; diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java index 9ca4ec347..1ea1a53e9 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java @@ -59,7 +59,7 @@ public class SearchResults */ public List getHits() { - return new ArrayList( hits.values() ); + return new ArrayList<>( hits.values() ); } /** diff --git a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java index 7ab8375da..83d19380c 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java @@ -46,7 +46,7 @@ public class MavenRepositorySearchTest private void createSimpleIndex( boolean scan ) throws Exception { - List files = new ArrayList(); + List files = new ArrayList<>(); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) ); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 @@ -60,7 +60,7 @@ public class MavenRepositorySearchTest private void createIndexContainingMoreArtifacts( boolean scan ) throws Exception { - List files = new ArrayList(); + List files = new ArrayList<>(); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) ); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 @@ -82,7 +82,7 @@ public class MavenRepositorySearchTest private void createIndexContainingMultipleArtifactsSameVersion( boolean scan ) throws Exception { - List files = new ArrayList(); + List files = new ArrayList<>(); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) ); @@ -188,7 +188,7 @@ public class MavenRepositorySearchTest { createIndexContainingMultipleArtifactsSameVersion( false ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); // search artifactId @@ -218,7 +218,7 @@ public class MavenRepositorySearchTest { createIndexContainingMultipleArtifactsSameVersion( true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); // search artifactId @@ -255,7 +255,7 @@ public class MavenRepositorySearchTest { createSimpleIndex( false ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 ); @@ -275,7 +275,7 @@ public class MavenRepositorySearchTest { createSimpleIndex( true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); // page 1 @@ -324,14 +324,14 @@ public class MavenRepositorySearchTest { createSimpleIndex( true ); - List files = new ArrayList(); + List files = new ArrayList<>(); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) ); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2 + "/org/apache/archiva/archiva-search/1.1/archiva-search-1.1.jar" ) ); createIndex( TEST_REPO_2, files, false ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); selectedRepos.add( TEST_REPO_2 ); @@ -369,7 +369,7 @@ public class MavenRepositorySearchTest { createSimpleIndex( false ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 ); @@ -388,7 +388,7 @@ public class MavenRepositorySearchTest public void testNoIndexFound() throws Exception { - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 ); @@ -406,7 +406,7 @@ public class MavenRepositorySearchTest public void testRepositoryNotFound() throws Exception { - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( "non-existing-repo" ); EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 ); @@ -426,10 +426,10 @@ public class MavenRepositorySearchTest { createSimpleIndex( true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); - List previousSearchTerms = new ArrayList(); + List previousSearchTerms = new ArrayList<>(); previousSearchTerms.add( "archiva-test" ); EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 2 ); @@ -455,14 +455,14 @@ public class MavenRepositorySearchTest public void testAdvancedSearch() throws Exception { - List files = new ArrayList(); + List files = new ArrayList<>(); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2 + "/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar" ) ); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_2 + "/org/apache/archiva/archiva-search/1.1/archiva-search-1.1.jar" ) ); createIndex( TEST_REPO_2, files, false ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_2 ); SearchFields searchFields = new SearchFields(); @@ -493,7 +493,7 @@ public class MavenRepositorySearchTest { createIndexContainingMoreArtifacts( false ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -541,14 +541,14 @@ public class MavenRepositorySearchTest public void testAdvancedSearchArtifactIdHasNumericChar() throws Exception { - List files = new ArrayList(); + List files = new ArrayList<>(); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/com/artifactid-numeric/1.0/artifactid-numeric-1.0.jar" ) ); files.add( new File( FileUtil.getBasedir(), "src/test/" + TEST_REPO_1 + "/com/artifactid-numeric123/1.0/artifactid-numeric123-1.0.jar" ) ); createIndex( TEST_REPO_1, files, true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -590,7 +590,7 @@ public class MavenRepositorySearchTest public void testAdvancedSearchSearchFieldsAreNull() throws Exception { - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -618,7 +618,7 @@ public class MavenRepositorySearchTest public void testAdvancedSearchSearchFieldsAreBlank() throws Exception { - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -654,7 +654,7 @@ public class MavenRepositorySearchTest { createSimpleIndex( true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -689,7 +689,7 @@ public class MavenRepositorySearchTest { createIndexContainingMoreArtifacts( true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -714,7 +714,7 @@ public class MavenRepositorySearchTest { createSimpleIndex( true ); - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); @@ -768,7 +768,7 @@ public class MavenRepositorySearchTest public void testAdvancedSearchNoIndexFound() throws Exception { - List selectedRepos = new ArrayList(); + List selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); SearchFields searchFields = new SearchFields(); diff --git a/archiva-modules/archiva-base/archiva-maven2-model/src/main/java/org/apache/archiva/maven2/model/TreeEntry.java b/archiva-modules/archiva-base/archiva-maven2-model/src/main/java/org/apache/archiva/maven2/model/TreeEntry.java index b122780aa..7a0db88e7 100644 --- a/archiva-modules/archiva-base/archiva-maven2-model/src/main/java/org/apache/archiva/maven2/model/TreeEntry.java +++ b/archiva-modules/archiva-base/archiva-maven2-model/src/main/java/org/apache/archiva/maven2/model/TreeEntry.java @@ -34,7 +34,7 @@ public class TreeEntry implements Serializable { - private List childs = new ArrayList(); + private List childs = new ArrayList<>(); private Artifact artifact; diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaModelCloner.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaModelCloner.java index 4601de0ca..ac70ecfed 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaModelCloner.java +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaModelCloner.java @@ -109,7 +109,7 @@ public class ArchivaModelCloner return null; } - List ret = new ArrayList( artifactReferenceList.size() ); + List ret = new ArrayList<>( artifactReferenceList.size() ); for ( ArtifactReference ref : artifactReferenceList ) { @@ -126,7 +126,7 @@ public class ArchivaModelCloner return null; } - List ret = new ArrayList( simple.size() ); + List ret = new ArrayList<>( simple.size() ); for ( String txt : simple ) { diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/AbstractUpdatePolicy.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/AbstractUpdatePolicy.java index 19e829f21..2c9b8477a 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/AbstractUpdatePolicy.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/AbstractUpdatePolicy.java @@ -81,7 +81,7 @@ public abstract class AbstractUpdatePolicy */ public static final String ONCE = "once"; - private List options = new ArrayList( 5 ); + private List options = new ArrayList<>( 5 ); public AbstractUpdatePolicy() { diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/CachedFailuresPolicy.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/CachedFailuresPolicy.java index bdb45b2e9..6976c45b5 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/CachedFailuresPolicy.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/CachedFailuresPolicy.java @@ -52,13 +52,10 @@ public class CachedFailuresPolicy */ public static final String YES = "yes"; - /** - * - */ @Inject private UrlFailureCache urlFailureCache; - private List options = new ArrayList( 2 ); + private List options = new ArrayList<>( 2 ); public CachedFailuresPolicy() { diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/ChecksumPolicy.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/ChecksumPolicy.java index eff2a37c1..878079e5b 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/ChecksumPolicy.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/ChecksumPolicy.java @@ -66,7 +66,7 @@ public class ChecksumPolicy private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[]{ ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 }; - private List options = new ArrayList( 3 ); + private List options = new ArrayList<>( 3 ); public ChecksumPolicy() { diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsDownloadPolicy.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsDownloadPolicy.java index d4e2341a6..32ac4dffb 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsDownloadPolicy.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsDownloadPolicy.java @@ -54,7 +54,7 @@ public class PropagateErrorsDownloadPolicy */ public static final String IGNORE = "ignore"; - private List options = new ArrayList( 3 ); + private List options = new ArrayList<>( 3 ); public PropagateErrorsDownloadPolicy() { diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java index 764118346..6b5c95cb9 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java @@ -45,7 +45,7 @@ public class PropagateErrorsOnUpdateDownloadPolicy */ public static final String NOT_PRESENT = "artifact not already present"; - private List options = new ArrayList( 2 ); + private List options = new ArrayList<>( 2 ); public PropagateErrorsOnUpdateDownloadPolicy() { diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java index ec6e59328..9976eb3a1 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -193,7 +193,7 @@ public class DefaultRepositoryProxyConnectors connector.setDisabled( proxyConfig.isDisabled() ); // Copy any blacklist patterns. - List blacklist = new ArrayList( 0 ); + List blacklist = new ArrayList<>( 0 ); if ( CollectionUtils.isNotEmpty( proxyConfig.getBlackListPatterns() ) ) { blacklist.addAll( proxyConfig.getBlackListPatterns() ); @@ -201,7 +201,7 @@ public class DefaultRepositoryProxyConnectors connector.setBlacklist( blacklist ); // Copy any whitelist patterns. - List whitelist = new ArrayList( 0 ); + List whitelist = new ArrayList<>( 0 ); if ( CollectionUtils.isNotEmpty( proxyConfig.getWhiteListPatterns() ) ) { whitelist.addAll( proxyConfig.getWhiteListPatterns() ); @@ -236,7 +236,7 @@ public class DefaultRepositoryProxyConnectors if ( connectors == null ) { // Create if we are the first. - connectors = new ArrayList( 1 ); + connectors = new ArrayList<>( 1 ); } // Add the connector. @@ -285,7 +285,7 @@ public class DefaultRepositoryProxyConnectors List all ) { List proxyConnectorRuleConfigurations = - new ArrayList(); + new ArrayList<>(); for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : all ) { diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java index e3f39d2ec..98c17a9b5 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java @@ -144,9 +144,9 @@ public abstract class AbstractProxyTestCase config = (MockConfiguration) applicationContext.getBean( "archivaConfiguration#mock", ArchivaConfiguration.class ); - config.getConfiguration().setManagedRepositories( new ArrayList() ); - config.getConfiguration().setRemoteRepositories( new ArrayList() ); - config.getConfiguration().setProxyConnectors( new ArrayList() ); + config.getConfiguration().setManagedRepositories( new ArrayList<>() ); + config.getConfiguration().setRemoteRepositories( new ArrayList<>() ); + config.getConfiguration().setProxyConnectors( new ArrayList<>() ); // Setup source repository (using default layout) String name = getClass().getSimpleName(); diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MetadataTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MetadataTransferTest.java index ed7f04b48..24624b20f 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MetadataTransferTest.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/MetadataTransferTest.java @@ -186,7 +186,7 @@ public class MetadataTransferTest String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/maven-metadata.xml"; setupTestableManagedRepository( requestedResource ); - config.getConfiguration().setProxyConnectors( new ArrayList( ) ); + config.getConfiguration().setProxyConnectors( new ArrayList<>( ) ); assertResourceNotFound( requestedResource ); @@ -206,7 +206,7 @@ public class MetadataTransferTest String requestedResource = "org/apache/maven/test/get-project-metadata/maven-metadata.xml"; setupTestableManagedRepository( requestedResource ); - config.getConfiguration().setProxyConnectors( new ArrayList( ) ); + config.getConfiguration().setProxyConnectors( new ArrayList<>( ) ); assertResourceExists( requestedResource ); @@ -333,7 +333,7 @@ public class MetadataTransferTest setupTestableManagedRepository( requestedResource ); - config.getConfiguration().setProxyConnectors( new ArrayList( ) ); + config.getConfiguration().setProxyConnectors( new ArrayList<>( ) ); // Configure Connector (usually done within archiva.xml configuration) saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java index f6afff08c..4e55a7cd5 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/AbstractRepositoryConnector.java @@ -142,7 +142,7 @@ public abstract class AbstractRepositoryConnector { if ( this.blackListPatterns == null ) { - this.blackListPatterns = new ArrayList( 0 ); + this.blackListPatterns = new ArrayList<>( 0 ); } return this.blackListPatterns; @@ -217,7 +217,7 @@ public abstract class AbstractRepositoryConnector { if ( this.whiteListPatterns == null ) { - this.whiteListPatterns = new ArrayList( 0 ); + this.whiteListPatterns = new ArrayList<>( 0 ); } return this.whiteListPatterns; @@ -365,7 +365,7 @@ public abstract class AbstractRepositoryConnector public List getPoliciesEntries() { - policiesEntries = new ArrayList( getPolicies().size() ); + policiesEntries = new ArrayList<>( getPolicies().size() ); for ( Map.Entry entry : getPolicies().entrySet() ) { policiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) ); @@ -383,7 +383,7 @@ public abstract class AbstractRepositoryConnector public List getPropertiesEntries() { - propertiesEntries = new ArrayList( getProperties().size() ); + propertiesEntries = new ArrayList<>( getProperties().size() ); for ( Map.Entry entry : getProperties().entrySet() ) { propertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/FileType.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/FileType.java index 7185e75d5..4e25a0d08 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/FileType.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/FileType.java @@ -66,7 +66,7 @@ public class FileType { if ( patterns == null ) { - this.patterns = new ArrayList( 0 ); + this.patterns = new ArrayList<>( 0 ); } return patterns; } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java index 09c7eb5fc..bc8c721b8 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/LdapConfiguration.java @@ -212,7 +212,7 @@ public class LdapConfiguration public List getExtraPropertiesEntries() { - extraPropertiesEntries = new ArrayList( getExtraProperties().size() ); + extraPropertiesEntries = new ArrayList<>( getExtraProperties().size() ); for ( Map.Entry entry : getExtraProperties().entrySet() ) { extraPropertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ProxyConnectorRule.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ProxyConnectorRule.java index f672bee4d..b4e710195 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ProxyConnectorRule.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ProxyConnectorRule.java @@ -75,7 +75,7 @@ public class ProxyConnectorRule { if ( this.proxyConnectors == null ) { - this.proxyConnectors = new ArrayList(); + this.proxyConnectors = new ArrayList<>(); } return proxyConnectors; } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java index 7e9cf66cb..dda660af1 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RedbackRuntimeConfiguration.java @@ -38,12 +38,12 @@ public class RedbackRuntimeConfiguration /** * Field userManagerImpls. */ - private List userManagerImpls = new ArrayList(); + private List userManagerImpls = new ArrayList<>(); /** * Field rbacManagerImpls. */ - private java.util.List rbacManagerImpls = new ArrayList(); + private java.util.List rbacManagerImpls = new ArrayList<>(); private LdapConfiguration ldapConfiguration; diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java index 924924bbd..3adbf760d 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java @@ -249,7 +249,7 @@ public class RemoteRepository public List getExtraParametersEntries() { - this.extraParametersEntries = new ArrayList(); + this.extraParametersEntries = new ArrayList<>(); for ( Map.Entry entry : getExtraParameters().entrySet() ) { this.extraParametersEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) ); @@ -292,7 +292,7 @@ public class RemoteRepository public List getExtraHeadersEntries() { - this.extraHeadersEntries = new ArrayList(); + this.extraHeadersEntries = new ArrayList<>(); for ( Map.Entry entry : getExtraHeaders().entrySet() ) { this.extraHeadersEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java index 8a116e158..4f0c3c8c2 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java @@ -97,7 +97,7 @@ public class RepositoryGroup { if ( this.repositories == null ) { - this.repositories = new ArrayList( 0 ); + this.repositories = new ArrayList<>( 0 ); } return this.repositories; diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java index ab771b398..3baa42632 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java @@ -47,8 +47,7 @@ public abstract class AbstractRepositoryAdmin protected Logger log = LoggerFactory.getLogger( getClass() ); @Inject - private List auditListeners = new ArrayList(); - + private List auditListeners = new ArrayList<>(); @Inject private RepositoryCommonValidator repositoryCommonValidator; diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java index 93933ad20..b49a649db 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java @@ -75,7 +75,7 @@ public class DefaultArchivaAdministration public List getLegacyArtifactPaths() throws RepositoryAdminException { - List legacyArtifactPaths = new ArrayList( + List legacyArtifactPaths = new ArrayList<>( getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths().size() ); for ( org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() ) { @@ -268,7 +268,7 @@ public class DefaultArchivaAdministration { return Collections.emptyList(); } - List fileTypes = new ArrayList( configFileTypes.size() ); + List fileTypes = new ArrayList<>( configFileTypes.size() ); for ( org.apache.archiva.configuration.FileType fileType : configFileTypes ) { fileTypes.add( getModelMapper().map( fileType, FileType.class ) ); @@ -279,14 +279,14 @@ public class DefaultArchivaAdministration public List getKnownContentConsumers() throws RepositoryAdminException { - return new ArrayList( + return new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() ); } public List getInvalidContentConsumers() throws RepositoryAdminException { - return new ArrayList( + return new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() ); } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java index 425fd5270..91a5f8668 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java @@ -109,7 +109,7 @@ public class DefaultRepositoryGroupAdmin throws RepositoryAdminException { List repositoriesGroups = - new ArrayList( getArchivaConfiguration().getConfiguration().getRepositoryGroups().size() ); + new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryGroups().size() ); for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() ) { @@ -289,7 +289,7 @@ public class DefaultRepositoryGroupAdmin java.util.List repos = map.get( groupId ); if ( repos == null ) { - repos = new ArrayList(); + repos = new ArrayList<>(); map.put( groupId, repos ); } repos.add( repo.getId() ); @@ -311,7 +311,7 @@ public class DefaultRepositoryGroupAdmin java.util.List groups = map.get( repositoryId ); if ( groups == null ) { - groups = new ArrayList(); + groups = new ArrayList<>(); map.put( repositoryId, groups ); } groups.add( group.getId() ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index 34c89b85f..5931eb12c 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -418,7 +418,7 @@ public class DefaultManagedRepositoryAdmin // olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException List proxyConnectors = - new ArrayList( config.getProxyConnectors() ); + new ArrayList<>( config.getProxyConnectors() ); for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors ) { if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) ) @@ -438,7 +438,7 @@ public class DefaultManagedRepositoryAdmin // copy to prevent UnsupportedOperationException RepositoryGroupConfiguration repositoryGroupConfiguration = config.findRepositoryGroupById( repoGroup ); - List repos = new ArrayList( repositoryGroupConfiguration.getRepositories() ); + List repos = new ArrayList<>( repositoryGroupConfiguration.getRepositories() ); config.removeRepositoryGroup( repositoryGroupConfiguration ); repos.remove( repository.getId() ); repositoryGroupConfiguration.setRepositories( repos ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java index bf0bde93b..321c88b29 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java @@ -47,7 +47,7 @@ public class DefaultNetworkProxyAdmin throws RepositoryAdminException { List networkProxies = - new ArrayList( getArchivaConfiguration().getConfiguration().getNetworkProxies().size() ); + new ArrayList<>( getArchivaConfiguration().getConfiguration().getNetworkProxies().size() ); for ( NetworkProxyConfiguration networkProxyConfiguration : getArchivaConfiguration().getConfiguration().getNetworkProxies() ) { networkProxies.add( getNetworkProxy( networkProxyConfiguration ) ); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java index bd9fdab40..22fc10bfa 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java @@ -63,7 +63,7 @@ public class DefaultProxyConnectorAdmin { List proxyConnectorConfigurations = getArchivaConfiguration().getConfiguration().getProxyConnectors(); - List proxyConnectors = new ArrayList( proxyConnectorConfigurations.size() ); + List proxyConnectors = new ArrayList<>( proxyConnectorConfigurations.size() ); for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations ) { proxyConnectors.add( getProxyConnector( configuration ) ); @@ -152,7 +152,7 @@ public class DefaultProxyConnectorAdmin { if ( patterns != null ) { - List rawPatterns = new ArrayList( patterns.size() ); + List rawPatterns = new ArrayList<>( patterns.size() ); for ( String pattern : patterns ) { rawPatterns.add( StringUtils.replace( pattern, "\\\\", "\\" ) ); @@ -177,7 +177,7 @@ public class DefaultProxyConnectorAdmin List connectors = proxyConnectorMap.get( key ); if ( connectors == null ) { - connectors = new ArrayList( 1 ); + connectors = new ArrayList<>( 1 ); proxyConnectorMap.put( key, connectors ); } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnectorrule/DefaultProxyConnectorRuleAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnectorrule/DefaultProxyConnectorRuleAdmin.java index 71b656058..276808eba 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnectorrule/DefaultProxyConnectorRuleAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnectorrule/DefaultProxyConnectorRuleAdmin.java @@ -41,7 +41,7 @@ import java.util.List; * @author Olivier Lamy * @since 1.4-M3 */ -@Service ("proxyConnectorRuleAdmin#default") +@Service("proxyConnectorRuleAdmin#default") public class DefaultProxyConnectorRuleAdmin extends AbstractRepositoryAdmin implements ProxyConnectorRuleAdmin @@ -57,8 +57,7 @@ public class DefaultProxyConnectorRuleAdmin { return Collections.emptyList(); } - List proxyConnectorRules = - new ArrayList( proxyConnectorRuleConfigurations.size() ); + List proxyConnectorRules = new ArrayList<>( proxyConnectorRuleConfigurations.size() ); for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : proxyConnectorRuleConfigurations ) { @@ -120,8 +119,7 @@ public class DefaultProxyConnectorRuleAdmin boolean toSave = false; - List proxyConnectorRuleConfigurations = - new ArrayList(); + List proxyConnectorRuleConfigurations = new ArrayList<>(); for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : configuration.getProxyConnectorRuleConfigurations() ) { @@ -157,7 +155,7 @@ public class DefaultProxyConnectorRuleAdmin proxyConnectorRule.getProxyConnectorRuleType().getRuleType() ) ) { List proxyConnectors = - new ArrayList( proxyConnectorRule.getProxyConnectors().size() ); + new ArrayList<>( proxyConnectorRule.getProxyConnectors().size() ); for ( ProxyConnector proxyConnector : proxyConnectorRule.getProxyConnectors() ) { ProxyConnectorConfiguration proxyConnectorConfiguration = new ProxyConnectorConfiguration(); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java index 058670bcd..c5d17a955 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java @@ -52,7 +52,7 @@ import java.util.Map; * @author Olivier Lamy * @since 1.4-M1 */ -@Service ( "remoteRepositoryAdmin#default" ) +@Service("remoteRepositoryAdmin#default") public class DefaultRemoteRepositoryAdmin extends AbstractRepositoryAdmin implements RemoteRepositoryAdmin @@ -115,8 +115,8 @@ public class DefaultRemoteRepositoryAdmin public List getRemoteRepositories() throws RepositoryAdminException { - List remoteRepositories = new ArrayList( - getArchivaConfiguration().getConfiguration().getRemoteRepositories().size() ); + List remoteRepositories = + new ArrayList<>( getArchivaConfiguration().getConfiguration().getRemoteRepositories().size() ); for ( RemoteRepositoryConfiguration repositoryConfiguration : getArchivaConfiguration().getConfiguration().getRemoteRepositories() ) { RemoteRepository remoteRepository = @@ -199,8 +199,7 @@ public class DefaultRemoteRepositoryAdmin // TODO use ProxyConnectorAdmin interface ? // [MRM-520] Proxy Connectors are not deleted with the deletion of a Repository. - List proxyConnectors = - new ArrayList( configuration.getProxyConnectors() ); + List proxyConnectors = new ArrayList<>( configuration.getProxyConnectors() ); for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors ) { if ( StringUtils.equals( proxyConnector.getTargetRepoId(), repositoryId ) ) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java index 0ed081925..356f00cdb 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java @@ -52,7 +52,7 @@ import java.util.Set; * @author Olivier Lamy * @since 1.4-M4 */ -@Service( "redbackRuntimeConfigurationAdmin#default" ) +@Service("redbackRuntimeConfigurationAdmin#default") public class DefaultRedbackRuntimeConfigurationAdmin extends AbstractRepositoryAdmin implements RedbackRuntimeConfigurationAdmin, UserConfiguration @@ -68,9 +68,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin @Inject public DefaultRedbackRuntimeConfigurationAdmin( ArchivaConfiguration archivaConfiguration,// - @Named( value = "userConfiguration#redback" ) // + @Named(value = "userConfiguration#redback") // UserConfiguration userConfiguration, - @Named( value = "cache#users" ) Cache usersCache ) + @Named(value = "cache#users") Cache usersCache ) { this.archivaConfiguration = archivaConfiguration; this.userConfiguration = userConfiguration; @@ -164,7 +164,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin Collection keys = userConfiguration.getKeys(); - List ldapGroupMappings = new ArrayList(); + List ldapGroupMappings = new ArrayList<>(); for ( String key : keys ) { @@ -344,7 +344,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin if ( mappings != null && mappings.size() > 0 ) { - List ldapGroupMappings = new ArrayList( mappings.size() ); + List ldapGroupMappings = new ArrayList<>( mappings.size() ); for ( org.apache.archiva.configuration.LdapGroupMapping mapping : mappings ) { @@ -417,7 +417,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin { List mappings = - new ArrayList( ldapGroupMappings.size() ); + new ArrayList<>( ldapGroupMappings.size() ); for ( LdapGroupMapping ldapGroupMapping : ldapGroupMappings ) { @@ -425,7 +425,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin org.apache.archiva.configuration.LdapGroupMapping mapping = new org.apache.archiva.configuration.LdapGroupMapping(); mapping.setGroup( ldapGroupMapping.getGroup() ); - mapping.setRoleNames( new ArrayList( ldapGroupMapping.getRoleNames() ) ); + mapping.setRoleNames( new ArrayList<>( ldapGroupMapping.getRoleNames() ) ); mappings.add( mapping ); } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java index 42387a64d..37135a1f9 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java @@ -33,7 +33,7 @@ public class MockAuditListener implements AuditListener { - private List auditEvents = new ArrayList(); + private List auditEvents = new ArrayList<>(); public void auditEvent( AuditEvent event ) { diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java index 656076ecf..43a7048d7 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/MetadataTools.java @@ -349,8 +349,8 @@ public class MetadataTools @PostConstruct public void initialize() { - this.artifactPatterns = new ArrayList(); - this.proxies = new HashMap>(); + this.artifactPatterns = new ArrayList<>(); + this.proxies = new HashMap<>(); initConfigVariables(); configuration.addChangeListener( this ); @@ -504,7 +504,7 @@ public class MetadataTools private List getMetadatasForManagedRepository( ManagedRepositoryContent managedRepository, String logicalResource ) { - List metadatas = new ArrayList(); + List metadatas = new ArrayList<>(); File file = new File( managedRepository.getRepoRoot(), logicalResource ); if ( file.exists() ) { @@ -622,7 +622,7 @@ public class MetadataTools else { // Add the plugins to the metadata model. - metadata.setPlugins( new ArrayList( allPlugins ) ); + metadata.setPlugins( new ArrayList<>( allPlugins ) ); // artifact ID was actually the last part of the group metadata.setGroupId( metadata.getGroupId() + "." + metadata.getArtifactId() ); @@ -643,12 +643,12 @@ public class MetadataTools private void updateMetadataVersions( Collection allVersions, ArchivaRepositoryMetadata metadata ) { // Sort the versions - List sortedVersions = new ArrayList( allVersions ); + List sortedVersions = new ArrayList<>( allVersions ); Collections.sort( sortedVersions, VersionComparator.getInstance() ); // Split the versions into released and snapshots. - List releasedVersions = new ArrayList(); - List snapshotVersions = new ArrayList(); + List releasedVersions = new ArrayList<>(); + List snapshotVersions = new ArrayList<>(); for ( String version : sortedVersions ) { @@ -795,7 +795,7 @@ public class MetadataTools } // sort the list to determine to aide in determining the Latest version. - List sortedVersions = new ArrayList(); + List sortedVersions = new ArrayList<>(); sortedVersions.addAll( snapshotVersions ); Collections.sort( sortedVersions, new VersionComparator() ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/RepositoryMetadataMerge.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/RepositoryMetadataMerge.java index a3ecbf8ca..7f0636033 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/RepositoryMetadataMerge.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/metadata/RepositoryMetadataMerge.java @@ -210,7 +210,7 @@ public class RepositoryMetadataMerge return null; } - List result = new ArrayList(); + List result = new ArrayList<>(); for (Plugin plugin : plugins) { diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java index c9bf80352..d485bd8e3 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/DefaultRepositoryScanner.java @@ -99,8 +99,8 @@ public class DefaultRepositoryScanner // Setup Includes / Excludes. - List allExcludes = new ArrayList(); - List allIncludes = new ArrayList(); + List allExcludes = new ArrayList<>(); + List allIncludes = new ArrayList<>(); if ( CollectionUtils.isNotEmpty( ignoredContentPatterns ) ) { @@ -147,7 +147,7 @@ public class DefaultRepositoryScanner private List gatherIds( List consumers ) { - List ids = new ArrayList(); + List ids = new ArrayList<>(); for ( RepositoryContentConsumer consumer : consumers ) { ids.add( consumer.getId() ); diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java index 3ba6a25c4..c45d815dc 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java @@ -164,7 +164,7 @@ public class RepositoryContentConsumers { return selectedKnownConsumers; } - List ret = new ArrayList(); + List ret = new ArrayList<>(); List knownSelected = getSelectedKnownConsumerIds(); @@ -195,7 +195,7 @@ public class RepositoryContentConsumers return selectedInvalidConsumers; } - List ret = new ArrayList(); + List ret = new ArrayList<>(); List invalidSelected = getSelectedInvalidConsumerIds(); @@ -219,7 +219,7 @@ public class RepositoryContentConsumers */ public List getAvailableKnownConsumers() { - return new ArrayList( + return new ArrayList<>( applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ).values() ); } @@ -232,7 +232,7 @@ public class RepositoryContentConsumers */ public List getAvailableInvalidConsumers() { - return new ArrayList( + return new ArrayList<>( applicationContext.getBeansOfType( InvalidRepositoryContentConsumer.class ).values() ); } @@ -261,7 +261,7 @@ public class RepositoryContentConsumers // - do not create missing/fix invalid checksums and update metadata when deploying from webdav since these are uploaded by maven if ( !updateRelatedArtifacts ) { - List clone = new ArrayList(); + List clone = new ArrayList<>(); clone.addAll( selectedKnownConsumers ); for ( KnownRepositoryContentConsumer consumer : clone ) diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java index bb88c7195..c75e6e5b3 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java @@ -42,7 +42,7 @@ public class KnownScanConsumer { private int processCount = 0; - private List includes = new ArrayList(); + private List includes = new ArrayList<>(); private boolean processUnmodified = false; diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java index fb5c87181..a19b16db7 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/RepositoryScannerTest.java @@ -143,7 +143,7 @@ public class RepositoryScannerTest private List getIgnoreList() { - List ignores = new ArrayList(); + List ignores = new ArrayList<>(); ignores.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); return ignores; } @@ -154,12 +154,12 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -181,12 +181,12 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -207,13 +207,13 @@ public class RepositoryScannerTest { ManagedRepository repository = createSimpleRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setProcessUnmodified( true ); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -234,14 +234,14 @@ public class RepositoryScannerTest { ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( new String[]{ "**/*.jar", "**/*.war", "**/*.pom", "**/maven-metadata.xml", "**/*-site.xml", "**/*.zip", "**/*.tar.gz", "**/*.sha1", "**/*.md5" } ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -259,7 +259,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryArtifactScanner() throws Exception { - List actualArtifactPaths = new ArrayList(); + List actualArtifactPaths = new ArrayList<>(); actualArtifactPaths.add( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar" ); actualArtifactPaths.add( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar" ); @@ -295,12 +295,12 @@ public class RepositoryScannerTest ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -317,7 +317,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryMetadataScanner() throws Exception { - List actualMetadataPaths = new ArrayList(); + List actualMetadataPaths = new ArrayList<>(); actualMetadataPaths.add( "org/apache/maven/some-ejb/1.0/maven-metadata.xml" ); actualMetadataPaths.add( "org/apache/maven/update/test-not-updated/maven-metadata.xml" ); @@ -332,12 +332,12 @@ public class RepositoryScannerTest ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer knownConsumer = new KnownScanConsumer(); knownConsumer.setIncludes( new String[]{ "**/maven-metadata*.xml" } ); knownConsumers.add( knownConsumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -354,7 +354,7 @@ public class RepositoryScannerTest public void testDefaultRepositoryProjectScanner() throws Exception { - List actualProjectPaths = new ArrayList(); + List actualProjectPaths = new ArrayList<>(); actualProjectPaths.add( "org/apache/maven/A/1.0/A-1.0.pom" ); actualProjectPaths.add( "org/apache/maven/B/2.0/B-2.0.pom" ); @@ -369,12 +369,12 @@ public class RepositoryScannerTest ManagedRepository repository = createDefaultRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( new String[]{ "**/*.pom" } ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); @@ -391,7 +391,7 @@ public class RepositoryScannerTest public void testLegacyRepositoryArtifactScanner() throws Exception { - List actualArtifactPaths = new ArrayList(); + List actualArtifactPaths = new ArrayList<>(); actualArtifactPaths.add( "invalid/jars/1.0/invalid-1.0.jar" ); actualArtifactPaths.add( "invalid/jars/invalid-1.0.rar" ); @@ -410,12 +410,12 @@ public class RepositoryScannerTest ManagedRepository repository = createLegacyRepository(); - List knownConsumers = new ArrayList(); + List knownConsumers = new ArrayList<>(); KnownScanConsumer consumer = new KnownScanConsumer(); consumer.setIncludes( ARTIFACT_PATTERNS ); knownConsumers.add( consumer ); - List invalidConsumers = new ArrayList(); + List invalidConsumers = new ArrayList<>(); InvalidScanConsumer badconsumer = new InvalidScanConsumer(); invalidConsumers.add( badconsumer ); diff --git a/archiva-modules/archiva-base/archiva-test-utils/src/main/java/org/apache/archiva/test/utils/ListGenerator.java b/archiva-modules/archiva-base/archiva-test-utils/src/main/java/org/apache/archiva/test/utils/ListGenerator.java index d0abc42dd..b9a22becc 100644 --- a/archiva-modules/archiva-base/archiva-test-utils/src/main/java/org/apache/archiva/test/utils/ListGenerator.java +++ b/archiva-modules/archiva-base/archiva-test-utils/src/main/java/org/apache/archiva/test/utils/ListGenerator.java @@ -58,7 +58,7 @@ public class ListGenerator return null; } - List generated = new ArrayList(); + List generated = new ArrayList<>(); testRound = Math.min( MAXROUND, testRound ); diff --git a/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/AbstractTransactionEvent.java b/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/AbstractTransactionEvent.java index 7dbe03bf7..73fabc998 100644 --- a/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/AbstractTransactionEvent.java +++ b/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/AbstractTransactionEvent.java @@ -40,11 +40,11 @@ import java.util.Map; public abstract class AbstractTransactionEvent implements TransactionEvent { - private Map backups = new HashMap(); + private Map backups = new HashMap<>(); - private List createdDirs = new ArrayList(); + private List createdDirs = new ArrayList<>(); - private List createdFiles = new ArrayList(); + private List createdFiles = new ArrayList<>(); /** * {@link List}<{@link Digester}> @@ -75,7 +75,7 @@ public abstract class AbstractTransactionEvent protected void mkDirs( File dir ) throws IOException { - List createDirs = new ArrayList(); + List createDirs = new ArrayList<>(); File parent = dir; while ( !parent.exists() || !parent.isDirectory() ) @@ -87,7 +87,7 @@ public abstract class AbstractTransactionEvent while ( !createDirs.isEmpty() ) { - File directory = (File) createDirs.remove( createDirs.size() - 1 ); + File directory = createDirs.remove( createDirs.size() - 1 ); if ( directory.mkdir() ) { diff --git a/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/FileTransaction.java b/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/FileTransaction.java index 35d8b005c..80fab4b32 100644 --- a/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/FileTransaction.java +++ b/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/archiva/transaction/FileTransaction.java @@ -32,7 +32,7 @@ import org.codehaus.plexus.digest.Digester; */ public class FileTransaction { - private List events = new ArrayList(); + private List events = new ArrayList<>(); public void commit() throws TransactionException diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java index 2b418b809..f9c650719 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java @@ -100,9 +100,9 @@ public class DefaultRepositoryArchivaTaskScheduler public static final String CRON_HOURLY = "0 0 * * * ?"; - private Set jobs = new HashSet(); + private Set jobs = new HashSet<>(); - private List queuedRepos = new ArrayList(); + private List queuedRepos = new ArrayList<>(); @PostConstruct public void startup() diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockArchivaAdministration.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockArchivaAdministration.java index 2cb62ef78..5e4a33104 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockArchivaAdministration.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockArchivaAdministration.java @@ -108,7 +108,7 @@ public class MockArchivaAdministration public List getKnownContentConsumers() throws RepositoryAdminException { - return new ArrayList( + return new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() ); } @@ -133,7 +133,7 @@ public class MockArchivaAdministration public List getInvalidContentConsumers() throws RepositoryAdminException { - return new ArrayList( + return new ArrayList<>( getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() ); } diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java index aed2a9510..a8b02b29d 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/mock/MockManagedRepositoryAdmin.java @@ -45,7 +45,7 @@ public class MockManagedRepositoryAdmin List managedRepoConfigs = getArchivaConfiguration().getConfiguration().getManagedRepositories(); - List managedRepos = new ArrayList( managedRepoConfigs.size() ); + List managedRepos = new ArrayList<>( managedRepoConfigs.size() ); for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs ) { diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java index cf98060e7..ba02a2c2f 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestRepositoryStatisticsManager.java @@ -82,7 +82,7 @@ public class TestRepositoryStatisticsManager List stats = repoStats.get( repositoryId ); if ( stats == null ) { - stats = new ArrayList(); + stats = new ArrayList<>(); repoStats.put( repositoryId, stats ); } return stats; 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 repositories = new ArrayList(); + private List 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 auditListeners = new ArrayList(); + private List auditListeners = new ArrayList<>(); @Inject protected UserRepositories userRepositories; @@ -272,7 +272,7 @@ public abstract class AbstractRestService { if ( artifactMetadatas != null && !artifactMetadatas.isEmpty() ) { - List artifacts = new ArrayList( artifactMetadatas.size() ); + List 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 browseGroupResultEntries = new ArrayList( namespaces.size() ); + List 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 browseGroupResultEntries = - new ArrayList( 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 versions = getVersions( selectedRepos, groupId, artifactId ); - return new VersionsList( new ArrayList( versions ) ); + return new VersionsList( new ArrayList<>( versions ) ); } catch ( MetadataResolutionException e ) { @@ -247,7 +247,7 @@ public class DefaultBrowseService versions.addAll( projectVersions ); } - List sortedVersions = new ArrayList( versions ); + List sortedVersions = new ArrayList<>( versions ); Collections.sort( sortedVersions, VersionComparator.getInstance() ); @@ -499,7 +499,7 @@ public class DefaultBrowseService public List getDependees( String groupId, String artifactId, String version, String repositoryId ) throws ArchivaRestServiceException { - List references = new ArrayList(); + List 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 artifacts = new ArrayList( references.size() ); + List artifacts = new ArrayList<>( references.size() ); for ( ProjectVersionReference projectVersionReference : references ) { @@ -549,7 +549,7 @@ public class DefaultBrowseService return Collections.emptyList(); } Map map = metadataFacet.toProperties(); - List entries = new ArrayList( map.size() ); + List entries = new ArrayList<>( map.size() ); for ( Map.Entry entry : map.entrySet() ) { @@ -711,7 +711,7 @@ public class DefaultBrowseService { List selectedRepos = getSelectedRepos( repositoryId ); - List artifactDownloadInfos = new ArrayList(); + List artifactDownloadInfos = new ArrayList<>(); RepositorySession session = repositorySessionFactory.createSession(); @@ -721,7 +721,7 @@ public class DefaultBrowseService { for ( String repoId : selectedRepos ) { - List artifacts = new ArrayList( + List 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 sorted = new ArrayList( artifactContentEntryMap.values() ); + List 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(); + 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 artifactsWithOutSnapshots = new ArrayList(); + List 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 repositoryType = new ArrayList(); + private List repositoryType = new ArrayList<>(); - private List adminFeatures = new ArrayList(); + private List 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( getBeansOfType( applicationContext, Policy.class ).values() ); + allPolicies = new ArrayList<>( getBeansOfType( applicationContext, Policy.class ).values() ); } public List getProxyConnectors() @@ -146,7 +146,7 @@ public class DefaultProxyConnectorService public List getAllPolicyInformations() throws ArchivaRestServiceException { - List policyInformations = new ArrayList( allPolicies.size() ); + List 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 informations = - new ArrayList( beans.size() ); + List informations = new ArrayList<>( beans.size() ); for ( Map.Entry entry : beans.entrySet() ) { @@ -229,8 +228,7 @@ public class DefaultRedbackRuntimeConfigurationService return Collections.emptyList(); } - List informations = - new ArrayList( beans.size() ); + List informations = new ArrayList<>( beans.size() ); for ( Map.Entry 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 stats = new ArrayList(); + List stats = new ArrayList<>(); for ( String repo : repositoriesId ) { try @@ -140,10 +140,10 @@ public class DefaultReportRepositoriesService if ( !ALL_REPOSITORIES.equals( repository ) ) { - observableRepositories = Collections.singletonList( repository ); + observableRepositories = Collections.singletonList( repository ); } - List problemArtifacts = new ArrayList(); + List 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 availableVersions = new ArrayList(); + List 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 availableVersions = new ArrayList(); + List 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 repositoriesGroups = - new ArrayList( 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( + 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( + 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( + 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( 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 artifacts = new ArrayList( searchResults.getReturnedHitsCount() ); + List 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 list = new ArrayList(); + private List list = new ArrayList<>(); private List 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 getEntries( List dataEntries ) { - List entries = new ArrayList(); + List 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 entries = new ArrayList(); + List 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 artifacts = new ArrayList(); + List artifacts = new ArrayList<>(); try { for ( String repoId : metadataRepository.getRepositories() ) @@ -106,7 +106,7 @@ public class NewVersionsOfArtifactRssFeedProcessor long tmp = 0; RssFeedEntry entry = null; - List entries = new ArrayList(); + List 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 entries = new ArrayList(); + List 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 entries = new ArrayList(); + List 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 newArtifacts = new ArrayList(); + List 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 managedRepositories = getAccessibleRepositories( principal, operation ); - List repoIds = new ArrayList( managedRepositories.size() ); + List 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 managedRepositories = new ArrayList(); + List 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 availableVersions = new ArrayList(); + List 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 repoIds = new ArrayList(); + List 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 findUsersByEmailKey( String emailKey, boolean orderAscending ) throws UserManagerException { - List users = new ArrayList(); + List users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -275,7 +275,7 @@ public class ArchivaConfigurableUsersManager public List findUsersByFullNameKey( String fullNameKey, boolean orderAscending ) throws UserManagerException { - List users = new ArrayList(); + List users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -291,7 +291,7 @@ public class ArchivaConfigurableUsersManager public List findUsersByQuery( UserQuery query ) throws UserManagerException { - List users = new ArrayList(); + List users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -307,7 +307,7 @@ public class ArchivaConfigurableUsersManager public List findUsersByUsernameKey( String usernameKey, boolean orderAscending ) throws UserManagerException { - List users = new ArrayList(); + List users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -328,7 +328,7 @@ public class ArchivaConfigurableUsersManager public List getUsers() throws UserManagerException { - List users = new ArrayList(); + List users = new ArrayList<>(); for ( UserManager userManager : userManagerPerId.values() ) { @@ -344,7 +344,7 @@ public class ArchivaConfigurableUsersManager public List getUsers( boolean orderAscending ) throws UserManagerException { - List users = new ArrayList(); + List 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 ldapGroupMappings = new ArrayList( mappings.size() ); + List ldapGroupMappings = new ArrayList<>( mappings.size() ); for ( Map.Entry> 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 userManagerImpls = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls(); - userManagers = new ArrayList( userManagerImpls.size() ); + userManagers = new ArrayList<>( userManagerImpls.size() ); for ( String beanId : userManagerImpls ) { @@ -100,7 +100,7 @@ public class ArchivaLockedAdminEnvironmentCheck { continue; } - List roles = new ArrayList(); + List roles = new ArrayList<>(); roles.add( RedbackRoleConstants.SYSTEM_ADMINISTRATOR_ROLE ); List 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( 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( 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( 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( 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( allUserAssignments.values() ); + return new ArrayList<>( allUserAssignments.values() ); } public List getUserAssignmentsForRoles( Collection roleNames ) throws RbacManagerException { - List allUserAssignments = new ArrayList(); + List 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 userManagerImpls = redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls(); - userManagers = new ArrayList( 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 authnResultErrors = new ArrayList(); + List 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 violations = new ArrayList(); + List violations = new ArrayList<>(); for ( Entry entry : checkers.entrySet() ) { EnvironmentCheck check = entry.getValue(); - List v = new ArrayList(); + List 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 entriesNames = new ArrayList(); + List entriesNames = new ArrayList<>(); Enumeration 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 users = new HashMap(); - List repoIds = new ArrayList(); + List 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 artifacts = new ArrayList(); + private List artifacts = new ArrayList<>(); - private List versions = new ArrayList(); + private List versions = new ArrayList<>(); public TestMetadataRepository() { -- 2.39.5