StackTraceElement (Throwable stackTraceHolder) { StackTraceElement[] stackTrace = stackTraceHolder.getStackTrace(); for (int idx = 2, len = stackTrace.length; idx < len; idx++) { String className = stackTrace[idx].getClassName(); if (className.startsWith("com.intellij.util.CachedValue")) continue; if (className.startsWith("com.intellij.psi.util.CachedValue")) continue; if (className.startsWith("com.intellij.psi.impl.PsiCachedValue")) continue; if (className.startsWith("com.intellij.openapi.util.Recursion")) continue; if (className.startsWith("com.intellij.psi.impl.PsiParameterizedCachedValue")) continue; return stackTrace[idx]; } return new StackTraceElement("unknown", "unknown", "", -1); }