List<String> (int frameCount) { if (myStacktrace == null) { return Collections.emptyList(); } int size = Math.min(myStacktrace.length, frameCount); List<String> result = new ArrayList<>(size); Map<String, PluginInfo> pluginInfoCache = new HashMap<>(); for (int i = 0; i < size; i++) { StackTraceElement element = myStacktrace[i]; PluginInfo pluginInfo = pluginInfoCache.get(element.getClassName()); if (pluginInfo == null) { pluginInfo = PluginInfoDetectorKt.getPluginInfo(element.getClassName()); pluginInfoCache.put(element.getClassName(), pluginInfo); } if (pluginInfo.isSafeToReport()) { result.add(element.getClassName() + "." + element.getMethodName()); } else { result.add(THIRD_PARTY); } } return result; }