mirror of https://github.com/apache/maven.git
[MNG-7297] Remove redundant type arguments (#581)
This commit is contained in:
parent
4daa48e0f6
commit
0080e84588
|
@ -119,7 +119,7 @@ public class MetadataResolutionResult
|
|||
public List<Artifact> getMissingArtifacts()
|
||||
{
|
||||
return missingArtifacts == null
|
||||
? Collections.<Artifact>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( missingArtifacts );
|
||||
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public class MetadataResolutionResult
|
|||
public List<Exception> getExceptions()
|
||||
{
|
||||
return exceptions == null
|
||||
? Collections.<Exception>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( exceptions );
|
||||
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class MetadataResolutionResult
|
|||
public List<Exception> getVersionRangeViolations()
|
||||
{
|
||||
return versionRangeViolations == null
|
||||
? Collections.<Exception>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( versionRangeViolations );
|
||||
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ public class MetadataResolutionResult
|
|||
public List<ArtifactResolutionException> getMetadataResolutionExceptions()
|
||||
{
|
||||
return metadataResolutionExceptions == null
|
||||
? Collections.<ArtifactResolutionException>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( metadataResolutionExceptions );
|
||||
|
||||
}
|
||||
|
|
|
@ -371,7 +371,7 @@ public class DefaultMaven
|
|||
throws MavenExecutionException
|
||||
{
|
||||
// CHECKSTYLE_OFF: LineLength
|
||||
for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections.<MavenProject>emptyList() ) )
|
||||
for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections.emptyList() ) )
|
||||
// CHECKSTYLE_ON: LineLength
|
||||
{
|
||||
listener.afterSessionStart( session );
|
||||
|
|
|
@ -121,7 +121,7 @@ public class RepositoryUtils
|
|||
nodeTrail.addAll( trail );
|
||||
nodeTrail.add( artifact.getId() );
|
||||
|
||||
if ( filter == null || filter.accept( node, Collections.<DependencyNode>emptyList() ) )
|
||||
if ( filter == null || filter.accept( node, Collections.emptyList() ) )
|
||||
{
|
||||
artifact.setDependencyTrail( nodeTrail );
|
||||
artifacts.add( artifact );
|
||||
|
|
|
@ -133,7 +133,7 @@ public class ArtifactResolutionResult
|
|||
public List<Artifact> getMissingArtifacts()
|
||||
{
|
||||
return missingArtifacts == null
|
||||
? Collections.<Artifact>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( missingArtifacts );
|
||||
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ public class ArtifactResolutionResult
|
|||
public List<Exception> getExceptions()
|
||||
{
|
||||
return exceptions == null
|
||||
? Collections.<Exception>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( exceptions );
|
||||
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ public class ArtifactResolutionResult
|
|||
public List<Exception> getVersionRangeViolations()
|
||||
{
|
||||
return versionRangeViolations == null
|
||||
? Collections.<Exception>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( versionRangeViolations );
|
||||
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ public class ArtifactResolutionResult
|
|||
public List<ArtifactResolutionException> getMetadataResolutionExceptions()
|
||||
{
|
||||
return metadataResolutionExceptions == null
|
||||
? Collections.<ArtifactResolutionException>emptyList()
|
||||
? Collections.emptyList()
|
||||
: Collections.unmodifiableList( metadataResolutionExceptions );
|
||||
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ public class DefaultClassRealmManager
|
|||
Objects.requireNonNull( plugin, "plugin cannot be null" );
|
||||
|
||||
Map<String, ClassLoader> foreignImports =
|
||||
Collections.<String, ClassLoader>singletonMap( "", getMavenApiRealm() );
|
||||
Collections.singletonMap( "", getMavenApiRealm() );
|
||||
|
||||
return createRealm( getKey( plugin, true ), RealmType.Extension, PARENT_CLASSLOADER, null,
|
||||
foreignImports, artifacts );
|
||||
|
|
|
@ -55,7 +55,7 @@ public class ExceptionSummary
|
|||
this.reference = ( reference != null ) ? reference : "";
|
||||
this.children = ( children != null )
|
||||
? Collections.unmodifiableList( children )
|
||||
: Collections.<ExceptionSummary>emptyList();
|
||||
: Collections.emptyList();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ public class MojoExecutionScopeModule
|
|||
bindScope( MojoExecutionScoped.class, scope );
|
||||
bind( MojoExecutionScope.class ).toInstance( scope );
|
||||
|
||||
bind( MavenProject.class ).toProvider( MojoExecutionScope.<MavenProject>seededKeyProvider() ).in( scope );
|
||||
bind( MojoExecution.class ).toProvider( MojoExecutionScope.<MojoExecution>seededKeyProvider() ).in( scope );
|
||||
bind( MavenProject.class ).toProvider( MojoExecutionScope.seededKeyProvider() ).in( scope );
|
||||
bind( MojoExecution.class ).toProvider( MojoExecutionScope.seededKeyProvider() ).in( scope );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@ public class MojoExecutor
|
|||
Collection<String> scopesToResolve = dependencyContext.getScopesToResolveForCurrentProject();
|
||||
|
||||
lifeCycleDependencyResolver.resolveProjectDependencies( project, scopesToCollect, scopesToResolve, session,
|
||||
aggregating, Collections.<Artifact>emptySet() );
|
||||
aggregating, Collections.emptySet() );
|
||||
|
||||
dependencyContext.synchronizeWithProjectState();
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ public class MojoExecutor
|
|||
{
|
||||
lifeCycleDependencyResolver.resolveProjectDependencies( aggregatedProject, scopesToCollect,
|
||||
scopesToResolve, session, aggregating,
|
||||
Collections.<Artifact>emptySet() );
|
||||
Collections.emptySet() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class DefaultLifecycleBindingsInjector
|
|||
}
|
||||
|
||||
Map<Object, Object> context =
|
||||
Collections.<Object, Object>singletonMap( PLUGIN_MANAGEMENT, target.getBuild().getPluginManagement() );
|
||||
Collections.singletonMap( PLUGIN_MANAGEMENT, target.getBuild().getPluginManagement() );
|
||||
|
||||
mergePluginContainer_Plugins( target.getBuild(), source.getBuild(), false, context );
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class DefaultPluginRealmCache
|
|||
}
|
||||
this.parentRealm = parentRealm;
|
||||
this.foreignImports =
|
||||
( foreignImports != null ) ? foreignImports : Collections.<String, ClassLoader>emptyMap();
|
||||
( foreignImports != null ) ? foreignImports : Collections.emptyMap();
|
||||
this.filter = dependencyFilter;
|
||||
|
||||
int hash = 17;
|
||||
|
|
|
@ -453,7 +453,7 @@ public class DefaultMavenPluginManager
|
|||
private List<Artifact> toMavenArtifacts( DependencyNode root, PreorderNodeListGenerator nlg )
|
||||
{
|
||||
List<Artifact> artifacts = new ArrayList<>( nlg.getNodes().size() );
|
||||
RepositoryUtils.toArtifacts( artifacts, Collections.singleton( root ), Collections.<String>emptyList(), null );
|
||||
RepositoryUtils.toArtifacts( artifacts, Collections.singleton( root ), Collections.emptyList(), null );
|
||||
artifacts.removeIf( artifact -> artifact.getFile() == null );
|
||||
return Collections.unmodifiableList( artifacts );
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class DefaultDependencyResolutionResult
|
|||
List<Exception> errors = resolutionErrors.get( dependency );
|
||||
return ( errors != null )
|
||||
? Collections.unmodifiableList( errors )
|
||||
: Collections.<Exception>emptyList();
|
||||
: Collections.emptyList();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public class DefaultProjectRealmCache
|
|||
{
|
||||
this.extensionRealms = ( extensionRealms != null )
|
||||
? Collections.unmodifiableList( extensionRealms )
|
||||
: Collections.<ClassRealm>emptyList();
|
||||
: Collections.emptyList();
|
||||
|
||||
this.hashCode = this.extensionRealms.hashCode();
|
||||
}
|
||||
|
|
|
@ -1422,7 +1422,7 @@ public class MavenProject
|
|||
*/
|
||||
public void setResolvedArtifacts( Set<Artifact> artifacts )
|
||||
{
|
||||
this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.<Artifact>emptySet();
|
||||
this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.emptySet();
|
||||
ArtifactsHolder artifactsHolder = threadLocalArtifactsHolder.get();
|
||||
artifactsHolder.artifacts = null;
|
||||
artifactsHolder.artifactMap = null;
|
||||
|
|
|
@ -115,10 +115,10 @@ public class DefaultProjectArtifactsCache
|
|||
}
|
||||
}
|
||||
collect = scopesToCollect == null
|
||||
? Collections.<String>emptySet()
|
||||
? Collections.emptySet()
|
||||
: Collections.unmodifiableSet( new HashSet<>( scopesToCollect ) );
|
||||
resolve = scopesToResolve == null
|
||||
? Collections.<String>emptySet()
|
||||
? Collections.emptySet()
|
||||
: Collections.unmodifiableSet( new HashSet<>( scopesToResolve ) );
|
||||
this.aggregating = aggregating;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ProjectArtifact
|
|||
DependencyManagement depMngt = project.getDependencyManagement();
|
||||
return ( depMngt != null )
|
||||
? Collections.unmodifiableList( depMngt.getDependencies() )
|
||||
: Collections.<Dependency>emptyList();
|
||||
: Collections.emptyList();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ public class SessionScope
|
|||
public Memento memento()
|
||||
{
|
||||
LinkedList<ScopeState> stack = values.get();
|
||||
return new Memento( stack != null ? stack.getFirst().seeded : Collections.<Key<?>, Provider<?>>emptyMap() );
|
||||
return new Memento( stack != null ? stack.getFirst().seeded : Collections.emptyMap() );
|
||||
}
|
||||
|
||||
public <T> void seed( Class<T> clazz, Provider<T> value )
|
||||
|
|
|
@ -61,6 +61,6 @@ public class SessionScopeModule
|
|||
bindScope( SessionScoped.class, scope );
|
||||
bind( SessionScope.class ).toInstance( scope );
|
||||
|
||||
bind( MavenSession.class ).toProvider( SessionScope.<MavenSession>seededKeyProvider() ).in( scope );
|
||||
bind( MavenSession.class ).toProvider( SessionScope.seededKeyProvider() ).in( scope );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class Result<T>
|
|||
*/
|
||||
public static <T> Result<T> success( T model )
|
||||
{
|
||||
return success( model, Collections.<ModelProblem>emptyList() );
|
||||
return success( model, Collections.emptyList() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ public class Result<T>
|
|||
|
||||
public static <T> Result<T> error( T model )
|
||||
{
|
||||
return error( model, Collections.<ModelProblem>emptyList() );
|
||||
return error( model, Collections.emptyList() );
|
||||
}
|
||||
|
||||
public static <T> Result<T> error( Result<?> result )
|
||||
|
|
|
@ -318,7 +318,7 @@ public class PluginDescriptor
|
|||
{
|
||||
return ( introducedDependencyArtifacts != null )
|
||||
? introducedDependencyArtifacts
|
||||
: Collections.<Artifact>emptySet();
|
||||
: Collections.emptySet();
|
||||
}
|
||||
|
||||
public void setName( String name )
|
||||
|
|
Loading…
Reference in New Issue