RFR: 8362237: IllegalArgumentException in the launcher when exception without stack trace is thrown

Kevin Rushforth kcr at openjdk.org
Fri Aug 1 11:00:55 UTC 2025


On Tue, 15 Jul 2025 12:46:27 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> Please review this change introducing a range check before pruning
>> stacktrace elements in source launch mode. Additional `null`-checks
>> are also added to this change set.
>
> I wonder when and why the exception-handling code moved from `InvocationTargetException::getTargetException` to `InvocationTargetException::getCause`? 🤔
> 
> Ah, API documentation of [InvocationTargetException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/reflect/InvocationTargetException.html#getTargetException()) to the rescue:
> 
>> API Note:
> This method predates the general-purpose exception chaining facility. The [Throwable.getCause()](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Throwable.html#getCause()) method is now the preferred means of obtaining this information.

@sormuras Do you intend to integrate this?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26315#issuecomment-3114668209


More information about the compiler-dev mailing list