Buggy code:
public class ExceptionUtils { static final String WRAPPED_MARKER = "<seq2seq4repair_space>[wrapped]<seq2seq4repair_space>" ; private static final String [ ] CAUSE_METHOD_NAMES = new String [ ] { "getCause" , "getNextException" , "getTargetException" , "getException" , "getSourceException" , "getRootCause" , "getCausedByException" , "getNested" , "getLinkedException" , "getNestedException" , "getLinkedCause" , "getThrowable" } ; public ExceptionUtils ( ) { } @ Deprecated public static String [ ] getDefaultCauseMethodNames ( ) { } @ Deprecated public static Throwable getCause ( Throwable throwable ) { } @ Deprecated public static Throwable getCause ( Throwable throwable , String [ ] methodNames ) { } public static Throwable getRootCause ( Throwable throwable ) { } private static Throwable getCauseUsingMethodName ( Throwable throwable , String methodName ) { } public static int getThrowableCount ( Throwable throwable ) { } public static Throwable [ ] getThrowables ( Throwable throwable ) { } public static List < Throwable > getThrowableList ( Throwable throwable ) { } public static int indexOfThrowable ( Throwable throwable , Class < ? > clazz ) { } public static int indexOfThrowable ( Throwable throwable , Class < ? > clazz , int fromIndex ) { } public static int indexOfType ( Throwable throwable , Class < ? > type ) { } public static int indexOfType ( Throwable throwable , Class < ? > type , int fromIndex ) { } private static int indexOf ( Throwable throwable , Class < ? > type , int fromIndex , boolean subclass ) { } public static void printRootCauseStackTrace ( Throwable throwable ) { } public static void printRootCauseStackTrace ( Throwable throwable , PrintStream stream ) { } public static void printRootCauseStackTrace ( Throwable throwable , PrintWriter writer ) { } public static String [ ] getRootCauseStackTrace ( Throwable throwable ) { if ( throwable == null ) { return ArrayUtils . EMPTY_STRING_ARRAY ; } Throwable [ ] throwables = ExceptionUtils . getThrowables ( throwable ) ; int count = throwables . length ; List < String > frames = new ArrayList < String > ( ) ; List < String > nextTrace = ExceptionUtils . getStackFrameList ( throwables [ ( count - 1 ) ] ) ; for ( int i = count ; ( -- i ) >= 0 ; ) { List < String > trace = nextTrace ; if ( i != 0 ) { nextTrace = ExceptionUtils . getStackFrameList ( throwables [ ( i - 1 ) ] ) ; ExceptionUtils . removeCommonFrames ( trace , nextTrace ) ; } if ( i == ( count - 1 ) ) { frames . add ( throwables [ i ] . toString ( ) ) ; } else { frames . add ( ( ( ExceptionUtils . WRAPPED_MARKER ) + ( throwables [ i ] . toString ( ) ) ) ) ; } for ( int j = 0 ; j < ( trace . size ( ) ) ; j ++ ) { frames . add ( trace . get ( j ) ) ; } } <START_BUG> return frames . toArray ( new String [ 0 ] ) ; <END_BUG> } public static void removeCommonFrames ( List < String > causeFrames , List < String > wrapperFrames ) { } public static String getStackTrace ( Throwable throwable ) { } public static String [ ] getStackFrames ( Throwable throwable ) { } static String [ ] getStackFrames ( String stackTrace ) { } static List < String > getStackFrameList ( Throwable t ) { } public static String getMessage ( Throwable th ) { } public static String getRootCauseMessage ( Throwable th ) { } }

Fix:
return frames . toArray ( new String [ frames . size ( ) ] ) ;