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

Don't return null for non-nullable Blobs in Java #935

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

DanielKamkha
Copy link
Contributor

@DanielKamkha DanielKamkha commented Jun 1, 2021

Updated JNI conversion function for non-nullable Blobs to avoid returning null when the C++ function returns a null
shared pointer.

Having a null shared pointer coming from C++ when the type is specified as non-nullable in the IDL is a violation of
contract. The correct fix for this issue would be to change Blob representation from shared_ptr<vector> to something
that cannot be null. However, this would be a breaking change, so it has to be done later (#934). For now it's just
the small JNI workaround.

Resolves: #929
Signed-off-by: Daniel Kamkha [email protected]

Updated JNI conversion function for non-nullable Blobs to avoid returning `null` when the C++ function returns a null
shared pointer.

Having a null shared pointer coming from C++ when the type is specified as non-nullable in the IDL is a violation of
contract. The correct fix for this issue would be to change `Blob` representation from `shared_ptr<vector>` to something
that cannot be `null`. However, this would be a breaking change, so it has to be done later (#934). For now it's just
the small JNI workaround.

Resolves: #929
Signed-off-by: Daniel Kamkha <[email protected]>
@DanielKamkha DanielKamkha added bug Something isn't working java labels Jun 1, 2021
@DanielKamkha DanielKamkha requested a review from Hsilgos June 1, 2021 09:27
@DanielKamkha DanielKamkha self-assigned this Jun 1, 2021
@DanielKamkha DanielKamkha merged commit 134cbce into master Jun 1, 2021
@DanielKamkha DanielKamkha deleted the java-nullable-blobs branch June 1, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working java
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect conversion in JNI for non-nullable built-in Blob type
2 participants