[Java.Interop] Map nullable byte jagged arrays to java.lang.Byte#12113
Draft
simonrozsival wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0e043be9-9070-43bc-aea4-a48438690bdf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0e043be9-9070-43bc-aea4-a48438690bdf
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
byte?as a managed-to-JNI signature alias ofsbyte?forjava/lang/Bytein the reflection type manager built-insjava/lang/Byteassbyte?Experiment evidence
Before this change, legacy reverse signature lookup had no built-in entry for
System.Byte?. Looking upbyte?[][]orbyte?[][][]therefore failed, andJNIEnv.NewArray()fell back tojava.lang.Object[][]/java.lang.Object[][][]. The element values still round-tripped. The trimmable manager already returned the intended[[Ljava/lang/Byte;and[[[Ljava/lang/Byte;signatures.Behavior change
Legacy
byte?reverse lookup now shares the existing nullable signed-byte JNI signature, producing exactjava.lang.Bytearray classes at ranks 2 and 3. Primitivebyte/sbytebehavior, Java-to-managedsbyte?canonicalization, and collection roots are unchanged.Tests
dotnet test tests/Java.Interop-Tests/Java.Interop-Tests.csproj --filter FullyQualifiedName~JniTypeManagerTests(6 passed; supplied installed JDK paths)