HADOOP-17599. Remove NULL checks before instanceof (#2804)
This commit is contained in:
parent
d77c7ab4e0
commit
d8ec8ab965
|
@ -1353,7 +1353,7 @@ public abstract class AbstractFileSystem implements PathCapabilities {
|
|||
|
||||
@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);
|
||||
|
|
|
@ -97,7 +97,7 @@ public class DelegationTokenRenewer
|
|||
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);
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class FileChecksum implements Writable {
|
|||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if (other == null || !(other instanceof FileChecksum)) {
|
||||
if (!(other instanceof FileChecksum)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public class RpcCallCache {
|
|||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || !(obj instanceof ClientRequest)) {
|
||||
if (!(obj instanceof ClientRequest)) {
|
||||
return false;
|
||||
}
|
||||
ClientRequest other = (ClientRequest) obj;
|
||||
|
|
|
@ -188,8 +188,7 @@ public class MockWasbAuthorizerImpl implements WasbAuthorizerInterface {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (obj == null
|
||||
|| !(obj instanceof AuthorizationComponent)) {
|
||||
if (!(obj instanceof AuthorizationComponent)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public abstract class GetAllResourceProfilesResponse {
|
|||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (other == null || !(other instanceof GetAllResourceProfilesResponse)) {
|
||||
if (!(other instanceof GetAllResourceProfilesResponse)) {
|
||||
return false;
|
||||
}
|
||||
return ((GetAllResourceProfilesResponse) other).getResourceProfiles()
|
||||
|
|
|
@ -45,7 +45,7 @@ public abstract class GetAllResourceTypeInfoResponse {
|
|||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (other == null || !(other instanceof GetAllResourceTypeInfoResponse)) {
|
||||
if (!(other instanceof GetAllResourceTypeInfoResponse)) {
|
||||
return false;
|
||||
}
|
||||
return ((GetAllResourceTypeInfoResponse) other).getResourceTypeInfo()
|
||||
|
|
|
@ -45,7 +45,7 @@ public abstract class GetResourceProfileRequest {
|
|||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (other == null || !(other instanceof GetResourceProfileRequest)) {
|
||||
if (!(other instanceof GetResourceProfileRequest)) {
|
||||
return false;
|
||||
}
|
||||
return this.getProfileName()
|
||||
|
|
|
@ -54,7 +54,7 @@ public abstract class GetResourceProfileResponse {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (other == null || !(other instanceof GetResourceProfileResponse)) {
|
||||
if (!(other instanceof GetResourceProfileResponse)) {
|
||||
return false;
|
||||
}
|
||||
return this.getResource()
|
||||
|
|
|
@ -139,7 +139,7 @@ public class LightWeightResource extends Resource {
|
|||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || !(obj instanceof Resource)) {
|
||||
if (!(obj instanceof Resource)) {
|
||||
return false;
|
||||
}
|
||||
Resource other = (Resource) obj;
|
||||
|
|
|
@ -68,7 +68,7 @@ public class Log4jWarningErrorMetricsAppender extends AppenderSkeleton {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object e) {
|
||||
if (e == null || !(e instanceof PurgeElement)) {
|
||||
if (!(e instanceof PurgeElement)) {
|
||||
return false;
|
||||
}
|
||||
if (e == this) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class VolumeId {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null || !(obj instanceof VolumeId)) {
|
||||
if (!(obj instanceof VolumeId)) {
|
||||
return false;
|
||||
}
|
||||
return StringUtils.equalsIgnoreCase(volumeId,
|
||||
|
|
|
@ -135,7 +135,7 @@ public class PrivilegedOperation {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == null || !(other instanceof PrivilegedOperation)) {
|
||||
if (!(other instanceof PrivilegedOperation)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class AssignedDevice implements Serializable, Comparable {
|
|||
|
||||
@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 class AssignedDevice implements Serializable, Comparable {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || !(o instanceof AssignedDevice)) {
|
||||
if (!(o instanceof AssignedDevice)) {
|
||||
return false;
|
||||
}
|
||||
AssignedDevice other = (AssignedDevice) o;
|
||||
|
|
|
@ -44,7 +44,7 @@ public class AssignedGpuDevice extends GpuDevice {
|
|||
|
||||
@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 class AssignedGpuDevice extends GpuDevice {
|
|||
|
||||
@Override
|
||||
public int compareTo(Object obj) {
|
||||
if (obj == null || (!(obj instanceof AssignedGpuDevice))) {
|
||||
if ((!(obj instanceof AssignedGpuDevice))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public class GpuDevice implements Serializable, Comparable {
|
|||
|
||||
@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 class GpuDevice implements Serializable, Comparable {
|
|||
|
||||
@Override
|
||||
public int compareTo(Object obj) {
|
||||
if (obj == null || (!(obj instanceof GpuDevice))) {
|
||||
if (!(obj instanceof GpuDevice)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public final class ContainerRuntimeContext {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null || !(obj instanceof Attribute)){
|
||||
if (!(obj instanceof Attribute)){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue