diff options
62 files changed, 123 insertions, 146 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 73662e6b5..e899562b0 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 @@ -53,8 +53,8 @@ import java.util.Properties; /** * ArchivaCli - * - * + * <p/> + * <p/> * TODO add back reading of archiva.xml from a given location */ public class ArchivaCli @@ -75,8 +75,6 @@ public class ArchivaCli throws IOException { - - try (InputStream pomStream = ArchivaCli.class.getResourceAsStream( POM_PROPERTIES )) { if ( pomStream == null ) @@ -190,7 +188,7 @@ public class ArchivaCli } } - private <T>T lookup( Class<T> clazz ) + private <T> T lookup( Class<T> clazz ) throws PlexusSisuBridgeException { PlexusSisuBridge plexusSisuBridge = applicationContext.getBean( PlexusSisuBridge.class ); @@ -244,8 +242,7 @@ public class ArchivaCli // we use a naming conventions knownRepositoryContentConsumer#hint // with plexus we used only hint so remove before# - Map<String, KnownRepositoryContentConsumer> smallNames = - new HashMap<String, KnownRepositoryContentConsumer>( beans.size() ); + Map<String, KnownRepositoryContentConsumer> smallNames = new HashMap<>( beans.size() ); for ( Map.Entry<String, KnownRepositoryContentConsumer> entry : beans.entrySet() ) { @@ -262,8 +259,7 @@ public class ArchivaCli Properties p = new Properties(); - - try(FileInputStream fis = new FileInputStream( properties )) + try (FileInputStream fis = new FileInputStream( properties )) { p.load( fis ); } 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 f55e1e523..4e916779b 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 @@ -92,7 +92,7 @@ public class LegacyToDefaultConverter private boolean dryrun; - private Map<Artifact, List<String>> warnings = new HashMap<Artifact, List<String>>(); + private Map<Artifact, List<String>> warnings = new HashMap<>(); @PostConstruct public void initialize() 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 1fd14aa57..21bcdd096 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 @@ -279,7 +279,7 @@ public class DefaultArchivaConfiguration // Fix policies boolean connectorValid = true; - Map<String, String> policies = new HashMap<String, String>(); + Map<String, String> policies = new HashMap<>(); // Make copy of policies policies.putAll( connector.getPolicies() ); // Clear out policies 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 7ad6d762c..f0ad020c7 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 @@ -45,7 +45,7 @@ import java.util.Map; /** * FileTypes */ -@Service ("fileTypes") +@Service("fileTypes") public class FileTypes implements RegistryListener { @@ -57,17 +57,14 @@ public class FileTypes public static final String IGNORED = "ignored"; - /** - * - */ @Inject - @Named (value = "archivaConfiguration#default") + @Named(value = "archivaConfiguration#default") private ArchivaConfiguration archivaConfiguration; /** * Map of default values for the file types. */ - private Map<String, List<String>> defaultTypeMap = new HashMap<String, List<String>>(); + private Map<String, List<String>> defaultTypeMap = new HashMap<>(); private List<String> artifactPatterns; @@ -87,15 +84,14 @@ public class FileTypes /** * Get the list of patterns for a specified filetype. - * - * <p> + * <p/> + * <p/> * You will always get a list. In this order. * <ul> * <li>The Configured List</li> * <li>The Default List</li> * <li>A single item list of <code>"**/*"</code></li> * </ul> - * * * @param id the id to lookup. * @return the list of patterns. diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java index 32b70f074..bf1637607 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/functors/FiletypeToMapClosure.java @@ -33,7 +33,7 @@ import java.util.Map; public class FiletypeToMapClosure implements Closure { - private Map<String, FileType> map = new HashMap<String, FileType>(); + private Map<String, FileType> map = new HashMap<>(); public void execute( Object input ) { 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 d996e1046..5ef93eb28 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 @@ -47,14 +47,8 @@ public class AutoRenameConsumer extends AbstractMonitoredConsumer implements KnownRepositoryContentConsumer { - /** - * default-value="auto-rename" - */ private String id = "auto-rename"; - /** - * default-value="Automatically rename common artifact mistakes." - */ private String description = "Automatically rename common artifact mistakes."; private static final String RENAME_FAILURE = "rename_failure"; @@ -63,7 +57,7 @@ public class AutoRenameConsumer private List<String> includes = new ArrayList<>( 3 ); - private Map<String, String> extensionRenameMap = new HashMap<String, String>(); + private Map<String, String> extensionRenameMap = new HashMap<>(); public AutoRenameConsumer() { diff --git a/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/Lock.java b/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/Lock.java index 0922a7495..bd4afcb61 100644 --- a/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/Lock.java +++ b/archiva-modules/archiva-base/archiva-filelock/src/main/java/org/apache/archiva/common/filelock/Lock.java @@ -41,7 +41,7 @@ public class Lock private AtomicBoolean write; - private final Map<Thread, AtomicInteger> fileClients = new HashMap<Thread, AtomicInteger>(); + private final Map<Thread, AtomicInteger> fileClients = new HashMap<>(); private FileLock fileLock; 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 1ea1a53e9..9dc650fdc 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 @@ -31,7 +31,7 @@ import java.util.Map; */ public class SearchResults { - private Map<String, SearchResultHit> hits = new HashMap<String, SearchResultHit>(); + private Map<String, SearchResultHit> hits = new HashMap<>(); private int totalHits; diff --git a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java index 613f20cde..75a262792 100644 --- a/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java +++ b/archiva-modules/archiva-base/archiva-proxy-common/src/main/java/org/apache/archiva/proxy/common/WagonFactoryRequest.java @@ -35,7 +35,7 @@ public class WagonFactoryRequest */ private String protocol; - private Map<String, String> headers = new HashMap<String, String>(); + private Map<String, String> headers = new HashMap<>(); private String userAgent = "Java-Archiva"; @@ -72,7 +72,7 @@ public class WagonFactoryRequest { if ( this.headers == null ) { - this.headers = new HashMap<String, String>(); + this.headers = new HashMap<>(); } return headers; } 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 9976eb3a1..1d2ff6e7d 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 @@ -134,7 +134,7 @@ public class DefaultRepositoryProxyConnectors @Inject private UrlFailureCache urlFailureCache; - private Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<String, List<ProxyConnector>>(); + private Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<>(); private Map<String, ProxyInfo> networkProxyMap = new ConcurrentHashMap<String, ProxyInfo>(); 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 4e55a7cd5..89c180e6f 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 @@ -157,7 +157,7 @@ public abstract class AbstractRepositoryConnector { if ( this.policies == null ) { - this.policies = new HashMap<String, String>(); + this.policies = new HashMap<>(); } return this.policies; @@ -172,7 +172,7 @@ public abstract class AbstractRepositoryConnector { if ( this.properties == null ) { - this.properties = new HashMap<String, String>(); + this.properties = new HashMap<>(); } return this.properties; 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 bc8c721b8..707d22dcf 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 @@ -93,7 +93,7 @@ public class LdapConfiguration /** * Field extraProperties. */ - private Map<String, String> extraProperties = new HashMap<String, String>(); + private Map<String, String> extraProperties = new HashMap<>(); /** * field to ease json mapping wrapper on <code>extraProperties</code> field 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 dda660af1..7a58dd25d 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 @@ -111,7 +111,7 @@ public class RedbackRuntimeConfiguration { if ( this.configurationProperties == null ) { - this.configurationProperties = new HashMap<String, String>(); + this.configurationProperties = new HashMap<>(); } return configurationProperties; } @@ -137,7 +137,7 @@ public class RedbackRuntimeConfiguration this.configurationPropertiesEntries = configurationPropertiesEntries; if ( configurationPropertiesEntries != null ) { - this.configurationProperties = new HashMap<String, String>( configurationPropertiesEntries.size() ); + this.configurationProperties = new HashMap<>( configurationPropertiesEntries.size() ); for ( PropertyEntry propertyEntry : configurationPropertiesEntries ) { this.configurationProperties.put( propertyEntry.getKey(), propertyEntry.getValue() ); 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 3adbf760d..db8021d86 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 @@ -232,7 +232,7 @@ public class RemoteRepository { if ( this.extraParameters == null ) { - this.extraParameters = new HashMap<String, String>(); + this.extraParameters = new HashMap<>(); } return extraParameters; } @@ -275,7 +275,7 @@ public class RemoteRepository { if ( this.extraHeaders == null ) { - this.extraHeaders = new HashMap<String, String>(); + this.extraHeaders = new HashMap<>(); } return extraHeaders; } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java index 0e4161718..666a8a178 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/FiletypeToMapClosure.java @@ -33,7 +33,7 @@ import java.util.Map; public class FiletypeToMapClosure implements Closure { - private Map<String, FileType> map = new HashMap<String, FileType>(); + private Map<String, FileType> map = new HashMap<>(); public void execute( Object input ) { 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 91a5f8668..5be2e8fe4 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 @@ -265,7 +265,7 @@ public class DefaultRepositoryGroupAdmin throws RepositoryAdminException { List<RepositoryGroup> repositoriesGroups = getRepositoriesGroups(); - Map<String, RepositoryGroup> map = new HashMap<String, RepositoryGroup>( repositoriesGroups.size() ); + Map<String, RepositoryGroup> map = new HashMap<>( repositoriesGroups.size() ); for ( RepositoryGroup repositoryGroup : repositoriesGroups ) { map.put( repositoryGroup.getId(), repositoryGroup ); @@ -277,7 +277,7 @@ public class DefaultRepositoryGroupAdmin throws RepositoryAdminException { - java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>(); + Map<String, List<String>> map = new HashMap<>(); for ( ManagedRepository repo : getManagedRepositoryAdmin().getManagedRepositories() ) { @@ -286,7 +286,7 @@ public class DefaultRepositoryGroupAdmin if ( !group.getRepositories().contains( repo.getId() ) ) { String groupId = group.getId(); - java.util.List<String> repos = map.get( groupId ); + List<String> repos = map.get( groupId ); if ( repos == null ) { repos = new ArrayList<>(); @@ -302,13 +302,13 @@ public class DefaultRepositoryGroupAdmin public Map<String, List<String>> getRepositoryToGroupMap() throws RepositoryAdminException { - java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>(); + Map<String, List<String>> map = new HashMap<>(); for ( RepositoryGroup group : getRepositoriesGroups() ) { for ( String repositoryId : group.getRepositories() ) { - java.util.List<String> groups = map.get( repositoryId ); + List<String> groups = map.get( repositoryId ); if ( groups == null ) { groups = new ArrayList<>(); 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 5931eb12c..891b83150 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 @@ -72,7 +72,7 @@ import java.util.Map; * * @author Olivier Lamy */ -@Service( "managedRepositoryAdmin#default" ) +@Service("managedRepositoryAdmin#default") public class DefaultManagedRepositoryAdmin extends AbstractRepositoryAdmin implements ManagedRepositoryAdmin @@ -83,7 +83,7 @@ public class DefaultManagedRepositoryAdmin public static final String STAGE_REPO_ID_END = "-stage"; @Inject - @Named( value = "archivaTaskScheduler#repository" ) + @Named(value = "archivaTaskScheduler#repository") private RepositoryArchivaTaskScheduler repositoryTaskScheduler; /** @@ -105,7 +105,7 @@ public class DefaultManagedRepositoryAdmin protected RoleManager roleManager; @Inject - @Named( value = "cache#namespaces" ) + @Named(value = "cache#namespaces") private Cache<String, Collection<String>> namespacesCache; // fields @@ -191,8 +191,7 @@ public class DefaultManagedRepositoryAdmin throws RepositoryAdminException { List<ManagedRepository> managedRepositories = getManagedRepositories(); - Map<String, ManagedRepository> repositoriesMap = - new HashMap<String, ManagedRepository>( managedRepositories.size() ); + Map<String, ManagedRepository> repositoriesMap = new HashMap<>( managedRepositories.size() ); for ( ManagedRepository managedRepository : managedRepositories ) { repositoriesMap.put( managedRepository.getId(), managedRepository ); @@ -417,8 +416,7 @@ public class DefaultManagedRepositoryAdmin } // olamy: copy list for reading as a unit test in webapp fail with ConcurrentModificationException - List<ProxyConnectorConfiguration> proxyConnectors = - new ArrayList<>( config.getProxyConnectors() ); + List<ProxyConnectorConfiguration> proxyConnectors = new ArrayList<>( config.getProxyConnectors() ); for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors ) { if ( StringUtils.equals( proxyConnector.getSourceRepoId(), repository.getId() ) ) 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 22fc10bfa..0d9914b0c 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 @@ -166,7 +166,7 @@ public class DefaultProxyConnectorAdmin public Map<String, List<ProxyConnector>> getProxyConnectorAsMap() throws RepositoryAdminException { - Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<String, java.util.List<ProxyConnector>>(); + Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<>(); Iterator<ProxyConnector> it = getProxyConnectors().iterator(); while ( it.hasNext() ) 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 c5d17a955..bcf945ad4 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 @@ -65,9 +65,9 @@ public class DefaultRemoteRepositoryAdmin private MavenIndexerUtils mavenIndexerUtils; // fields - List<? extends IndexCreator> indexCreators; + private List<? extends IndexCreator> indexCreators; - NexusIndexer indexer; + private NexusIndexer indexer; @PostConstruct private void initialize() @@ -245,7 +245,7 @@ public class DefaultRemoteRepositoryAdmin public Map<String, RemoteRepository> getRemoteRepositoriesAsMap() throws RepositoryAdminException { - java.util.Map<String, RemoteRepository> map = new HashMap<String, RemoteRepository>(); + java.util.Map<String, RemoteRepository> map = new HashMap<>(); for ( RemoteRepository repo : getRemoteRepositories() ) { diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java index f90c663bf..780ae4ed2 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java @@ -149,10 +149,10 @@ public abstract class AbstractRepositoryAdminTest remoteRepository.setId( id ); remoteRepository.setRemoteDownloadNetworkProxyId( "foo" ); remoteRepository.setDescription( "cool apache repo" ); - Map<String, String> extraParameters = new HashMap<String, String>(); + Map<String, String> extraParameters = new HashMap<>(); extraParameters.put( "foo", "bar" ); remoteRepository.setExtraParameters( extraParameters ); - Map<String, String> extraHeaders = new HashMap<String, String>(); + Map<String, String> extraHeaders = new HashMap<>(); extraHeaders.put( "beer", "wine" ); remoteRepository.setExtraHeaders( extraHeaders ); return remoteRepository; diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ArtifactClassifierMapping.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ArtifactClassifierMapping.java index 5d2137703..0f3fa8271 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ArtifactClassifierMapping.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ArtifactClassifierMapping.java @@ -36,7 +36,7 @@ public class ArtifactClassifierMapping static { // note additional 's' on type as these are maven 1.x directory components - typeToClassifierMap = new HashMap<String, String>(); + typeToClassifierMap = new HashMap<>( 3 ); typeToClassifierMap.put( "java-sources", "sources" ); typeToClassifierMap.put( "javadoc.jars", "javadoc" ); typeToClassifierMap.put( "javadocs", "javadoc" ); 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 c45d815dc..5a5b4d71a 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 @@ -48,7 +48,7 @@ import java.util.Map; /** * RepositoryContentConsumerUtil */ -@Service ("repositoryContentConsumers") +@Service( "repositoryContentConsumers" ) public class RepositoryContentConsumers implements ApplicationContextAware { @@ -119,7 +119,7 @@ public class RepositoryContentConsumers public Map<String, KnownRepositoryContentConsumer> getSelectedKnownConsumersMap() throws RepositoryAdminException { - Map<String, KnownRepositoryContentConsumer> consumerMap = new HashMap<String, KnownRepositoryContentConsumer>(); + Map<String, KnownRepositoryContentConsumer> consumerMap = new HashMap<>(); for ( KnownRepositoryContentConsumer consumer : getSelectedKnownConsumers() ) { @@ -138,8 +138,7 @@ public class RepositoryContentConsumers public Map<String, InvalidRepositoryContentConsumer> getSelectedInvalidConsumersMap() throws RepositoryAdminException { - Map<String, InvalidRepositoryContentConsumer> consumerMap = - new HashMap<String, InvalidRepositoryContentConsumer>(); + Map<String, InvalidRepositoryContentConsumer> consumerMap = new HashMap<>(); for ( InvalidRepositoryContentConsumer consumer : getSelectedInvalidConsumers() ) { @@ -154,7 +153,7 @@ public class RepositoryContentConsumers * selected according to the active configuration. * * @return the list of {@link KnownRepositoryContentConsumer} that have been selected - * by the active configuration. + * by the active configuration. */ public synchronized List<KnownRepositoryContentConsumer> getSelectedKnownConsumers() throws RepositoryAdminException @@ -183,7 +182,7 @@ public class RepositoryContentConsumers * selected according to the active configuration. * * @return the list of {@link InvalidRepositoryContentConsumer} that have been selected - * by the active configuration. + * by the active configuration. */ public synchronized List<InvalidRepositoryContentConsumer> getSelectedInvalidConsumers() throws RepositoryAdminException @@ -215,12 +214,11 @@ public class RepositoryContentConsumers * available and present in the classpath and as components in the IoC. * * @return the list of all available {@link KnownRepositoryContentConsumer} present in the classpath - * and as a component in the IoC. + * and as a component in the IoC. */ public List<KnownRepositoryContentConsumer> getAvailableKnownConsumers() { - return new ArrayList<>( - applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ).values() ); + return new ArrayList<>( applicationContext.getBeansOfType( KnownRepositoryContentConsumer.class ).values() ); } /** @@ -228,12 +226,11 @@ public class RepositoryContentConsumers * available and present in the classpath and as components in the IoC. * * @return the list of all available {@link InvalidRepositoryContentConsumer} present in the classpath - * and as a component in the IoC. + * and as a component in the IoC. */ public List<InvalidRepositoryContentConsumer> getAvailableInvalidConsumers() { - return new ArrayList<>( - applicationContext.getBeansOfType( InvalidRepositoryContentConsumer.class ).values() ); + return new ArrayList<>( applicationContext.getBeansOfType( InvalidRepositoryContentConsumer.class ).values() ); } /** diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java index 88638ba00..371776ab0 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScannerInstance.java @@ -43,8 +43,6 @@ import java.util.Map; /** * RepositoryScannerInstance - * - * */ public class RepositoryScannerInstance implements DirectoryWalkListener @@ -83,8 +81,8 @@ public class RepositoryScannerInstance this.knownConsumers = knownConsumerList; this.invalidConsumers = invalidConsumerList; - consumerTimings = new HashMap<String, Long>(); - consumerCounts = new HashMap<String, Long>(); + consumerTimings = new HashMap<>(); + consumerCounts = new HashMap<>(); this.consumerProcessFile = new ConsumerProcessFileClosure(); consumerProcessFile.setExecuteOnEntireRepo( true ); diff --git a/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/LatinEntities.java b/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/LatinEntities.java index 724ac9e78..51f2a46ad 100644 --- a/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/LatinEntities.java +++ b/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/LatinEntities.java @@ -33,7 +33,7 @@ public class LatinEntities static { - defaultEntityMap = new HashMap<String, String>(); + defaultEntityMap = new HashMap<>(); defaultEntityMap.put( "nbsp", "\u00a0" ); defaultEntityMap.put( "iexcl", "\u00a1" ); diff --git a/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java b/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java index 714b8d6e3..43cb09c4b 100644 --- a/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java +++ b/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/archiva/xml/XMLReader.java @@ -56,7 +56,7 @@ public class XMLReader private Document document; - private Map<String, String> namespaceMap = new HashMap<String, String>(); + private Map<String, String> namespaceMap = new HashMap<>(); public XMLReader( String type, File file ) throws XMLException 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 ba02a2c2f..a2ebf4532 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 @@ -35,7 +35,7 @@ import java.util.Map; public class TestRepositoryStatisticsManager implements RepositoryStatisticsManager { - private Map<String, List<RepositoryStatistics>> repoStats = new HashMap<String, List<RepositoryStatistics>>(); + private Map<String, List<RepositoryStatistics>> repoStats = new HashMap<>(); public boolean hasStatistics( MetadataRepository metadataRepository, String repositoryId ) throws MetadataRepositoryException 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 c05da22ca..8534e0c96 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 @@ -182,7 +182,7 @@ public abstract class AbstractRestService // as per convention we named spring bean role#hint remove role# if exists Map<String, T> springBeans = applicationContext.getBeansOfType( clazz ); - Map<String, T> beans = new HashMap<String, T>( springBeans.size() ); + Map<String, T> beans = new HashMap<>( springBeans.size() ); for ( Map.Entry<String, T> entry : springBeans.entrySet() ) { 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 df86ba443..507cfd50a 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 @@ -195,8 +195,7 @@ public class DefaultBrowseService { repositorySession.close(); } - List<BrowseResultEntry> browseGroupResultEntries = - new ArrayList<>( namespaces.size() + projects.size() ); + List<BrowseResultEntry> browseGroupResultEntries = new ArrayList<>( namespaces.size() + projects.size() ); for ( String namespace : namespaces ) { browseGroupResultEntries.add( new BrowseResultEntry( namespace, false ).groupId( namespace ) ); @@ -571,7 +570,7 @@ public class DefaultBrowseService return Boolean.FALSE; } - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); MetadataFacet metadataFacet = projectVersionMetadata.getFacet( GenericMetadataFacet.FACET_ID ); @@ -972,7 +971,7 @@ public class DefaultBrowseService protected List<ArtifactContentEntry> readFileEntries( File file, String filterPath, String repoId ) throws IOException { - Map<String, ArtifactContentEntry> artifactContentEntryMap = new HashMap<String, ArtifactContentEntry>(); + Map<String, ArtifactContentEntry> artifactContentEntryMap = new HashMap<>(); int filterDepth = StringUtils.countMatches( filterPath, "/" ); /*if ( filterDepth == 0 ) { @@ -1013,8 +1012,7 @@ public class DefaultBrowseService if ( StringUtils.isNotEmpty( filterPath ) ) { - Map<String, ArtifactContentEntry> filteredArtifactContentEntryMap = - new HashMap<String, ArtifactContentEntry>(); + Map<String, ArtifactContentEntry> filteredArtifactContentEntryMap = new HashMap<>(); for ( Map.Entry<String, ArtifactContentEntry> entry : artifactContentEntryMap.entrySet() ) { @@ -1045,7 +1043,7 @@ public class DefaultBrowseService private List<ArtifactContentEntry> getSmallerDepthEntries( Map<String, ArtifactContentEntry> entries ) { int smallestDepth = Integer.MAX_VALUE; - Map<Integer, List<ArtifactContentEntry>> perDepthList = new HashMap<Integer, List<ArtifactContentEntry>>(); + Map<Integer, List<ArtifactContentEntry>> perDepthList = new HashMap<>(); for ( Map.Entry<String, ArtifactContentEntry> entry : entries.entrySet() ) { diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java index aacdf159e..cf28db7e1 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java @@ -49,7 +49,7 @@ public class BrowseServiceTest Map<String, String> toMap( List<Entry> entries ) { - Map<String, String> map = new HashMap<String, String>( entries.size() ); + Map<String, String> map = new HashMap<>( entries.size() ); for ( Entry entry : entries ) { @@ -487,7 +487,7 @@ public class BrowseServiceTest BrowseService browseService = getBrowseService( authorizationHeader, false ); - Map<String, String> inputMetadata = new HashMap<String, String>( 3 ); + Map<String, String> inputMetadata = new HashMap<>( 3 ); inputMetadata.put( "buildNumber", "1" ); inputMetadata.put( "author", "alecharp" ); inputMetadata.put( "jenkins_version", "1.486" ); 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 ad06d3dd6..4ab49fc47 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 @@ -86,7 +86,7 @@ public class NewArtifactsRssFeedProcessorTest metadataRepository.setArtifactsByDateRange( newArtifacts ); - Map<String, String> reqParams = new HashMap<String, String>(); + Map<String, String> reqParams = new HashMap<>(); reqParams.put( RssFeedProcessor.KEY_REPO_ID, TEST_REPO ); SyndFeed feed = newArtifactsProcessor.process( reqParams, metadataRepository ); diff --git a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java index 45d07e897..97228260c 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java +++ b/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java @@ -84,7 +84,7 @@ public class NewVersionsOfArtifactRssFeedProcessorTest ArtifactMetadata artifact3 = createArtifact( whenGatheredNext, "1.0.3-SNAPSHOT" ); - Map<String, String> reqParams = new HashMap<String, String>(); + Map<String, String> reqParams = new HashMap<>(); reqParams.put( RssFeedProcessor.KEY_GROUP_ID, GROUP_ID ); reqParams.put( RssFeedProcessor.KEY_ARTIFACT_ID, ARTIFACT_ID ); 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 cc9ae88db..ddbae53eb 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 @@ -131,7 +131,7 @@ public class RssFeedServlet try { - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); SyndFeed feed = null; if ( isAllowed( req, repoId, groupId, artifactId ) ) 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 ec129a515..ab8719983 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 @@ -132,7 +132,7 @@ public class ArchivaLdapRoleMapperConfiguration return Collections.emptyMap(); } - Map<String, Collection<String>> res = new HashMap<String, Collection<String>>( ldapGroupMappings.size() ); + Map<String, Collection<String>> res = new HashMap<>( ldapGroupMappings.size() ); for ( LdapGroupMapping ldapGroupMapping : ldapGroupMappings ) { 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 c511b0274..8ecc97c8e 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 @@ -225,7 +225,7 @@ public class ArchivaRbacManager public List<Role> getAllRoles() throws RbacManagerException { - Map<String, Role> allRoles = new HashMap<String, Role>(); + Map<String, Role> allRoles = new HashMap<>(); boolean allFailed = true; Exception lastException = null; for ( RBACManager rbacManager : rbacManagersPerId.values() ) @@ -357,7 +357,7 @@ public class ArchivaRbacManager public List<Permission> getAllPermissions() throws RbacManagerException { - Map<String, Permission> allPermissions = new HashMap<String, Permission>(); + Map<String, Permission> allPermissions = new HashMap<>(); boolean allFailed = true; Exception lastException = null; for ( RBACManager rbacManager : rbacManagersPerId.values() ) @@ -481,7 +481,7 @@ public class ArchivaRbacManager public List<Operation> getAllOperations() throws RbacManagerException { - Map<String, Operation> allOperations = new HashMap<String, Operation>(); + Map<String, Operation> allOperations = new HashMap<>(); boolean allFailed = true; Exception lastException = null; for ( RBACManager rbacManager : rbacManagersPerId.values() ) @@ -605,7 +605,7 @@ public class ArchivaRbacManager public List<Resource> getAllResources() throws RbacManagerException { - Map<String, Resource> allResources = new HashMap<String, Resource>(); + Map<String, Resource> allResources = new HashMap<>(); boolean allFailed = true; Exception lastException = null; for ( RBACManager rbacManager : rbacManagersPerId.values() ) @@ -788,7 +788,7 @@ public class ArchivaRbacManager public List<UserAssignment> getAllUserAssignments() throws RbacManagerException { - Map<String, UserAssignment> allUserAssignments = new HashMap<String, UserAssignment>(); + Map<String, UserAssignment> allUserAssignments = new HashMap<>(); 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/startup/SecuritySynchronization.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/SecuritySynchronization.java index 7d7ac0b75..bf942cb91 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 @@ -86,7 +86,7 @@ public class SecuritySynchronization // as per convention we named spring bean role#hint remove role# if exists Map<String, T> springBeans = applicationContext.getBeansOfType( clazz ); - Map<String, T> beans = new HashMap<String, T>( springBeans.size() ); + Map<String, T> beans = new HashMap<>( springBeans.size() ); for ( Entry<String, T> entry : springBeans.entrySet() ) { 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 e9e717d4c..20f624a3a 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 @@ -50,7 +50,7 @@ import java.util.Map; public class SecuritySystemStub implements SecuritySystem { - Map<String, String> users = new HashMap<String, String>(); + Map<String, String> users = new HashMap<>(); List<String> repoIds = new ArrayList<>(); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataResolver.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataResolver.java index 2a5ba06c6..e5a06f569 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataResolver.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataResolver.java @@ -36,18 +36,18 @@ import java.util.Set; public class TestMetadataResolver implements MetadataResolver { - private Map<String, ProjectVersionMetadata> projectVersions = new HashMap<String, ProjectVersionMetadata>(); + private Map<String, ProjectVersionMetadata> projectVersions = new HashMap<>(); - private Map<String, List<ArtifactMetadata>> artifacts = new HashMap<String, List<ArtifactMetadata>>(); + private Map<String, List<ArtifactMetadata>> artifacts = new HashMap<>(); private Map<String, List<ProjectVersionReference>> references = new HashMap<String, List<ProjectVersionReference>>(); - private Map<String, List<String>> namespaces = new HashMap<String, List<String>>(); + private Map<String, List<String>> namespaces = new HashMap<>(); - private Map<String, Collection<String>> projectsInNamespace = new HashMap<String, Collection<String>>(); + private Map<String, Collection<String>> projectsInNamespace = new HashMap<>(); - private Map<String, Collection<String>> versionsInProject = new HashMap<String, Collection<String>>(); + private Map<String, Collection<String>> versionsInProject = new HashMap<>(); public ProjectVersionMetadata resolveProjectVersion( RepositorySession repositorySession, String repoId, String namespace, String projectId, String projectVersion ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 93c403fad..070d93687 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -1291,7 +1291,7 @@ public class ArchivaDavResourceFactory TemporaryGroupIndexSessionCleaner.TEMPORARY_INDEX_SESSION_KEY ); if ( temporaryGroupIndexMap == null ) { - temporaryGroupIndexMap = new HashMap<String, TemporaryGroupIndex>(); + temporaryGroupIndexMap = new HashMap<>(); } TemporaryGroupIndex tmp = temporaryGroupIndexMap.get( repositoryGroupConfiguration.getId() ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java index ee9f750eb..14fd0fe3d 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/IndexWriter.java @@ -151,7 +151,7 @@ public class IndexWriter else { // virtual repository - filter unique directories - Map<String, List<String>> uniqueChildFiles = new HashMap<String, List<String>>(); + Map<String, List<String>> uniqueChildFiles = new HashMap<>(); List<String> sortedList = new ArrayList<>(); for ( File resource : localResources ) { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/MimeTypes.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/MimeTypes.java index f691bae55..f437efb03 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/MimeTypes.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/MimeTypes.java @@ -50,7 +50,7 @@ public class MimeTypes private String resource = "org/apache/archiva/webdav/util/mime.types"; - private Map<String, String> mimeMap = new HashMap<String, String>(); + private Map<String, String> mimeMap = new HashMap<>(); private Logger log = LoggerFactory.getLogger( MimeTypes.class ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/TemporaryGroupIndexSessionCleaner.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/TemporaryGroupIndexSessionCleaner.java index e0ffaad68..450044876 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/TemporaryGroupIndexSessionCleaner.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/util/TemporaryGroupIndexSessionCleaner.java @@ -53,7 +53,7 @@ public class TemporaryGroupIndexSessionCleaner if ( httpSessionEvent.getSession().getAttribute( TEMPORARY_INDEX_SESSION_KEY ) == null ) { httpSessionEvent.getSession().setAttribute( TEMPORARY_INDEX_SESSION_KEY, - new HashMap<String, TemporaryGroupIndex>() ); + new HashMap<>() ); } if ( indexMerger == null ) diff --git a/archiva-modules/metadata/metadata-model-maven2/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java b/archiva-modules/metadata/metadata-model-maven2/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java index 6a88d6540..7c4a9383b 100644 --- a/archiva-modules/metadata/metadata-model-maven2/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java +++ b/archiva-modules/metadata/metadata-model-maven2/src/main/java/org/apache/archiva/metadata/model/maven2/MavenArtifactFacet.java @@ -91,7 +91,7 @@ public class MavenArtifactFacet public Map<String, String> toProperties() { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put( "type", type ); if ( classifier != null ) { diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/FacetedMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/FacetedMetadata.java index e2261a199..97e00a6ce 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/FacetedMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/FacetedMetadata.java @@ -32,7 +32,7 @@ public abstract class FacetedMetadata /** * The facets to store, keyed by the {@linkplain MetadataFacet#getFacetId() Facet ID} of the metadata. */ - private Map<String, MetadataFacet> facets = new HashMap<String, MetadataFacet>(); + private Map<String, MetadataFacet> facets = new HashMap<>(); /** * Add a new facet to the metadata. If it already exists, it will be replaced. diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java index 5f7f8c0a2..21e404862 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java @@ -94,7 +94,7 @@ public abstract class AbstractMetadataRepositoryTest protected static Map<String, MetadataFacetFactory> createTestMetadataFacetFactories() { - Map<String, MetadataFacetFactory> factories = new HashMap<String, MetadataFacetFactory>(); + Map<String, MetadataFacetFactory> factories = new HashMap<>(); factories.put( TEST_FACET_ID, new MetadataFacetFactory() { public MetadataFacet createMetadataFacet() @@ -461,7 +461,7 @@ public abstract class AbstractMetadataRepositoryTest ProjectVersionMetadata metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); - Map<String, String> additionalProps = new HashMap<String, String>(); + Map<String, String> additionalProps = new HashMap<>(); additionalProps.put( "deleteKey", "deleteValue" ); MetadataFacet facet = new TestMetadataFacet( TEST_FACET_ID, "baz", additionalProps ); @@ -529,7 +529,7 @@ public abstract class AbstractMetadataRepositoryTest { ArtifactMetadata metadata = createArtifact(); - Map<String, String> additionalProps = new HashMap<String, String>(); + Map<String, String> additionalProps = new HashMap<>(); additionalProps.put( "deleteKey", "deleteValue" ); MetadataFacet facet = new TestMetadataFacet( TEST_FACET_ID, "baz", additionalProps ); @@ -1555,7 +1555,7 @@ public abstract class AbstractMetadataRepositoryTest } else { - Map<String, String> props = new HashMap<String, String>(); + Map<String, String> props = new HashMap<>(); props.put( "foo", value ); for ( String key : additionalProps.keySet() ) @@ -1583,7 +1583,7 @@ public abstract class AbstractMetadataRepositoryTest if ( additionalProps == null ) { - additionalProps = new HashMap<String, String>(); + additionalProps = new HashMap<>(); } for ( String key : properties.keySet() ) diff --git a/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java b/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java index a73c6bc5c..9e98e30e9 100644 --- a/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java +++ b/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java @@ -259,7 +259,7 @@ public class AuditEvent public Map<String, String> toProperties() { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put( "action", this.action ); if ( this.userId != null ) { diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java index 74bc3d9d7..e1749a955 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java @@ -147,7 +147,7 @@ public class Maven3DependencyTreeBuilder } List<RemoteRepository> remoteRepositories = new ArrayList<>(); - Map<String, NetworkProxy> networkProxies = new HashMap<String, NetworkProxy>(); + Map<String, NetworkProxy> networkProxies = new HashMap<>(); try { diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/DefaultArtifactMappingProvider.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/DefaultArtifactMappingProvider.java index 6be451e1f..0c5afebc4 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/DefaultArtifactMappingProvider.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/DefaultArtifactMappingProvider.java @@ -37,7 +37,7 @@ public class DefaultArtifactMappingProvider public DefaultArtifactMappingProvider() { - classifierAndExtensionToTypeMap = new HashMap<String, String>(); + classifierAndExtensionToTypeMap = new HashMap<>( 4 ); // Maven 2.2.1 supplied types (excluding defaults where extension == type and no classifier) classifierAndExtensionToTypeMap.put( "client:jar", "ejb-client" ); @@ -45,7 +45,7 @@ public class DefaultArtifactMappingProvider classifierAndExtensionToTypeMap.put( "javadoc:jar", "javadoc" ); classifierAndExtensionToTypeMap.put( "tests:jar", "test-jar" ); - typeToExtensionMap = new HashMap<String, String>(); + typeToExtensionMap = new HashMap<>(); // Maven 2.2.1 supplied types (excluding defaults where extension == type and no classifier) typeToExtensionMap.put( "ejb-client", "jar" ); diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java index 0628b055a..a29241dee 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java @@ -233,7 +233,7 @@ public class Maven2RepositoryStorage // TODO: this is a workaround until we can properly resolve using proxies as well - this doesn't cache // anything locally! List<RemoteRepository> remoteRepositories = new ArrayList<>(); - Map<String, NetworkProxy> networkProxies = new HashMap<String, NetworkProxy>(); + Map<String, NetworkProxy> networkProxies = new HashMap<>(); Map<String, List<ProxyConnector>> proxyConnectorsMap = proxyConnectorAdmin.getProxyConnectorAsMap(); List<ProxyConnector> proxyConnectors = proxyConnectorsMap.get( readMetadataRequest.getRepositoryId() ); diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenProjectFacet.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenProjectFacet.java index 93826d8d1..9faa02fa0 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenProjectFacet.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenProjectFacet.java @@ -90,7 +90,7 @@ public class MavenProjectFacet public Map<String, String> toProperties() { - HashMap<String, String> properties = new HashMap<String, String>(); + HashMap<String, String> properties = new HashMap<>(); properties.put( "groupId", groupId ); properties.put( "artifactId", artifactId ); properties.put( "packaging", packaging ); diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java index 8993be82f..e40292d7f 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/repository/content/legacy/AbstractLegacyRepositoryContent.java @@ -44,7 +44,7 @@ public abstract class AbstractLegacyRepositoryContent static { - typeToDirectoryMap = new HashMap<String, String>(); + typeToDirectoryMap = new HashMap<>( 5 ); typeToDirectoryMap.put( "ejb-client", "ejb" ); typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_ONE_PLUGIN, "plugin" ); typeToDirectoryMap.put( "distribution-tgz", "distribution" ); diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java index 9ea29d728..85e63e59a 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/configuration/MockRepoAdmin.java @@ -216,13 +216,13 @@ public class MockRepoAdmin public Boolean updateProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation ) throws RepositoryAdminException { - return null; //To change body of implemented methods use File | Settings | File Templates. + return null; } public Map<String, List<ProxyConnector>> getProxyConnectorAsMap() throws RepositoryAdminException { - Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<String, List<ProxyConnector>>(); + Map<String, List<ProxyConnector>> proxyConnectorMap = new HashMap<>(); Iterator<ProxyConnector> it = getProxyConnectors().iterator(); while ( it.hasNext() ) diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index c8f7942dd..9eb38392f 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -37,7 +37,7 @@ import java.util.Map; public class TestMetadataRepository implements MetadataRepository { - private Map<String, MetadataFacet> facets = new HashMap<String, MetadataFacet>(); + private Map<String, MetadataFacet> facets = new HashMap<>(); public void updateProject( String repoId, ProjectMetadata project ) { diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java index 67a17cd5a..86513b344 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java @@ -1041,7 +1041,7 @@ public class CassandraMetadataRepository .addEqualsExpression( "projectVersion", projectVersion ) // .execute(); - Map<String, Map<String, String>> metadataFacetsPerFacetIds = new HashMap<String, Map<String, String>>(); + Map<String, Map<String, String>> metadataFacetsPerFacetIds = new HashMap<>(); for ( Row<String, String, String> row : result.get() ) { @@ -1050,7 +1050,7 @@ public class CassandraMetadataRepository Map<String, String> metaValues = metadataFacetsPerFacetIds.get( facetId ); if ( metaValues == null ) { - metaValues = new HashMap<String, String>(); + metaValues = new HashMap<>(); metadataFacetsPerFacetIds.put( facetId, metaValues ); } metaValues.put( getStringValue( columnSlice, "key" ), getStringValue( columnSlice, "value" ) ); @@ -1578,7 +1578,7 @@ public class CassandraMetadataRepository { return null; } - Map<String, String> map = new HashMap<String, String>( size ); + Map<String, String> map = new HashMap<>( size ); for ( Row<String, String, String> row : result.get() ) { ColumnSlice<String, String> columnSlice = row.getColumnSlice(); @@ -1780,7 +1780,7 @@ public class CassandraMetadataRepository { // cql cannot run or in queries so running twice the query - Map<String, ArtifactMetadata> artifactMetadataMap = new HashMap<String, ArtifactMetadata>(); + Map<String, ArtifactMetadata> artifactMetadataMap = new HashMap<>(); RangeSlicesQuery<String, String, String> query = HFactory // .createRangeSlicesQuery( keyspace, ss, ss, ss ) // @@ -2116,7 +2116,7 @@ public class CassandraMetadataRepository if ( !facetModels.isEmpty() ) { MetadataFacet metadataFacet = metadataFacetFactory.createMetadataFacet(); - Map<String, String> props = new HashMap<String, String>( facetModels.size() ); + Map<String, String> props = new HashMap<>( facetModels.size() ); for ( MetadataFacetModel metadataFacetModel : facetModels ) { props.put( metadataFacetModel.getKey(), metadataFacetModel.getValue() ); diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java index cef2fd7ce..ef0f23986 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java @@ -65,7 +65,7 @@ public class CassandraRepositorySessionFactory applicationContext.getBeansOfType( MetadataFacetFactory.class ); // olamy with spring the "id" is now "metadataFacetFactory#hint" // whereas was only hint with plexus so let remove metadataFacetFactory# - metadataFacetFactories = new HashMap<String, MetadataFacetFactory>( tmpMetadataFacetFactories.size() ); + metadataFacetFactories = new HashMap<>( tmpMetadataFacetFactories.size() ); for ( Map.Entry<String, MetadataFacetFactory> entry : tmpMetadataFacetFactories.entrySet() ) { diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index b373c8d5d..e12ca7a27 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -357,7 +357,7 @@ public class FileMetadataRepository if ( metadataFacetFactory != null ) { metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name ); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); for ( Object key : new ArrayList( properties.keySet() ) ) { String property = (String) key; @@ -447,7 +447,7 @@ public class FileMetadataRepository public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId, String projectVersion ) { - Map<String, ArtifactMetadata> artifacts = new HashMap<String, ArtifactMetadata>(); + Map<String, ArtifactMetadata> artifacts = new HashMap<>(); File directory = new File( getDirectory( repoId ), namespace + "/" + projectId + "/" + projectVersion ); @@ -516,7 +516,7 @@ public class FileMetadataRepository { MetadataFacet facet = factory.createMetadataFacet(); String prefix = propertyPrefix + facet.getFacetId(); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); for ( Object key : new ArrayList( properties.keySet() ) ) { String property = (String) key; @@ -1029,7 +1029,7 @@ public class FileMetadataRepository else { MetadataFacet facet = factory.createMetadataFacet(); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); for ( Object key : new ArrayList( properties.keySet() ) ) { String property = (String) key; diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java index 54ca6ca39..0f775a2c6 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java @@ -70,7 +70,7 @@ public class FileRepositorySessionFactory applicationContext.getBeansOfType( MetadataFacetFactory.class ); // olamy with spring the "id" is now "metadataFacetFactory#hint" // whereas was only hint with plexus so let remove metadataFacetFactory# - metadataFacetFactories = new HashMap<String, MetadataFacetFactory>( tmpMetadataFacetFactories.size() ); + metadataFacetFactories = new HashMap<>( tmpMetadataFacetFactories.size() ); for ( Map.Entry<String, MetadataFacetFactory> entry : tmpMetadataFacetFactories.entrySet() ) { diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java index 2acdbaab8..cbe0f5d26 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java @@ -482,7 +482,7 @@ public class JcrMetadataRepository if ( metadataFacetFactory != null ) { metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name ); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); for ( Property property : JcrUtils.getProperties( node ) ) { String p = property.getName(); @@ -931,7 +931,7 @@ public class JcrMetadataRepository else { MetadataFacet facet = factory.createMetadataFacet(); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); for ( Property property : JcrUtils.getProperties( n ) ) { String p = property.getName(); @@ -1351,7 +1351,7 @@ public class JcrMetadataRepository else { MetadataFacet facet = factory.createMetadataFacet(); - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); for ( Property p : JcrUtils.getProperties( n ) ) { String property = p.getName(); diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java index 954743c9d..fcd7fed21 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java @@ -101,7 +101,7 @@ public class JcrRepositorySessionFactory // olamy with spring the "id" is now "metadataFacetFactory#hint" // whereas was only hint with plexus so let remove metadataFacetFactory# Map<String, MetadataFacetFactory> cleanedMetadataFacetFactories = - new HashMap<String, MetadataFacetFactory>( metadataFacetFactories.size() ); + new HashMap<>( metadataFacetFactories.size() ); for ( Map.Entry<String, MetadataFacetFactory> entry : metadataFacetFactories.entrySet() ) { diff --git a/archiva-modules/plugins/npanday-support/src/main/java/org/apache/archiva/plugins/npanday/NPandayArtifactMappingProvider.java b/archiva-modules/plugins/npanday-support/src/main/java/org/apache/archiva/plugins/npanday/NPandayArtifactMappingProvider.java index f8a60905a..76b79e282 100644 --- a/archiva-modules/plugins/npanday-support/src/main/java/org/apache/archiva/plugins/npanday/NPandayArtifactMappingProvider.java +++ b/archiva-modules/plugins/npanday-support/src/main/java/org/apache/archiva/plugins/npanday/NPandayArtifactMappingProvider.java @@ -37,7 +37,7 @@ public class NPandayArtifactMappingProvider public NPandayArtifactMappingProvider() { - extensionToTypeMap = new HashMap<String, String>(); + extensionToTypeMap = new HashMap<>(); // TODO: this could be one of many - we need to look up the artifact metadata from the POM instead // should do this anyway so that plugins don't compete for providing an extension @@ -46,7 +46,7 @@ public class NPandayArtifactMappingProvider extensionToTypeMap.put( "netmodule", "dotnet-module" ); extensionToTypeMap.put( "exe", "dotnet-executable" ); - typeToExtensionMap = new HashMap<String, String>(); + typeToExtensionMap = new HashMap<>(); typeToExtensionMap.put( "dotnet-library", "dll" ); typeToExtensionMap.put( "dotnet-library-config", "dll.config" ); typeToExtensionMap.put( "dotnet-executable", "exe" ); diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java index 328ccf833..3262b3ec6 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java +++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/RepositoryProblemFacet.java @@ -55,7 +55,7 @@ public class RepositoryProblemFacet public Map<String, String> toProperties() { - Map<String, String> map = new HashMap<String, String>(); + Map<String, String> map = new HashMap<>(); map.put( "repositoryId", repositoryId ); map.put( "namespace", namespace ); map.put( "project", project ); diff --git a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java index efa26c5d6..736b46501 100644 --- a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java +++ b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java @@ -196,7 +196,7 @@ public class DefaultRepositoryStatisticsManager QueryResult queryResult = query.execute(); - Map<String, Integer> totalByType = new HashMap<String, Integer>(); + Map<String, Integer> totalByType = new HashMap<>(); long totalSize = 0, totalArtifacts = 0; for ( Row row : JcrUtils.getRows( queryResult ) ) { diff --git a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java index f32c6992f..eab3e8200 100644 --- a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java +++ b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java @@ -170,7 +170,7 @@ public class RepositoryStatistics public Map<String, String> toProperties() { - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put( "scanEndTime", String.valueOf( scanEndTime.getTime() ) ); properties.put( "scanStartTime", String.valueOf( scanStartTime.getTime() ) ); properties.put( "totalArtifactCount", String.valueOf( totalArtifactCount ) ); |