RFR: 7903877: jextract exception handling in downcall wrappers

Jorn Vernee jvernee at openjdk.org
Mon Apr 28 13:31:04 UTC 2025


On Wed, 23 Apr 2025 16:27:10 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

> Can I please get a review for this patch to improve the exception handling in downcall wrappers, if the exception is reachable then throwing an exception is better than catching an exception and turning them into an `AssertionError`.
> 
> TIA

test/jtreg/generator/reachableException/TestReachableException.java line 106:

> 104:             Class<?> exceptionClass = future.get(5, TimeUnit.SECONDS);
> 105:             assertEquals(WrongThreadException.class, exceptionClass,
> 106:                     "Exception should be WrongThreadException, not wrapped in AssertionError");

Isn't this already checked by `testWrongThreadAccess`?

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

PR Review Comment: https://git.openjdk.org/jextract/pull/282#discussion_r2063661539


More information about the jextract-dev mailing list