mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-28 14:20:46 +00:00
hashCode and equals
This commit is contained in:
+7
-6
@@ -27,13 +27,14 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
public class CallFunctionActionItem extends ActionItem {
|
||||
|
||||
public GraphTargetItem functionName;
|
||||
public final GraphTargetItem functionName;
|
||||
|
||||
public List<GraphTargetItem> arguments;
|
||||
public final List<GraphTargetItem> arguments;
|
||||
|
||||
public GraphTargetItem calculatedFunction;
|
||||
|
||||
@@ -99,8 +100,8 @@ public class CallFunctionActionItem extends ActionItem {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 37 * hash + (this.functionName != null ? this.functionName.hashCode() : 0);
|
||||
hash = 37 * hash + (this.arguments != null ? this.arguments.hashCode() : 0);
|
||||
hash = 37 * hash + Objects.hashCode(functionName);
|
||||
hash = 37 * hash + Objects.hashCode(arguments);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -113,10 +114,10 @@ public class CallFunctionActionItem extends ActionItem {
|
||||
return false;
|
||||
}
|
||||
final CallFunctionActionItem other = (CallFunctionActionItem) obj;
|
||||
if (this.functionName != other.functionName && (this.functionName == null || !this.functionName.equals(other.functionName))) {
|
||||
if (!Objects.equals(functionName, other.functionName)) {
|
||||
return false;
|
||||
}
|
||||
if (this.arguments != other.arguments && (this.arguments == null || !this.arguments.equals(other.arguments))) {
|
||||
if (!Objects.equals(this.arguments, other.arguments)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
+6
-6
@@ -39,11 +39,11 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue {
|
||||
|
||||
public Object value;
|
||||
|
||||
public List<String> constants;
|
||||
public final List<String> constants;
|
||||
|
||||
public GraphTargetItem computedRegValue;
|
||||
|
||||
public int pos = -1;
|
||||
public final int pos;
|
||||
|
||||
public DirectValueActionItem(Object o) {
|
||||
this(null, 0, o, new ArrayList<>());
|
||||
@@ -204,8 +204,8 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 71 * hash + Objects.hashCode(this.value);
|
||||
hash = 71 * hash + System.identityHashCode(this.constants);
|
||||
hash = 71 * hash + Objects.hashCode(value);
|
||||
hash = 71 * hash + Objects.hashCode(constants);
|
||||
hash = 71 * hash + pos;
|
||||
return hash;
|
||||
}
|
||||
@@ -219,10 +219,10 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue {
|
||||
return false;
|
||||
}
|
||||
final DirectValueActionItem other = (DirectValueActionItem) obj;
|
||||
if (!Objects.equals(this.value, other.value)) {
|
||||
if (!Objects.equals(value, other.value)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.constants, other.constants)) {
|
||||
if (!Objects.equals(constants, other.constants)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
+7
-6
@@ -28,12 +28,13 @@ import com.jpexs.decompiler.graph.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GetMemberActionItem extends ActionItem {
|
||||
|
||||
public GraphTargetItem object;
|
||||
public final GraphTargetItem object;
|
||||
|
||||
public GraphTargetItem memberName;
|
||||
public final GraphTargetItem memberName;
|
||||
|
||||
@Override
|
||||
public List<GraphTargetItem> getAllSubItems() {
|
||||
@@ -71,8 +72,8 @@ public class GetMemberActionItem extends ActionItem {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 47 * hash + (this.object != null ? this.object.hashCode() : 0);
|
||||
hash = 47 * hash + (this.memberName != null ? this.memberName.hashCode() : 0);
|
||||
hash = 47 * hash + Objects.hashCode(object);
|
||||
hash = 47 * hash + Objects.hashCode(memberName);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -85,10 +86,10 @@ public class GetMemberActionItem extends ActionItem {
|
||||
return false;
|
||||
}
|
||||
final GetMemberActionItem other = (GetMemberActionItem) obj;
|
||||
if (this.object != other.object && (this.object == null || !this.object.equals(other.object))) {
|
||||
if (!Objects.equals(object, other.object)) {
|
||||
return false;
|
||||
}
|
||||
if (this.memberName != other.memberName && (this.memberName == null || !this.memberName.equals(other.memberName))) {
|
||||
if (!Objects.equals(memberName, other.memberName)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
+4
-3
@@ -29,11 +29,12 @@ import com.jpexs.decompiler.graph.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
public class GetVariableActionItem extends ActionItem {
|
||||
|
||||
public GraphTargetItem name;
|
||||
public final GraphTargetItem name;
|
||||
|
||||
private GraphTargetItem computedValue;
|
||||
|
||||
@@ -115,7 +116,7 @@ public class GetVariableActionItem extends ActionItem {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 13 * hash + (this.name != null ? this.name.hashCode() : 0);
|
||||
hash = 13 * hash + Objects.hashCode(name);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ public class GetVariableActionItem extends ActionItem {
|
||||
return false;
|
||||
}
|
||||
final GetVariableActionItem other = (GetVariableActionItem) obj;
|
||||
if (this.name != other.name && (this.name == null || !this.name.equals(other.name))) {
|
||||
if (!Objects.equals(name, other.name)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -21,14 +21,14 @@ import java.io.Serializable;
|
||||
|
||||
public class RegisterNumber implements Serializable {
|
||||
|
||||
public int number;
|
||||
public final int number;
|
||||
|
||||
public String name = null;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 47 * hash + this.number;
|
||||
hash = 47 * hash + number;
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class RegisterNumber implements Serializable {
|
||||
return false;
|
||||
}
|
||||
final RegisterNumber other = (RegisterNumber) obj;
|
||||
if (this.number != other.number) {
|
||||
if (number != other.number) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user