From 8e18c9092c7cd6f3ec9477ba9da9d41c0d05fb9e Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Tue, 25 Oct 2022 11:23:28 -0500 Subject: [PATCH] [generator] Avoid C#11 delegate cache overhead. (#1053) Fixes: https://github.com/xamarin/java.interop/issues/1034 Context: https://github.com/dotnet/roslyn/issues/62832#issuecomment-1198456455 Context: Context: https://github.com/xamarin/xamarin-android/commit/938b2cbe2f64a0ec0e5984cb59321e05d9db7de7 [The C#11 compiler was updated][0] so that "method group conversions" are now cached: > The C# 11 compiler caches the delegate object created from a method > group conversion and reuses that single delegate object. Our marshal method infrastructure uses method group conversions, e.g. the cast to `(_JniMarshal_PP_L)` is a method group conversion: static Delegate GetGetActionBarHandler () { if (cb_getActionBar == null) cb_getActionBar = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetActionBar); return cb_getActionBar; } This C# 11 compiler change resulted in `Mono.Android.dll` and .NET Android apps being ~4.5% *larger*. This was worked around in xamarin/xamarin-android@938b2cbe by setting `$(LangVersion)`=10 (i.e. "don't use C# 11"). Update `generator` output to avoid use of method group conversion for delegate types. This allows us to use C# 11 without increasing the size of `Mono.Android.dll` and .NET Android apps: static Delegate GetGetActionBarHandler () { if (cb_getActionBar == null) cb_getActionBar = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetActionBar)); return cb_getActionBar; } [0]: https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#improved-method-group-conversion-to-delegate --- .../WriteDuplicateInterfaceEventArgs.txt | 4 +- .../WriteInterfaceRedeclaredDefaultMethod.txt | 43 +++++++++++-------- .../XAJavaInterop1-NRT/WriteClass.txt | 18 ++++---- .../XAJavaInterop1-NRT/WriteInterface.txt | 18 ++++---- .../WriteMethodWithCharSequenceArrays.txt | 2 +- .../XAJavaInterop1/WriteClass.txt | 18 ++++---- .../WriteDefaultInterfaceMethodInvoker.txt | 4 +- .../XAJavaInterop1/WriteInterface.txt | 18 ++++---- .../WriteInterfaceDefaultMethod.txt | 2 +- .../WriteInterfaceDefaultProperty.txt | 4 +- ...riteInterfaceDefaultPropertyGetterOnly.txt | 2 +- .../WriteInterfaceRedeclaredDefaultMethod.txt | 2 +- .../WriteMethodWithCharSequenceArrays.txt | 2 +- .../WriteNestedInterfaceClass.txt | 2 +- .../WriteNestedInterfaceTypes.txt | 4 +- .../WriteUnnestedInterfaceTypes.txt | 4 +- .../Xamarin.Test.BasePublicClass.cs | 2 +- .../Xamarin.Test.ExtendPublicClass.cs | 2 +- .../Xamarin.Test.IExtendedInterface.cs | 4 +- .../Xamarin.Test.PublicClass.cs | 4 +- .../AccessModifiers/Xamarin.Test.TestClass.cs | 2 +- .../Adapters/Xamarin.Test.AbsSpinner.cs | 4 +- .../Adapters/Xamarin.Test.AdapterView.cs | 4 +- .../Xamarin.Test.GenericReturnObject.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 4 +- .../CSharpKeywords/Java.Lang.Throwable.cs | 2 +- .../Xamarin.Test.CSharpKeywords.cs | 2 +- .../Core_Jar2Xml/Android.Text.ISpannable.cs | 2 +- .../Core_Jar2Xml/Android.Text.ISpanned.cs | 2 +- .../Android.Text.SpannableString.cs | 2 +- .../Android.Text.SpannableStringInternal.cs | 2 +- .../Core_Jar2Xml/Android.Views.View.cs | 8 ++-- ...e.Android.Exoplayer.Drm.IExoMediaCrypto.cs | 2 +- ...ogle.Android.Exoplayer.Drm.IExoMediaDrm.cs | 4 +- .../Xamarin.Test.II1.cs | 2 +- .../Xamarin.Test.II2.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 2 +- .../Xamarin.Test.SomeObject2.cs | 4 +- .../Xamarin.Test.NotificationCompatBase.cs | 2 +- .../NormalMethods/Xamarin.Test.A.cs | 4 +- .../NormalMethods/Xamarin.Test.C.cs | 2 +- .../NormalMethods/Xamarin.Test.SomeObject.cs | 18 ++++---- .../Xamarin.Test.SomeObject.cs | 12 +++--- .../ParameterXPath/Xamarin.Test.A.cs | 4 +- .../Streams/Java.IO.FilterOutputStream.cs | 2 +- .../Streams/Java.IO.IOException.cs | 2 +- .../Streams/Java.IO.InputStream.cs | 18 ++++---- .../Streams/Java.IO.OutputStream.cs | 10 ++--- .../Streams/Java.Lang.Throwable.cs | 2 +- .../TestInterface/ClassWithoutNamespace.cs | 2 +- .../IInterfaceWithoutNamespace.cs | 2 +- .../Test.ME.GenericImplementation.cs | 2 +- ....ME.GenericObjectPropertyImplementation.cs | 4 +- .../Test.ME.GenericStringImplementation.cs | 2 +- ....ME.GenericStringPropertyImplementation.cs | 4 +- .../Test.ME.IGenericInterface.cs | 2 +- .../Test.ME.IGenericPropertyInterface.cs | 4 +- .../TestInterface/Test.ME.ITestInterface.cs | 6 +-- .../Test.ME.TestInterfaceImplementation.cs | 6 +-- .../java.lang.Enum/Java.Lang.IComparable.cs | 2 +- .../generator/SourceWriters/MethodCallback.cs | 2 +- 61 files changed, 167 insertions(+), 158 deletions(-) diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteDuplicateInterfaceEventArgs.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteDuplicateInterfaceEventArgs.txt index 6aa591629..9f3b880f5 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteDuplicateInterfaceEventArgs.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteDuplicateInterfaceEventArgs.txt @@ -71,7 +71,7 @@ internal partial class AnimatorListenerInvoker : global::Java.Lang.Object, Anima static Delegate GetOnAnimationEnd_IHandler () { if (cb_OnAnimationEnd_I == null) - cb_OnAnimationEnd_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_Z) n_OnAnimationEnd_I); + cb_OnAnimationEnd_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_Z (n_OnAnimationEnd_I)); return cb_OnAnimationEnd_I; } @@ -97,7 +97,7 @@ internal partial class AnimatorListenerInvoker : global::Java.Lang.Object, Anima static Delegate GetOnAnimationEnd_IIHandler () { if (cb_OnAnimationEnd_II == null) - cb_OnAnimationEnd_II = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPII_Z) n_OnAnimationEnd_II); + cb_OnAnimationEnd_II = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPII_Z (n_OnAnimationEnd_II)); return cb_OnAnimationEnd_II; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceRedeclaredDefaultMethod.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceRedeclaredDefaultMethod.txt index 9fad896a3..dd73ded38 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceRedeclaredDefaultMethod.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceRedeclaredDefaultMethod.txt @@ -4,42 +4,49 @@ public partial interface IMyInterface2 : java.code.IMyInterface { // Metadata.xml XPath method reference: path="/api/package[@name='java.code']/interface[@name='IMyInterface']/method[@name='DoSomething' and count(parameter)=0]" [Register ("DoSomething", "()V", "GetDoSomethingHandler:java.code.IMyInterface2Invoker, MyAssembly")] void DoSomething (); - + } + [global::Android.Runtime.Register ("java/code/IMyInterface2", DoNotGenerateAcw=true)] internal partial class IMyInterface2Invoker : global::Java.Lang.Object, IMyInterface2 { - static readonly JniPeerMembers _members = new JniPeerMembers ("java/code/IMyInterface2", typeof (IMyInterface2Invoker)); - + static readonly JniPeerMembers _members = new XAPeerMembers ("java/code/IMyInterface2", typeof (IMyInterface2Invoker)); + static IntPtr java_class_ref { get { return _members.JniPeerType.PeerReference.Handle; } } - + + [global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)] + [global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)] public override global::Java.Interop.JniPeerMembers JniPeerMembers { get { return _members; } } - + + [global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)] + [global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)] protected override IntPtr ThresholdClass { get { return class_ref; } } - + + [global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)] + [global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::System.Type ThresholdType { get { return _members.ManagedPeerType; } } - + IntPtr class_ref; - + public static IMyInterface2 GetObject (IntPtr handle, JniHandleOwnership transfer) { return global::Java.Lang.Object.GetObject (handle, transfer); } - + static IntPtr Validate (IntPtr handle) { if (!JNIEnv.IsInstanceOf (handle, java_class_ref)) - throw new InvalidCastException (string.Format ("Unable to convert instance of type '{0}' to type '{1}'.", JNIEnv.GetClassNameFromInstance (handle), "java.code.IMyInterface2")); + throw new InvalidCastException ($"Unable to convert instance of type '{JNIEnv.GetClassNameFromInstance (handle)}' to type 'java.code.IMyInterface2'."); return handle; } - + protected override void Dispose (bool disposing) { if (this.class_ref != IntPtr.Zero) @@ -47,28 +54,30 @@ internal partial class IMyInterface2Invoker : global::Java.Lang.Object, IMyInter this.class_ref = IntPtr.Zero; base.Dispose (disposing); } - + public IMyInterface2Invoker (IntPtr handle, JniHandleOwnership transfer) : base (Validate (handle), transfer) { IntPtr local_ref = JNIEnv.GetObjectClass (((global::Java.Lang.Object) this).Handle); this.class_ref = JNIEnv.NewGlobalRef (local_ref); JNIEnv.DeleteLocalRef (local_ref); } - + static Delegate cb_DoSomething; - #pragma warning disable 0169 +#pragma warning disable 0169 static Delegate GetDoSomethingHandler () { if (cb_DoSomething == null) - cb_DoSomething = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_DoSomething); + cb_DoSomething = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_DoSomething)); return cb_DoSomething; } + static void n_DoSomething (IntPtr jnienv, IntPtr native__this) { var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.DoSomething (); } - #pragma warning restore 0169 +#pragma warning restore 0169 + IntPtr id_DoSomething; public unsafe void DoSomething () { @@ -76,5 +85,5 @@ internal partial class IMyInterface2Invoker : global::Java.Lang.Object, IMyInter id_DoSomething = JNIEnv.GetMethodID (class_ref, "DoSomething", "()V"); JNIEnv.CallVoidMethod (((global::Java.Lang.Object) this).Handle, id_DoSomething); } - + } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteClass.txt index dcf38f05d..e75b6c1aa 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteClass.txt @@ -54,7 +54,7 @@ public partial class MyClass { static Delegate Getget_CountHandler () { if (cb_get_Count == null) - cb_get_Count = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_Count); + cb_get_Count = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_Count)); return cb_get_Count; } @@ -70,7 +70,7 @@ public partial class MyClass { static Delegate Getset_Count_IHandler () { if (cb_set_Count_I == null) - cb_set_Count_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_Count_I); + cb_set_Count_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_Count_I)); return cb_set_Count_I; } @@ -110,7 +110,7 @@ public partial class MyClass { static Delegate Getget_KeyHandler () { if (cb_get_Key == null) - cb_get_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_get_Key); + cb_get_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_get_Key)); return cb_get_Key; } @@ -126,7 +126,7 @@ public partial class MyClass { static Delegate Getset_Key_Ljava_lang_String_Handler () { if (cb_set_Key_Ljava_lang_String_ == null) - cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_set_Key_Ljava_lang_String_); + cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_set_Key_Ljava_lang_String_)); return cb_set_Key_Ljava_lang_String_; } @@ -193,7 +193,7 @@ public partial class MyClass { static Delegate Getget_AbstractCountHandler () { if (cb_get_AbstractCount == null) - cb_get_AbstractCount = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_AbstractCount); + cb_get_AbstractCount = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_AbstractCount)); return cb_get_AbstractCount; } @@ -209,7 +209,7 @@ public partial class MyClass { static Delegate Getset_AbstractCount_IHandler () { if (cb_set_AbstractCount_I == null) - cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_AbstractCount_I); + cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_AbstractCount_I)); return cb_set_AbstractCount_I; } @@ -235,7 +235,7 @@ public partial class MyClass { static Delegate GetGetCountForKey_Ljava_lang_String_Handler () { if (cb_GetCountForKey_Ljava_lang_String_ == null) - cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetCountForKey_Ljava_lang_String_); + cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetCountForKey_Ljava_lang_String_)); return cb_GetCountForKey_Ljava_lang_String_; } @@ -269,7 +269,7 @@ public partial class MyClass { static Delegate GetKeyHandler () { if (cb_Key == null) - cb_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_Key); + cb_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_Key)); return cb_Key; } @@ -308,7 +308,7 @@ public partial class MyClass { static Delegate GetAbstractMethodHandler () { if (cb_AbstractMethod == null) - cb_AbstractMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_AbstractMethod); + cb_AbstractMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_AbstractMethod)); return cb_AbstractMethod; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt index 55be0a052..f22b66d41 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteInterface.txt @@ -135,7 +135,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getget_CountHandler () { if (cb_get_Count == null) - cb_get_Count = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_Count); + cb_get_Count = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_Count)); return cb_get_Count; } @@ -151,7 +151,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getset_Count_IHandler () { if (cb_set_Count_I == null) - cb_set_Count_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_Count_I); + cb_set_Count_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_Count_I)); return cb_set_Count_I; } @@ -184,7 +184,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getget_KeyHandler () { if (cb_get_Key == null) - cb_get_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_get_Key); + cb_get_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_get_Key)); return cb_get_Key; } @@ -200,7 +200,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getset_Key_Ljava_lang_String_Handler () { if (cb_set_Key_Ljava_lang_String_ == null) - cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_set_Key_Ljava_lang_String_); + cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_set_Key_Ljava_lang_String_)); return cb_set_Key_Ljava_lang_String_; } @@ -236,7 +236,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getget_AbstractCountHandler () { if (cb_get_AbstractCount == null) - cb_get_AbstractCount = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_AbstractCount); + cb_get_AbstractCount = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_AbstractCount)); return cb_get_AbstractCount; } @@ -252,7 +252,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getset_AbstractCount_IHandler () { if (cb_set_AbstractCount_I == null) - cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_AbstractCount_I); + cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_AbstractCount_I)); return cb_set_AbstractCount_I; } @@ -285,7 +285,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetGetCountForKey_Ljava_lang_String_Handler () { if (cb_GetCountForKey_Ljava_lang_String_ == null) - cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetCountForKey_Ljava_lang_String_); + cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetCountForKey_Ljava_lang_String_)); return cb_GetCountForKey_Ljava_lang_String_; } @@ -316,7 +316,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetKeyHandler () { if (cb_Key == null) - cb_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_Key); + cb_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_Key)); return cb_Key; } @@ -340,7 +340,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetAbstractMethodHandler () { if (cb_AbstractMethod == null) - cb_AbstractMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_AbstractMethod); + cb_AbstractMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_AbstractMethod)); return cb_AbstractMethod; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteMethodWithCharSequenceArrays.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteMethodWithCharSequenceArrays.txt index 5da373d95..2db53ca34 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteMethodWithCharSequenceArrays.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1-NRT/WriteMethodWithCharSequenceArrays.txt @@ -34,7 +34,7 @@ public partial class MyClass : Java.Lang.Object { static Delegate GetEcho_arrayLjava_lang_CharSequence_Handler () { if (cb_echo_arrayLjava_lang_CharSequence_ == null) - cb_echo_arrayLjava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_L) n_Echo_arrayLjava_lang_CharSequence_); + cb_echo_arrayLjava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_L (n_Echo_arrayLjava_lang_CharSequence_)); return cb_echo_arrayLjava_lang_CharSequence_; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt index 5d6379020..b99b83877 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt @@ -54,7 +54,7 @@ public partial class MyClass { static Delegate Getget_CountHandler () { if (cb_get_Count == null) - cb_get_Count = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_Count); + cb_get_Count = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_Count)); return cb_get_Count; } @@ -70,7 +70,7 @@ public partial class MyClass { static Delegate Getset_Count_IHandler () { if (cb_set_Count_I == null) - cb_set_Count_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_Count_I); + cb_set_Count_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_Count_I)); return cb_set_Count_I; } @@ -110,7 +110,7 @@ public partial class MyClass { static Delegate Getget_KeyHandler () { if (cb_get_Key == null) - cb_get_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_get_Key); + cb_get_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_get_Key)); return cb_get_Key; } @@ -126,7 +126,7 @@ public partial class MyClass { static Delegate Getset_Key_Ljava_lang_String_Handler () { if (cb_set_Key_Ljava_lang_String_ == null) - cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_set_Key_Ljava_lang_String_); + cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_set_Key_Ljava_lang_String_)); return cb_set_Key_Ljava_lang_String_; } @@ -193,7 +193,7 @@ public partial class MyClass { static Delegate Getget_AbstractCountHandler () { if (cb_get_AbstractCount == null) - cb_get_AbstractCount = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_AbstractCount); + cb_get_AbstractCount = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_AbstractCount)); return cb_get_AbstractCount; } @@ -209,7 +209,7 @@ public partial class MyClass { static Delegate Getset_AbstractCount_IHandler () { if (cb_set_AbstractCount_I == null) - cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_AbstractCount_I); + cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_AbstractCount_I)); return cb_set_AbstractCount_I; } @@ -235,7 +235,7 @@ public partial class MyClass { static Delegate GetGetCountForKey_Ljava_lang_String_Handler () { if (cb_GetCountForKey_Ljava_lang_String_ == null) - cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetCountForKey_Ljava_lang_String_); + cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetCountForKey_Ljava_lang_String_)); return cb_GetCountForKey_Ljava_lang_String_; } @@ -269,7 +269,7 @@ public partial class MyClass { static Delegate GetKeyHandler () { if (cb_Key == null) - cb_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_Key); + cb_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_Key)); return cb_Key; } @@ -308,7 +308,7 @@ public partial class MyClass { static Delegate GetAbstractMethodHandler () { if (cb_AbstractMethod == null) - cb_AbstractMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_AbstractMethod); + cb_AbstractMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_AbstractMethod)); return cb_AbstractMethod; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt index 80bbdcf77..664feeeec 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt @@ -12,7 +12,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static Delegate GetDoDefaultHandler () { if (cb_DoDefault == null) - cb_DoDefault = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_DoDefault); + cb_DoDefault = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_DoDefault)); return cb_DoDefault; } @@ -96,7 +96,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetDoDeclarationHandler () { if (cb_DoDeclaration == null) - cb_DoDeclaration = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_DoDeclaration); + cb_DoDeclaration = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_DoDeclaration)); return cb_DoDeclaration; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt index 80db984d0..b7bebab0a 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt @@ -135,7 +135,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getget_CountHandler () { if (cb_get_Count == null) - cb_get_Count = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_Count); + cb_get_Count = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_Count)); return cb_get_Count; } @@ -151,7 +151,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getset_Count_IHandler () { if (cb_set_Count_I == null) - cb_set_Count_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_Count_I); + cb_set_Count_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_Count_I)); return cb_set_Count_I; } @@ -184,7 +184,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getget_KeyHandler () { if (cb_get_Key == null) - cb_get_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_get_Key); + cb_get_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_get_Key)); return cb_get_Key; } @@ -200,7 +200,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getset_Key_Ljava_lang_String_Handler () { if (cb_set_Key_Ljava_lang_String_ == null) - cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_set_Key_Ljava_lang_String_); + cb_set_Key_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_set_Key_Ljava_lang_String_)); return cb_set_Key_Ljava_lang_String_; } @@ -236,7 +236,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getget_AbstractCountHandler () { if (cb_get_AbstractCount == null) - cb_get_AbstractCount = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_AbstractCount); + cb_get_AbstractCount = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_AbstractCount)); return cb_get_AbstractCount; } @@ -252,7 +252,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate Getset_AbstractCount_IHandler () { if (cb_set_AbstractCount_I == null) - cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_AbstractCount_I); + cb_set_AbstractCount_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_AbstractCount_I)); return cb_set_AbstractCount_I; } @@ -285,7 +285,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetGetCountForKey_Ljava_lang_String_Handler () { if (cb_GetCountForKey_Ljava_lang_String_ == null) - cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetCountForKey_Ljava_lang_String_); + cb_GetCountForKey_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetCountForKey_Ljava_lang_String_)); return cb_GetCountForKey_Ljava_lang_String_; } @@ -316,7 +316,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetKeyHandler () { if (cb_Key == null) - cb_Key = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_Key); + cb_Key = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_Key)); return cb_Key; } @@ -340,7 +340,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static Delegate GetAbstractMethodHandler () { if (cb_AbstractMethod == null) - cb_AbstractMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_AbstractMethod); + cb_AbstractMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_AbstractMethod)); return cb_AbstractMethod; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt index ef50cb158..89e07fbd7 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt @@ -8,7 +8,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static Delegate GetDoSomethingHandler () { if (cb_DoSomething == null) - cb_DoSomething = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_DoSomething); + cb_DoSomething = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_DoSomething)); return cb_DoSomething; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt index c10907ab8..64e36addf 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt @@ -8,7 +8,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static Delegate Getget_ValueHandler () { if (cb_get_Value == null) - cb_get_Value = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_Value); + cb_get_Value = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_Value)); return cb_get_Value; } @@ -24,7 +24,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static Delegate Getset_Value_IHandler () { if (cb_set_Value_I == null) - cb_set_Value_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_set_Value_I); + cb_set_Value_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_set_Value_I)); return cb_set_Value_I; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt index 595e6de5e..b926e6637 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt @@ -8,7 +8,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static Delegate Getget_ValueHandler () { if (cb_get_Value == null) - cb_get_Value = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_get_Value); + cb_get_Value = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_get_Value)); return cb_get_Value; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceRedeclaredDefaultMethod.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceRedeclaredDefaultMethod.txt index 76ebb857e..dd73ded38 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceRedeclaredDefaultMethod.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceRedeclaredDefaultMethod.txt @@ -67,7 +67,7 @@ internal partial class IMyInterface2Invoker : global::Java.Lang.Object, IMyInter static Delegate GetDoSomethingHandler () { if (cb_DoSomething == null) - cb_DoSomething = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_DoSomething); + cb_DoSomething = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_DoSomething)); return cb_DoSomething; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithCharSequenceArrays.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithCharSequenceArrays.txt index 5cd2726ff..e4d231b71 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithCharSequenceArrays.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithCharSequenceArrays.txt @@ -34,7 +34,7 @@ public partial class MyClass : Java.Lang.Object { static Delegate GetEcho_arrayLjava_lang_CharSequence_Handler () { if (cb_echo_arrayLjava_lang_CharSequence_ == null) - cb_echo_arrayLjava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_L) n_Echo_arrayLjava_lang_CharSequence_); + cb_echo_arrayLjava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_L (n_Echo_arrayLjava_lang_CharSequence_)); return cb_echo_arrayLjava_lang_CharSequence_; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt index 635d09f5e..f014926a4 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt @@ -102,7 +102,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static Delegate GetGetBarHandler () { if (cb_getBar == null) - cb_getBar = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetBar); + cb_getBar = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetBar)); return cb_getBar; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt index 1d9557528..680bc5e9b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt @@ -78,7 +78,7 @@ public partial interface IParent : IJavaObject, IJavaPeerable { static Delegate GetGetBarHandler () { if (cb_getBar == null) - cb_getBar = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetBar); + cb_getBar = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetBar)); return cb_getBar; } @@ -162,7 +162,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static Delegate GetGetBarHandler () { if (cb_getBar == null) - cb_getBar = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetBar); + cb_getBar = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetBar)); return cb_getBar; } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt index c434c906f..ecb9ce6d9 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt @@ -69,7 +69,7 @@ internal partial class IParentChildInvoker : global::Java.Lang.Object, IParentCh static Delegate GetGetBarHandler () { if (cb_getBar == null) - cb_getBar = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetBar); + cb_getBar = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetBar)); return cb_getBar; } @@ -162,7 +162,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static Delegate GetGetBarHandler () { if (cb_getBar == null) - cb_getBar = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetBar); + cb_getBar = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetBar)); return cb_getBar; } diff --git a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.BasePublicClass.cs b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.BasePublicClass.cs index 98fc38b2d..14081ca48 100644 --- a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.BasePublicClass.cs +++ b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.BasePublicClass.cs @@ -51,7 +51,7 @@ protected BasePublicClass (IntPtr javaReference, JniHandleOwnership transfer) : static Delegate GetBaseMethodHandler () { if (cb_baseMethod == null) - cb_baseMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_BaseMethod); + cb_baseMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_BaseMethod)); return cb_baseMethod; } diff --git a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs index b296b414a..30f0d1737 100644 --- a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs +++ b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs @@ -68,7 +68,7 @@ public unsafe ExtendPublicClass () : base (IntPtr.Zero, JniHandleOwnership.DoNot static Delegate GetFooHandler () { if (cb_foo == null) - cb_foo = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Foo); + cb_foo = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Foo)); return cb_foo; } diff --git a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.IExtendedInterface.cs b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.IExtendedInterface.cs index 0e2d1348c..28a75ad74 100644 --- a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.IExtendedInterface.cs +++ b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.IExtendedInterface.cs @@ -78,7 +78,7 @@ public IExtendedInterfaceInvoker (IntPtr handle, JniHandleOwnership transfer) : static Delegate GetExtendedMethodHandler () { if (cb_extendedMethod == null) - cb_extendedMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_ExtendedMethod); + cb_extendedMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_ExtendedMethod)); return cb_extendedMethod; } @@ -102,7 +102,7 @@ public unsafe void ExtendedMethod () static Delegate GetBaseMethodHandler () { if (cb_baseMethod == null) - cb_baseMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_BaseMethod); + cb_baseMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_BaseMethod)); return cb_baseMethod; } diff --git a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.PublicClass.cs b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.PublicClass.cs index 6673f267d..cf86b71ce 100644 --- a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.PublicClass.cs +++ b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.PublicClass.cs @@ -87,7 +87,7 @@ public IProtectedInterfaceInvoker (IntPtr handle, JniHandleOwnership transfer) : static Delegate GetFooHandler () { if (cb_foo == null) - cb_foo = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Foo); + cb_foo = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Foo)); return cb_foo; } @@ -158,7 +158,7 @@ public unsafe PublicClass () : base (IntPtr.Zero, JniHandleOwnership.DoNotTransf static Delegate GetFooHandler () { if (cb_foo == null) - cb_foo = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Foo); + cb_foo = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Foo)); return cb_foo; } diff --git a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.TestClass.cs b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.TestClass.cs index c15ed710e..b748cec51 100644 --- a/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.TestClass.cs +++ b/tests/generator-Tests/expected.xaji/AccessModifiers/Xamarin.Test.TestClass.cs @@ -68,7 +68,7 @@ public unsafe TestClass () : base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer static Delegate GetBaseMethodHandler () { if (cb_baseMethod == null) - cb_baseMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_BaseMethod); + cb_baseMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_BaseMethod)); return cb_baseMethod; } diff --git a/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AbsSpinner.cs b/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AbsSpinner.cs index bb31521ec..b4ab5efbf 100644 --- a/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AbsSpinner.cs +++ b/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AbsSpinner.cs @@ -51,7 +51,7 @@ protected AbsSpinner (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetGetAdapterHandler () { if (cb_getAdapter == null) - cb_getAdapter = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetAdapter); + cb_getAdapter = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetAdapter)); return cb_getAdapter; } @@ -67,7 +67,7 @@ static IntPtr n_GetAdapter (IntPtr jnienv, IntPtr native__this) static Delegate GetSetAdapter_Lxamarin_test_SpinnerAdapter_Handler () { if (cb_setAdapter_Lxamarin_test_SpinnerAdapter_ == null) - cb_setAdapter_Lxamarin_test_SpinnerAdapter_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetAdapter_Lxamarin_test_SpinnerAdapter_); + cb_setAdapter_Lxamarin_test_SpinnerAdapter_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetAdapter_Lxamarin_test_SpinnerAdapter_)); return cb_setAdapter_Lxamarin_test_SpinnerAdapter_; } diff --git a/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AdapterView.cs b/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AdapterView.cs index db349fec2..f9d006317 100644 --- a/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AdapterView.cs +++ b/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.AdapterView.cs @@ -52,7 +52,7 @@ protected AdapterView (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetGetAdapterHandler () { if (cb_getAdapter == null) - cb_getAdapter = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetAdapter); + cb_getAdapter = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetAdapter)); return cb_getAdapter; } @@ -68,7 +68,7 @@ static IntPtr n_GetAdapter (IntPtr jnienv, IntPtr native__this) static Delegate GetSetAdapter_Lxamarin_test_Adapter_Handler () { if (cb_setAdapter_Lxamarin_test_Adapter_ == null) - cb_setAdapter_Lxamarin_test_Adapter_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetAdapter_Lxamarin_test_Adapter_); + cb_setAdapter_Lxamarin_test_Adapter_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetAdapter_Lxamarin_test_Adapter_)); return cb_setAdapter_Lxamarin_test_Adapter_; } diff --git a/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.GenericReturnObject.cs b/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.GenericReturnObject.cs index 0d0033545..3e7c915be 100644 --- a/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.GenericReturnObject.cs +++ b/tests/generator-Tests/expected.xaji/Adapters/Xamarin.Test.GenericReturnObject.cs @@ -51,7 +51,7 @@ protected GenericReturnObject (IntPtr javaReference, JniHandleOwnership transfer static Delegate GetGenericReturnHandler () { if (cb_GenericReturn == null) - cb_GenericReturn = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GenericReturn); + cb_GenericReturn = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GenericReturn)); return cb_GenericReturn; } diff --git a/tests/generator-Tests/expected.xaji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.xaji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs index 8df1709a9..91c42c291 100644 --- a/tests/generator-Tests/expected.xaji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.xaji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs @@ -71,7 +71,7 @@ protected SomeObject (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetGetSomeColorHandler () { if (cb_getSomeColor == null) - cb_getSomeColor = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetSomeColor); + cb_getSomeColor = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetSomeColor)); return cb_getSomeColor; } @@ -87,7 +87,7 @@ static int n_GetSomeColor (IntPtr jnienv, IntPtr native__this) static Delegate GetSetSomeColor_IHandler () { if (cb_setSomeColor_I == null) - cb_setSomeColor_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_SetSomeColor_I); + cb_setSomeColor_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_SetSomeColor_I)); return cb_setSomeColor_I; } diff --git a/tests/generator-Tests/expected.xaji/CSharpKeywords/Java.Lang.Throwable.cs b/tests/generator-Tests/expected.xaji/CSharpKeywords/Java.Lang.Throwable.cs index d77835162..143653f06 100644 --- a/tests/generator-Tests/expected.xaji/CSharpKeywords/Java.Lang.Throwable.cs +++ b/tests/generator-Tests/expected.xaji/CSharpKeywords/Java.Lang.Throwable.cs @@ -29,7 +29,7 @@ internal static IntPtr class_ref { static Delegate GetGetMessageHandler () { if (cb_getMessage == null) - cb_getMessage = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetMessage); + cb_getMessage = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetMessage)); return cb_getMessage; } diff --git a/tests/generator-Tests/expected.xaji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs b/tests/generator-Tests/expected.xaji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs index 3ca30d858..bf086dc64 100644 --- a/tests/generator-Tests/expected.xaji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs +++ b/tests/generator-Tests/expected.xaji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs @@ -51,7 +51,7 @@ protected CSharpKeywords (IntPtr javaReference, JniHandleOwnership transfer) : b static Delegate GetUsePartial_IHandler () { if (cb_usePartial_I == null) - cb_usePartial_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_L) n_UsePartial_I); + cb_usePartial_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_L (n_UsePartial_I)); return cb_usePartial_I; } diff --git a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpannable.cs b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpannable.cs index 34f08bee7..c9a27a55b 100644 --- a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpannable.cs +++ b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpannable.cs @@ -70,7 +70,7 @@ public ISpannableInvoker (IntPtr handle, JniHandleOwnership transfer) : base (Va static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () { if (cb_getSpanFlags_Ljava_lang_Object_ == null) - cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetSpanFlags_Ljava_lang_Object_); + cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetSpanFlags_Ljava_lang_Object_)); return cb_getSpanFlags_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpanned.cs b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpanned.cs index ab995f700..2e841d9d9 100644 --- a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpanned.cs +++ b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.ISpanned.cs @@ -75,7 +75,7 @@ public ISpannedInvoker (IntPtr handle, JniHandleOwnership transfer) : base (Vali static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () { if (cb_getSpanFlags_Ljava_lang_Object_ == null) - cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetSpanFlags_Ljava_lang_Object_); + cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetSpanFlags_Ljava_lang_Object_)); return cb_getSpanFlags_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableString.cs b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableString.cs index 5fbfbf7df..7112e3d54 100644 --- a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableString.cs +++ b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableString.cs @@ -94,7 +94,7 @@ public unsafe SpannableString (string source) : base (IntPtr.Zero, JniHandleOwne static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () { if (cb_getSpanFlags_Ljava_lang_Object_ == null) - cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetSpanFlags_Ljava_lang_Object_); + cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetSpanFlags_Ljava_lang_Object_)); return cb_getSpanFlags_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableStringInternal.cs b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableStringInternal.cs index ee93439c0..fd16adf66 100644 --- a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableStringInternal.cs +++ b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Text.SpannableStringInternal.cs @@ -51,7 +51,7 @@ protected SpannableStringInternal (IntPtr javaReference, JniHandleOwnership tran static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () { if (cb_getSpanFlags_Ljava_lang_Object_ == null) - cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetSpanFlags_Ljava_lang_Object_); + cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetSpanFlags_Ljava_lang_Object_)); return cb_getSpanFlags_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Views.View.cs b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Views.View.cs index 8820fff51..61025fd12 100644 --- a/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Views.View.cs +++ b/tests/generator-Tests/expected.xaji/Core_Jar2Xml/Android.Views.View.cs @@ -87,7 +87,7 @@ public IOnClickListenerInvoker (IntPtr handle, JniHandleOwnership transfer) : ba static Delegate GetOnClick_Landroid_view_View_Handler () { if (cb_onClick_Landroid_view_View_ == null) - cb_onClick_Landroid_view_View_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_OnClick_Landroid_view_View_); + cb_onClick_Landroid_view_View_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_OnClick_Landroid_view_View_)); return cb_onClick_Landroid_view_View_; } @@ -169,7 +169,7 @@ protected View (IntPtr javaReference, JniHandleOwnership transfer) : base (javaR static Delegate GetSetOnClickListener_Landroid_view_View_OnClickListener_Handler () { if (cb_setOnClickListener_Landroid_view_View_OnClickListener_ == null) - cb_setOnClickListener_Landroid_view_View_OnClickListener_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetOnClickListener_Landroid_view_View_OnClickListener_); + cb_setOnClickListener_Landroid_view_View_OnClickListener_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetOnClickListener_Landroid_view_View_OnClickListener_)); return cb_setOnClickListener_Landroid_view_View_OnClickListener_; } @@ -200,7 +200,7 @@ public virtual unsafe void SetOnClickListener (global::Android.Views.View.IOnCli static Delegate GetSetOn123Listener_Landroid_view_View_OnClickListener_Handler () { if (cb_setOn123Listener_Landroid_view_View_OnClickListener_ == null) - cb_setOn123Listener_Landroid_view_View_OnClickListener_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetOn123Listener_Landroid_view_View_OnClickListener_); + cb_setOn123Listener_Landroid_view_View_OnClickListener_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetOn123Listener_Landroid_view_View_OnClickListener_)); return cb_setOn123Listener_Landroid_view_View_OnClickListener_; } @@ -231,7 +231,7 @@ public virtual unsafe void SetOn123Listener (global::Android.Views.View.IOnClick static Delegate GetAddTouchables_Ljava_util_ArrayList_Handler () { if (cb_addTouchables_Ljava_util_ArrayList_ == null) - cb_addTouchables_Ljava_util_ArrayList_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_AddTouchables_Ljava_util_ArrayList_); + cb_addTouchables_Ljava_util_ArrayList_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_AddTouchables_Ljava_util_ArrayList_)); return cb_addTouchables_Ljava_util_ArrayList_; } diff --git a/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaCrypto.cs b/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaCrypto.cs index e65e2b997..a70ceac36 100644 --- a/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaCrypto.cs +++ b/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaCrypto.cs @@ -74,7 +74,7 @@ public IExoMediaCryptoInvoker (IntPtr handle, JniHandleOwnership transfer) : bas static Delegate GetRequiresSecureDecoderComponent_Ljava_lang_String_Handler () { if (cb_requiresSecureDecoderComponent_Ljava_lang_String_ == null) - cb_requiresSecureDecoderComponent_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_Z) n_RequiresSecureDecoderComponent_Ljava_lang_String_); + cb_requiresSecureDecoderComponent_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_Z (n_RequiresSecureDecoderComponent_Ljava_lang_String_)); return cb_requiresSecureDecoderComponent_Ljava_lang_String_; } diff --git a/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs b/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs index ed95935a8..a3293c6cc 100644 --- a/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs +++ b/tests/generator-Tests/expected.xaji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs @@ -75,7 +75,7 @@ public IExoMediaDrmOnEventListenerInvoker (IntPtr handle, JniHandleOwnership tra static Delegate GetOnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayBHandler () { if (cb_onEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB == null) - cb_onEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPLLIIL_V) n_OnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB); + cb_onEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPLLIIL_V (n_OnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB)); return cb_onEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB; } @@ -261,7 +261,7 @@ public IExoMediaDrmInvoker (IntPtr handle, JniHandleOwnership transfer) : base ( static Delegate GetSetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_Handler () { if (cb_setOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_ == null) - cb_setOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_); + cb_setOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_)); return cb_setOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_; } diff --git a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II1.cs b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II1.cs index 634e2dedd..d87af4970 100644 --- a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II1.cs +++ b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II1.cs @@ -74,7 +74,7 @@ public II1Invoker (IntPtr handle, JniHandleOwnership transfer) : base (Validate static Delegate GetCloseHandler () { if (cb_close == null) - cb_close = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Close); + cb_close = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Close)); return cb_close; } diff --git a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II2.cs b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II2.cs index 1e200b19a..d13fdaf0a 100644 --- a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II2.cs +++ b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.II2.cs @@ -74,7 +74,7 @@ public II2Invoker (IntPtr handle, JniHandleOwnership transfer) : base (Validate static Delegate GetCloseHandler () { if (cb_close == null) - cb_close = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Close); + cb_close = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Close)); return cb_close; } diff --git a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs index 2d737e3d1..36cb738ff 100644 --- a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs @@ -51,7 +51,7 @@ protected SomeObject (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetCloseHandler () { if (cb_close == null) - cb_close = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Close); + cb_close = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Close)); return cb_close; } diff --git a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs index af5336cf1..6dfa92928 100644 --- a/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs +++ b/tests/generator-Tests/expected.xaji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs @@ -51,7 +51,7 @@ protected SomeObject2 (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetIrrelevantHandler () { if (cb_irrelevant == null) - cb_irrelevant = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Irrelevant); + cb_irrelevant = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Irrelevant)); return cb_irrelevant; } @@ -78,7 +78,7 @@ public virtual unsafe void Irrelevant () static Delegate GetCloseHandler () { if (cb_close == null) - cb_close = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Close); + cb_close = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Close)); return cb_close; } diff --git a/tests/generator-Tests/expected.xaji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs b/tests/generator-Tests/expected.xaji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs index 025a2b799..d0123d48b 100644 --- a/tests/generator-Tests/expected.xaji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs +++ b/tests/generator-Tests/expected.xaji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs @@ -90,7 +90,7 @@ public IFactoryInvoker (IntPtr handle, JniHandleOwnership transfer) : base (Vali static Delegate GetBuild_IHandler () { if (cb_build_I == null) - cb_build_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_L) n_Build_I); + cb_build_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_L (n_Build_I)); return cb_build_I; } diff --git a/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.A.cs b/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.A.cs index 7d0bb2c6f..677e9f177 100644 --- a/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.A.cs +++ b/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.A.cs @@ -55,7 +55,7 @@ protected B (IntPtr javaReference, JniHandleOwnership transfer) : base (javaRefe static Delegate GetSetCustomDimension_IHandler () { if (cb_setCustomDimension_I == null) - cb_setCustomDimension_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_L) n_SetCustomDimension_I); + cb_setCustomDimension_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_L (n_SetCustomDimension_I)); return cb_setCustomDimension_I; } @@ -115,7 +115,7 @@ protected A (IntPtr javaReference, JniHandleOwnership transfer) : base (javaRefe static Delegate GetGetHandleHandler () { if (cb_getHandle == null) - cb_getHandle = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetHandle); + cb_getHandle = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetHandle)); return cb_getHandle; } diff --git a/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.C.cs b/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.C.cs index 11ddac6e7..e54eb5be4 100644 --- a/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.C.cs +++ b/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.C.cs @@ -52,7 +52,7 @@ protected C (IntPtr javaReference, JniHandleOwnership transfer) : base (javaRefe static Delegate GetSetCustomDimension_IHandler () { if (cb_setCustomDimension_I == null) - cb_setCustomDimension_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_L) n_SetCustomDimension_I); + cb_setCustomDimension_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_L (n_SetCustomDimension_I)); return cb_setCustomDimension_I; } diff --git a/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.SomeObject.cs index bede6f084..b4607771a 100644 --- a/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.xaji/NormalMethods/Xamarin.Test.SomeObject.cs @@ -71,7 +71,7 @@ public unsafe SomeObject (global::Java.Lang.Class c) : base (IntPtr.Zero, JniHan static Delegate GetGetTypeHandler () { if (cb_getType == null) - cb_getType = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetType); + cb_getType = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetType)); return cb_getType; } @@ -99,7 +99,7 @@ static IntPtr n_GetType (IntPtr jnienv, IntPtr native__this) static Delegate GetHandle_Ljava_lang_Object_Ljava_lang_Throwable_Handler () { if (cb_handle_Ljava_lang_Object_Ljava_lang_Throwable_ == null) - cb_handle_Ljava_lang_Object_Ljava_lang_Throwable_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPLL_I) n_Handle_Ljava_lang_Object_Ljava_lang_Throwable_); + cb_handle_Ljava_lang_Object_Ljava_lang_Throwable_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPLL_I (n_Handle_Ljava_lang_Object_Ljava_lang_Throwable_)); return cb_handle_Ljava_lang_Object_Ljava_lang_Throwable_; } @@ -135,7 +135,7 @@ static int n_Handle_Ljava_lang_Object_Ljava_lang_Throwable_ (IntPtr jnienv, IntP static Delegate GetIntegerMethodHandler () { if (cb_IntegerMethod == null) - cb_IntegerMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_IntegerMethod); + cb_IntegerMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_IntegerMethod)); return cb_IntegerMethod; } @@ -163,7 +163,7 @@ public virtual unsafe int IntegerMethod () static Delegate GetVoidMethodHandler () { if (cb_VoidMethod == null) - cb_VoidMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_VoidMethod); + cb_VoidMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_VoidMethod)); return cb_VoidMethod; } @@ -190,7 +190,7 @@ public virtual unsafe void VoidMethod () static Delegate GetStringMethodHandler () { if (cb_StringMethod == null) - cb_StringMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_StringMethod); + cb_StringMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_StringMethod)); return cb_StringMethod; } @@ -218,7 +218,7 @@ public virtual unsafe string StringMethod () static Delegate GetObjectMethodHandler () { if (cb_ObjectMethod == null) - cb_ObjectMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_ObjectMethod); + cb_ObjectMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_ObjectMethod)); return cb_ObjectMethod; } @@ -246,7 +246,7 @@ static IntPtr n_ObjectMethod (IntPtr jnienv, IntPtr native__this) static Delegate GetVoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_Handler () { if (cb_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_ == null) - cb_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPLIL_V) n_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_); + cb_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPLIL_V (n_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_)); return cb_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_; } @@ -283,7 +283,7 @@ public virtual unsafe void VoidMethodWithParams (string astring, int anint, glob static Delegate GetObsoleteMethodHandler () { if (cb_ObsoleteMethod == null) - cb_ObsoleteMethod = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_ObsoleteMethod); + cb_ObsoleteMethod = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_ObsoleteMethod)); return cb_ObsoleteMethod; } @@ -313,7 +313,7 @@ public virtual unsafe int ObsoleteMethod () static Delegate GetArrayListTest_Ljava_util_ArrayList_Handler () { if (cb_ArrayListTest_Ljava_util_ArrayList_ == null) - cb_ArrayListTest_Ljava_util_ArrayList_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_ArrayListTest_Ljava_util_ArrayList_); + cb_ArrayListTest_Ljava_util_ArrayList_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_ArrayListTest_Ljava_util_ArrayList_)); return cb_ArrayListTest_Ljava_util_ArrayList_; } diff --git a/tests/generator-Tests/expected.xaji/NormalProperties/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.xaji/NormalProperties/Xamarin.Test.SomeObject.cs index c0336da69..5dfb2294d 100644 --- a/tests/generator-Tests/expected.xaji/NormalProperties/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.xaji/NormalProperties/Xamarin.Test.SomeObject.cs @@ -51,7 +51,7 @@ protected SomeObject (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetGetSomeIntegerHandler () { if (cb_getSomeInteger == null) - cb_getSomeInteger = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_GetSomeInteger); + cb_getSomeInteger = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_GetSomeInteger)); return cb_getSomeInteger; } @@ -67,7 +67,7 @@ static int n_GetSomeInteger (IntPtr jnienv, IntPtr native__this) static Delegate GetSetSomeInteger_IHandler () { if (cb_setSomeInteger_I == null) - cb_setSomeInteger_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_SetSomeInteger_I); + cb_setSomeInteger_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_SetSomeInteger_I)); return cb_setSomeInteger_I; } @@ -93,7 +93,7 @@ public abstract int SomeInteger { static Delegate GetGetSomeObjectPropertyHandler () { if (cb_getSomeObjectProperty == null) - cb_getSomeObjectProperty = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetSomeObjectProperty); + cb_getSomeObjectProperty = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetSomeObjectProperty)); return cb_getSomeObjectProperty; } @@ -109,7 +109,7 @@ static IntPtr n_GetSomeObjectProperty (IntPtr jnienv, IntPtr native__this) static Delegate GetSetSomeObjectProperty_Ljava_lang_Object_Handler () { if (cb_setSomeObjectProperty_Ljava_lang_Object_ == null) - cb_setSomeObjectProperty_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetSomeObjectProperty_Ljava_lang_Object_); + cb_setSomeObjectProperty_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetSomeObjectProperty_Ljava_lang_Object_)); return cb_setSomeObjectProperty_Ljava_lang_Object_; } @@ -136,7 +136,7 @@ static void n_SetSomeObjectProperty_Ljava_lang_Object_ (IntPtr jnienv, IntPtr na static Delegate GetGetSomeStringHandler () { if (cb_getSomeString == null) - cb_getSomeString = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetSomeString); + cb_getSomeString = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetSomeString)); return cb_getSomeString; } @@ -152,7 +152,7 @@ static IntPtr n_GetSomeString (IntPtr jnienv, IntPtr native__this) static Delegate GetSetSomeString_Ljava_lang_String_Handler () { if (cb_setSomeString_Ljava_lang_String_ == null) - cb_setSomeString_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetSomeString_Ljava_lang_String_); + cb_setSomeString_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetSomeString_Ljava_lang_String_)); return cb_setSomeString_Ljava_lang_String_; } diff --git a/tests/generator-Tests/expected.xaji/ParameterXPath/Xamarin.Test.A.cs b/tests/generator-Tests/expected.xaji/ParameterXPath/Xamarin.Test.A.cs index f7ed7be26..b2edb0eb0 100644 --- a/tests/generator-Tests/expected.xaji/ParameterXPath/Xamarin.Test.A.cs +++ b/tests/generator-Tests/expected.xaji/ParameterXPath/Xamarin.Test.A.cs @@ -52,7 +52,7 @@ protected A (IntPtr javaReference, JniHandleOwnership transfer) : base (javaRefe static Delegate GetSetA_Ljava_lang_Object_Handler () { if (cb_setA_Ljava_lang_Object_ == null) - cb_setA_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetA_Ljava_lang_Object_); + cb_setA_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetA_Ljava_lang_Object_)); return cb_setA_Ljava_lang_Object_; } @@ -85,7 +85,7 @@ public virtual unsafe void SetA (global::Java.Lang.Object adapter) static Delegate GetListTest_Ljava_util_List_Handler () { if (cb_listTest_Ljava_util_List_ == null) - cb_listTest_Ljava_util_List_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_ListTest_Ljava_util_List_); + cb_listTest_Ljava_util_List_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_ListTest_Ljava_util_List_)); return cb_listTest_Ljava_util_List_; } diff --git a/tests/generator-Tests/expected.xaji/Streams/Java.IO.FilterOutputStream.cs b/tests/generator-Tests/expected.xaji/Streams/Java.IO.FilterOutputStream.cs index 9444b7ff6..4900e259e 100644 --- a/tests/generator-Tests/expected.xaji/Streams/Java.IO.FilterOutputStream.cs +++ b/tests/generator-Tests/expected.xaji/Streams/Java.IO.FilterOutputStream.cs @@ -73,7 +73,7 @@ public unsafe FilterOutputStream (global::System.IO.Stream @out) : base (IntPtr. static Delegate GetWrite_IHandler () { if (cb_write_I == null) - cb_write_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_Write_I); + cb_write_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_Write_I)); return cb_write_I; } diff --git a/tests/generator-Tests/expected.xaji/Streams/Java.IO.IOException.cs b/tests/generator-Tests/expected.xaji/Streams/Java.IO.IOException.cs index 44517099e..ae3fbf63a 100644 --- a/tests/generator-Tests/expected.xaji/Streams/Java.IO.IOException.cs +++ b/tests/generator-Tests/expected.xaji/Streams/Java.IO.IOException.cs @@ -51,7 +51,7 @@ protected IOException (IntPtr javaReference, JniHandleOwnership transfer) : base static Delegate GetPrintStackTraceHandler () { if (cb_printStackTrace == null) - cb_printStackTrace = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_PrintStackTrace); + cb_printStackTrace = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_PrintStackTrace)); return cb_printStackTrace; } diff --git a/tests/generator-Tests/expected.xaji/Streams/Java.IO.InputStream.cs b/tests/generator-Tests/expected.xaji/Streams/Java.IO.InputStream.cs index b562872c0..9f106b41b 100644 --- a/tests/generator-Tests/expected.xaji/Streams/Java.IO.InputStream.cs +++ b/tests/generator-Tests/expected.xaji/Streams/Java.IO.InputStream.cs @@ -68,7 +68,7 @@ public unsafe InputStream () : base (IntPtr.Zero, JniHandleOwnership.DoNotTransf static Delegate GetAvailableHandler () { if (cb_available == null) - cb_available = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_Available); + cb_available = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_Available)); return cb_available; } @@ -96,7 +96,7 @@ public virtual unsafe int Available () static Delegate GetCloseHandler () { if (cb_close == null) - cb_close = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Close); + cb_close = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Close)); return cb_close; } @@ -123,7 +123,7 @@ public virtual unsafe void Close () static Delegate GetMark_IHandler () { if (cb_mark_I == null) - cb_mark_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_Mark_I); + cb_mark_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_Mark_I)); return cb_mark_I; } @@ -152,7 +152,7 @@ public virtual unsafe void Mark (int readlimit) static Delegate GetMarkSupportedHandler () { if (cb_markSupported == null) - cb_markSupported = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_Z) n_MarkSupported); + cb_markSupported = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_Z (n_MarkSupported)); return cb_markSupported; } @@ -180,7 +180,7 @@ public virtual unsafe bool MarkSupported () static Delegate GetReadHandler () { if (cb_read == null) - cb_read = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_I) n_Read); + cb_read = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_I (n_Read)); return cb_read; } @@ -200,7 +200,7 @@ static int n_Read (IntPtr jnienv, IntPtr native__this) static Delegate GetRead_arrayBHandler () { if (cb_read_arrayB == null) - cb_read_arrayB = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_Read_arrayB); + cb_read_arrayB = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_Read_arrayB)); return cb_read_arrayB; } @@ -240,7 +240,7 @@ public virtual unsafe int Read (byte[] buffer) static Delegate GetRead_arrayBIIHandler () { if (cb_read_arrayBII == null) - cb_read_arrayBII = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPLII_I) n_Read_arrayBII); + cb_read_arrayBII = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPLII_I (n_Read_arrayBII)); return cb_read_arrayBII; } @@ -282,7 +282,7 @@ public virtual unsafe int Read (byte[] buffer, int byteOffset, int byteCount) static Delegate GetResetHandler () { if (cb_reset == null) - cb_reset = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Reset); + cb_reset = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Reset)); return cb_reset; } @@ -309,7 +309,7 @@ public virtual unsafe void Reset () static Delegate GetSkip_JHandler () { if (cb_skip_J == null) - cb_skip_J = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPJ_J) n_Skip_J); + cb_skip_J = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPJ_J (n_Skip_J)); return cb_skip_J; } diff --git a/tests/generator-Tests/expected.xaji/Streams/Java.IO.OutputStream.cs b/tests/generator-Tests/expected.xaji/Streams/Java.IO.OutputStream.cs index 128209066..a268bd3f8 100644 --- a/tests/generator-Tests/expected.xaji/Streams/Java.IO.OutputStream.cs +++ b/tests/generator-Tests/expected.xaji/Streams/Java.IO.OutputStream.cs @@ -68,7 +68,7 @@ public unsafe OutputStream () : base (IntPtr.Zero, JniHandleOwnership.DoNotTrans static Delegate GetCloseHandler () { if (cb_close == null) - cb_close = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Close); + cb_close = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Close)); return cb_close; } @@ -95,7 +95,7 @@ public virtual unsafe void Close () static Delegate GetFlushHandler () { if (cb_flush == null) - cb_flush = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Flush); + cb_flush = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Flush)); return cb_flush; } @@ -122,7 +122,7 @@ public virtual unsafe void Flush () static Delegate GetWrite_arrayBHandler () { if (cb_write_arrayB == null) - cb_write_arrayB = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_Write_arrayB); + cb_write_arrayB = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_Write_arrayB)); return cb_write_arrayB; } @@ -160,7 +160,7 @@ public virtual unsafe void Write (byte[] buffer) static Delegate GetWrite_arrayBIIHandler () { if (cb_write_arrayBII == null) - cb_write_arrayBII = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPLII_V) n_Write_arrayBII); + cb_write_arrayBII = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPLII_V (n_Write_arrayBII)); return cb_write_arrayBII; } @@ -200,7 +200,7 @@ public virtual unsafe void Write (byte[] buffer, int offset, int count) static Delegate GetWrite_IHandler () { if (cb_write_I == null) - cb_write_I = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPI_V) n_Write_I); + cb_write_I = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPI_V (n_Write_I)); return cb_write_I; } diff --git a/tests/generator-Tests/expected.xaji/Streams/Java.Lang.Throwable.cs b/tests/generator-Tests/expected.xaji/Streams/Java.Lang.Throwable.cs index d77835162..143653f06 100644 --- a/tests/generator-Tests/expected.xaji/Streams/Java.Lang.Throwable.cs +++ b/tests/generator-Tests/expected.xaji/Streams/Java.Lang.Throwable.cs @@ -29,7 +29,7 @@ internal static IntPtr class_ref { static Delegate GetGetMessageHandler () { if (cb_getMessage == null) - cb_getMessage = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetMessage); + cb_getMessage = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetMessage)); return cb_getMessage; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/ClassWithoutNamespace.cs b/tests/generator-Tests/expected.xaji/TestInterface/ClassWithoutNamespace.cs index 1e6d7ec80..cd2627cd4 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/ClassWithoutNamespace.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/ClassWithoutNamespace.cs @@ -66,7 +66,7 @@ public unsafe ClassWithoutNamespace () : base (IntPtr.Zero, JniHandleOwnership.D static Delegate GetFooHandler () { if (cb_Foo == null) - cb_Foo = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Foo); + cb_Foo = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Foo)); return cb_Foo; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/IInterfaceWithoutNamespace.cs b/tests/generator-Tests/expected.xaji/TestInterface/IInterfaceWithoutNamespace.cs index 379f08295..45fbb6776 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/IInterfaceWithoutNamespace.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/IInterfaceWithoutNamespace.cs @@ -72,7 +72,7 @@ public IInterfaceWithoutNamespaceInvoker (IntPtr handle, JniHandleOwnership tran static Delegate GetFooHandler () { if (cb_Foo == null) - cb_Foo = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_V) n_Foo); + cb_Foo = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_V (n_Foo)); return cb_Foo; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericImplementation.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericImplementation.cs index 9e8cc5b11..2d23d5428 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericImplementation.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericImplementation.cs @@ -68,7 +68,7 @@ public unsafe GenericImplementation () : base (IntPtr.Zero, JniHandleOwnership.D static Delegate GetSetObject_arrayBHandler () { if (cb_SetObject_arrayB == null) - cb_SetObject_arrayB = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetObject_arrayB); + cb_SetObject_arrayB = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetObject_arrayB)); return cb_SetObject_arrayB; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs index 84ffb5866..9aed9330b 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs @@ -68,7 +68,7 @@ public unsafe GenericObjectPropertyImplementation () : base (IntPtr.Zero, JniHan static Delegate GetGetObjectHandler () { if (cb_getObject == null) - cb_getObject = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetObject); + cb_getObject = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetObject)); return cb_getObject; } @@ -84,7 +84,7 @@ static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) static Delegate GetSetObject_Ljava_lang_Object_Handler () { if (cb_setObject_Ljava_lang_Object_ == null) - cb_setObject_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetObject_Ljava_lang_Object_); + cb_setObject_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetObject_Ljava_lang_Object_)); return cb_setObject_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringImplementation.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringImplementation.cs index ee964434f..f82690208 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringImplementation.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringImplementation.cs @@ -68,7 +68,7 @@ public unsafe GenericStringImplementation () : base (IntPtr.Zero, JniHandleOwner static Delegate GetSetObject_arrayLjava_lang_String_Handler () { if (cb_SetObject_arrayLjava_lang_String_ == null) - cb_SetObject_arrayLjava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetObject_arrayLjava_lang_String_); + cb_SetObject_arrayLjava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetObject_arrayLjava_lang_String_)); return cb_SetObject_arrayLjava_lang_String_; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs index 86ce6c5e5..b824d69b3 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs @@ -68,7 +68,7 @@ public unsafe GenericStringPropertyImplementation () : base (IntPtr.Zero, JniHan static Delegate GetGetObjectHandler () { if (cb_getObject == null) - cb_getObject = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetObject); + cb_getObject = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetObject)); return cb_getObject; } @@ -84,7 +84,7 @@ static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) static Delegate GetSetObject_Ljava_lang_String_Handler () { if (cb_SetObject_Ljava_lang_String_ == null) - cb_SetObject_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetObject_Ljava_lang_String_); + cb_SetObject_Ljava_lang_String_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetObject_Ljava_lang_String_)); return cb_SetObject_Ljava_lang_String_; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericInterface.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericInterface.cs index 5f56ad2ba..45716b0eb 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericInterface.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericInterface.cs @@ -75,7 +75,7 @@ public IGenericInterfaceInvoker (IntPtr handle, JniHandleOwnership transfer) : b static Delegate GetSetObject_Ljava_lang_Object_Handler () { if (cb_SetObject_Ljava_lang_Object_ == null) - cb_SetObject_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetObject_Ljava_lang_Object_); + cb_SetObject_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetObject_Ljava_lang_Object_)); return cb_SetObject_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericPropertyInterface.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericPropertyInterface.cs index 11c5b47d9..0d2713960 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericPropertyInterface.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.IGenericPropertyInterface.cs @@ -81,7 +81,7 @@ public IGenericPropertyInterfaceInvoker (IntPtr handle, JniHandleOwnership trans static Delegate GetGetObjectHandler () { if (cb_getObject == null) - cb_getObject = JNINativeWrapper.CreateDelegate ((_JniMarshal_PP_L) n_GetObject); + cb_getObject = JNINativeWrapper.CreateDelegate (new _JniMarshal_PP_L (n_GetObject)); return cb_getObject; } @@ -97,7 +97,7 @@ static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) static Delegate GetSetObject_Ljava_lang_Object_Handler () { if (cb_setObject_Ljava_lang_Object_ == null) - cb_setObject_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_SetObject_Ljava_lang_Object_); + cb_setObject_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_SetObject_Ljava_lang_Object_)); return cb_setObject_Ljava_lang_Object_; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs index 335ae83ae..c8b595285 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.ITestInterface.cs @@ -136,7 +136,7 @@ public ITestInterfaceInvoker (IntPtr handle, JniHandleOwnership transfer) : base static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () { if (cb_getSpanFlags_Ljava_lang_Object_ == null) - cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetSpanFlags_Ljava_lang_Object_); + cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetSpanFlags_Ljava_lang_Object_)); return cb_getSpanFlags_Ljava_lang_Object_; } @@ -165,7 +165,7 @@ public unsafe int GetSpanFlags (global::Java.Lang.Object tag) static Delegate GetAppend_Ljava_lang_CharSequence_Handler () { if (cb_append_Ljava_lang_CharSequence_ == null) - cb_append_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_Append_Ljava_lang_CharSequence_); + cb_append_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_Append_Ljava_lang_CharSequence_)); return cb_append_Ljava_lang_CharSequence_; } @@ -194,7 +194,7 @@ public unsafe void Append (global::Java.Lang.ICharSequence value) static Delegate GetIdentity_Ljava_lang_CharSequence_Handler () { if (cb_identity_Ljava_lang_CharSequence_ == null) - cb_identity_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_L) n_Identity_Ljava_lang_CharSequence_); + cb_identity_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_L (n_Identity_Ljava_lang_CharSequence_)); return cb_identity_Ljava_lang_CharSequence_; } diff --git a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.TestInterfaceImplementation.cs b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.TestInterfaceImplementation.cs index b5059c63d..69bbde3e1 100644 --- a/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.TestInterfaceImplementation.cs +++ b/tests/generator-Tests/expected.xaji/TestInterface/Test.ME.TestInterfaceImplementation.cs @@ -89,7 +89,7 @@ public unsafe TestInterfaceImplementation () : base (IntPtr.Zero, JniHandleOwner static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () { if (cb_getSpanFlags_Ljava_lang_Object_ == null) - cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_GetSpanFlags_Ljava_lang_Object_); + cb_getSpanFlags_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_GetSpanFlags_Ljava_lang_Object_)); return cb_getSpanFlags_Ljava_lang_Object_; } @@ -111,7 +111,7 @@ static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this static Delegate GetAppend_Ljava_lang_CharSequence_Handler () { if (cb_append_Ljava_lang_CharSequence_ == null) - cb_append_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_V) n_Append_Ljava_lang_CharSequence_); + cb_append_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_V (n_Append_Ljava_lang_CharSequence_)); return cb_append_Ljava_lang_CharSequence_; } @@ -139,7 +139,7 @@ public void Append (string value) static Delegate GetIdentity_Ljava_lang_CharSequence_Handler () { if (cb_identity_Ljava_lang_CharSequence_ == null) - cb_identity_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_L) n_Identity_Ljava_lang_CharSequence_); + cb_identity_Ljava_lang_CharSequence_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_L (n_Identity_Ljava_lang_CharSequence_)); return cb_identity_Ljava_lang_CharSequence_; } diff --git a/tests/generator-Tests/expected.xaji/java.lang.Enum/Java.Lang.IComparable.cs b/tests/generator-Tests/expected.xaji/java.lang.Enum/Java.Lang.IComparable.cs index bbe178542..457d5478c 100644 --- a/tests/generator-Tests/expected.xaji/java.lang.Enum/Java.Lang.IComparable.cs +++ b/tests/generator-Tests/expected.xaji/java.lang.Enum/Java.Lang.IComparable.cs @@ -75,7 +75,7 @@ public IComparableInvoker (IntPtr handle, JniHandleOwnership transfer) : base (V static Delegate GetCompareTo_Ljava_lang_Object_Handler () { if (cb_compareTo_Ljava_lang_Object_ == null) - cb_compareTo_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate ((_JniMarshal_PPL_I) n_CompareTo_Ljava_lang_Object_); + cb_compareTo_Ljava_lang_Object_ = JNINativeWrapper.CreateDelegate (new _JniMarshal_PPL_I (n_CompareTo_Ljava_lang_Object_)); return cb_compareTo_Ljava_lang_Object_; } diff --git a/tools/generator/SourceWriters/MethodCallback.cs b/tools/generator/SourceWriters/MethodCallback.cs index f292d89f8..161a5e53c 100644 --- a/tools/generator/SourceWriters/MethodCallback.cs +++ b/tools/generator/SourceWriters/MethodCallback.cs @@ -145,7 +145,7 @@ protected override void WriteBody (CodeWriter writer) var callback_name = method.EscapedCallbackName; writer.WriteLine ($"if ({callback_name} == null)"); - writer.WriteLine ($"\t{callback_name} = JNINativeWrapper.CreateDelegate (({method.GetDelegateType (opt)}) n_{method.Name + method.IDSignature});"); + writer.WriteLine ($"\t{callback_name} = JNINativeWrapper.CreateDelegate (new {method.GetDelegateType (opt)} (n_{method.Name + method.IDSignature}));"); writer.WriteLine ($"return {callback_name};"); } }