Fix for KtLightParameter and KtLightParameterList equality

This commit is contained in:
Nicolay Mitropolsky
2017-08-24 20:09:50 +03:00
committed by Pavel Talanov
parent f8f5494d79
commit 6953ae79e2
3 changed files with 124 additions and 0 deletions
@@ -185,4 +185,15 @@ public class KtLightParameter extends LightParameter implements KtLightDeclarati
public boolean equals(Object obj) {
return obj instanceof PsiElement && isEquivalentTo((PsiElement) obj);
}
@Override
public int hashCode() {
KtParameter kotlinOrigin = getKotlinOrigin();
if (kotlinOrigin != null) {
return kotlinOrigin.hashCode();
}
else {
return 0;
}
}
}
@@ -45,4 +45,15 @@ class KtLightParameterList(
visitor.visitParameterList(this)
}
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as KtLightParameterList
if (parent != other.parent) return false
return true
}
override fun hashCode(): Int = parent.hashCode()
}