HADOOP-17599. Remove NULL checks before instanceof (#2804)

This commit is contained in:
Jack Jiang 2021-03-23 23:46:11 +08:00 committed by GitHub
parent d77c7ab4e0
commit d8ec8ab965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 20 additions and 21 deletions

View File

@ -1353,7 +1353,7 @@ public int hashCode() {
@Override //Object
public boolean equals(Object other) {
if (other == null || !(other instanceof AbstractFileSystem)) {
if (!(other instanceof AbstractFileSystem)) {
return false;
}
return myUri.equals(((AbstractFileSystem) other).myUri);

View File

@ -97,7 +97,7 @@ public int hashCode() {
public boolean equals(final Object that) {
if (this == that) {
return true;
} else if (that == null || !(that instanceof RenewAction)) {
} else if (!(that instanceof RenewAction)) {
return false;
}
return token.equals(((RenewAction<?>)that).token);

View File

@ -47,7 +47,7 @@ public boolean equals(Object other) {
if (other == this) {
return true;
}
if (other == null || !(other instanceof FileChecksum)) {
if (!(other instanceof FileChecksum)) {
return false;
}

View File

@ -93,7 +93,7 @@ public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !(obj instanceof ClientRequest)) {
if (!(obj instanceof ClientRequest)) {
return false;
}
ClientRequest other = (ClientRequest) obj;

View File

@ -188,8 +188,7 @@ public boolean equals(Object obj) {
return true;
}
if (obj == null
|| !(obj instanceof AuthorizationComponent)) {
if (!(obj instanceof AuthorizationComponent)) {
return false;
}

View File

@ -45,7 +45,7 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || !(other instanceof GetAllResourceProfilesResponse)) {
if (!(other instanceof GetAllResourceProfilesResponse)) {
return false;
}
return ((GetAllResourceProfilesResponse) other).getResourceProfiles()

View File

@ -45,7 +45,7 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || !(other instanceof GetAllResourceTypeInfoResponse)) {
if (!(other instanceof GetAllResourceTypeInfoResponse)) {
return false;
}
return ((GetAllResourceTypeInfoResponse) other).getResourceTypeInfo()

View File

@ -45,7 +45,7 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || !(other instanceof GetResourceProfileRequest)) {
if (!(other instanceof GetResourceProfileRequest)) {
return false;
}
return this.getProfileName()

View File

@ -54,7 +54,7 @@ public boolean equals(Object other) {
return true;
}
if (other == null || !(other instanceof GetResourceProfileResponse)) {
if (!(other instanceof GetResourceProfileResponse)) {
return false;
}
return this.getResource()

View File

@ -139,7 +139,7 @@ public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !(obj instanceof Resource)) {
if (!(obj instanceof Resource)) {
return false;
}
Resource other = (Resource) obj;

View File

@ -68,7 +68,7 @@ public int compareTo(PurgeElement e) {
@Override
public boolean equals(Object e) {
if (e == null || !(e instanceof PurgeElement)) {
if (!(e instanceof PurgeElement)) {
return false;
}
if (e == this) {

View File

@ -43,7 +43,7 @@ public String toString() {
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof VolumeId)) {
if (!(obj instanceof VolumeId)) {
return false;
}
return StringUtils.equalsIgnoreCase(volumeId,

View File

@ -135,7 +135,7 @@ public List<String> getArguments() {
@Override
public boolean equals(Object other) {
if (other == null || !(other instanceof PrivilegedOperation)) {
if (!(other instanceof PrivilegedOperation)) {
return false;
}

View File

@ -49,7 +49,7 @@ public String getContainerId() {
@Override
public int compareTo(Object o) {
if (o == null || !(o instanceof AssignedDevice)) {
if (!(o instanceof AssignedDevice)) {
return -1;
}
AssignedDevice other = (AssignedDevice) o;
@ -62,7 +62,7 @@ public int compareTo(Object o) {
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof AssignedDevice)) {
if (!(o instanceof AssignedDevice)) {
return false;
}
AssignedDevice other = (AssignedDevice) o;

View File

@ -44,7 +44,7 @@ public void setContainerId(String containerId) {
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof AssignedGpuDevice)) {
if (!(obj instanceof AssignedGpuDevice)) {
return false;
}
AssignedGpuDevice other = (AssignedGpuDevice) obj;
@ -54,7 +54,7 @@ public boolean equals(Object obj) {
@Override
public int compareTo(Object obj) {
if (obj == null || (!(obj instanceof AssignedGpuDevice))) {
if ((!(obj instanceof AssignedGpuDevice))) {
return -1;
}

View File

@ -43,7 +43,7 @@ public int getMinorNumber() {
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof GpuDevice)) {
if (!(obj instanceof GpuDevice)) {
return false;
}
GpuDevice other = (GpuDevice) obj;
@ -52,7 +52,7 @@ public boolean equals(Object obj) {
@Override
public int compareTo(Object obj) {
if (obj == null || (!(obj instanceof GpuDevice))) {
if (!(obj instanceof GpuDevice)) {
return -1;
}

View File

@ -54,7 +54,7 @@ public int hashCode() {
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof Attribute)){
if (!(obj instanceof Attribute)){
return false;
}