Skip to content

Commit

Permalink
#41 - a little bit of cosmetics (simplified some statements)
Browse files Browse the repository at this point in the history
  • Loading branch information
csoroiu committed Jul 25, 2018
1 parent fb04320 commit e9bf86c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ public boolean equals( Object o )

Annotation annotation = (Annotation) o;

if ( className != null ? !className.equals( annotation.className ) : annotation.className != null )
{
return false;
}

return true;
return className != null ? className.equals( annotation.className ) : annotation.className == null;
}

public int hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ public boolean equals( Object o )

Ignore ignore = (Ignore) o;

if ( className != null ? !className.equals( ignore.className ) : ignore.className != null )
{
return false;
}

return true;
return className != null ? className.equals( ignore.className ) : ignore.className == null;
}

public int hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ public boolean equals( Object o )

Signature signature = (Signature) o;

if ( src != null ? !src.equals( signature.src ) : signature.src != null )
{
return false;
}

return true;
return src != null ? src.equals( signature.src ) : signature.src == null;
}

public int hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,7 @@ private InputStream[] getBaseSignatures()
baseSignatures.add( new FileInputStream( artifact.getFile() ) );
}
}
final InputStream[] baseSignatureInputStreams =
(InputStream[]) baseSignatures.toArray( new InputStream[baseSignatures.size()] );
return baseSignatureInputStreams;
return baseSignatures.toArray( new InputStream[baseSignatures.size()] );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ public void execute()
return;
}

if ( signature == null || StringUtils.isBlank(signature.getGroupId()) || signature.getGroupId() == "null") {
getLog().info( "Signature version is: " + signature.getVersion() );
return;
if ( signature == null || StringUtils.isBlank( signature.getGroupId() ) || "null".equals( signature.getGroupId()) )
{
getLog().info( "Signature version is: " + signature.getVersion() );
return;
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ public boolean equals( Object o )

JdkToolchain that = (JdkToolchain) o;

if ( parameters != null ? !parameters.equals( that.parameters ) : that.parameters != null )
{
return false;
}

return true;
return parameters != null ? parameters.equals( that.parameters ) : that.parameters == null;
}

public int hashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ public static void main( String[] args )
files.add(new File(args[i]));
}

for (int i = 0; i < files.size(); i++)
for ( File file : files )
{
m.process((File) files.get(i));
m.process(file);
}

if (threshold!=null && m.maximumVersion.compareTo(threshold)>0)
if ( threshold != null && m.maximumVersion.compareTo( threshold ) > 0 )
{
System.exit(1);
}
}

protected void process( String name, InputStream image )
Expand All @@ -107,8 +109,8 @@ protected void process( String name, InputStream image )

if (humanReadableName)
{
String hn = (String)HUMAN_READABLE_NAME.get(v);
if (hn!=null) v = hn;
String hn = HUMAN_READABLE_NAME.get(v);
if ( hn != null ) v = hn;
}

System.out.println( v + " " + name );
Expand All @@ -129,5 +131,7 @@ private static int u2( byte u, byte d )
HUMAN_READABLE_NAME.put("48.0","Java4");
HUMAN_READABLE_NAME.put("49.0","Java5");
HUMAN_READABLE_NAME.put("50.0","Java6");
HUMAN_READABLE_NAME.put("51.0","Java7");
HUMAN_READABLE_NAME.put("52.0","Java8");
}
}

0 comments on commit e9bf86c

Please sign in to comment.