HDFS-15913. Remove useless NULL checks before instanceof (#2805)
This commit is contained in:
parent
d8ec8ab965
commit
9c2a712597
|
@ -219,7 +219,7 @@ public class BlockStoragePolicy implements BlockStoragePolicySpi {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof BlockStoragePolicy)) {
|
||||
} else if (!(obj instanceof BlockStoragePolicy)) {
|
||||
return false;
|
||||
}
|
||||
final BlockStoragePolicy that = (BlockStoragePolicy)obj;
|
||||
|
|
|
@ -86,7 +86,7 @@ public class RollingUpgradeInfo extends RollingUpgradeStatus {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof RollingUpgradeInfo)) {
|
||||
} else if (!(obj instanceof RollingUpgradeInfo)) {
|
||||
return false;
|
||||
}
|
||||
final RollingUpgradeInfo that = (RollingUpgradeInfo)obj;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class RollingUpgradeStatus {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof RollingUpgradeStatus)) {
|
||||
} else if (!(obj instanceof RollingUpgradeStatus)) {
|
||||
return false;
|
||||
}
|
||||
final RollingUpgradeStatus that = (RollingUpgradeStatus) obj;
|
||||
|
|
|
@ -622,7 +622,7 @@ public class Dispatcher {
|
|||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof StorageGroup)) {
|
||||
} else if (!(obj instanceof StorageGroup)) {
|
||||
return false;
|
||||
} else {
|
||||
final StorageGroup that = (StorageGroup) obj;
|
||||
|
|
|
@ -321,7 +321,7 @@ public class DatanodeStorageInfo {
|
|||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof DatanodeStorageInfo)) {
|
||||
} else if (!(obj instanceof DatanodeStorageInfo)) {
|
||||
return false;
|
||||
}
|
||||
final DatanodeStorageInfo that = (DatanodeStorageInfo)obj;
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ErrorReportAction implements BPServiceActorAction {
|
|||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || !(obj instanceof ErrorReportAction)) {
|
||||
if (!(obj instanceof ErrorReportAction)) {
|
||||
return false;
|
||||
}
|
||||
ErrorReportAction other = (ErrorReportAction) obj;
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ReportBadBlockAction implements BPServiceActorAction {
|
|||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || !(obj instanceof ReportBadBlockAction)) {
|
||||
if (!(obj instanceof ReportBadBlockAction)) {
|
||||
return false;
|
||||
}
|
||||
ReportBadBlockAction other = (ReportBadBlockAction) obj;
|
||||
|
|
|
@ -200,7 +200,7 @@ public class StorageLocation
|
|||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null || !(obj instanceof StorageLocation)) {
|
||||
if (!(obj instanceof StorageLocation)) {
|
||||
return false;
|
||||
}
|
||||
int comp = compareTo((StorageLocation) obj);
|
||||
|
|
|
@ -850,7 +850,7 @@ public abstract class INode implements INodeAttributes, Diff.Element<byte[]> {
|
|||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null || !(that instanceof INode)) {
|
||||
if (!(that instanceof INode)) {
|
||||
return false;
|
||||
}
|
||||
return getId() == ((INode) that).getId();
|
||||
|
|
|
@ -275,7 +275,7 @@ public class QuotaCounts {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof QuotaCounts)) {
|
||||
} else if (!(obj instanceof QuotaCounts)) {
|
||||
return false;
|
||||
}
|
||||
final QuotaCounts that = (QuotaCounts)obj;
|
||||
|
|
|
@ -232,7 +232,7 @@ public class Snapshot implements Comparable<byte[]> {
|
|||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
} else if (that == null || !(that instanceof Snapshot)) {
|
||||
} else if (!(that instanceof Snapshot)) {
|
||||
return false;
|
||||
}
|
||||
return this.id == ((Snapshot)that).id;
|
||||
|
|
|
@ -130,7 +130,7 @@ public class EnumCounters<E extends Enum<E>> {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof EnumCounters)) {
|
||||
} else if (!(obj instanceof EnumCounters)) {
|
||||
return false;
|
||||
}
|
||||
final EnumCounters<?> that = (EnumCounters<?>)obj;
|
||||
|
|
|
@ -102,7 +102,7 @@ public class EnumDoubles<E extends Enum<E>> {
|
|||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (obj == null || !(obj instanceof EnumDoubles)) {
|
||||
} else if (!(obj instanceof EnumDoubles)) {
|
||||
return false;
|
||||
}
|
||||
final EnumDoubles<?> that = (EnumDoubles<?>)obj;
|
||||
|
|
Loading…
Reference in New Issue