MNG-7296 - Remove redundant 'if' statement

This commit is contained in:
Arturo Bernal 2021-10-10 09:43:13 +02:00 committed by Sylwester Lachiewicz
parent e50d65d228
commit 4fafe44112
12 changed files with 16 additions and 53 deletions

View File

@ -44,9 +44,9 @@ public final class ArtifactUtils
{
return true;
}
else if ( Artifact.VERSION_FILE_PATTERN.matcher( version ).matches() )
else
{
return true;
return Artifact.VERSION_FILE_PATTERN.matcher( version ).matches();
}
}
return false;

View File

@ -349,14 +349,12 @@ public class DefaultArtifact
{
return false;
}
else if ( a.getClassifier() == null ? classifier != null : !a.getClassifier().equals( classifier ) )
else
{
return false;
return a.getClassifier() == null ? classifier == null : a.getClassifier().equals( classifier );
}
// We don't consider the version range in the comparison, just the resolved version
return true;
}
public String getBaseVersion()

View File

@ -88,10 +88,7 @@ public class Restriction
{
return false;
}
if ( comparison < 0 )
{
return false;
}
return comparison >= 0;
}
return true;

View File

@ -368,12 +368,7 @@ public class StringSearchModelInterpolator
// return false;
// }
if ( "parent".equals( field.getName() ) )
{
return false;
}
return true;
return !"parent".equals( field.getName() );
}
private void evaluateArray( Object target )

View File

@ -265,11 +265,10 @@ public class DefaultExceptionHandler
{
return false;
}
else if ( exception.getClass().getName().startsWith( "java" ) )
else
{
return false;
return !exception.getClass().getName().startsWith( "java" );
}
return true;
}
private String getMessage( String message, Throwable exception )

View File

@ -408,10 +408,7 @@ public class DefaultGraphBuilder
id = project.getGroupId() + id;
if ( id.equals( selector ) )
{
return true;
}
return id.equals( selector );
}
// relative path, e.g. "sub", "../sub" or "."

View File

@ -392,12 +392,10 @@ public class ActiveProjectArtifact
{
return false;
}
else if ( a.getClassifier() == null ? getClassifier() != null : !a.getClassifier().equals( getClassifier() ) )
else
{
return false;
return a.getClassifier() == null ? getClassifier() == null : a.getClassifier().equals( getClassifier() );
}
return true;
}
}

View File

@ -141,11 +141,7 @@ public class FileProfileActivator
ActivationFile file = activation.getFile();
if ( file == null )
{
return false;
}
return true;
return file != null;
}
}

View File

@ -99,11 +99,7 @@ public class JdkVersionProfileActivator
String jdk = activation.getJdk();
if ( jdk == null )
{
return false;
}
return true;
return jdk != null;
}
private static boolean isInRange( String value, List<RangeValue> range )

View File

@ -92,11 +92,7 @@ public class OperatingSystemProfileActivator
ActivationOS os = activation.getOs();
if ( os == null )
{
return false;
}
return true;
return os != null;
}
private boolean ensureAtLeastOneNonNull( ActivationOS os )

View File

@ -119,11 +119,7 @@ public class PropertyProfileActivator
ActivationProperty property = activation.getProperty();
if ( property == null )
{
return false;
}
return true;
return property != null;
}
}

View File

@ -80,12 +80,7 @@ public class DependencyKey
{
return false;
}
if ( !Objects.equals( groupId, other.groupId ) )
{
return false;
}
return true;
return Objects.equals( groupId, other.groupId );
}