Provide equals/hashCode based on original PSI to avoid potential PCEs
#KT-59445
This commit is contained in:
committed by
Space Team
parent
05652e7d8d
commit
d0477a6a30
+6
@@ -18,6 +18,12 @@ class JavaElementPsiSourceWithFixedPsi<PSI : PsiElement>(
|
||||
override val factory: JavaElementSourceFactory
|
||||
get() = JavaElementSourceFactory.getInstance(psi.project)
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return if (other === this) true else other is JavaElementPsiSourceWithFixedPsi<*> && psi == other.psi
|
||||
}
|
||||
|
||||
override fun hashCode(): Int = psi.hashCode()
|
||||
|
||||
override fun toString(): String {
|
||||
return psi.toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user