[MNG-7297] Remove redundant type arguments (#581)

This commit is contained in:
Arturo Bernal 2021-10-11 20:58:38 +02:00 committed by GitHub
parent 4daa48e0f6
commit 0080e84588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 30 additions and 30 deletions

View File

@ -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 );
}

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );
}

View File

@ -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 );

View File

@ -55,7 +55,7 @@ public class ExceptionSummary
this.reference = ( reference != null ) ? reference : "";
this.children = ( children != null )
? Collections.unmodifiableList( children )
: Collections.<ExceptionSummary>emptyList();
: Collections.emptyList();
}

View File

@ -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 );
}
}

View File

@ -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() );
}
}
}

View File

@ -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 );
}

View File

@ -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;

View File

@ -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 );
}

View File

@ -100,7 +100,7 @@ class DefaultDependencyResolutionResult
List<Exception> errors = resolutionErrors.get( dependency );
return ( errors != null )
? Collections.unmodifiableList( errors )
: Collections.<Exception>emptyList();
: Collections.emptyList();
}

View File

@ -56,7 +56,7 @@ public class DefaultProjectRealmCache
{
this.extensionRealms = ( extensionRealms != null )
? Collections.unmodifiableList( extensionRealms )
: Collections.<ClassRealm>emptyList();
: Collections.emptyList();
this.hashCode = this.extensionRealms.hashCode();
}

View File

@ -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;

View File

@ -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;

View File

@ -61,7 +61,7 @@ public class ProjectArtifact
DependencyManagement depMngt = project.getDependencyManagement();
return ( depMngt != null )
? Collections.unmodifiableList( depMngt.getDependencies() )
: Collections.<Dependency>emptyList();
: Collections.emptyList();
}

View File

@ -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 )

View File

@ -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 );
}
}

View File

@ -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 )

View File

@ -318,7 +318,7 @@ public class PluginDescriptor
{
return ( introducedDependencyArtifacts != null )
? introducedDependencyArtifacts
: Collections.<Artifact>emptySet();
: Collections.emptySet();
}
public void setName( String name )