mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 04:40:53 +00:00
hashCode and equals
This commit is contained in:
@@ -217,9 +217,9 @@ public class FontHelper {
|
||||
|
||||
public static class KerningPair {
|
||||
|
||||
public char char1;
|
||||
public final char char1;
|
||||
|
||||
public char char2;
|
||||
public final char char2;
|
||||
|
||||
public int kerning;
|
||||
|
||||
@@ -247,13 +247,13 @@ public class FontHelper {
|
||||
return false;
|
||||
}
|
||||
final KerningPair other = (KerningPair) obj;
|
||||
if (this.char1 != other.char1) {
|
||||
if (char1 != other.char1) {
|
||||
return false;
|
||||
}
|
||||
if (this.char2 != other.char2) {
|
||||
if (char2 != other.char2) {
|
||||
return false;
|
||||
}
|
||||
if (this.kerning != other.kerning) {
|
||||
if (kerning != other.kerning) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -44,8 +44,8 @@ public class MyEntry<K, V> implements Entry<K, V> {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 61 * hash + Objects.hashCode(this.key);
|
||||
hash = 61 * hash + Objects.hashCode(this.value);
|
||||
hash = 61 * hash + Objects.hashCode(key);
|
||||
hash = 61 * hash + Objects.hashCode(value);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -57,12 +57,11 @@ public class MyEntry<K, V> implements Entry<K, V> {
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
final MyEntry<K, V> other = (MyEntry<K, V>) obj;
|
||||
if (!Objects.equals(this.key, other.key)) {
|
||||
final MyEntry<?, ?> other = (MyEntry<?, ?>) obj;
|
||||
if (!Objects.equals(key, other.key)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.value, other.value)) {
|
||||
if (!Objects.equals(value, other.value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user