Unnecessary null check before instanceof removed
This commit is contained in:
@@ -63,7 +63,7 @@ public class LinkConstant extends PooledConstant {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) return true;
|
||||
if (o == null || !(o instanceof LinkConstant)) return false;
|
||||
if (!(o instanceof LinkConstant)) return false;
|
||||
|
||||
LinkConstant cn = (LinkConstant)o;
|
||||
return this.type == cn.type &&
|
||||
|
||||
@@ -40,7 +40,7 @@ public class PrimitiveConstant extends PooledConstant {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) return true;
|
||||
if (o == null || !(o instanceof PrimitiveConstant)) return false;
|
||||
if (!(o instanceof PrimitiveConstant)) return false;
|
||||
|
||||
PrimitiveConstant cn = (PrimitiveConstant)o;
|
||||
return this.type == cn.type &&
|
||||
|
||||
@@ -36,7 +36,7 @@ public class FieldDescriptor {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) return true;
|
||||
if (o == null || !(o instanceof FieldDescriptor)) return false;
|
||||
if (!(o instanceof FieldDescriptor)) return false;
|
||||
|
||||
FieldDescriptor fd = (FieldDescriptor)o;
|
||||
return type.equals(fd.type);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class MethodDescriptor {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) return true;
|
||||
if (o == null || !(o instanceof MethodDescriptor)) return false;
|
||||
if (!(o instanceof MethodDescriptor)) return false;
|
||||
|
||||
MethodDescriptor md = (MethodDescriptor)o;
|
||||
return ret.equals(md.ret) && Arrays.equals(params, md.params);
|
||||
|
||||
@@ -265,7 +265,7 @@ public class VarType { // TODO: optimize switch
|
||||
return true;
|
||||
}
|
||||
|
||||
if (o == null || !(o instanceof VarType)) {
|
||||
if (!(o instanceof VarType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user