public static String formatAsStackTraceElement ( InjectionPoint ij ) { Member member ; if ( ij . getAnnotated ( ) instanceof AnnotatedField ) { AnnotatedField < ? > annotatedField = ( AnnotatedField < ? > ) ij . getAnnotated ( ) ; member = annotatedField . getJavaMember ( ) ; } else if ( ij . getAnnotated ( ) instanceof AnnotatedParameter < ? > ) { AnnotatedParameter < ? > annotatedParameter = ( AnnotatedParameter < ? > ) ij . getAnnotated ( ) ; member = annotatedParameter . getDeclaringCallable ( ) . getJavaMember ( ) ; } else { // Not throwing an exception, because this method is invoked when an exception is already being thrown. // Throwing an exception here would hide the original exception. return "-" ; } return formatAsStackTraceElement ( member ) ; }
See also WELD - 1454 .