Include event type in visitor name #2091
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This commit fixes event visitor method generation by including the event type
in the visitor name. Note that event type here is actually the member name in
the encompassing eventstream structure, not the Java class of the event.
For example, in the example below, "Foo" is the event type.
To ensure that this change is backwards compatible with existing services that
have event streams (Transcribe Streaming and Kinesis), we also include a
customization to supress this behavior keep the method name as "visit".
Note that by sheer luck, the existing consumer method setters, e.g.
are unaffected by this change. See an example here.
The previous generation scheme for these methods is "on{Generation Java class
name for event shape}"; now it's "on{event type}". However, both Transcribe and
Kinesis use the shape name as the member name (or vise versa?) in their current
iteration of their event streams.
For example, in Kinesis, SubscribeToShard's output stream is defined as
Motivation and Context
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsLicense