[maven] branch MNG-6847 created (now 3949228)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven] branch MNG-6847 created (now 3949228)

michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch MNG-6847
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at 3949228  [MNG-6847] Explicit type can be replaced by the diamond operator

This branch includes the following new commits:

     new 3949228  [MNG-6847] Explicit type can be replaced by the diamond operator

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Reply | Threaded
Open this post in threaded view
|

[maven] 01/01: [MNG-6847] Explicit type can be replaced by the diamond operator

michaelo
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MNG-6847
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 39492281b22cf891c049f03858cd0476dafaee8e
Author: Artem Krosheninnikov <[hidden email]>
AuthorDate: Mon Jan 13 19:39:45 2020 +0300

    [MNG-6847] Explicit type can be replaced by the diamond operator
   
    This closes #315
---
 .../resolver/MultipleArtifactsNotFoundException.java         |  2 +-
 .../org/apache/maven/artifact/versioning/VersionRange.java   |  4 ++--
 .../org/apache/maven/building/DefaultProblemCollector.java   |  2 +-
 .../maven/artifact/resolver/DefaultArtifactResolver.java     |  2 +-
 .../java/org/apache/maven/DuplicateProjectException.java     |  2 +-
 .../execution/DefaultMavenExecutionRequestPopulator.java     |  2 +-
 .../apache/maven/execution/DefaultMavenExecutionResult.java  |  4 ++--
 .../apache/maven/graph/FilteredProjectDependencyGraph.java   |  2 +-
 .../internal/DefaultLifecycleExecutionPlanCalculator.java    |  4 ++--
 .../apache/maven/lifecycle/internal/DependencyContext.java   |  4 ++--
 .../maven/lifecycle/internal/LifecycleModuleBuilder.java     |  3 +--
 .../apache/maven/lifecycle/internal/ReactorBuildStatus.java  |  2 +-
 .../internal/builder/multithreaded/ThreadOutputMuxer.java    |  2 +-
 .../java/org/apache/maven/project/DefaultProjectBuilder.java | 12 ++++++------
 .../src/main/java/org/apache/maven/project/MavenProject.java |  2 +-
 .../maven/project/artifact/DefaultMavenMetadataCache.java    |  8 ++++----
 .../org/apache/maven/toolchain/DefaultToolchainManager.java  |  2 +-
 .../toolchain/building/DefaultToolchainsBuildingResult.java  |  2 +-
 .../apache/maven/lifecycle/internal/BuilderCommonTest.java   |  2 +-
 .../maven/lifecycle/internal/stub/CompletionServiceStub.java |  2 +-
 .../maven/lifecycle/internal/stub/MojoExecutorStub.java      |  2 +-
 .../maven/cli/transfer/ConsoleMavenTransferListener.java     |  2 +-
 .../org/apache/maven/model/building/DefaultModelBuilder.java |  2 +-
 .../repository/internal/RemoteSnapshotMetadataTest.java      |  2 +-
 .../settings/building/DefaultSettingsBuildingResult.java     |  2 +-
 .../settings/building/DefaultSettingsProblemCollector.java   |  2 +-
 .../settings/crypto/DefaultSettingsDecryptionResult.java     |  6 +++---
 27 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
index 896710f..d08dfd5 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
@@ -41,7 +41,7 @@ public class MultipleArtifactsNotFoundException
                                                List<Artifact> missingArtifacts,
                                                List<ArtifactRepository> remoteRepositories )
     {
-        this( originatingArtifact, new ArrayList<Artifact>(), missingArtifacts, remoteRepositories );
+        this( originatingArtifact, new ArrayList<>(), missingArtifacts, remoteRepositories );
     }
 
     /**
diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
index bbc6523..d2409dd 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
@@ -37,10 +37,10 @@ import org.apache.maven.artifact.Artifact;
 public class VersionRange
 {
     private static final Map<String, VersionRange> CACHE_SPEC =
-        Collections.<String, VersionRange>synchronizedMap( new WeakHashMap<String, VersionRange>() );
+        Collections.synchronizedMap( new WeakHashMap<>() );
 
     private static final Map<String, VersionRange> CACHE_VERSION =
-                    Collections.<String, VersionRange>synchronizedMap( new WeakHashMap<String, VersionRange>() );
+                    Collections.synchronizedMap( new WeakHashMap<>() );
 
     private final ArtifactVersion recommendedVersion;
 
diff --git a/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java b/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java
index 8502942..2c09df6 100644
--- a/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java
+++ b/maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblemCollector.java
@@ -38,7 +38,7 @@ class DefaultProblemCollector
 
     DefaultProblemCollector( List<Problem> problems )
     {
-        this.problems = ( problems != null ) ? problems : new ArrayList<Problem>();
+        this.problems = ( problems != null ) ? problems : new ArrayList<>();
     }
 
     @Override
diff --git a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
index 2d1d8d9..44fdcdb 100644
--- a/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
+++ b/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
@@ -116,7 +116,7 @@ public class DefaultArtifactResolver
         else
         {
             executor = new ThreadPoolExecutor( threads, threads, 3, TimeUnit.SECONDS,
-                                               new LinkedBlockingQueue<Runnable>(), new DaemonThreadCreator() );
+                    new LinkedBlockingQueue<>(), new DaemonThreadCreator() );
         }
     }
 
diff --git a/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java b/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java
index b139872..5d7cec1 100644
--- a/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java
+++ b/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java
@@ -45,7 +45,7 @@ public class DuplicateProjectException
     {
         super( message, (File) null );
 
-        this.collisions = ( collisions != null ) ? collisions : new LinkedHashMap<String, List<File>>();
+        this.collisions = ( collisions != null ) ? collisions : new LinkedHashMap<>();
     }
 
     /**
diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
index ec9419c..6951c91 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
@@ -78,7 +78,7 @@ public class DefaultMavenExecutionRequestPopulator
             {
                 if ( !groupedToolchains.containsKey( model.getType() ) )
                 {
-                    groupedToolchains.put( model.getType(), new ArrayList<ToolchainModel>() );
+                    groupedToolchains.put( model.getType(), new ArrayList<>() );
                 }
 
                 groupedToolchains.get( model.getType() ).add( model );
diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
index 112a064..6ab1daa 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
@@ -41,7 +41,7 @@ public class DefaultMavenExecutionResult
     private final List<Throwable> exceptions = new CopyOnWriteArrayList<>();
 
     private final Map<MavenProject, BuildSummary> buildSummaries =
-        Collections.synchronizedMap( new IdentityHashMap<MavenProject, BuildSummary>() );
+        Collections.synchronizedMap( new IdentityHashMap<>() );
 
     public MavenExecutionResult setProject( MavenProject project )
     {
@@ -65,7 +65,7 @@ public class DefaultMavenExecutionResult
     public List<MavenProject> getTopologicallySortedProjects()
     {
         return null == topologicallySortedProjects
-                   ? Collections.<MavenProject>emptyList()
+                   ? Collections.emptyList()
                    : Collections.unmodifiableList( topologicallySortedProjects );
 
     }
diff --git a/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java b/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java
index 5097e4a..97ba57e 100644
--- a/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java
+++ b/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java
@@ -56,7 +56,7 @@ class FilteredProjectDependencyGraph
         this.projectDependencyGraph =
                 Objects.requireNonNull( projectDependencyGraph, "projectDependencyGraph cannot be null" );
 
-        this.whiteList = new IdentityHashMap<MavenProject, Object>();
+        this.whiteList = new IdentityHashMap<>();
 
         for ( MavenProject project : whiteList )
         {
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
index ef60c4e..833705c 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java
@@ -179,7 +179,7 @@ public class DefaultLifecycleExecutionPlanCalculator
 
         finalizeMojoConfiguration( mojoExecution );
 
-        calculateForkedExecutions( mojoExecution, session, project, new HashSet<MojoDescriptor>() );
+        calculateForkedExecutions( mojoExecution, session, project, new HashSet<>() );
     }
 
     public List<MojoExecution> calculateMojoExecutions( MavenSession session, MavenProject project, List<Object> tasks )
@@ -331,7 +331,7 @@ public class DefaultLifecycleExecutionPlanCalculator
         PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
         LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException
     {
-        calculateForkedExecutions( mojoExecution, session, session.getCurrentProject(), new HashSet<MojoDescriptor>() );
+        calculateForkedExecutions( mojoExecution, session, session.getCurrentProject(), new HashSet<>() );
     }
 
     private void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session, MavenProject project,
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java
index 7ee499f..55b14d6 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java
@@ -62,8 +62,8 @@ public class DependencyContext
         this.project = project;
         scopesToCollectForCurrentProject = scopesToCollect;
         scopesToResolveForCurrentProject = scopesToResolve;
-        scopesToCollectForAggregatedProjects = Collections.synchronizedSet( new TreeSet<String>() );
-        scopesToResolveForAggregatedProjects = Collections.synchronizedSet( new TreeSet<String>() );
+        scopesToCollectForAggregatedProjects = Collections.synchronizedSet( new TreeSet<>() );
+        scopesToResolveForAggregatedProjects = Collections.synchronizedSet( new TreeSet<>() );
     }
 
     public MavenProject getProject()
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
index 548fe6c..3391e0c 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
@@ -22,7 +22,6 @@ package org.apache.maven.lifecycle.internal;
 import java.util.HashSet;
 import java.util.List;
 
-import org.apache.maven.artifact.Artifact;
 import org.apache.maven.execution.BuildSuccess;
 import org.apache.maven.execution.ExecutionEvent;
 import org.apache.maven.execution.MavenSession;
@@ -108,7 +107,7 @@ public class LifecycleModuleBuilder
             eventCatapult.fire( ExecutionEvent.Type.ProjectStarted, session, null );
 
             MavenExecutionPlan executionPlan =
-                builderCommon.resolveBuildPlan( session, currentProject, taskSegment, new HashSet<Artifact>() );
+                builderCommon.resolveBuildPlan( session, currentProject, taskSegment, new HashSet<>() );
             List<MojoExecution> mojoExecutions = executionPlan.getMojoExecutions();
 
             projectExecutionListener.beforeProjectLifecycleExecution( new ProjectExecutionEvent( session,
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java
index 2e2c3fd..9bd8b86 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java
@@ -37,7 +37,7 @@ public class ReactorBuildStatus
 {
     private final ProjectDependencyGraph projectDependencyGraph;
 
-    private final Collection<String> blackListedProjects = Collections.synchronizedSet( new HashSet<String>() );
+    private final Collection<String> blackListedProjects = Collections.synchronizedSet( new HashSet<>() );
 
     private volatile boolean halted = false;
 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java
index 1732896..d17a20e 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java
@@ -56,7 +56,7 @@ public class ThreadOutputMuxer
 
     private final PrintStream defaultPrintStream = new PrintStream( defaultOutputStreamForUnknownData );
 
-    private final Set<ProjectSegment> completedBuilds = Collections.synchronizedSet( new HashSet<ProjectSegment>() );
+    private final Set<ProjectSegment> completedBuilds = Collections.synchronizedSet( new HashSet<>() );
 
     private volatile ProjectSegment currentBuild;
 
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
index 7e18f1e..c5bf26c 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@@ -185,8 +185,8 @@ public class DefaultProjectBuilder
 
                 modelProblems = result.getProblems();
 
-                initProject( project, Collections.<String, MavenProject>emptyMap(), true,
-                             result, new HashMap<File, Boolean>(), projectBuildingRequest );
+                initProject( project, Collections.emptyMap(), true,
+                             result, new HashMap<>(), projectBuildingRequest );
             }
             else if ( projectBuildingRequest.isResolveDependencies() )
             {
@@ -374,7 +374,7 @@ public class DefaultProjectBuilder
         Map<String, MavenProject> projectIndex = new HashMap<>( 256 );
 
         boolean noErrors =
-            build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive,
+            build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet<>(), true, recursive,
                    config );
 
         populateReactorModelPool( modelPool, interimResults );
@@ -384,8 +384,8 @@ public class DefaultProjectBuilder
         try
         {
             noErrors =
-                build( results, new ArrayList<MavenProject>(), projectIndex, interimResults, request,
-                       new HashMap<File, Boolean>(), config.session ) && noErrors;
+                build( results, new ArrayList<>(), projectIndex, interimResults, request,
+                        new HashMap<>(), config.session ) && noErrors;
         }
         finally
         {
@@ -465,7 +465,7 @@ public class DefaultProjectBuilder
         try
         {
             // first pass: build without building parent.
-            initProject( project, projectIndex, false, result, new HashMap<File, Boolean>( 0 ), config.request );
+            initProject( project, projectIndex, false, result, new HashMap<>( 0 ), config.request );
         }
         catch ( InvalidArtifactRTException iarte )
         {
diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
index ceb39e2..896d641 100644
--- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
+++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
@@ -175,7 +175,7 @@ public class MavenProject
 
     private DependencyFilter extensionDependencyFilter;
 
-    private final Set<String> lifecyclePhases = Collections.synchronizedSet( new LinkedHashSet<String>() );
+    private final Set<String> lifecyclePhases = Collections.synchronizedSet( new LinkedHashSet<>() );
 
     public MavenProject()
     {
diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java
index 6f2eb08..3db7bb7 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java
@@ -220,14 +220,14 @@ public class DefaultMavenMetadataCache
         {
             this.pomArtifact = ArtifactUtils.copyArtifact( pomArtifact );
             this.relocatedArtifact = ArtifactUtils.copyArtifactSafe( relocatedArtifact );
-            this.artifacts = ArtifactUtils.copyArtifacts( artifacts, new ArrayList<Artifact>() );
+            this.artifacts = ArtifactUtils.copyArtifacts( artifacts, new ArrayList<>() );
             this.remoteRepositories = new ArrayList<>( remoteRepositories );
 
             this.managedVersions = managedVersions;
             if ( managedVersions != null )
             {
                 this.managedVersions =
-                    ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<String, Artifact>() );
+                    ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<>() );
             }
 
             File pomFile = pomArtifact.getFile();
@@ -310,11 +310,11 @@ public class DefaultMavenMetadataCache
             Artifact pomArtifact = ArtifactUtils.copyArtifact( cacheRecord.getArtifact() );
             Artifact relocatedArtifact = ArtifactUtils.copyArtifactSafe( cacheRecord.getRelocatedArtifact() );
             Set<Artifact> artifacts =
-                ArtifactUtils.copyArtifacts( cacheRecord.getArtifacts(), new LinkedHashSet<Artifact>() );
+                ArtifactUtils.copyArtifacts( cacheRecord.getArtifacts(), new LinkedHashSet<>() );
             Map<String, Artifact> managedVersions = cacheRecord.getManagedVersions();
             if ( managedVersions != null )
             {
-                managedVersions = ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<String, Artifact>() );
+                managedVersions = ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<>() );
             }
             return new ResolutionGroup( pomArtifact, relocatedArtifact, artifacts, managedVersions,
                                         cacheRecord.getRemoteRepositories() );
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
index 0bdee11..4c60aa4 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
@@ -129,7 +129,7 @@ public class DefaultToolchainManager
             }
         }
 
-        return ( context != null ) ? context : new HashMap<String, Object>();
+        return ( context != null ) ? context : new HashMap<>();
     }
 
     public static final String getStorageKey( String type )
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java
index 60ca244..4cad090 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java
@@ -48,7 +48,7 @@ public class DefaultToolchainsBuildingResult
     public DefaultToolchainsBuildingResult( PersistedToolchains effectiveToolchains, List<Problem> problems )
     {
         this.effectiveToolchains = effectiveToolchains;
-        this.problems = ( problems != null ) ? problems : new ArrayList<Problem>();
+        this.problems = ( problems != null ) ? problems : new ArrayList<>();
     }
 
     @Override
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java
index 6f896d8..02fd595 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java
@@ -45,7 +45,7 @@ public class BuilderCommonTest
         final BuilderCommon builderCommon = getBuilderCommon();
         final MavenExecutionPlan plan =
             builderCommon.resolveBuildPlan( session1, ProjectDependencyGraphStub.A, taskSegment1,
-                                            new HashSet<Artifact>() );
+                    new HashSet<>() );
         assertEquals( LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan().size(), plan.size() );
 
     }
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java
index 8d4a04b..6c7acea 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java
@@ -33,7 +33,7 @@ public class CompletionServiceStub
     implements CompletionService<ProjectSegment>
 {
     List<FutureTask<ProjectSegment>> projectBuildFutureTasks =
-        Collections.synchronizedList( new ArrayList<FutureTask<ProjectSegment>>() );
+        Collections.synchronizedList(new ArrayList<>() );
 
     final boolean finishImmediately;
 
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
index 8a6580b..250e60d 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
@@ -36,7 +36,7 @@ public class MojoExecutorStub
     extends MojoExecutor
 { // This is being lazy instead of making interface
 
-    public List<MojoExecution> executions = Collections.synchronizedList( new ArrayList<MojoExecution>() );
+    public List<MojoExecution> executions = Collections.synchronizedList(new ArrayList<>() );
 
     @Override
     public void execute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex,
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java
index 1ad943b..950b5d0 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java
@@ -41,7 +41,7 @@ public class ConsoleMavenTransferListener
 {
 
     private Map<TransferResource, Long> transfers = Collections.synchronizedMap(
-                                                        new LinkedHashMap<TransferResource, Long>() );
+            new LinkedHashMap<>() );
 
     private boolean printResourceNames;
     private int lastLength;
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
index f981944..e341086 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
@@ -437,7 +437,7 @@ public class DefaultModelBuilder
     public ModelBuildingResult build( ModelBuildingRequest request, ModelBuildingResult result )
         throws ModelBuildingException
     {
-        return build( request, result, new LinkedHashSet<String>() );
+        return build( request, result, new LinkedHashSet<>() );
     }
 
     private ModelBuildingResult build( ModelBuildingRequest request, ModelBuildingResult result,
diff --git a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataTest.java b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataTest.java
index 278231f..3540bf2 100644
--- a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataTest.java
+++ b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/RemoteSnapshotMetadataTest.java
@@ -75,7 +75,7 @@ public class RemoteSnapshotMetadataTest
         String datePart = ts.replaceAll( "\\..*", "" );
 
         /* Allow for this test running across midnight */
-        Set<String> expected = new HashSet<String>( Arrays.asList( dateBefore, dateAfter ) );
+        Set<String> expected = new HashSet<>( Arrays.asList( dateBefore, dateAfter ) );
         assertTrue( "Expected " + datePart + " to be in " + expected,
                 expected.contains( datePart ) );
     }
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java
index 187031e..48456e5 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java
@@ -40,7 +40,7 @@ class DefaultSettingsBuildingResult
     DefaultSettingsBuildingResult( Settings effectiveSettings, List<SettingsProblem> problems )
     {
         this.effectiveSettings = effectiveSettings;
-        this.problems = ( problems != null ) ? problems : new ArrayList<SettingsProblem>();
+        this.problems = ( problems != null ) ? problems : new ArrayList<>();
     }
 
     @Override
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblemCollector.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblemCollector.java
index 65c74c0..024f5a7 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblemCollector.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblemCollector.java
@@ -39,7 +39,7 @@ class DefaultSettingsProblemCollector
 
     DefaultSettingsProblemCollector( List<SettingsProblem> problems )
     {
-        this.problems = ( problems != null ) ? problems : new ArrayList<SettingsProblem>();
+        this.problems = ( problems != null ) ? problems : new ArrayList<>();
     }
 
     public List<SettingsProblem> getProblems()
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java
index 4458c61..ccdad19 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java
@@ -43,9 +43,9 @@ class DefaultSettingsDecryptionResult
 
     DefaultSettingsDecryptionResult( List<Server> servers, List<Proxy> proxies, List<SettingsProblem> problems )
     {
-        this.servers = ( servers != null ) ? servers : new ArrayList<Server>();
-        this.proxies = ( proxies != null ) ? proxies : new ArrayList<Proxy>();
-        this.problems = ( problems != null ) ? problems : new ArrayList<SettingsProblem>();
+        this.servers = ( servers != null ) ? servers : new ArrayList<>();
+        this.proxies = ( proxies != null ) ? proxies : new ArrayList<>();
+        this.problems = ( problems != null ) ? problems : new ArrayList<>();
     }
 
     @Override