Add hashCode to pool entry
This commit is contained in:
@@ -35,6 +35,14 @@ public class Double extends PoolEntry
|
||||
return value == d.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 5;
|
||||
hash = 79 * hash + (int) (java.lang.Double.doubleToLongBits(this.value) ^ (java.lang.Double.doubleToLongBits(this.value) >>> 32));
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlots()
|
||||
{
|
||||
|
||||
@@ -35,6 +35,14 @@ public class Float extends PoolEntry
|
||||
return value == f.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 7;
|
||||
hash = 37 * hash + java.lang.Float.floatToIntBits(this.value);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getTypeClass()
|
||||
{
|
||||
|
||||
@@ -34,6 +34,14 @@ public class Integer extends PoolEntry
|
||||
Integer i = (Integer) other;
|
||||
return value == i.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 3;
|
||||
hash = 97 * hash + this.value;
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.lang.String toString()
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.runelite.deob.ConstantPool;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class InterfaceMethod extends PoolEntry
|
||||
{
|
||||
@@ -51,6 +52,15 @@ public class InterfaceMethod extends PoolEntry
|
||||
InterfaceMethod i = (InterfaceMethod) other;
|
||||
return clazz.equals(i.clazz) && nat.equals(i.nat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 5;
|
||||
hash = 23 * hash + Objects.hashCode(this.clazz);
|
||||
hash = 23 * hash + Objects.hashCode(this.nat);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public Class getClassEntry()
|
||||
{
|
||||
|
||||
@@ -35,6 +35,14 @@ public class Long extends PoolEntry
|
||||
return value == l.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 3;
|
||||
hash = 37 * hash + (int) (this.value ^ (this.value >>> 32));
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlots()
|
||||
{
|
||||
|
||||
@@ -29,6 +29,9 @@ public abstract class PoolEntry
|
||||
@Override
|
||||
public abstract boolean equals(Object other);
|
||||
|
||||
@Override
|
||||
public abstract int hashCode();
|
||||
|
||||
public abstract void write(DataOutputStream out) throws IOException;
|
||||
|
||||
public ConstantType getType()
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.runelite.deob.execution.Type;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class String extends PoolEntry
|
||||
{
|
||||
@@ -54,6 +55,14 @@ public class String extends PoolEntry
|
||||
return string.equals(s.string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 5;
|
||||
hash = 83 * hash + Objects.hashCode(this.string);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.runelite.deob.ConstantPool;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class UTF8 extends PoolEntry
|
||||
{
|
||||
@@ -34,6 +35,14 @@ public class UTF8 extends PoolEntry
|
||||
return string.equals(u.string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 5;
|
||||
hash = 29 * hash + Objects.hashCode(this.string);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public java.lang.String getValue()
|
||||
{
|
||||
return string;
|
||||
|
||||
Reference in New Issue
Block a user