-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(java): invalid collections returned with non-class elements (#1197)
The Java runtime for jsii used to not be able to necessarily hold the type information necessary to correctly process the contents of collections, as the generic information is lost. In order to address this, introduced a new `NativeType<T>` class that is able to carry: 1. The actual declared type of the value (via generic type parameter) 2. The raw type of the value (reified) 3. The correct JavaType to pass to Jackson to obtain the correct result It also preserves the specific behavior around de-serialization of `JsiiObject` sub-classes as well as jsii interfaces, correctly requesting de-serialization as the `JsiiObject` class, and in a second phase `transform` this into the correct value type as needed. Introduced a new test that validates the `List<T>` and `Map<String, T>` values received from `node` are deserialized to instances with the appropriate content type. Fixes #1196
- Loading branch information
1 parent
2652043
commit bbc2302
Showing
79 changed files
with
1,338 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.