mirror of https://github.com/apache/maven.git
Code cleanup - Various code simplifications (tests, loops, …)
This commit is contained in:
parent
87a5532eb9
commit
9e5183f0ad
|
@ -170,12 +170,8 @@ public class Restriction
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( upperBoundInclusive != restriction.upperBoundInclusive )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return upperBoundInclusive == restriction.upperBoundInclusive;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
|
|
|
@ -122,14 +122,7 @@ public class DefaultRepositoryMetadataManager
|
|||
+ ") in favor of local copy" );
|
||||
}
|
||||
}
|
||||
else if ( updateCheckManager.isUpdateRequired( metadata, repository, file ) )
|
||||
{
|
||||
update = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
update = false;
|
||||
}
|
||||
else update = updateCheckManager.isUpdateRequired( metadata, repository, file );
|
||||
|
||||
if ( update )
|
||||
{
|
||||
|
|
|
@ -288,7 +288,6 @@ public class StringSearchModelInterpolator
|
|||
+ cls.getName()
|
||||
+ "; it is an unmodifiable collection." );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class MetadataGraphNode
|
|||
return metadata == null;
|
||||
}
|
||||
|
||||
return metadata == null ? false : metadata.toString().equals( node2.metadata.toString() );
|
||||
return metadata != null && metadata.toString().equals( node2.metadata.toString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ public class DefaultArtifactResolverTest
|
|||
|
||||
// we want to see all top-level thread groups
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup();
|
||||
while ( !( tg.getParent() != null ) )
|
||||
while ( tg.getParent() == null )
|
||||
{
|
||||
tg = tg.getParent();
|
||||
}
|
||||
|
|
|
@ -54,12 +54,8 @@ public class ExclusionSetFilter
|
|||
|
||||
id = artifact.getGroupId() + ':' + id;
|
||||
|
||||
if ( excludes.contains( id ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !excludes.contains( id );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -92,13 +92,8 @@ public class DependencyContext
|
|||
|
||||
public boolean isResolutionRequiredForCurrentProject()
|
||||
{
|
||||
if ( lastDependencyArtifacts != project.getDependencyArtifacts()
|
||||
|| ( lastDependencyArtifacts != null && lastDependencyArtifactCount != lastDependencyArtifacts.size() ) )
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
return lastDependencyArtifacts != project.getDependencyArtifacts() || ( lastDependencyArtifacts != null
|
||||
&& lastDependencyArtifactCount != lastDependencyArtifacts.size() );
|
||||
}
|
||||
|
||||
public boolean isResolutionRequiredForAggregatedProjects( Collection<String> scopesToCollect,
|
||||
|
|
|
@ -196,7 +196,6 @@ public class DefaultPluginVersionResolver
|
|||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -734,12 +734,8 @@ public class MavenMetadataSource
|
|||
{
|
||||
return true;
|
||||
}
|
||||
if ( e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException
|
||||
&& e.getCause().getCause() instanceof ArtifactNotFoundException )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException
|
||||
&& e.getCause().getCause() instanceof ArtifactNotFoundException;
|
||||
}
|
||||
|
||||
private boolean isNonTransferrablePom( Exception e )
|
||||
|
@ -748,12 +744,8 @@ public class MavenMetadataSource
|
|||
{
|
||||
return true;
|
||||
}
|
||||
if ( e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException
|
||||
&& !( e.getCause().getCause() instanceof ArtifactNotFoundException ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException
|
||||
&& !( e.getCause().getCause() instanceof ArtifactNotFoundException );
|
||||
}
|
||||
|
||||
private Properties getSystemProperties()
|
||||
|
|
|
@ -781,13 +781,9 @@ public class DefaultModelValidator
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( !validateBannedCharacters( fieldName, problems, severity, version, string, sourceHint, tracker,
|
||||
ILLEGAL_VERSION_CHARS ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return validateBannedCharacters( fieldName, problems, severity, version, string, sourceHint, tracker,
|
||||
ILLEGAL_VERSION_CHARS );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean validate20ProperSnapshotVersion( String fieldName, ModelProblemCollector problems, Severity severity, Version version,
|
||||
|
|
|
@ -545,12 +545,8 @@ public class MojoDescriptor
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( !compareObjects( getGoal(), other.getGoal() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return compareObjects( getGoal(), other.getGoal() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue