Fix stacktrace check for KT-27718. This work-around should be removed after fix of IDEA-203651

#KT-27718 Fixed
This commit is contained in:
Andrey Uskov
2018-12-06 20:23:05 +03:00
parent d84c5b1608
commit 235b6ca6cd
@@ -11,8 +11,9 @@ interface KotlinRootType {
fun isSameRootType(kotlinRoot: KotlinRootType, other: Any?): Boolean {
if (kotlinRoot.isTestRoot()) {
if (other is JavaResourceRootType || other is JavaSourceRootType) {
val invokeLevel = 3
val stack = Thread.currentThread().stackTrace
if (stack.size > 2 && "isTestSource" == stack[2].methodName && "com.intellij.openapi.roots.impl.SourceFolderImpl" == stack[2].className) {
if (stack.size > invokeLevel && "isTestSource" == stack[invokeLevel].methodName && "com.intellij.openapi.roots.impl.SourceFolderImpl" == stack[invokeLevel].className) {
if (JavaResourceRootType.TEST_RESOURCE == other) {
return true
}