Skip to content

Commit 1bcfcc5

Browse files
authored
[Java.Interop] JniType.RegisterNativeMethods() is public (#214)
Context: dotnet/android#1027 Context: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/2048/ Commit 7d51163 changed the visibility of `JniType.RegisterNativeMethods()` from `public` to `internal`, in an effort to reduce the likelihood of "user error" from calling `JNIEnv::RegisterNatives()` multiple times, as `JNIEnv::RegisterNatives()` invocations are *replacements*, not "additive"; calling it more than once is *generally* Wrong™. *Unfortunately*, `JniType.RegisterNativeMethods()` is part of the public and shipping API, so we can't remove it, as seen in the [xamarin-android PR build][pr2048] output: [pr2048]: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/2048/consoleText ABI BREAK IN: Java.Interop.dll <!-- start namespace Java.Interop --> <div> <h2>Namespace Java.Interop</h2> <!-- start type JniType --> <div> <h3>Type Changed: Java.Interop.JniType</h3> <p>Removed method:</p> <pre> <span class='removed removed-method breaking' data-is-breaking>public void RegisterNativeMethods (JniNativeMethodRegistration[]);</span> </pre> Revert the visibility of `JniType.RegisterNativeMethods()` to `public`, so that we don't break API compatibility.
1 parent a9379f7 commit 1bcfcc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Java.Interop/Java.Interop/JniType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public bool IsInstanceOfType (JniObjectReference value)
135135
JniNativeMethodRegistration[] methods;
136136
#pragma warning restore 0414
137137

138-
internal void RegisterNativeMethods (params JniNativeMethodRegistration[] methods)
138+
public void RegisterNativeMethods (params JniNativeMethodRegistration[] methods)
139139
{
140140
AssertValid ();
141141

0 commit comments

Comments
 (0)