Fix checkstyle reported errors

This commit is contained in:
rfscholte 2019-09-10 18:51:18 +02:00
parent d09bc7437f
commit 38efe8444c
9 changed files with 26 additions and 50 deletions

View File

@ -593,11 +593,8 @@ public boolean equals( Object obj )
}
VersionRange other = (VersionRange) obj;
boolean equals =
Objects.equals(recommendedVersion, other.recommendedVersion);
equals &=
Objects.equals(restrictions, other.restrictions);
return equals;
return Objects.equals( recommendedVersion, other.recommendedVersion )
&& Objects.equals( restrictions, other.restrictions );
}
public int hashCode()

View File

@ -70,7 +70,7 @@ public void omitForNearer( Artifact omitted, Artifact kept )
String omittedVersion = omitted.getVersion();
String keptVersion = kept.getVersion();
if (!Objects.equals(omittedVersion, keptVersion))
if ( !Objects.equals( omittedVersion, keptVersion ) )
{
logger.debug( indent + omitted + " (removed - nearer found: " + keptVersion + ")" );
}

View File

@ -354,7 +354,7 @@ public boolean equals( Object obj )
protected static <T> boolean eq( T s1, T s2 )
{
return Objects.equals(s1, s2);
return Objects.equals( s1, s2 );
}
public Authentication getAuthentication()

View File

@ -69,12 +69,7 @@ public boolean equals( Object obj )
ScopeArtifactFilter other = (ScopeArtifactFilter) obj;
return equals( scope, other.scope );
}
private static <T> boolean equals( T str1, T str2 )
{
return Objects.equals(str1, str2);
return Objects.equals( scope, other.scope );
}
}

View File

@ -39,7 +39,7 @@ class CacheUtils
@Deprecated
public static <T> boolean eq( T s1, T s2 )
{
return Objects.equals(s1, s2);
return Objects.equals( s1, s2 );
}
/**

View File

@ -194,9 +194,11 @@ public boolean equals( Object obj )
CacheKey that = (CacheKey) obj;
return eq( this.artifactId, that.artifactId ) && eq( this.groupId, that.groupId )
&& eq( this.version, that.version ) && eq( this.localRepo, that.localRepo )
&& eq( this.workspace, that.workspace )
return Objects.equals( this.artifactId, that.artifactId )
&& Objects.equals( this.groupId, that.groupId )
&& Objects.equals( this.version, that.version )
&& Objects.equals( this.localRepo, that.localRepo )
&& Objects.equals( this.workspace, that.workspace )
&& RepositoryUtils.repositoriesEquals( this.repositories, that.repositories );
}
@ -211,11 +213,6 @@ private static int hash( Object obj )
return obj != null ? obj.hashCode() : 0;
}
private static <T> boolean eq( T s1, T s2 )
{
return Objects.equals(s1, s2);
}
}
}

View File

@ -1056,13 +1056,9 @@ else if ( !( other instanceof MavenProject ) )
MavenProject that = (MavenProject) other;
return eq( getArtifactId(), that.getArtifactId() ) && eq( getGroupId(), that.getGroupId() )
&& eq( getVersion(), that.getVersion() );
}
private static <T> boolean eq( T s1, T s2 )
{
return Objects.equals(s1, s2);
return Objects.equals( getArtifactId(), that.getArtifactId() )
&& Objects.equals( getGroupId(), that.getGroupId() )
&& Objects.equals( getVersion(), that.getVersion() );
}
@Override

View File

@ -133,13 +133,13 @@ private static boolean artifactEquals( Artifact a1, Artifact a2 )
return true;
}
return eq( a1.getGroupId(), a2.getGroupId() )
&& eq( a1.getArtifactId(), a2.getArtifactId() )
&& eq( a1.getType(), a2.getType() )
&& eq( a1.getVersion(), a2.getVersion() )
&& eq( a1.getClassifier(), a2.getClassifier() )
&& eq( a1.getScope(), a2.getScope() )
&& eq( a1.getDependencyFilter(), a2.getDependencyFilter() )
return Objects.equals( a1.getGroupId(), a2.getGroupId() )
&& Objects.equals( a1.getArtifactId(), a2.getArtifactId() )
&& Objects.equals( a1.getType(), a2.getType() )
&& Objects.equals( a1.getVersion(), a2.getVersion() )
&& Objects.equals( a1.getClassifier(), a2.getClassifier() )
&& Objects.equals( a1.getScope(), a2.getScope() )
&& Objects.equals( a1.getDependencyFilter(), a2.getDependencyFilter() )
&& a1.isOptional() == a2.isOptional();
}
@ -167,7 +167,8 @@ private static boolean repositoryEquals( ArtifactRepository r1, ArtifactReposito
return true;
}
return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() )
return Objects.equals( r1.getId(), r2.getId() )
&& Objects.equals( r1.getUrl(), r2.getUrl() )
&& repositoryPolicyEquals( r1.getReleases(), r2.getReleases() )
&& repositoryPolicyEquals( r1.getSnapshots(), r2.getSnapshots() );
}
@ -179,7 +180,7 @@ private static boolean repositoryPolicyEquals( ArtifactRepositoryPolicy p1, Arti
return true;
}
return p1.isEnabled() == p2.isEnabled() && eq( p1.getUpdatePolicy(), p2.getUpdatePolicy() );
return p1.isEnabled() == p2.isEnabled() && Objects.equals( p1.getUpdatePolicy(), p2.getUpdatePolicy() );
}
private static boolean repositoriesEquals( List<ArtifactRepository> r1, List<ArtifactRepository> r2 )
@ -200,11 +201,6 @@ private static boolean repositoriesEquals( List<ArtifactRepository> r1, List<Art
return true;
}
private static <T> boolean eq( T s1, T s2 )
{
return Objects.equals(s1, s2);
}
/**
* CacheRecord
*/

View File

@ -138,7 +138,7 @@ public boolean equals( Object obj )
DefaultToolchain other = (DefaultToolchain) obj;
if (!Objects.equals(type, other.type))
if ( !Objects.equals( type, other.type ) )
{
return false;
}
@ -146,12 +146,7 @@ public boolean equals( Object obj )
Properties thisProvides = this.getModel().getProvides();
Properties otherProvides = other.getModel().getProvides();
if (!Objects.equals(thisProvides, otherProvides))
{
return false;
}
return true;
return Objects.equals( thisProvides, otherProvides );
}
@Override