On Tue, 1 Jul 2025 04:57:05 GMT, Manukumar V S <m...@openjdk.org> wrote:
> Issue: > javax/swing/JComboBox/bug4276920.java unnecessarily throws Error instead of > RuntimeException whenever a test failure occurs. > This causes unnecessary extra attention in CI systems and triggers task > failures as throwing an Error will write the error message to System.err and > the CI system will detect it as an 'Error' and fails the task eventually. > But this is just a normal test failure only and just need to throw > 'RuntimeException' and no need to throw an 'Error'. > > Fix: > Replace 'Error' with 'RuntimeException' > > Testing: > Tested using mach5 in all the available platforms. > Tested manually the negative (failure) condition also and verified that its > throwing 'RuntimeException' in cases of failure. This was an unnecessary change. The CI task failed for different reason, it timed out. Yet the task displayed the error message from the javax/swing/JComboBox/bug4276920.java test failure, which happened to be the first string that contained `Error:` prefix. There's nothing wrong with throwing `Error` instead of `RuntimeException` to fail a test, although the latter is much more common. I even find `Error` more descriptive, and it's shorter. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26056#issuecomment-3053768610