diff --git a/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java b/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java index 7be1d96950..2d1c5db44b 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java @@ -119,7 +119,7 @@ public class MetadataResolutionResult public List getMissingArtifacts() { return missingArtifacts == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( missingArtifacts ); } @@ -152,7 +152,7 @@ public class MetadataResolutionResult public List getExceptions() { return exceptions == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( exceptions ); } @@ -192,7 +192,7 @@ public class MetadataResolutionResult public List getVersionRangeViolations() { return versionRangeViolations == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( versionRangeViolations ); } @@ -227,7 +227,7 @@ public class MetadataResolutionResult public List getMetadataResolutionExceptions() { return metadataResolutionExceptions == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( metadataResolutionExceptions ); } diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java index cae176d849..c0955a7b21 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -371,7 +371,7 @@ public class DefaultMaven throws MavenExecutionException { // CHECKSTYLE_OFF: LineLength - for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections.emptyList() ) ) + for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections.emptyList() ) ) // CHECKSTYLE_ON: LineLength { listener.afterSessionStart( session ); diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index ceb6ba3770..bafed36ee7 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -121,7 +121,7 @@ public class RepositoryUtils nodeTrail.addAll( trail ); nodeTrail.add( artifact.getId() ); - if ( filter == null || filter.accept( node, Collections.emptyList() ) ) + if ( filter == null || filter.accept( node, Collections.emptyList() ) ) { artifact.setDependencyTrail( nodeTrail ); artifacts.add( artifact ); diff --git a/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java b/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java index 27690daa4c..06739b451c 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java @@ -133,7 +133,7 @@ public class ArtifactResolutionResult public List getMissingArtifacts() { return missingArtifacts == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( missingArtifacts ); } @@ -171,7 +171,7 @@ public class ArtifactResolutionResult public List getExceptions() { return exceptions == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( exceptions ); } @@ -211,7 +211,7 @@ public class ArtifactResolutionResult public List getVersionRangeViolations() { return versionRangeViolations == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( versionRangeViolations ); } @@ -246,7 +246,7 @@ public class ArtifactResolutionResult public List getMetadataResolutionExceptions() { return metadataResolutionExceptions == null - ? Collections.emptyList() + ? Collections.emptyList() : Collections.unmodifiableList( metadataResolutionExceptions ); } diff --git a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java index abd4bb63b5..b9e8d22d69 100644 --- a/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java +++ b/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java @@ -245,7 +245,7 @@ public class DefaultClassRealmManager Objects.requireNonNull( plugin, "plugin cannot be null" ); Map foreignImports = - Collections.singletonMap( "", getMavenApiRealm() ); + Collections.singletonMap( "", getMavenApiRealm() ); return createRealm( getKey( plugin, true ), RealmType.Extension, PARENT_CLASSLOADER, null, foreignImports, artifacts ); diff --git a/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java b/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java index 6615af61ce..b72bab601e 100644 --- a/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java +++ b/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java @@ -55,7 +55,7 @@ public class ExceptionSummary this.reference = ( reference != null ) ? reference : ""; this.children = ( children != null ) ? Collections.unmodifiableList( children ) - : Collections.emptyList(); + : Collections.emptyList(); } diff --git a/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java b/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java index b62b59056d..9b2617fe5d 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java +++ b/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java @@ -52,8 +52,8 @@ public class MojoExecutionScopeModule bindScope( MojoExecutionScoped.class, scope ); bind( MojoExecutionScope.class ).toInstance( scope ); - bind( MavenProject.class ).toProvider( MojoExecutionScope.seededKeyProvider() ).in( scope ); - bind( MojoExecution.class ).toProvider( MojoExecutionScope.seededKeyProvider() ).in( scope ); + bind( MavenProject.class ).toProvider( MojoExecutionScope.seededKeyProvider() ).in( scope ); + bind( MojoExecution.class ).toProvider( MojoExecutionScope.seededKeyProvider() ).in( scope ); } } diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java index c28f2182b1..946bffb0a1 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java @@ -251,7 +251,7 @@ public class MojoExecutor Collection scopesToResolve = dependencyContext.getScopesToResolveForCurrentProject(); lifeCycleDependencyResolver.resolveProjectDependencies( project, scopesToCollect, scopesToResolve, session, - aggregating, Collections.emptySet() ); + aggregating, Collections.emptySet() ); dependencyContext.synchronizeWithProjectState(); } @@ -269,7 +269,7 @@ public class MojoExecutor { lifeCycleDependencyResolver.resolveProjectDependencies( aggregatedProject, scopesToCollect, scopesToResolve, session, aggregating, - Collections.emptySet() ); + Collections.emptySet() ); } } } diff --git a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java index 378ebf1e85..ec0800f013 100644 --- a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java +++ b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java @@ -104,7 +104,7 @@ public class DefaultLifecycleBindingsInjector } Map context = - Collections.singletonMap( PLUGIN_MANAGEMENT, target.getBuild().getPluginManagement() ); + Collections.singletonMap( PLUGIN_MANAGEMENT, target.getBuild().getPluginManagement() ); mergePluginContainer_Plugins( target.getBuild(), source.getBuild(), false, context ); } diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java index b2b1c40a5e..fef5fe1d16 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java @@ -94,7 +94,7 @@ public class DefaultPluginRealmCache } this.parentRealm = parentRealm; this.foreignImports = - ( foreignImports != null ) ? foreignImports : Collections.emptyMap(); + ( foreignImports != null ) ? foreignImports : Collections.emptyMap(); this.filter = dependencyFilter; int hash = 17; diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 84924516b4..7da8ea88fa 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -453,7 +453,7 @@ public class DefaultMavenPluginManager private List toMavenArtifacts( DependencyNode root, PreorderNodeListGenerator nlg ) { List artifacts = new ArrayList<>( nlg.getNodes().size() ); - RepositoryUtils.toArtifacts( artifacts, Collections.singleton( root ), Collections.emptyList(), null ); + RepositoryUtils.toArtifacts( artifacts, Collections.singleton( root ), Collections.emptyList(), null ); artifacts.removeIf( artifact -> artifact.getFile() == null ); return Collections.unmodifiableList( artifacts ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java index 509e8b48d9..8e5a6ba9dc 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java @@ -100,7 +100,7 @@ class DefaultDependencyResolutionResult List errors = resolutionErrors.get( dependency ); return ( errors != null ) ? Collections.unmodifiableList( errors ) - : Collections.emptyList(); + : Collections.emptyList(); } diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java index 6651b62a10..d67e5a6070 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java @@ -56,7 +56,7 @@ public class DefaultProjectRealmCache { this.extensionRealms = ( extensionRealms != null ) ? Collections.unmodifiableList( extensionRealms ) - : Collections.emptyList(); + : Collections.emptyList(); this.hashCode = this.extensionRealms.hashCode(); } 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 83b86c36f1..bbafcdf2b1 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 @@ -1422,7 +1422,7 @@ public class MavenProject */ public void setResolvedArtifacts( Set artifacts ) { - this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.emptySet(); + this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.emptySet(); ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get(); artifactsHolder.artifacts = null; artifactsHolder.artifactMap = null; diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java index b4f6b63593..b4ec77d9ad 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultProjectArtifactsCache.java @@ -115,10 +115,10 @@ public class DefaultProjectArtifactsCache } } collect = scopesToCollect == null - ? Collections.emptySet() + ? Collections.emptySet() : Collections.unmodifiableSet( new HashSet<>( scopesToCollect ) ); resolve = scopesToResolve == null - ? Collections.emptySet() + ? Collections.emptySet() : Collections.unmodifiableSet( new HashSet<>( scopesToResolve ) ); this.aggregating = aggregating; diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java b/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java index af63596efb..a3a8dd6f9d 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java @@ -61,7 +61,7 @@ public class ProjectArtifact DependencyManagement depMngt = project.getDependencyManagement(); return ( depMngt != null ) ? Collections.unmodifiableList( depMngt.getDependencies() ) - : Collections.emptyList(); + : Collections.emptyList(); } diff --git a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java index 31c2900944..de97d4479f 100644 --- a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java +++ b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java @@ -116,7 +116,7 @@ public class SessionScope public Memento memento() { LinkedList stack = values.get(); - return new Memento( stack != null ? stack.getFirst().seeded : Collections., Provider>emptyMap() ); + return new Memento( stack != null ? stack.getFirst().seeded : Collections.emptyMap() ); } public void seed( Class clazz, Provider value ) diff --git a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java index cd88104846..b00c58841e 100644 --- a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java +++ b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java @@ -61,6 +61,6 @@ public class SessionScopeModule bindScope( SessionScoped.class, scope ); bind( SessionScope.class ).toInstance( scope ); - bind( MavenSession.class ).toProvider( SessionScope.seededKeyProvider() ).in( scope ); + bind( MavenSession.class ).toProvider( SessionScope.seededKeyProvider() ).in( scope ); } } diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/Result.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/Result.java index df0c797200..15d9958d07 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/Result.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/Result.java @@ -51,7 +51,7 @@ public class Result */ public static Result success( T model ) { - return success( model, Collections.emptyList() ); + return success( model, Collections.emptyList() ); } /** @@ -99,7 +99,7 @@ public class Result public static Result error( T model ) { - return error( model, Collections.emptyList() ); + return error( model, Collections.emptyList() ); } public static Result error( Result result ) diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java index 01ead82404..2d4e1efe44 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java @@ -318,7 +318,7 @@ public class PluginDescriptor { return ( introducedDependencyArtifacts != null ) ? introducedDependencyArtifacts - : Collections.emptySet(); + : Collections.emptySet(); } public void setName( String name )