private String getSourceCodePath ( StackTraceElement stackTraceElement ) { Objects . requireNonNull ( stackTraceElement , Required . STACK_TRACE_ELEMENT . toString ( ) ) ; String packageName = stackTraceElement . getClassName ( ) ; int position = packageName . lastIndexOf ( ' ' ) ; if ( position > 0 ) { packageName = packageName . substring ( 0 , position ) ; return StringUtils . replace ( packageName , "." , File . separator ) + File . separator + stackTraceElement . getFileName ( ) ; } return stackTraceElement . getFileName ( ) ; }
Retrieves the source code file name from an StrackTraceElement