Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mapping of generic thrown exception types #4813

Merged
merged 4 commits into from
Dec 25, 2024

Conversation

jkschneider
Copy link
Member

What's changed?

Widened the type of JavaType.Method#thrownExceptions to JavaType to support the mapping of generic exceptions.

A method that throws a combination of a generic and non-generic exception looks like this:

interface Test {
   <T extends FileNotFoundException> void throwsGenericException() throws T, InterruptedException;
}

Its JVMS 4.3.4 signature is:

<T:Ljava/io/FileNotFoundException;>()V^TT;^Ljava/lang/InterruptedException;

What's your motivation?

Preparing the way for compile verification as a post-recipe task.

Anything in particular you'd like reviewers to focus on?

Should be LST deserialization compatible, but this is an ABI change and we should release workers and CLI ASAP. Old serialized LSTs will not have mapped generic exceptions correctly. They instead previously mapped the class bound (in the example above java.io.FileNotFoundException.

Checklist

  • I've added unit tests to cover both positive and negative cases

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

@jkschneider jkschneider merged commit 15740e4 into main Dec 25, 2024
2 checks passed
@jkschneider jkschneider deleted the generic-thrown-exception-types branch December 25, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant