Object declaringSource = source;
if (declaringSource instanceof ElementSource) {
originalSource = (ElementSource) declaringSource;
declaringSource = originalSource.getDeclaringSource();
}
IncludeStackTraceOption stackTraceOption = getIncludeStackTraceOption();
if (stackTraceOption == IncludeStackTraceOption.COMPLETE ||
(stackTraceOption == IncludeStackTraceOption.ONLY_FOR_DECLARING_SOURCE
&& declaringSource == null)) {
callStack = new Throwable().getStackTrace();
}