Skip to content

Commit

Permalink
[modify info] restruct equal name to void conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
yanlinly committed Sep 13, 2018
1 parent eb74cd6 commit 2986620
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ public boolean equals(Object obj) {

Http other = (Http) obj;

if (!equals(type, other.getType())) {
if (!strEquals(type, other.getType())) {
return false;
}

if (!equals(path, other.getPath())) {
if (!strEquals(path, other.getPath())) {
return false;
}
if (!equals(headers, other.getHeaders())) {
if (!strEquals(headers, other.getHeaders())) {
return false;
}
return expectedResponseCode == other.getExpectedResponseCode();
Expand Down Expand Up @@ -162,20 +162,20 @@ public boolean equals(Object obj) {

Mysql other = (Mysql) obj;

if (!equals(user, other.getUser())) {
if (!strEquals(user, other.getUser())) {
return false;
}

if (!equals(pwd, other.getPwd())) {
if (!strEquals(pwd, other.getPwd())) {
return false;
}

return equals(cmd, other.getCmd());
return strEquals(cmd, other.getCmd());

}
}

private static boolean equals(String str1, String str2) {
private static boolean strEquals(String str1, String str2) {
return str1 == null ? str2 == null : str1.equals(str2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ public boolean equals(Object obj) {

Instance host = (Instance) obj;

return equals(toString(), host.toString());
return strEquals(toString(), host.toString());
}

@Override
public int hashCode() {
return toString().hashCode();
}

private static boolean equals(String str1, String str2) {
private static boolean strEquals(String str1, String str2) {
return str1 == null ? str2 == null : str1.equals(str2);
}

Expand Down

0 comments on commit 2986620

Please sign in to comment.