Skip to content

Removing the implementation from the stack trace may result in an IllegalArgumentException #138

@jamezp

Description

@jamezp

If a Throwable.getStackTrace() returns a 0 length array, the _copyStackTraceMinusOne will throw an IllegalArgumentException.

The generated method looks like:

private static void _copyStackTraceMinusOne(final Throwable e) {
    final StackTraceElement[] st = e.getStackTrace();
    e.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
}

If the st variable is a 0 length array an exception will be thrown. This can happen with a setting like -XX:-StackTraceInThrowable where adding the stack trace to throwables is disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions