Skip to content

[Java.Interop] Fix JNI signature generating #248

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

Closed

Conversation

radekdoulik
Copy link
Member

Commit
cb161d2
introduced a regression described in
dotnet/android#1149 (comment)

The signature of the InitializeCreator method was wrongly calculated
as ()Ljava/lang/Object; instead of original
()Lmd59b7a7576784821ea63294fbca8600da1/Creator_1;

The reason for that is, that
cb161d2#diff-9e153905b02dbe50c0e0b874ba40bf3eR262
started using IEnumerable<T>::OfType<T>, which traverses
inheritance, unlike the original Type::GetCustomAttributes called
with inherit = false.

Thus for the Creator<Player> we got the RegisterAttribute from the
parent type Java.Lang.Object which led to non-null result from
ToJniNameFromAttributes method. At the end the result was used here
cb161d2#diff-9e153905b02dbe50c0e0b874ba40bf3eR361
instead of returning ToJniName (type, exportKind) result.

Commit
dotnet@cb161d2
introduced a regression described in
dotnet/android#1149 (comment)

The signature of the `InitializeCreator` method was wrongly calculated
as `()Ljava/lang/Object;` instead of original
`()Lmd59b7a7576784821ea63294fbca8600da1/Creator_1;`

The reason for that is, that
dotnet@cb161d2#diff-9e153905b02dbe50c0e0b874ba40bf3eR262
started using `IEnumerable<T>::OfType<T>`, which traverses
inheritance, unlike the original `Type::GetCustomAttributes` called
with `inherit = false`.

Thus for the `Creator<Player>` we got the `RegisterAttribute` from the
parent type `Java.Lang.Object` which led to non-null result from
`ToJniNameFromAttributes` method. At the end the result was used here
dotnet@cb161d2#diff-9e153905b02dbe50c0e0b874ba40bf3eR361
instead of returning `ToJniName (type, exportKind)` result.
@radekdoulik radekdoulik requested a review from jonpryor January 8, 2018 23:19
@jonpryor
Copy link
Member

jonpryor commented Jan 9, 2018

Commit from master cherry-picked as eb6e3c4.

@jonpryor jonpryor closed this Jan 9, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants