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

Try dotnet/java-interop#1323 #9921

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

jonpryor
Copy link
Member

Context: dotnet/java-interop#1323
Context: #9862 (comment)

Does It Build™?

(The expectation is that it does build -- only unit tests are changed in dotnet/java-interop#1323 -- but that the new
JniRuntimeJniValueManagerContract.cs.CreatePeer_ReplaceableDoesNotReplace() test will fail.)`

Context: dotnet/java-interop#1323
Context: #9862 (comment)

Does It Build™?

(The expectation is that it *does* build -- only unit tests are changed
in dotnet/java-interop#1323 -- but that the new
`JniRuntimeJniValueManagerContract.cs.CreatePeer_ReplaceableDoesNotReplace()`
test will fail.)`
@jonpryor jonpryor force-pushed the dev/jonp/jonp-try-ji-1323 branch from e67229e to d6e0e7d Compare April 4, 2025 19:13
@jonpryor
Copy link
Member Author

jonpryor commented Apr 4, 2025

So I expected JniRuntimeJniValueManagerContract.CreatePeer_ReplaceableDoesNotReplace() to fail, but it failed for the wrong reason:

Expected peer1.JniManagedPeerState to have .Replaceable, but was None.

Further investigation was because we weren't hitting this line:

result.SetJniManagedPeerState (JniManagedPeerStates.Replaceable | JniManagedPeerStates.Activatable);

because Runtime.IsGCUserPeer() returned false, because AnotherJavaInterfaceImpl.java does not implement GCUserPeerable.

Okay, fair.

What I no longer remember -- and thus need to dig around for -- is why we're "protect" setting .Replacable with IsGCUserPeer(). Offhand, this feels like something we could always do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant