-
Notifications
You must be signed in to change notification settings - Fork 56
[Java.Runtime.Environment] don't call PeekPeer()
inside AddPeer()
#1329
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
Conversation
Context: dotnet/android#10004 This breaks the "replaceable" logic otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the call to PeekPeer inside AddPeer to fix issues with the "replaceable" logic in the Java runtime environment.
- Removed PeekPeer check from MonoRuntimeValueManager.cs
- Removed PeekPeer check from ManagedValueManager.cs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Java.Runtime.Environment/Java.Interop/MonoRuntimeValueManager.cs | Removed PeekPeer call from AddPeer to prevent premature return when a duplicate peer is encountered. |
src/Java.Runtime.Environment/Java.Interop/ManagedValueManager.cs | Removed PeekPeer check from AddPeer, aligning with the updated logic to support replaceable peers. |
/azp run |
No pipelines are associated with this pull request. |
This could use a test. dotnet/android#10004 notes behavior around "replaceable" values. What somewhat confuses me about this is #1323 also attempted to test replaceable values, and did not need any changes within dotnet/java-interop to pass. Meanwhile, the tests failed under dotnet/android#9921, for reasons I haven't gotten a chance to investigate. Is the test in #1323 incorrect or insufficient? Are we hitting a different corner case around "replaceable" values? The explanation in this PR also leaves me wanting:
How does this break "replaceable" logic? Especially considering this existing test, which attempts to assert that duplicate java-interop/tests/Java.Interop-Tests/Java.Interop/JniRuntimeJniValueManagerContract.cs Lines 67 to 77 in 7b7ae83
The existing test passes, but why? I wonder if we're now getting a
|
I do need to revisit what's happening this repo (java.interop) & the test above, but on the dotnet/android side:
java-interop/src/Java.Runtime.Environment/Java.Interop/ManagedValueManager.cs Lines 60 to 62 in 7b7ae83
So, I think this one we could merge, as a test caught it and is fixed by the change: Further investigation & test changes needed on this PR. |
I believe that this has been superseded by #1323, which also removes the |
Context: dotnet/android#10004
This breaks the "replaceable" logic otherwise.