Simplify if statements

See gh-17785
This commit is contained in:
SaberXu
2019-08-05 22:56:13 +08:00
committed by Stephane Nicoll
parent 3efead4ba5
commit c6c3a91f8d
5 changed files with 9 additions and 24 deletions

View File

@@ -106,17 +106,14 @@ public class LaunchScriptConfiguration implements Serializable {
return false;
}
if (this.script == null) {
if (other.script != null) {
return false;
}
return other.script == null;
}
else if (!this.script.equals(other.script)) {
return false;
}
else if (!equalContents(this.script, other.script)) {
return false;
else {
return equalContents(this.script, other.script);
}
return true;
}
private boolean equalContents(File one, File two) {
@@ -132,7 +129,7 @@ public class LaunchScriptConfiguration implements Serializable {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.properties == null) ? 0 : this.properties.hashCode());
result = prime * result + this.properties.hashCode();
result = prime * result + ((this.script == null) ? 0 : this.script.hashCode());
return result;
}