Integrated: 8366264: tools/javac/launcher/SourceLauncherStackTraceTest.java does not cover the scenario for 8362237

Chen Liang liach at openjdk.org
Sat Aug 30 14:06:46 UTC 2025


On Thu, 28 Aug 2025 17:34:31 GMT, Chen Liang <liach at openjdk.org> wrote:

> In #26601, I moved a test case to create a traceless exception for the source launcher that depended on C2 behaviors to a separate test with compiler flags. However, that move is incorrect: to reproduce the issue, the cause exception must have no trace while the InvocationTargetException does. My migrated test blindly turned off stack traces for all exceptions, which is not the intended scenario.
> 
> I found that in Java 7, Throwable, Exception, Error, and RuntimeException get new constructors that allow specifying suppression and trace filling behaviors. We can use that constructor to prohibit stack traces for the cause while preserving the trace for the InvocationTargetException.
> 
> Testing: Running the single source file on Java 24 and getting the array copy IAE (ensure it is a valid reproducer), and running the test to ensure the new case passes.

This pull request has now been integrated.

Changeset: 0e739931
Author:    Chen Liang <liach at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/0e7399318b6c33c03a72ed1fdfb671f8cd9342a3
Stats:     108 lines in 2 files changed: 24 ins; 84 del; 0 mod

8366264: tools/javac/launcher/SourceLauncherStackTraceTest.java does not cover the scenario for 8362237

Reviewed-by: cstein, jlahoda

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

PR: https://git.openjdk.org/jdk/pull/26993


More information about the compiler-dev mailing list