From d73608679cdffcc3c27095280ab82d1c33dd3496 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Tue, 7 Apr 2020 14:16:00 -0500 Subject: [PATCH] [generator] simplify life with 'var' in generated code (#621) Context: https://github.com/xamarin/xamarin-android/pull/4227 Our generated code *may* predate `var`, or at least predate `var` becoming widely accepted. As such, we generate code like this: java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); Migrate this code to `var` as it simplifies `generator` and reasoning about behavior when "cross-compiling" code between C#7 and C#8-with- [Nullable Reference Type][0] toolchains: var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); [0]: https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references --- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../expected.ji/Android.Text.ISpannable.cs | 6 ++--- .../expected.ji/Android.Text.ISpanned.cs | 6 ++--- .../Android.Text.SpannableString.cs | 4 +-- .../Android.Text.SpannableStringInternal.cs | 4 +-- .../expected.ji/Android.Views.View.cs | 14 +++++----- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../expected/Android.Text.ISpannable.cs | 6 ++--- .../expected/Android.Text.ISpanned.cs | 6 ++--- .../expected/Android.Text.SpannableString.cs | 4 +-- .../Android.Text.SpannableStringInternal.cs | 4 +-- .../Tests-Core/expected/Android.Views.View.cs | 14 +++++----- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Common/WriteInterfaceMethodInvokers.txt | 10 +++---- .../WriteInterfaceMethodInvokersWithSkips.txt | 10 +++---- .../Common/WriteInterfacePropertyInvokers.txt | 18 ++++++------- ...riteInterfacePropertyInvokersWithSkips.txt | 14 +++++----- .../WritePropertyAbstractDeclaration.txt | 4 +-- .../Common/WritePropertyCallbacks.txt | 4 +-- .../Common/WritePropertyInvoker.txt | 4 +-- .../Common/WritePropertyStringVariant.txt | 2 +- .../JavaInterop1/WriteClass.txt | 22 ++++++++-------- .../JavaInterop1/WriteClassMethods.txt | 8 +++--- .../JavaInterop1/WriteClassProperties.txt | 14 +++++----- .../WriteDefaultInterfaceMethodInvoker.txt | 2 +- .../JavaInterop1/WriteInterface.txt | 24 ++++++++--------- .../WriteInterfaceDefaultMethod.txt | 2 +- .../WriteInterfaceDefaultProperty.txt | 4 +-- ...riteInterfaceDefaultPropertyGetterOnly.txt | 2 +- .../JavaInterop1/WriteInterfaceInvoker.txt | 24 ++++++++--------- .../WriteMethodAbstractWithVoidReturn.txt | 2 +- .../WriteMethodAsyncifiedWithIntReturn.txt | 2 +- .../WriteMethodAsyncifiedWithVoidReturn.txt | 2 +- .../JavaInterop1/WriteMethodProtected.txt | 2 +- .../JavaInterop1/WriteMethodWithIntReturn.txt | 2 +- .../WriteMethodWithStringReturn.txt | 2 +- .../WriteMethodWithVoidReturn.txt | 2 +- .../WriteNestedInterfaceClass.txt | 2 +- .../WriteNestedInterfaceTypes.txt | 4 +-- .../JavaInterop1/WriteProperty.txt | 4 +-- .../WriteUnnestedInterfaceTypes.txt | 4 +-- .../XAJavaInterop1/WriteClass.txt | 22 ++++++++-------- .../XAJavaInterop1/WriteClassMethods.txt | 8 +++--- .../XAJavaInterop1/WriteClassProperties.txt | 14 +++++----- .../WriteDefaultInterfaceMethodInvoker.txt | 2 +- .../XAJavaInterop1/WriteInterface.txt | 24 ++++++++--------- .../WriteInterfaceDefaultMethod.txt | 2 +- .../WriteInterfaceDefaultProperty.txt | 4 +-- ...riteInterfaceDefaultPropertyGetterOnly.txt | 2 +- .../XAJavaInterop1/WriteInterfaceInvoker.txt | 24 ++++++++--------- .../WriteMethodAbstractWithVoidReturn.txt | 2 +- .../WriteMethodAsyncifiedWithIntReturn.txt | 2 +- .../WriteMethodAsyncifiedWithVoidReturn.txt | 2 +- .../XAJavaInterop1/WriteMethodProtected.txt | 2 +- .../WriteMethodWithIntReturn.txt | 2 +- .../WriteMethodWithStringReturn.txt | 2 +- .../WriteMethodWithVoidReturn.txt | 2 +- .../WriteNestedInterfaceClass.txt | 2 +- .../WriteNestedInterfaceTypes.txt | 4 +-- .../XAJavaInterop1/WriteProperty.txt | 4 +-- .../WriteUnnestedInterfaceTypes.txt | 4 +-- .../XamarinAndroid/WriteClass.txt | 22 ++++++++-------- .../XamarinAndroid/WriteClassMethods.txt | 8 +++--- .../XamarinAndroid/WriteClassProperties.txt | 14 +++++----- .../XamarinAndroid/WriteInterface.txt | 24 ++++++++--------- .../XamarinAndroid/WriteInterfaceInvoker.txt | 24 ++++++++--------- .../WriteMethodAbstractWithVoidReturn.txt | 2 +- .../WriteMethodAsyncifiedWithIntReturn.txt | 2 +- .../WriteMethodAsyncifiedWithVoidReturn.txt | 2 +- .../XamarinAndroid/WriteMethodProtected.txt | 2 +- .../WriteMethodWithIntReturn.txt | 2 +- .../WriteMethodWithStringReturn.txt | 2 +- .../WriteMethodWithVoidReturn.txt | 2 +- .../XamarinAndroid/WriteProperty.txt | 4 +-- .../Xamarin.Test.BasePublicClass.cs | 2 +- .../Xamarin.Test.ExtendPublicClass.cs | 2 +- .../Xamarin.Test.PublicClass.cs | 4 +-- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Adapters/Xamarin.Test.AbsSpinner.cs | 6 ++--- .../Adapters/Xamarin.Test.AdapterView.cs | 6 ++--- .../Xamarin.Test.GenericReturnObject.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 6 ++--- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Xamarin.Test.CSharpKeywords.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- ...ogle.Android.Exoplayer.Drm.IExoMediaDrm.cs | 12 ++++----- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Xamarin.Test.II1.cs | 2 +- .../Xamarin.Test.II2.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 2 +- .../Xamarin.Test.SomeObject2.cs | 4 +-- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Xamarin.Test.NotificationCompatBase.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../NormalMethods/Xamarin.Test.A.cs | 4 +-- .../NormalMethods/Xamarin.Test.C.cs | 2 +- .../NormalMethods/Xamarin.Test.SomeObject.cs | 26 +++++++++---------- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 16 ++++++------ .../Java.Interop.__TypeRegistrations.cs | 2 +- .../ParameterXPath/Xamarin.Test.A.cs | 6 ++--- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Streams/Java.IO.FilterOutputStream.cs | 2 +- .../Streams/Java.IO.IOException.cs | 2 +- .../Streams/Java.IO.InputStream.cs | 22 ++++++++-------- .../Streams/Java.IO.OutputStream.cs | 14 +++++----- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Streams/Java.Lang.Throwable.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Test.ME.GenericImplementation.cs | 4 +-- ....ME.GenericObjectPropertyImplementation.cs | 6 ++--- .../Test.ME.GenericStringImplementation.cs | 4 +-- ....ME.GenericStringPropertyImplementation.cs | 6 ++--- .../Test.ME.IGenericInterface.cs | 4 +-- .../Test.ME.IGenericPropertyInterface.cs | 6 ++--- .../TestInterface/Test.ME.ITestInterface.cs | 20 +++++++------- .../Test.ME.TestInterfaceImplementation.cs | 17 ++++++------ .../Java.Interop.__TypeRegistrations.cs | 2 +- .../java.lang.Enum/Java.Lang.IComparable.cs | 6 ++--- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../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 | 6 ++--- .../Adapters/Xamarin.Test.AdapterView.cs | 6 ++--- .../Xamarin.Test.GenericReturnObject.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 6 ++--- .../Xamarin.Test.CSharpKeywords.cs | 2 +- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../Xamarin.Test.SomeObject.cs | 6 ++--- .../Xamarin.Test.SomeObject2.cs | 12 ++++----- ...ogle.Android.Exoplayer.Drm.IExoMediaDrm.cs | 12 ++++----- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../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 +- .../expected/NormalMethods/Xamarin.Test.A.cs | 4 +-- .../expected/NormalMethods/Xamarin.Test.C.cs | 2 +- .../NormalMethods/Xamarin.Test.SomeObject.cs | 26 +++++++++---------- .../Xamarin.Test.SomeObject.cs | 16 ++++++------ .../expected/ParameterXPath/Xamarin.Test.A.cs | 6 ++--- .../Streams/Java.IO.FilterOutputStream.cs | 2 +- .../expected/Streams/Java.IO.IOException.cs | 2 +- .../expected/Streams/Java.IO.InputStream.cs | 22 ++++++++-------- .../expected/Streams/Java.IO.OutputStream.cs | 14 +++++----- .../expected/Streams/Java.Lang.Throwable.cs | 2 +- .../TestInterface/ClassWithoutNamespace.cs | 2 +- .../IInterfaceWithoutNamespace.cs | 2 +- .../Test.ME.GenericImplementation.cs | 4 +-- ....ME.GenericObjectPropertyImplementation.cs | 6 ++--- .../Test.ME.GenericStringImplementation.cs | 4 +-- ....ME.GenericStringPropertyImplementation.cs | 6 ++--- .../Test.ME.IGenericInterface.cs | 4 +-- .../Test.ME.IGenericPropertyInterface.cs | 6 ++--- .../TestInterface/Test.ME.ITestInterface.cs | 20 +++++++------- .../Test.ME.TestInterfaceImplementation.cs | 17 ++++++------ .../java.lang.Enum/Java.Lang.IComparable.cs | 6 ++--- .../Java.Interop.__TypeRegistrations.cs | 2 +- .../CodeGenerator.cs | 14 +++++----- .../ClassGen.cs | 2 +- .../GenBase.cs | 2 +- .../Parameter.cs | 2 +- .../Symbols/ArraySymbol.cs | 2 +- .../Symbols/CharSequenceSymbol.cs | 2 +- .../Symbols/GenericTypeParameter.cs | 2 +- .../Symbols/StreamSymbol.cs | 2 +- .../Symbols/StringSymbol.cs | 2 +- .../Symbols/XmlPullParserSymbol.cs | 2 +- .../Symbols/XmlResourceParserSymbol.cs | 2 +- 178 files changed, 531 insertions(+), 529 deletions(-) diff --git a/tests/generator-Tests/Tests-Core/expected.cp/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/Tests-Core/expected.cp/Java.Interop.__TypeRegistrations.cs index 210cb8258..764df7e06 100644 --- a/tests/generator-Tests/Tests-Core/expected.cp/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/Tests-Core/expected.cp/Java.Interop.__TypeRegistrations.cs @@ -27,7 +27,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpannable.cs b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpannable.cs index c7b373664..2abaa032c 100644 --- a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpannable.cs +++ b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpannable.cs @@ -73,8 +73,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - Android.Text.ISpannable __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (tag); return __ret; } @@ -87,7 +87,7 @@ public unsafe Android.Text.SpanTypes GetSpanFlags (Java.Lang.Object tag) id_getSpanFlags_Ljava_lang_Object_ = JNIEnv.GetMethodID (class_ref, "getSpanFlags", "(Ljava/lang/Object;)I"); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue ((tag == null) ? IntPtr.Zero : ((global::Java.Lang.Object) tag).Handle); - Android.Text.SpanTypes __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); + var __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpanned.cs b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpanned.cs index 39c66727f..a99b776cc 100644 --- a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpanned.cs +++ b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.ISpanned.cs @@ -78,8 +78,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - Android.Text.ISpanned __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (tag); return __ret; } @@ -92,7 +92,7 @@ public unsafe Android.Text.SpanTypes GetSpanFlags (Java.Lang.Object tag) id_getSpanFlags_Ljava_lang_Object_ = JNIEnv.GetMethodID (class_ref, "getSpanFlags", "(Ljava/lang/Object;)I"); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue ((tag == null) ? IntPtr.Zero : ((global::Java.Lang.Object) tag).Handle); - Android.Text.SpanTypes __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); + var __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableString.cs b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableString.cs index 9b621a1ea..eb7372bc1 100644 --- a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableString.cs +++ b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableString.cs @@ -84,8 +84,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_what) { - Android.Text.SpannableString __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object what = global::Java.Lang.Object.GetObject (native_what, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var what = global::Java.Lang.Object.GetObject (native_what, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (what); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableStringInternal.cs b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableStringInternal.cs index 32948f11d..c2fdff74e 100644 --- a/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableStringInternal.cs +++ b/tests/generator-Tests/Tests-Core/expected.ji/Android.Text.SpannableStringInternal.cs @@ -41,8 +41,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - Android.Text.SpannableStringInternal __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object p0 = global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var p0 = global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (p0); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected.ji/Android.Views.View.cs b/tests/generator-Tests/Tests-Core/expected.ji/Android.Views.View.cs index 7f8ce10c2..94d3230c7 100644 --- a/tests/generator-Tests/Tests-Core/expected.ji/Android.Views.View.cs +++ b/tests/generator-Tests/Tests-Core/expected.ji/Android.Views.View.cs @@ -81,8 +81,8 @@ static Delegate GetOnClick_Landroid_view_View_Handler () static void n_OnClick_Landroid_view_View_ (IntPtr jnienv, IntPtr native__this, IntPtr native_v) { - Android.Views.View.IOnClickListener __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Android.Views.View v = global::Java.Lang.Object.GetObject (native_v, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var v = global::Java.Lang.Object.GetObject (native_v, JniHandleOwnership.DoNotTransfer); __this.OnClick (v); } #pragma warning restore 0169 @@ -160,8 +160,8 @@ static Delegate GetSetOnClickListener_Landroid_view_View_OnClickListener_Handler static void n_SetOnClickListener_Landroid_view_View_OnClickListener_ (IntPtr jnienv, IntPtr native__this, IntPtr native_l) { - Android.Views.View __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Android.Views.View.IOnClickListener l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); __this.SetOnClickListener (l); } #pragma warning restore 0169 @@ -190,8 +190,8 @@ static Delegate GetSetOn123Listener_Landroid_view_View_OnClickListener_Handler ( static void n_SetOn123Listener_Landroid_view_View_OnClickListener_ (IntPtr jnienv, IntPtr native__this, IntPtr native_l) { - Android.Views.View __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Android.Views.View.IOnClickListener l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); __this.SetOn123Listener (l); } #pragma warning restore 0169 @@ -220,7 +220,7 @@ static Delegate GetAddTouchables_Ljava_util_ArrayList_Handler () static void n_AddTouchables_Ljava_util_ArrayList_ (IntPtr jnienv, IntPtr native__this, IntPtr native_views) { - Android.Views.View __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var views = Android.Runtime.JavaList.FromJniHandle (native_views, JniHandleOwnership.DoNotTransfer); __this.AddTouchables (views); } diff --git a/tests/generator-Tests/Tests-Core/expected.ji/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/Tests-Core/expected.ji/Java.Interop.__TypeRegistrations.cs index 7ced4038e..9acd4384e 100644 --- a/tests/generator-Tests/Tests-Core/expected.ji/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/Tests-Core/expected.ji/Java.Interop.__TypeRegistrations.cs @@ -27,7 +27,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpannable.cs b/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpannable.cs index 76649648c..b4a8154cd 100644 --- a/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpannable.cs +++ b/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpannable.cs @@ -64,8 +64,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - Android.Text.ISpannable __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (tag); return __ret; } @@ -78,7 +78,7 @@ public unsafe Android.Text.SpanTypes GetSpanFlags (Java.Lang.Object tag) id_getSpanFlags_Ljava_lang_Object_ = JNIEnv.GetMethodID (class_ref, "getSpanFlags", "(Ljava/lang/Object;)I"); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (tag); - Android.Text.SpanTypes __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); + var __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpanned.cs b/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpanned.cs index b50a6e743..9d385c1d0 100644 --- a/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpanned.cs +++ b/tests/generator-Tests/Tests-Core/expected/Android.Text.ISpanned.cs @@ -69,8 +69,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - Android.Text.ISpanned __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (tag); return __ret; } @@ -83,7 +83,7 @@ public unsafe Android.Text.SpanTypes GetSpanFlags (Java.Lang.Object tag) id_getSpanFlags_Ljava_lang_Object_ = JNIEnv.GetMethodID (class_ref, "getSpanFlags", "(Ljava/lang/Object;)I"); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (tag); - Android.Text.SpanTypes __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); + var __ret = (Android.Text.SpanTypes) JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableString.cs b/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableString.cs index 8f660048d..9aa1a7300 100644 --- a/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableString.cs +++ b/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableString.cs @@ -98,8 +98,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_what) { - Android.Text.SpannableString __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object what = global::Java.Lang.Object.GetObject (native_what, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var what = global::Java.Lang.Object.GetObject (native_what, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (what); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableStringInternal.cs b/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableStringInternal.cs index 9c9953302..5893feeca 100644 --- a/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableStringInternal.cs +++ b/tests/generator-Tests/Tests-Core/expected/Android.Text.SpannableStringInternal.cs @@ -36,8 +36,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - Android.Text.SpannableStringInternal __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Java.Lang.Object p0 = global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var p0 = global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); int __ret = (int) __this.GetSpanFlags (p0); return __ret; } diff --git a/tests/generator-Tests/Tests-Core/expected/Android.Views.View.cs b/tests/generator-Tests/Tests-Core/expected/Android.Views.View.cs index 4c3a00556..33245dcb4 100644 --- a/tests/generator-Tests/Tests-Core/expected/Android.Views.View.cs +++ b/tests/generator-Tests/Tests-Core/expected/Android.Views.View.cs @@ -72,8 +72,8 @@ static Delegate GetOnClick_Landroid_view_View_Handler () static void n_OnClick_Landroid_view_View_ (IntPtr jnienv, IntPtr native__this, IntPtr native_v) { - Android.Views.View.IOnClickListener __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Android.Views.View v = global::Java.Lang.Object.GetObject (native_v, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var v = global::Java.Lang.Object.GetObject (native_v, JniHandleOwnership.DoNotTransfer); __this.OnClick (v); } #pragma warning restore 0169 @@ -147,8 +147,8 @@ static Delegate GetSetOnClickListener_Landroid_view_View_OnClickListener_Handler static void n_SetOnClickListener_Landroid_view_View_OnClickListener_ (IntPtr jnienv, IntPtr native__this, IntPtr native_l) { - Android.Views.View __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Android.Views.View.IOnClickListener l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); __this.SetOnClickListener (l); } #pragma warning restore 0169 @@ -183,8 +183,8 @@ static Delegate GetSetOn123Listener_Landroid_view_View_OnClickListener_Handler ( static void n_SetOn123Listener_Landroid_view_View_OnClickListener_ (IntPtr jnienv, IntPtr native__this, IntPtr native_l) { - Android.Views.View __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - Android.Views.View.IOnClickListener l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var l = (Android.Views.View.IOnClickListener)global::Java.Lang.Object.GetObject (native_l, JniHandleOwnership.DoNotTransfer); __this.SetOn123Listener (l); } #pragma warning restore 0169 @@ -219,7 +219,7 @@ static Delegate GetAddTouchables_Ljava_util_ArrayList_Handler () static void n_AddTouchables_Ljava_util_ArrayList_ (IntPtr jnienv, IntPtr native__this, IntPtr native_views) { - Android.Views.View __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var views = Android.Runtime.JavaList.FromJniHandle (native_views, JniHandleOwnership.DoNotTransfer); __this.AddTouchables (views); } diff --git a/tests/generator-Tests/Tests-Core/expected/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/Tests-Core/expected/Java.Interop.__TypeRegistrations.cs index 7ced4038e..9acd4384e 100644 --- a/tests/generator-Tests/Tests-Core/expected/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/Tests-Core/expected/Java.Interop.__TypeRegistrations.cs @@ -27,7 +27,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokers.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokers.txt index 84b8da0d8..fe918f37a 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokers.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokers.txt @@ -9,8 +9,8 @@ static Delegate GetGetCountForKey_Ljava_lang_String_Handler () static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -24,7 +24,7 @@ public unsafe int GetCountForKey (string key) IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -40,7 +40,7 @@ static Delegate GetKeyHandler () static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -64,7 +64,7 @@ static Delegate GetAbstractMethodHandler () static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokersWithSkips.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokersWithSkips.txt index 84b8da0d8..fe918f37a 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokersWithSkips.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfaceMethodInvokersWithSkips.txt @@ -9,8 +9,8 @@ static Delegate GetGetCountForKey_Ljava_lang_String_Handler () static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -24,7 +24,7 @@ public unsafe int GetCountForKey (string key) IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -40,7 +40,7 @@ static Delegate GetKeyHandler () static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -64,7 +64,7 @@ static Delegate GetAbstractMethodHandler () static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokers.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokers.txt index 52d70afb7..78ca2cc54 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokers.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokers.txt @@ -9,7 +9,7 @@ static Delegate Getget_CountHandler () static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_Count_IHandler () static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -58,7 +58,7 @@ static Delegate Getget_KeyHandler () static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -74,8 +74,8 @@ static Delegate Getset_Key_Ljava_lang_String_Handler () static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -110,7 +110,7 @@ static Delegate Getget_StaticCountHandler () static int n_get_StaticCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.StaticCount; } #pragma warning restore 0169 @@ -126,7 +126,7 @@ static Delegate Getset_StaticCount_IHandler () static void n_set_StaticCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.StaticCount = value; } #pragma warning restore 0169 @@ -159,7 +159,7 @@ static Delegate Getget_AbstractCountHandler () static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -175,7 +175,7 @@ static Delegate Getset_AbstractCount_IHandler () static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokersWithSkips.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokersWithSkips.txt index 59b8937d8..bf56a20f1 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokersWithSkips.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WriteInterfacePropertyInvokersWithSkips.txt @@ -9,7 +9,7 @@ static Delegate Getget_KeyHandler () static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -25,8 +25,8 @@ static Delegate Getset_Key_Ljava_lang_String_Handler () static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -61,7 +61,7 @@ static Delegate Getget_StaticCountHandler () static int n_get_StaticCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.StaticCount; } #pragma warning restore 0169 @@ -77,7 +77,7 @@ static Delegate Getset_StaticCount_IHandler () static void n_set_StaticCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.StaticCount = value; } #pragma warning restore 0169 @@ -110,7 +110,7 @@ static Delegate Getget_AbstractCountHandler () static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -126,7 +126,7 @@ static Delegate Getset_AbstractCount_IHandler () static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyAbstractDeclaration.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyAbstractDeclaration.txt index dceeede50..930e4a308 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyAbstractDeclaration.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyAbstractDeclaration.txt @@ -9,7 +9,7 @@ static Delegate Getget_MyPropertyHandler () static int n_get_MyProperty (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MyProperty; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_MyProperty_IHandler () static void n_set_MyProperty_I (IntPtr jnienv, IntPtr native__this, int value) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.MyProperty = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyCallbacks.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyCallbacks.txt index fbad5da5a..b904abb0a 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyCallbacks.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyCallbacks.txt @@ -9,7 +9,7 @@ static Delegate Getget_MyPropertyHandler () static int n_get_MyProperty (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MyProperty; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_MyProperty_IHandler () static void n_set_MyProperty_I (IntPtr jnienv, IntPtr native__this, int value) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.MyProperty = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyInvoker.txt index b365b7260..93ab534db 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyInvoker.txt @@ -9,7 +9,7 @@ static Delegate Getget_MyPropertyHandler () static int n_get_MyProperty (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MyProperty; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_MyProperty_IHandler () static void n_set_MyProperty_I (IntPtr jnienv, IntPtr native__this, int value) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.MyProperty = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyStringVariant.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyStringVariant.txt index de61d5319..639a5fc22 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyStringVariant.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/Common/WritePropertyStringVariant.txt @@ -1,7 +1,7 @@ public string MyProperty { get { return MyProperty == null ? null : MyProperty.ToString (); } set { - global::Java.Lang.String jls = value == null ? null : new global::Java.Lang.String (value); + var jls = value == null ? null : new global::Java.Lang.String (value); MyProperty = jls; if (jls != null) jls.Dispose (); } diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClass.txt index 1a43eafeb..8c6217d1b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClass.txt @@ -62,7 +62,7 @@ public partial class MyClass { static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -78,7 +78,7 @@ public partial class MyClass { static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -118,7 +118,7 @@ public partial class MyClass { static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -134,8 +134,8 @@ public partial class MyClass { static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -201,7 +201,7 @@ public partial class MyClass { static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -217,7 +217,7 @@ public partial class MyClass { static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -240,8 +240,8 @@ public partial class MyClass { static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -274,7 +274,7 @@ public partial class MyClass { static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -313,7 +313,7 @@ public partial class MyClass { static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassMethods.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassMethods.txt index 0138df85f..6535faf97 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassMethods.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassMethods.txt @@ -9,8 +9,8 @@ static Delegate GetGetCountForKey_Ljava_lang_String_Handler () static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -43,7 +43,7 @@ static Delegate GetKeyHandler () static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -82,7 +82,7 @@ static Delegate GetAbstractMethodHandler () static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassProperties.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassProperties.txt index 012d8d057..43a35eff5 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassProperties.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteClassProperties.txt @@ -9,7 +9,7 @@ static Delegate Getget_CountHandler () static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_Count_IHandler () static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -65,7 +65,7 @@ static Delegate Getget_KeyHandler () static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -81,8 +81,8 @@ static Delegate Getset_Key_Ljava_lang_String_Handler () static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -148,7 +148,7 @@ static Delegate Getget_AbstractCountHandler () static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -164,7 +164,7 @@ static Delegate Getset_AbstractCount_IHandler () static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteDefaultInterfaceMethodInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteDefaultInterfaceMethodInvoker.txt index 729ccfb48..6e2ada3f4 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteDefaultInterfaceMethodInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteDefaultInterfaceMethodInvoker.txt @@ -60,7 +60,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_DoDeclaration (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.DoDeclaration (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterface.txt index 344fb5dcf..10a3c8536 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterface.txt @@ -129,7 +129,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -145,7 +145,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -178,7 +178,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -194,8 +194,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -230,7 +230,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -246,7 +246,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -279,8 +279,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -294,7 +294,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -310,7 +310,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -334,7 +334,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultMethod.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultMethod.txt index 4d0001ac1..0f5a62ceb 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultMethod.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultMethod.txt @@ -14,7 +14,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static void n_DoSomething (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.DoSomething (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultProperty.txt index 4fac6c8ce..91a8e4df1 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultProperty.txt @@ -14,7 +14,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static int n_get_Value (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Value; } #pragma warning restore 0169 @@ -30,7 +30,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static void n_set_Value_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Value = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt index a3fd049bb..a9ec1e593 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt @@ -14,7 +14,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static int n_get_Value (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceInvoker.txt index 385e80531..4aa6ee6d0 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteInterfaceInvoker.txt @@ -60,7 +60,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -76,7 +76,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -109,7 +109,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -125,8 +125,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -161,7 +161,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -177,7 +177,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -210,8 +210,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -225,7 +225,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -241,7 +241,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -265,7 +265,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAbstractWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAbstractWithVoidReturn.txt index e1d94c910..b7d3c80f2 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAbstractWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAbstractWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt index 3bb0345a7..0845b9d15 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static int n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt index 58c5a0b73..86ae0ee27 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodProtected.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodProtected.txt index 1d1d67f5a..61f3a2e44 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodProtected.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodProtected.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithIntReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithIntReturn.txt index 308b39ad2..2b15c54a2 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithIntReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithIntReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static int n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithStringReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithStringReturn.txt index ea83867b2..189b1521e 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithStringReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithStringReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static IntPtr n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.bar ()); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithVoidReturn.txt index ef5cbad1a..9feb4f6f4 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteMethodWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceClass.txt index ba32a9f79..c0cb405fc 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceClass.txt @@ -98,7 +98,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceTypes.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceTypes.txt index ba46e94b8..12978e6bd 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceTypes.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteNestedInterfaceTypes.txt @@ -80,7 +80,7 @@ public partial interface IParent : IJavaObject, IJavaPeerable { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent.IChild __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 @@ -161,7 +161,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteProperty.txt index 110b2bec9..b5b58733a 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteProperty.txt @@ -9,7 +9,7 @@ static Delegate Getget_MyPropertyHandler () static int n_get_MyProperty (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MyProperty; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_MyProperty_IHandler () static void n_set_MyProperty_I (IntPtr jnienv, IntPtr native__this, int value) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.MyProperty = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteUnnestedInterfaceTypes.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteUnnestedInterfaceTypes.txt index 7ecbd9e50..7ddbd9323 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteUnnestedInterfaceTypes.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/JavaInterop1/WriteUnnestedInterfaceTypes.txt @@ -71,7 +71,7 @@ internal partial class IParentChildInvoker : global::Java.Lang.Object, IParentCh static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParentChild __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 @@ -161,7 +161,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt index f1fd5bf4a..5936c52fc 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClass.txt @@ -62,7 +62,7 @@ public partial class MyClass { static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -78,7 +78,7 @@ public partial class MyClass { static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -118,7 +118,7 @@ public partial class MyClass { static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -134,8 +134,8 @@ public partial class MyClass { static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -201,7 +201,7 @@ public partial class MyClass { static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -217,7 +217,7 @@ public partial class MyClass { static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -240,8 +240,8 @@ public partial class MyClass { static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -274,7 +274,7 @@ public partial class MyClass { static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -313,7 +313,7 @@ public partial class MyClass { static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassMethods.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassMethods.txt index 0138df85f..6535faf97 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassMethods.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassMethods.txt @@ -9,8 +9,8 @@ static Delegate GetGetCountForKey_Ljava_lang_String_Handler () static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -43,7 +43,7 @@ static Delegate GetKeyHandler () static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -82,7 +82,7 @@ static Delegate GetAbstractMethodHandler () static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassProperties.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassProperties.txt index 012d8d057..43a35eff5 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassProperties.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteClassProperties.txt @@ -9,7 +9,7 @@ static Delegate Getget_CountHandler () static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_Count_IHandler () static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -65,7 +65,7 @@ static Delegate Getget_KeyHandler () static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -81,8 +81,8 @@ static Delegate Getset_Key_Ljava_lang_String_Handler () static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -148,7 +148,7 @@ static Delegate Getget_AbstractCountHandler () static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -164,7 +164,7 @@ static Delegate Getset_AbstractCount_IHandler () static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt index 6dde814ef..c96fffa4b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteDefaultInterfaceMethodInvoker.txt @@ -60,7 +60,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_DoDeclaration (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.DoDeclaration (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt index 3a3b78e35..f0e2bdc7c 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterface.txt @@ -129,7 +129,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -145,7 +145,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -178,7 +178,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -194,8 +194,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -230,7 +230,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -246,7 +246,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -279,8 +279,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -294,7 +294,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -310,7 +310,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -334,7 +334,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt index 4937f737d..a9cef33d1 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultMethod.txt @@ -14,7 +14,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static void n_DoSomething (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.DoSomething (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt index 368d674a0..52c27db01 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultProperty.txt @@ -14,7 +14,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static int n_get_Value (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Value; } #pragma warning restore 0169 @@ -30,7 +30,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static void n_set_Value_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Value = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt index 3a9b7754d..51dc1bb95 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceDefaultPropertyGetterOnly.txt @@ -14,7 +14,7 @@ public partial interface IMyInterface : IJavaObject, IJavaPeerable { private static int n_get_Value (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceInvoker.txt index b19858527..6a2ca98d8 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteInterfaceInvoker.txt @@ -60,7 +60,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -76,7 +76,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -109,7 +109,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -125,8 +125,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -161,7 +161,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -177,7 +177,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -210,8 +210,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -225,7 +225,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -241,7 +241,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -265,7 +265,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAbstractWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAbstractWithVoidReturn.txt index e1d94c910..b7d3c80f2 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAbstractWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAbstractWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt index 3bb0345a7..0845b9d15 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithIntReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static int n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt index 58c5a0b73..86ae0ee27 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodAsyncifiedWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodProtected.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodProtected.txt index 1d1d67f5a..61f3a2e44 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodProtected.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodProtected.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithIntReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithIntReturn.txt index 308b39ad2..2b15c54a2 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithIntReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithIntReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static int n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithStringReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithStringReturn.txt index ea83867b2..189b1521e 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithStringReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithStringReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static IntPtr n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.bar ()); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithVoidReturn.txt index ef5cbad1a..9feb4f6f4 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteMethodWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt index d40713502..13bdd7d3d 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceClass.txt @@ -98,7 +98,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt index f13d20716..eec67a98b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteNestedInterfaceTypes.txt @@ -80,7 +80,7 @@ public partial interface IParent : IJavaObject, IJavaPeerable { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent.IChild __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 @@ -161,7 +161,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteProperty.txt index 110b2bec9..b5b58733a 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteProperty.txt @@ -9,7 +9,7 @@ static Delegate Getget_MyPropertyHandler () static int n_get_MyProperty (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MyProperty; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_MyProperty_IHandler () static void n_set_MyProperty_I (IntPtr jnienv, IntPtr native__this, int value) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.MyProperty = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt index 0966e21b1..bc3d31de6 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XAJavaInterop1/WriteUnnestedInterfaceTypes.txt @@ -71,7 +71,7 @@ internal partial class IParentChildInvoker : global::Java.Lang.Object, IParentCh static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParentChild __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 @@ -161,7 +161,7 @@ internal partial class IParentInvoker : global::Java.Lang.Object, IParent { static int n_GetBar (IntPtr jnienv, IntPtr native__this) { - Com.Xamarin.Android.IParent __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Bar; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClass.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClass.txt index 29a12118a..4e9c67151 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClass.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClass.txt @@ -82,7 +82,7 @@ public partial class MyClass { static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -98,7 +98,7 @@ public partial class MyClass { static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -149,7 +149,7 @@ public partial class MyClass { static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -165,8 +165,8 @@ public partial class MyClass { static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -246,7 +246,7 @@ public partial class MyClass { static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -262,7 +262,7 @@ public partial class MyClass { static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -285,8 +285,8 @@ public partial class MyClass { static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -326,7 +326,7 @@ public partial class MyClass { static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -372,7 +372,7 @@ public partial class MyClass { static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassMethods.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassMethods.txt index bae86be84..076f01d4f 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassMethods.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassMethods.txt @@ -9,8 +9,8 @@ static Delegate GetGetCountForKey_Ljava_lang_String_Handler () static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -50,7 +50,7 @@ static Delegate GetKeyHandler () static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -96,7 +96,7 @@ static Delegate GetAbstractMethodHandler () static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassProperties.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassProperties.txt index e025e5206..a779e6207 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassProperties.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteClassProperties.txt @@ -9,7 +9,7 @@ static Delegate Getget_CountHandler () static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_Count_IHandler () static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -76,7 +76,7 @@ static Delegate Getget_KeyHandler () static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -92,8 +92,8 @@ static Delegate Getset_Key_Ljava_lang_String_Handler () static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -173,7 +173,7 @@ static Delegate Getget_AbstractCountHandler () static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -189,7 +189,7 @@ static Delegate Getset_AbstractCount_IHandler () static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.MyClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterface.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterface.txt index 2d850820e..ac85a3976 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterface.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterface.txt @@ -123,7 +123,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -139,7 +139,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -172,7 +172,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -188,8 +188,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -224,7 +224,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -240,7 +240,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -273,8 +273,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -288,7 +288,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -304,7 +304,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -328,7 +328,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterfaceInvoker.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterfaceInvoker.txt index eb42e9a78..27557b9bf 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterfaceInvoker.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteInterfaceInvoker.txt @@ -52,7 +52,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_Count (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Count; } #pragma warning restore 0169 @@ -68,7 +68,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Count_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Count = value; } #pragma warning restore 0169 @@ -101,7 +101,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_get_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key); } #pragma warning restore 0169 @@ -117,8 +117,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_Key_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Key = value; } #pragma warning restore 0169 @@ -153,7 +153,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_get_AbstractCount (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.AbstractCount; } #pragma warning restore 0169 @@ -169,7 +169,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_set_AbstractCount_I (IntPtr jnienv, IntPtr native__this, int value) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractCount = value; } #pragma warning restore 0169 @@ -202,8 +202,8 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static int n_GetCountForKey_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_key) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var key = JNIEnv.GetString (native_key, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetCountForKey (key); return __ret; } @@ -217,7 +217,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf IntPtr native_key = JNIEnv.NewString (key); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_key); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_GetCountForKey_Ljava_lang_String_, __args); JNIEnv.DeleteLocalRef (native_key); return __ret; } @@ -233,7 +233,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static IntPtr n_Key (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Key ()); } #pragma warning restore 0169 @@ -257,7 +257,7 @@ internal partial class IMyInterfaceInvoker : global::Java.Lang.Object, IMyInterf static void n_AbstractMethod (IntPtr jnienv, IntPtr native__this) { - java.code.IMyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.AbstractMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAbstractWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAbstractWithVoidReturn.txt index 2fd9eb46a..44104474e 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAbstractWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAbstractWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithIntReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithIntReturn.txt index 7a5a04721..d56798718 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithIntReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithIntReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static int n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithVoidReturn.txt index 73873e164..5363ab7a3 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodAsyncifiedWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodProtected.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodProtected.txt index 2eeafc088..adb21722c 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodProtected.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodProtected.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithIntReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithIntReturn.txt index dacc86497..573280f0b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithIntReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithIntReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static int n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithStringReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithStringReturn.txt index 245fde349..ca0d2aaf3 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithStringReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithStringReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static IntPtr n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.bar ()); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithVoidReturn.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithVoidReturn.txt index 439bc0148..ae470c92b 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithVoidReturn.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteMethodWithVoidReturn.txt @@ -9,7 +9,7 @@ static Delegate GetbarHandler () static void n_bar (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.bar (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteProperty.txt b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteProperty.txt index 3e110e36f..f396c6c04 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteProperty.txt +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorExpectedResults/XamarinAndroid/WriteProperty.txt @@ -9,7 +9,7 @@ static Delegate Getget_MyPropertyHandler () static int n_get_MyProperty (IntPtr jnienv, IntPtr native__this) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MyProperty; } #pragma warning restore 0169 @@ -25,7 +25,7 @@ static Delegate Getset_MyProperty_IHandler () static void n_set_MyProperty_I (IntPtr jnienv, IntPtr native__this, int value) { - com.mypackage.foo __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.MyProperty = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.BasePublicClass.cs b/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.BasePublicClass.cs index 78480d31b..3e7409922 100644 --- a/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.BasePublicClass.cs +++ b/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.BasePublicClass.cs @@ -41,7 +41,7 @@ static Delegate GetBaseMethodHandler () static void n_BaseMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.BasePublicClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.BaseMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs b/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs index b1e3624b5..c22bc285a 100644 --- a/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs +++ b/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs @@ -59,7 +59,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.ExtendPublicClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.PublicClass.cs b/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.PublicClass.cs index 5a07663e5..650246adf 100644 --- a/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.PublicClass.cs +++ b/tests/generator-Tests/expected.ji/AccessModifiers/Xamarin.Test.PublicClass.cs @@ -81,7 +81,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.PublicClass.IProtectedInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 @@ -147,7 +147,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.PublicClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AbsSpinner.cs b/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AbsSpinner.cs index d45408fbb..b04c9d1cc 100644 --- a/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AbsSpinner.cs +++ b/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AbsSpinner.cs @@ -41,7 +41,7 @@ static Delegate GetGetAdapterHandler () static IntPtr n_GetAdapter (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.AbsSpinner __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Adapter); } #pragma warning restore 0169 @@ -57,8 +57,8 @@ static Delegate GetSetAdapter_Lxamarin_test_SpinnerAdapter_Handler () static void n_SetAdapter_Lxamarin_test_SpinnerAdapter_ (IntPtr jnienv, IntPtr native__this, IntPtr native_adapter) { - global::Xamarin.Test.AbsSpinner __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Xamarin.Test.ISpinnerAdapter adapter = (global::Xamarin.Test.ISpinnerAdapter)global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var adapter = (global::Xamarin.Test.ISpinnerAdapter)global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); __this.Adapter = adapter; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AdapterView.cs b/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AdapterView.cs index 5c2e80516..919b5142d 100644 --- a/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AdapterView.cs +++ b/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.AdapterView.cs @@ -42,7 +42,7 @@ static Delegate GetGetAdapterHandler () static IntPtr n_GetAdapter (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.AdapterView __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.RawAdapter); } #pragma warning restore 0169 @@ -58,8 +58,8 @@ static Delegate GetSetAdapter_Lxamarin_test_Adapter_Handler () static void n_SetAdapter_Lxamarin_test_Adapter_ (IntPtr jnienv, IntPtr native__this, IntPtr native_adapter) { - global::Xamarin.Test.AdapterView __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); __this.RawAdapter = adapter; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.GenericReturnObject.cs b/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.GenericReturnObject.cs index a9e1ec281..f1fda92ff 100644 --- a/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.GenericReturnObject.cs +++ b/tests/generator-Tests/expected.ji/Adapters/Xamarin.Test.GenericReturnObject.cs @@ -41,7 +41,7 @@ static Delegate GetGenericReturnHandler () static IntPtr n_GenericReturn (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.GenericReturnObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.GenericReturn ()); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.ji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs index d1107d178..79f69fa5c 100644 --- a/tests/generator-Tests/expected.ji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.ji/Android.Graphics.Color/Xamarin.Test.SomeObject.cs @@ -61,7 +61,7 @@ static Delegate GetGetSomeColorHandler () static int n_GetSomeColor (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.SomeColor.ToArgb (); } #pragma warning restore 0169 @@ -77,8 +77,8 @@ static Delegate GetSetSomeColor_IHandler () static void n_SetSomeColor_I (IntPtr jnienv, IntPtr native__this, int native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Android.Graphics.Color newvalue = new global::Android.Graphics.Color (native_newvalue); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = new global::Android.Graphics.Color (native_newvalue); __this.SomeColor = newvalue; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs b/tests/generator-Tests/expected.ji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs index c8bc590ed..42c4931b8 100644 --- a/tests/generator-Tests/expected.ji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs +++ b/tests/generator-Tests/expected.ji/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs @@ -41,7 +41,7 @@ static Delegate GetUsePartial_IHandler () static IntPtr n_UsePartial_I (IntPtr jnienv, IntPtr native__this, int partial) { - global::Xamarin.Test.CSharpKeywords __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.UsePartial (partial)); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs b/tests/generator-Tests/expected.ji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs index d20bd6f37..8af8eb372 100644 --- a/tests/generator-Tests/expected.ji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs +++ b/tests/generator-Tests/expected.ji/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs @@ -78,10 +78,10 @@ static Delegate GetOnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBI static void n_OnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_p0, IntPtr native_p1, int p2, int p3, IntPtr native_p4) { - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); - byte[] p1 = (byte[]) JNIEnv.GetArray (native_p1, JniHandleOwnership.DoNotTransfer, typeof (byte)); - byte[] p4 = (byte[]) JNIEnv.GetArray (native_p4, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); + var p1 = (byte[]) JNIEnv.GetArray (native_p1, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var p4 = (byte[]) JNIEnv.GetArray (native_p4, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.OnEvent (p0, p1, p2, p3, p4); if (p1 != null) JNIEnv.CopyArray (p1, native_p1); @@ -259,8 +259,8 @@ static Delegate GetSetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMedia static void n_SetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); __this.SetOnEventListener (p0); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II1.cs b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II1.cs index 218c7cfd0..34ce6354c 100644 --- a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II1.cs +++ b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II1.cs @@ -77,7 +77,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.II1 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II2.cs b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II2.cs index 669e81f5d..004091bb5 100644 --- a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II2.cs +++ b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.II2.cs @@ -77,7 +77,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.II2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs index 55a449039..02b194375 100644 --- a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs @@ -41,7 +41,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs index e9504dbdf..a5fbc5559 100644 --- a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs +++ b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs @@ -41,7 +41,7 @@ static Delegate GetIrrelevantHandler () static void n_Irrelevant (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Irrelevant (); } #pragma warning restore 0169 @@ -68,7 +68,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs b/tests/generator-Tests/expected.ji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs index 8b724e121..fca51fcf2 100644 --- a/tests/generator-Tests/expected.ji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs +++ b/tests/generator-Tests/expected.ji/NestedTypes/Xamarin.Test.NotificationCompatBase.cs @@ -85,7 +85,7 @@ static Delegate GetBuild_IHandler () static IntPtr n_Build_I (IntPtr jnienv, IntPtr native__this, int p0) { - global::Xamarin.Test.NotificationCompatBase.Action.IFactory __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Build (p0)); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.A.cs b/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.A.cs index 3d113b1cc..59039a267 100644 --- a/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.A.cs +++ b/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.A.cs @@ -46,7 +46,7 @@ static Delegate GetSetCustomDimension_IHandler () static IntPtr n_SetCustomDimension_I (IntPtr jnienv, IntPtr native__this, int index) { - global::Xamarin.Test.A.B __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.SetCustomDimension (index)); } #pragma warning restore 0169 @@ -99,7 +99,7 @@ static Delegate GetGetHandleHandler () static int n_GetHandle (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.A __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.GetHandle (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.C.cs b/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.C.cs index b4d912f2f..d2e61602f 100644 --- a/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.C.cs +++ b/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.C.cs @@ -42,7 +42,7 @@ static Delegate GetSetCustomDimension_IHandler () static IntPtr n_SetCustomDimension_I (IntPtr jnienv, IntPtr native__this, int index) { - global::Xamarin.Test.C __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.SetCustomDimension (index)); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.SomeObject.cs index a993d267c..a240909af 100644 --- a/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.ji/NormalMethods/Xamarin.Test.SomeObject.cs @@ -61,7 +61,7 @@ static Delegate GetGetTypeHandler () static IntPtr n_GetType (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewArray (__this.GetType ()); } #pragma warning restore 0169 @@ -89,9 +89,9 @@ static Delegate GetHandle_Ljava_lang_Object_Ljava_lang_Throwable_Handler () static int n_Handle_Ljava_lang_Object_Ljava_lang_Throwable_ (IntPtr jnienv, IntPtr native__this, IntPtr native_o, IntPtr native_t) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object o = global::Java.Lang.Object.GetObject (native_o, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Throwable t = global::Java.Lang.Object.GetObject (native_t, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var o = global::Java.Lang.Object.GetObject (native_o, JniHandleOwnership.DoNotTransfer); + var t = global::Java.Lang.Object.GetObject (native_t, JniHandleOwnership.DoNotTransfer); int __ret = __this.Handle (o, t); return __ret; } @@ -123,7 +123,7 @@ static Delegate GetIntegerMethodHandler () static int n_IntegerMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.IntegerMethod (); } #pragma warning restore 0169 @@ -151,7 +151,7 @@ static Delegate GetVoidMethodHandler () static void n_VoidMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.VoidMethod (); } #pragma warning restore 0169 @@ -178,7 +178,7 @@ static Delegate GetStringMethodHandler () static IntPtr n_StringMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.StringMethod ()); } #pragma warning restore 0169 @@ -206,7 +206,7 @@ static Delegate GetObjectMethodHandler () static IntPtr n_ObjectMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.ObjectMethod ()); } #pragma warning restore 0169 @@ -234,9 +234,9 @@ static Delegate GetVoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_Han static void n_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_astring, int anint, IntPtr native_anObject) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string astring = JNIEnv.GetString (native_astring, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object anObject = global::Java.Lang.Object.GetObject (native_anObject, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var astring = JNIEnv.GetString (native_astring, JniHandleOwnership.DoNotTransfer); + var anObject = global::Java.Lang.Object.GetObject (native_anObject, JniHandleOwnership.DoNotTransfer); __this.VoidMethodWithParams (astring, anint, anObject); } #pragma warning restore 0169 @@ -271,7 +271,7 @@ static Delegate GetObsoleteMethodHandler () [Obsolete] static int n_ObsoleteMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.ObsoleteMethod (); } #pragma warning restore 0169 @@ -300,7 +300,7 @@ static Delegate GetArrayListTest_Ljava_util_ArrayList_Handler () static void n_ArrayListTest_Ljava_util_ArrayList_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var p0 = global::Android.Runtime.JavaList.FromJniHandle (native_p0, JniHandleOwnership.DoNotTransfer); __this.ArrayListTest (p0); } diff --git a/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/NormalProperties/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected.ji/NormalProperties/Xamarin.Test.SomeObject.cs index 46b9d5160..9140a103f 100644 --- a/tests/generator-Tests/expected.ji/NormalProperties/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected.ji/NormalProperties/Xamarin.Test.SomeObject.cs @@ -41,7 +41,7 @@ static Delegate GetGetSomeIntegerHandler () static int n_GetSomeInteger (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.SomeInteger; } #pragma warning restore 0169 @@ -57,7 +57,7 @@ static Delegate GetSetSomeInteger_IHandler () static void n_SetSomeInteger_I (IntPtr jnienv, IntPtr native__this, int newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.SomeInteger = newvalue; } #pragma warning restore 0169 @@ -80,7 +80,7 @@ static Delegate GetGetSomeObjectPropertyHandler () static IntPtr n_GetSomeObjectProperty (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.SomeObjectProperty); } #pragma warning restore 0169 @@ -96,8 +96,8 @@ static Delegate GetSetSomeObjectProperty_Ljava_lang_Object_Handler () static void n_SetSomeObjectProperty_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object newvalue = global::Java.Lang.Object.GetObject (native_newvalue, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = global::Java.Lang.Object.GetObject (native_newvalue, JniHandleOwnership.DoNotTransfer); __this.SomeObjectProperty = newvalue; } #pragma warning restore 0169 @@ -120,7 +120,7 @@ static Delegate GetGetSomeStringHandler () static IntPtr n_GetSomeString (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.SomeString); } #pragma warning restore 0169 @@ -136,8 +136,8 @@ static Delegate GetSetSomeString_Ljava_lang_String_Handler () static void n_SetSomeString_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string newvalue = JNIEnv.GetString (native_newvalue, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = JNIEnv.GetString (native_newvalue, JniHandleOwnership.DoNotTransfer); __this.SomeString = newvalue; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/ParameterXPath/Xamarin.Test.A.cs b/tests/generator-Tests/expected.ji/ParameterXPath/Xamarin.Test.A.cs index 1ad979f35..285a8afa6 100644 --- a/tests/generator-Tests/expected.ji/ParameterXPath/Xamarin.Test.A.cs +++ b/tests/generator-Tests/expected.ji/ParameterXPath/Xamarin.Test.A.cs @@ -42,8 +42,8 @@ static Delegate GetSetA_Ljava_lang_Object_Handler () static void n_SetA_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_adapter) { - global::Xamarin.Test.A __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); __this.SetA (adapter); } #pragma warning restore 0169 @@ -74,7 +74,7 @@ static Delegate GetListTest_Ljava_util_List_Handler () static void n_ListTest_Ljava_util_List_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - global::Xamarin.Test.A __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var p0 = global::Android.Runtime.JavaList.FromJniHandle (native_p0, JniHandleOwnership.DoNotTransfer); __this.ListTest (p0); } diff --git a/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/Streams/Java.IO.FilterOutputStream.cs b/tests/generator-Tests/expected.ji/Streams/Java.IO.FilterOutputStream.cs index a25c31496..26387f106 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.IO.FilterOutputStream.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.IO.FilterOutputStream.cs @@ -63,7 +63,7 @@ static Delegate GetWrite_IHandler () static void n_Write_I (IntPtr jnienv, IntPtr native__this, int oneByte) { - global::Java.IO.FilterOutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Write (oneByte); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Streams/Java.IO.IOException.cs b/tests/generator-Tests/expected.ji/Streams/Java.IO.IOException.cs index 843297add..ed04613c4 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.IO.IOException.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.IO.IOException.cs @@ -41,7 +41,7 @@ static Delegate GetPrintStackTraceHandler () static void n_PrintStackTrace (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.IOException __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.PrintStackTrace (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Streams/Java.IO.InputStream.cs b/tests/generator-Tests/expected.ji/Streams/Java.IO.InputStream.cs index b6472a250..b3be61e79 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.IO.InputStream.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.IO.InputStream.cs @@ -59,7 +59,7 @@ static Delegate GetAvailableHandler () static int n_Available (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Available (); } #pragma warning restore 0169 @@ -87,7 +87,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 @@ -114,7 +114,7 @@ static Delegate GetMark_IHandler () static void n_Mark_I (IntPtr jnienv, IntPtr native__this, int readlimit) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Mark (readlimit); } #pragma warning restore 0169 @@ -143,7 +143,7 @@ static Delegate GetMarkSupportedHandler () static bool n_MarkSupported (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MarkSupported (); } #pragma warning restore 0169 @@ -171,7 +171,7 @@ static Delegate GetReadHandler () static int n_Read (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Read (); } #pragma warning restore 0169 @@ -191,8 +191,8 @@ static Delegate GetRead_arrayBHandler () static int n_Read_arrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); int __ret = __this.Read (buffer); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -230,8 +230,8 @@ static Delegate GetRead_arrayBIIHandler () static int n_Read_arrayBII (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer, int byteOffset, int byteCount) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); int __ret = __this.Read (buffer, byteOffset, byteCount); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -271,7 +271,7 @@ static Delegate GetResetHandler () static void n_Reset (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Reset (); } #pragma warning restore 0169 @@ -298,7 +298,7 @@ static Delegate GetSkip_JHandler () static long n_Skip_J (IntPtr jnienv, IntPtr native__this, long byteCount) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Skip (byteCount); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Streams/Java.IO.OutputStream.cs b/tests/generator-Tests/expected.ji/Streams/Java.IO.OutputStream.cs index e0efda25a..9ba0b8978 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.IO.OutputStream.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.IO.OutputStream.cs @@ -59,7 +59,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 @@ -86,7 +86,7 @@ static Delegate GetFlushHandler () static void n_Flush (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Flush (); } #pragma warning restore 0169 @@ -113,8 +113,8 @@ static Delegate GetWrite_arrayBHandler () static void n_Write_arrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.Write (buffer); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -150,8 +150,8 @@ static Delegate GetWrite_arrayBIIHandler () static void n_Write_arrayBII (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer, int offset, int count) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.Write (buffer, offset, count); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -189,7 +189,7 @@ static Delegate GetWrite_IHandler () static void n_Write_I (IntPtr jnienv, IntPtr native__this, int oneByte) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Write (oneByte); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/Streams/Java.Lang.Throwable.cs b/tests/generator-Tests/expected.ji/Streams/Java.Lang.Throwable.cs index c9c94cab2..4098b942d 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.Lang.Throwable.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.Lang.Throwable.cs @@ -27,7 +27,7 @@ static Delegate GetGetMessageHandler () static IntPtr n_GetMessage (IntPtr jnienv, IntPtr native__this) { - global::Java.Lang.Throwable __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Message); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericImplementation.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericImplementation.cs index e59f60afd..5541276bf 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericImplementation.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericImplementation.cs @@ -59,8 +59,8 @@ static Delegate GetSetObject_arrayBHandler () static void n_SetObject_arrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] value = (byte[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = (byte[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.SetObject (value); if (value != null) JNIEnv.CopyArray (value, native_value); diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs index d44af5ec0..fb76f9b3f 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs @@ -59,7 +59,7 @@ static Delegate GetGetObjectHandler () static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) { - global::Test.ME.GenericObjectPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Object); } #pragma warning restore 0169 @@ -75,8 +75,8 @@ static Delegate GetSetObject_Ljava_lang_Object_Handler () static void n_SetObject_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericObjectPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Object = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringImplementation.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringImplementation.cs index f1d071ba0..719ee72f7 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringImplementation.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringImplementation.cs @@ -59,8 +59,8 @@ static Delegate GetSetObject_arrayLjava_lang_String_Handler () static void n_SetObject_arrayLjava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericStringImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string[] value = (string[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (string)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = (string[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (string)); __this.SetObject (value); if (value != null) JNIEnv.CopyArray (value, native_value); diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs index a2c6d8144..48341d5b9 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.GenericStringPropertyImplementation.cs @@ -59,7 +59,7 @@ static Delegate GetGetObjectHandler () static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) { - global::Test.ME.GenericStringPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Object); } #pragma warning restore 0169 @@ -75,8 +75,8 @@ static Delegate GetSetObject_Ljava_lang_String_Handler () static void n_SetObject_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericStringPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Object = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericInterface.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericInterface.cs index 25fed6a0b..c1ba12a2e 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericInterface.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericInterface.cs @@ -78,8 +78,8 @@ static Delegate GetSetObject_Ljava_lang_Object_Handler () static void n_SetObject_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.IGenericInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.SetObject (value); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericPropertyInterface.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericPropertyInterface.cs index b481c150d..29f457db9 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericPropertyInterface.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.IGenericPropertyInterface.cs @@ -81,7 +81,7 @@ static Delegate GetGetObjectHandler () static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) { - global::Test.ME.IGenericPropertyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Object); } #pragma warning restore 0169 @@ -97,8 +97,8 @@ static Delegate GetSetObject_Ljava_lang_Object_Handler () static void n_SetObject_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.IGenericPropertyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Object = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.ITestInterface.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.ITestInterface.cs index 258daa29f..f910a6a2a 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.ITestInterface.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.ITestInterface.cs @@ -62,14 +62,14 @@ public static partial class ITestInterfaceExtensions { public static void Append (this Test.ME.ITestInterface self, string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); self.Append (jls_value); jls_value?.Dispose (); } public static string Identity (this Test.ME.ITestInterface self, string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); global::Java.Lang.ICharSequence __result = self.IdentityFormatted (jls_value); var __rsval = __result?.ToString (); jls_value?.Dispose (); @@ -139,8 +139,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - global::Test.ME.ITestInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetSpanFlags (tag); return __ret; } @@ -153,7 +153,7 @@ public unsafe int GetSpanFlags (global::Java.Lang.Object tag) id_getSpanFlags_Ljava_lang_Object_ = JNIEnv.GetMethodID (class_ref, "getSpanFlags", "(Ljava/lang/Object;)I"); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue ((tag == null) ? IntPtr.Zero : ((global::Java.Lang.Object) tag).Handle); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); return __ret; } @@ -168,8 +168,8 @@ static Delegate GetAppend_Ljava_lang_CharSequence_Handler () static void n_Append_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.ITestInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Append (value); } #pragma warning restore 0169 @@ -197,8 +197,8 @@ static Delegate GetIdentity_Ljava_lang_CharSequence_Handler () static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.ITestInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); IntPtr __ret = CharSequence.ToLocalJniHandle (__this.IdentityFormatted (value)); return __ret; } @@ -212,7 +212,7 @@ static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native_ IntPtr native_value = CharSequence.ToLocalJniHandle (value); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_value); - global::Java.Lang.ICharSequence __ret = global::Java.Lang.Object.GetObject (JNIEnv.CallObjectMethod (((global::Java.Lang.Object) this).Handle, id_identity_Ljava_lang_CharSequence_, __args), JniHandleOwnership.TransferLocalRef); + var __ret = global::Java.Lang.Object.GetObject (JNIEnv.CallObjectMethod (((global::Java.Lang.Object) this).Handle, id_identity_Ljava_lang_CharSequence_, __args), JniHandleOwnership.TransferLocalRef); JNIEnv.DeleteLocalRef (native_value); return __ret; } diff --git a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.TestInterfaceImplementation.cs b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.TestInterfaceImplementation.cs index 4d44c73e1..61b94b9df 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Test.ME.TestInterfaceImplementation.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Test.ME.TestInterfaceImplementation.cs @@ -81,8 +81,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - global::Test.ME.TestInterfaceImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetSpanFlags (tag); return __ret; } @@ -103,8 +103,8 @@ static Delegate GetAppend_Ljava_lang_CharSequence_Handler () static void n_Append_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.TestInterfaceImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Append (value); } #pragma warning restore 0169 @@ -115,7 +115,7 @@ static void n_Append_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__thi public void Append (string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); Append (jls_value); jls_value?.Dispose (); } @@ -131,8 +131,8 @@ static Delegate GetIdentity_Ljava_lang_CharSequence_Handler () static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.TestInterfaceImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); IntPtr __ret = CharSequence.ToLocalJniHandle (__this.IdentityFormatted (value)); return __ret; } @@ -144,7 +144,7 @@ static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native_ public string Identity (string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); global::Java.Lang.ICharSequence __result = IdentityFormatted (jls_value); var __rsval = __result?.ToString (); jls_value?.Dispose (); @@ -212,6 +212,7 @@ public override unsafe void Append (global::Java.Lang.ICharSequence value) JNIEnv.DeleteLocalRef (native_value); } } + } } diff --git a/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Lang.IComparable.cs b/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Lang.IComparable.cs index 5eeecaf25..32925cf0f 100644 --- a/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Lang.IComparable.cs +++ b/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Lang.IComparable.cs @@ -78,8 +78,8 @@ static Delegate GetCompareTo_Ljava_lang_Object_Handler () static int n_CompareTo_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_another) { - global::Java.Lang.IComparable __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object another = global::Java.Lang.Object.GetObject (native_another, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var another = global::Java.Lang.Object.GetObject (native_another, JniHandleOwnership.DoNotTransfer); int __ret = __this.CompareTo (another); return __ret; } @@ -93,7 +93,7 @@ public unsafe int CompareTo (global::Java.Lang.Object another) IntPtr native_another = JNIEnv.ToLocalJniHandle (another); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_another); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_compareTo_Ljava_lang_Object_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_compareTo_Ljava_lang_Object_, __args); JNIEnv.DeleteLocalRef (native_another); return __ret; } diff --git a/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.BasePublicClass.cs b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.BasePublicClass.cs index f9e404d25..8bbca76b2 100644 --- a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.BasePublicClass.cs +++ b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.BasePublicClass.cs @@ -36,7 +36,7 @@ static Delegate GetBaseMethodHandler () static void n_BaseMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.BasePublicClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.BaseMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs index 7b915c99c..319ed738e 100644 --- a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs +++ b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.ExtendPublicClass.cs @@ -64,7 +64,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.ExtendPublicClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.IExtendedInterface.cs b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.IExtendedInterface.cs index c289f307b..76265a305 100644 --- a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.IExtendedInterface.cs +++ b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.IExtendedInterface.cs @@ -72,7 +72,7 @@ static Delegate GetExtendedMethodHandler () static void n_ExtendedMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.IExtendedInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.ExtendedMethod (); } #pragma warning restore 0169 @@ -96,7 +96,7 @@ static Delegate GetBaseMethodHandler () static void n_BaseMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.IExtendedInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.BaseMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.PublicClass.cs b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.PublicClass.cs index 01cadce6b..d1b4ed2e1 100644 --- a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.PublicClass.cs +++ b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.PublicClass.cs @@ -72,7 +72,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.PublicClass.IProtectedInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 @@ -144,7 +144,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.PublicClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.TestClass.cs b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.TestClass.cs index b1759154e..b28856b9d 100644 --- a/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.TestClass.cs +++ b/tests/generator-Tests/expected/AccessModifiers/Xamarin.Test.TestClass.cs @@ -64,7 +64,7 @@ static Delegate GetBaseMethodHandler () static void n_BaseMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.TestClass __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.BaseMethod (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Adapters/Xamarin.Test.AbsSpinner.cs b/tests/generator-Tests/expected/Adapters/Xamarin.Test.AbsSpinner.cs index 713b92a6d..299c70378 100644 --- a/tests/generator-Tests/expected/Adapters/Xamarin.Test.AbsSpinner.cs +++ b/tests/generator-Tests/expected/Adapters/Xamarin.Test.AbsSpinner.cs @@ -36,7 +36,7 @@ static Delegate GetGetAdapterHandler () static IntPtr n_GetAdapter (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.AbsSpinner __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Adapter); } #pragma warning restore 0169 @@ -52,8 +52,8 @@ static Delegate GetSetAdapter_Lxamarin_test_SpinnerAdapter_Handler () static void n_SetAdapter_Lxamarin_test_SpinnerAdapter_ (IntPtr jnienv, IntPtr native__this, IntPtr native_adapter) { - global::Xamarin.Test.AbsSpinner __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Xamarin.Test.ISpinnerAdapter adapter = (global::Xamarin.Test.ISpinnerAdapter)global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var adapter = (global::Xamarin.Test.ISpinnerAdapter)global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); __this.Adapter = adapter; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Adapters/Xamarin.Test.AdapterView.cs b/tests/generator-Tests/expected/Adapters/Xamarin.Test.AdapterView.cs index 563d8837f..c04e825a6 100644 --- a/tests/generator-Tests/expected/Adapters/Xamarin.Test.AdapterView.cs +++ b/tests/generator-Tests/expected/Adapters/Xamarin.Test.AdapterView.cs @@ -37,7 +37,7 @@ static Delegate GetGetAdapterHandler () static IntPtr n_GetAdapter (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.AdapterView __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.RawAdapter); } #pragma warning restore 0169 @@ -53,8 +53,8 @@ static Delegate GetSetAdapter_Lxamarin_test_Adapter_Handler () static void n_SetAdapter_Lxamarin_test_Adapter_ (IntPtr jnienv, IntPtr native__this, IntPtr native_adapter) { - global::Xamarin.Test.AdapterView __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); __this.RawAdapter = adapter; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Adapters/Xamarin.Test.GenericReturnObject.cs b/tests/generator-Tests/expected/Adapters/Xamarin.Test.GenericReturnObject.cs index b8e38860b..97e9a5c3d 100644 --- a/tests/generator-Tests/expected/Adapters/Xamarin.Test.GenericReturnObject.cs +++ b/tests/generator-Tests/expected/Adapters/Xamarin.Test.GenericReturnObject.cs @@ -36,7 +36,7 @@ static Delegate GetGenericReturnHandler () static IntPtr n_GenericReturn (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.GenericReturnObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.GenericReturn ()); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Android.Graphics.Color/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected/Android.Graphics.Color/Xamarin.Test.SomeObject.cs index 6b95c8495..82a5cfda2 100644 --- a/tests/generator-Tests/expected/Android.Graphics.Color/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected/Android.Graphics.Color/Xamarin.Test.SomeObject.cs @@ -57,7 +57,7 @@ static Delegate GetGetSomeColorHandler () static int n_GetSomeColor (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.SomeColor.ToArgb (); } #pragma warning restore 0169 @@ -73,8 +73,8 @@ static Delegate GetSetSomeColor_IHandler () static void n_SetSomeColor_I (IntPtr jnienv, IntPtr native__this, int native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Android.Graphics.Color newvalue = new global::Android.Graphics.Color (native_newvalue); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = new global::Android.Graphics.Color (native_newvalue); __this.SomeColor = newvalue; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs b/tests/generator-Tests/expected/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs index f35538e8f..0c79c3e52 100644 --- a/tests/generator-Tests/expected/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs +++ b/tests/generator-Tests/expected/CSharpKeywords/Xamarin.Test.CSharpKeywords.cs @@ -36,7 +36,7 @@ static Delegate GetUsePartial_IHandler () static IntPtr n_UsePartial_I (IntPtr jnienv, IntPtr native__this, int partial) { - global::Xamarin.Test.CSharpKeywords __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.UsePartial (partial)); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject.cs index cec1db509..ec2127209 100644 --- a/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject.cs @@ -36,7 +36,7 @@ static Delegate GetGetSomeObjectPropertyHandler () static int n_GetSomeObjectProperty (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return (int) __this.SomeObjectProperty; } #pragma warning restore 0169 @@ -52,8 +52,8 @@ static Delegate GetSetSomeObjectProperty_IHandler () static void n_SetSomeObjectProperty_I (IntPtr jnienv, IntPtr native__this, int native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Xamarin.Test.SomeValues newvalue = (global::Xamarin.Test.SomeValues) native_newvalue; + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = (global::Xamarin.Test.SomeValues) native_newvalue; __this.SomeObjectProperty = newvalue; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject2.cs b/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject2.cs index eb10fd820..503894e5a 100644 --- a/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject2.cs +++ b/tests/generator-Tests/expected/EnumerationFixup/Xamarin.Test.SomeObject2.cs @@ -36,7 +36,7 @@ static Delegate GetGetSomeObjectPropertyHandler () static int n_GetSomeObjectProperty (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return (int) __this.SomeObjectProperty; } #pragma warning restore 0169 @@ -52,8 +52,8 @@ static Delegate GetSetSomeObjectProperty_IHandler () static void n_SetSomeObjectProperty_I (IntPtr jnienv, IntPtr native__this, int native_newvalue) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Xamarin.Test.SomeValues newvalue = (global::Xamarin.Test.SomeValues) native_newvalue; + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = (global::Xamarin.Test.SomeValues) native_newvalue; __this.SomeObjectProperty = newvalue; } #pragma warning restore 0169 @@ -104,7 +104,7 @@ static Delegate GetGetSomeObjectPropertyArrayHandler () static IntPtr n_GetSomeObjectPropertyArray (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewArray (__this.GetSomeObjectPropertyArray ()); } #pragma warning restore 0169 @@ -138,8 +138,8 @@ static Delegate GetSetSomeObjectPropertyArray_arrayIHandler () static void n_SetSomeObjectPropertyArray_arrayI (IntPtr jnienv, IntPtr native__this, IntPtr native_newvalue) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Xamarin.Test.SomeValues[] newvalue = (global::Xamarin.Test.SomeValues[]) JNIEnv.GetArray (native_newvalue, JniHandleOwnership.DoNotTransfer, typeof (global::Xamarin.Test.SomeValues)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = (global::Xamarin.Test.SomeValues[]) JNIEnv.GetArray (native_newvalue, JniHandleOwnership.DoNotTransfer, typeof (global::Xamarin.Test.SomeValues)); __this.SetSomeObjectPropertyArray (newvalue); if (newvalue != null) JNIEnv.CopyArray (newvalue, native_newvalue); diff --git a/tests/generator-Tests/expected/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs b/tests/generator-Tests/expected/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs index d2325eb24..725f9d99b 100644 --- a/tests/generator-Tests/expected/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs +++ b/tests/generator-Tests/expected/GenericArguments/Com.Google.Android.Exoplayer.Drm.IExoMediaDrm.cs @@ -69,10 +69,10 @@ static Delegate GetOnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBI static void n_OnEvent_Lcom_google_android_exoplayer_drm_ExoMediaDrm_arrayBIIarrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_p0, IntPtr native_p1, int p2, int p3, IntPtr native_p4) { - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); - byte[] p1 = (byte[]) JNIEnv.GetArray (native_p1, JniHandleOwnership.DoNotTransfer, typeof (byte)); - byte[] p4 = (byte[]) JNIEnv.GetArray (native_p4, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); + var p1 = (byte[]) JNIEnv.GetArray (native_p1, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var p4 = (byte[]) JNIEnv.GetArray (native_p4, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.OnEvent (p0, p1, p2, p3, p4); if (p1 != null) JNIEnv.CopyArray (p1, native_p1); @@ -242,8 +242,8 @@ static Delegate GetSetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMedia static void n_SetOnEventListener_Lcom_google_android_exoplayer_drm_ExoMediaDrm_OnEventListener_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var p0 = (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrmOnEventListener)global::Java.Lang.Object.GetObject (native_p0, JniHandleOwnership.DoNotTransfer); __this.SetOnEventListener (p0); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II1.cs b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II1.cs index ebd6b7ceb..38e537c90 100644 --- a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II1.cs +++ b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II1.cs @@ -68,7 +68,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.II1 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II2.cs b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II2.cs index 13588bd3e..11efbf3a5 100644 --- a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II2.cs +++ b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.II2.cs @@ -68,7 +68,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.II2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs index 369623c50..613d6cfbc 100644 --- a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject.cs @@ -36,7 +36,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs index 6e75018a0..55e18da9b 100644 --- a/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs +++ b/tests/generator-Tests/expected/InterfaceMethodsConflict/Xamarin.Test.SomeObject2.cs @@ -36,7 +36,7 @@ static Delegate GetIrrelevantHandler () static void n_Irrelevant (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Irrelevant (); } #pragma warning restore 0169 @@ -69,7 +69,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject2 __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/NestedTypes/Xamarin.Test.NotificationCompatBase.cs b/tests/generator-Tests/expected/NestedTypes/Xamarin.Test.NotificationCompatBase.cs index dd1ab14ca..869f90a3d 100644 --- a/tests/generator-Tests/expected/NestedTypes/Xamarin.Test.NotificationCompatBase.cs +++ b/tests/generator-Tests/expected/NestedTypes/Xamarin.Test.NotificationCompatBase.cs @@ -76,7 +76,7 @@ static Delegate GetBuild_IHandler () static IntPtr n_Build_I (IntPtr jnienv, IntPtr native__this, int p0) { - global::Xamarin.Test.NotificationCompatBase.Action.IFactory __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Build (p0)); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.A.cs b/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.A.cs index 22674a43d..ffd781199 100644 --- a/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.A.cs +++ b/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.A.cs @@ -41,7 +41,7 @@ static Delegate GetSetCustomDimension_IHandler () static IntPtr n_SetCustomDimension_I (IntPtr jnienv, IntPtr native__this, int index) { - global::Xamarin.Test.A.B __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.SetCustomDimension (index)); } #pragma warning restore 0169 @@ -95,7 +95,7 @@ static Delegate GetGetHandleHandler () static int n_GetHandle (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.A __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.GetHandle (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.C.cs b/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.C.cs index bde8d119e..d98089aa9 100644 --- a/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.C.cs +++ b/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.C.cs @@ -37,7 +37,7 @@ static Delegate GetSetCustomDimension_IHandler () static IntPtr n_SetCustomDimension_I (IntPtr jnienv, IntPtr native__this, int index) { - global::Xamarin.Test.C __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.SetCustomDimension (index)); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.SomeObject.cs index a1ee6e70e..b33deeb02 100644 --- a/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected/NormalMethods/Xamarin.Test.SomeObject.cs @@ -66,7 +66,7 @@ static Delegate GetGetTypeHandler () static IntPtr n_GetType (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewArray (__this.GetType ()); } #pragma warning restore 0169 @@ -99,9 +99,9 @@ static Delegate GetHandle_Ljava_lang_Object_Ljava_lang_Throwable_Handler () static int n_Handle_Ljava_lang_Object_Ljava_lang_Throwable_ (IntPtr jnienv, IntPtr native__this, IntPtr native_o, IntPtr native_t) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object o = global::Java.Lang.Object.GetObject (native_o, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Throwable t = global::Java.Lang.Object.GetObject (native_t, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var o = global::Java.Lang.Object.GetObject (native_o, JniHandleOwnership.DoNotTransfer); + var t = global::Java.Lang.Object.GetObject (native_t, JniHandleOwnership.DoNotTransfer); int __ret = __this.Handle (o, t); return __ret; } @@ -140,7 +140,7 @@ static Delegate GetIntegerMethodHandler () static int n_IntegerMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.IntegerMethod (); } #pragma warning restore 0169 @@ -173,7 +173,7 @@ static Delegate GetVoidMethodHandler () static void n_VoidMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.VoidMethod (); } #pragma warning restore 0169 @@ -206,7 +206,7 @@ static Delegate GetStringMethodHandler () static IntPtr n_StringMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.StringMethod ()); } #pragma warning restore 0169 @@ -239,7 +239,7 @@ static Delegate GetObjectMethodHandler () static IntPtr n_ObjectMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.ObjectMethod ()); } #pragma warning restore 0169 @@ -272,9 +272,9 @@ static Delegate GetVoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_Han static void n_VoidMethodWithParams_Ljava_lang_String_ILjava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_astring, int anint, IntPtr native_anObject) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string astring = JNIEnv.GetString (native_astring, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object anObject = global::Java.Lang.Object.GetObject (native_anObject, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var astring = JNIEnv.GetString (native_astring, JniHandleOwnership.DoNotTransfer); + var anObject = global::Java.Lang.Object.GetObject (native_anObject, JniHandleOwnership.DoNotTransfer); __this.VoidMethodWithParams (astring, anint, anObject); } #pragma warning restore 0169 @@ -315,7 +315,7 @@ static Delegate GetObsoleteMethodHandler () [Obsolete] static int n_ObsoleteMethod (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.ObsoleteMethod (); } #pragma warning restore 0169 @@ -349,7 +349,7 @@ static Delegate GetArrayListTest_Ljava_util_ArrayList_Handler () static void n_ArrayListTest_Ljava_util_ArrayList_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var p0 = global::Android.Runtime.JavaList.FromJniHandle (native_p0, JniHandleOwnership.DoNotTransfer); __this.ArrayListTest (p0); } diff --git a/tests/generator-Tests/expected/NormalProperties/Xamarin.Test.SomeObject.cs b/tests/generator-Tests/expected/NormalProperties/Xamarin.Test.SomeObject.cs index 8f41cc46b..c0e125055 100644 --- a/tests/generator-Tests/expected/NormalProperties/Xamarin.Test.SomeObject.cs +++ b/tests/generator-Tests/expected/NormalProperties/Xamarin.Test.SomeObject.cs @@ -36,7 +36,7 @@ static Delegate GetGetSomeIntegerHandler () static int n_GetSomeInteger (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.SomeInteger; } #pragma warning restore 0169 @@ -52,7 +52,7 @@ static Delegate GetSetSomeInteger_IHandler () static void n_SetSomeInteger_I (IntPtr jnienv, IntPtr native__this, int newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.SomeInteger = newvalue; } #pragma warning restore 0169 @@ -75,7 +75,7 @@ static Delegate GetGetSomeObjectPropertyHandler () static IntPtr n_GetSomeObjectProperty (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.SomeObjectProperty); } #pragma warning restore 0169 @@ -91,8 +91,8 @@ static Delegate GetSetSomeObjectProperty_Ljava_lang_Object_Handler () static void n_SetSomeObjectProperty_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object newvalue = global::Java.Lang.Object.GetObject (native_newvalue, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = global::Java.Lang.Object.GetObject (native_newvalue, JniHandleOwnership.DoNotTransfer); __this.SomeObjectProperty = newvalue; } #pragma warning restore 0169 @@ -115,7 +115,7 @@ static Delegate GetGetSomeStringHandler () static IntPtr n_GetSomeString (IntPtr jnienv, IntPtr native__this) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.SomeString); } #pragma warning restore 0169 @@ -131,8 +131,8 @@ static Delegate GetSetSomeString_Ljava_lang_String_Handler () static void n_SetSomeString_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_newvalue) { - global::Xamarin.Test.SomeObject __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string newvalue = JNIEnv.GetString (native_newvalue, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var newvalue = JNIEnv.GetString (native_newvalue, JniHandleOwnership.DoNotTransfer); __this.SomeString = newvalue; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/ParameterXPath/Xamarin.Test.A.cs b/tests/generator-Tests/expected/ParameterXPath/Xamarin.Test.A.cs index a2a1f5999..3357e503f 100644 --- a/tests/generator-Tests/expected/ParameterXPath/Xamarin.Test.A.cs +++ b/tests/generator-Tests/expected/ParameterXPath/Xamarin.Test.A.cs @@ -37,8 +37,8 @@ static Delegate GetSetA_Ljava_lang_Object_Handler () static void n_SetA_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_adapter) { - global::Xamarin.Test.A __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var adapter = global::Java.Lang.Object.GetObject (native_adapter, JniHandleOwnership.DoNotTransfer); __this.SetA (adapter); } #pragma warning restore 0169 @@ -75,7 +75,7 @@ static Delegate GetListTest_Ljava_util_List_Handler () static void n_ListTest_Ljava_util_List_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) { - global::Xamarin.Test.A __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); var p0 = global::Android.Runtime.JavaList.FromJniHandle (native_p0, JniHandleOwnership.DoNotTransfer); __this.ListTest (p0); } diff --git a/tests/generator-Tests/expected/Streams/Java.IO.FilterOutputStream.cs b/tests/generator-Tests/expected/Streams/Java.IO.FilterOutputStream.cs index a62b1b43d..91271be4d 100644 --- a/tests/generator-Tests/expected/Streams/Java.IO.FilterOutputStream.cs +++ b/tests/generator-Tests/expected/Streams/Java.IO.FilterOutputStream.cs @@ -68,7 +68,7 @@ static Delegate GetWrite_IHandler () static void n_Write_I (IntPtr jnienv, IntPtr native__this, int oneByte) { - global::Java.IO.FilterOutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Write (oneByte); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Streams/Java.IO.IOException.cs b/tests/generator-Tests/expected/Streams/Java.IO.IOException.cs index dbcab9dbb..972b502e3 100644 --- a/tests/generator-Tests/expected/Streams/Java.IO.IOException.cs +++ b/tests/generator-Tests/expected/Streams/Java.IO.IOException.cs @@ -36,7 +36,7 @@ static Delegate GetPrintStackTraceHandler () static void n_PrintStackTrace (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.IOException __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.PrintStackTrace (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Streams/Java.IO.InputStream.cs b/tests/generator-Tests/expected/Streams/Java.IO.InputStream.cs index 5f0c0d95e..39e85d310 100644 --- a/tests/generator-Tests/expected/Streams/Java.IO.InputStream.cs +++ b/tests/generator-Tests/expected/Streams/Java.IO.InputStream.cs @@ -64,7 +64,7 @@ static Delegate GetAvailableHandler () static int n_Available (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Available (); } #pragma warning restore 0169 @@ -97,7 +97,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 @@ -130,7 +130,7 @@ static Delegate GetMark_IHandler () static void n_Mark_I (IntPtr jnienv, IntPtr native__this, int readlimit) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Mark (readlimit); } #pragma warning restore 0169 @@ -165,7 +165,7 @@ static Delegate GetMarkSupportedHandler () static bool n_MarkSupported (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.MarkSupported (); } #pragma warning restore 0169 @@ -198,7 +198,7 @@ static Delegate GetReadHandler () static int n_Read (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Read (); } #pragma warning restore 0169 @@ -218,8 +218,8 @@ static Delegate GetRead_arrayBHandler () static int n_Read_arrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); int __ret = __this.Read (buffer); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -264,8 +264,8 @@ static Delegate GetRead_arrayBIIHandler () static int n_Read_arrayBII (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer, int byteOffset, int byteCount) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); int __ret = __this.Read (buffer, byteOffset, byteCount); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -312,7 +312,7 @@ static Delegate GetResetHandler () static void n_Reset (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Reset (); } #pragma warning restore 0169 @@ -345,7 +345,7 @@ static Delegate GetSkip_JHandler () static long n_Skip_J (IntPtr jnienv, IntPtr native__this, long byteCount) { - global::Java.IO.InputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return __this.Skip (byteCount); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Streams/Java.IO.OutputStream.cs b/tests/generator-Tests/expected/Streams/Java.IO.OutputStream.cs index 223bf7a1f..41d6c5d74 100644 --- a/tests/generator-Tests/expected/Streams/Java.IO.OutputStream.cs +++ b/tests/generator-Tests/expected/Streams/Java.IO.OutputStream.cs @@ -64,7 +64,7 @@ static Delegate GetCloseHandler () static void n_Close (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Close (); } #pragma warning restore 0169 @@ -97,7 +97,7 @@ static Delegate GetFlushHandler () static void n_Flush (IntPtr jnienv, IntPtr native__this) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Flush (); } #pragma warning restore 0169 @@ -130,8 +130,8 @@ static Delegate GetWrite_arrayBHandler () static void n_Write_arrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.Write (buffer); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -173,8 +173,8 @@ static Delegate GetWrite_arrayBIIHandler () static void n_Write_arrayBII (IntPtr jnienv, IntPtr native__this, IntPtr native_buffer, int offset, int count) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var buffer = (byte[]) JNIEnv.GetArray (native_buffer, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.Write (buffer, offset, count); if (buffer != null) JNIEnv.CopyArray (buffer, native_buffer); @@ -218,7 +218,7 @@ static Delegate GetWrite_IHandler () static void n_Write_I (IntPtr jnienv, IntPtr native__this, int oneByte) { - global::Java.IO.OutputStream __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Write (oneByte); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/Streams/Java.Lang.Throwable.cs b/tests/generator-Tests/expected/Streams/Java.Lang.Throwable.cs index 1340c92de..479cb3314 100644 --- a/tests/generator-Tests/expected/Streams/Java.Lang.Throwable.cs +++ b/tests/generator-Tests/expected/Streams/Java.Lang.Throwable.cs @@ -26,7 +26,7 @@ static Delegate GetGetMessageHandler () static IntPtr n_GetMessage (IntPtr jnienv, IntPtr native__this) { - global::Java.Lang.Throwable __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Message); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/ClassWithoutNamespace.cs b/tests/generator-Tests/expected/TestInterface/ClassWithoutNamespace.cs index 05719a261..2ecf60286 100644 --- a/tests/generator-Tests/expected/TestInterface/ClassWithoutNamespace.cs +++ b/tests/generator-Tests/expected/TestInterface/ClassWithoutNamespace.cs @@ -62,7 +62,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - ClassWithoutNamespace __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/IInterfaceWithoutNamespace.cs b/tests/generator-Tests/expected/TestInterface/IInterfaceWithoutNamespace.cs index 718a0dc92..63d03cfc5 100644 --- a/tests/generator-Tests/expected/TestInterface/IInterfaceWithoutNamespace.cs +++ b/tests/generator-Tests/expected/TestInterface/IInterfaceWithoutNamespace.cs @@ -66,7 +66,7 @@ static Delegate GetFooHandler () static void n_Foo (IntPtr jnienv, IntPtr native__this) { - IInterfaceWithoutNamespace __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); __this.Foo (); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericImplementation.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericImplementation.cs index bad6e22c0..7d94d9ec9 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericImplementation.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericImplementation.cs @@ -64,8 +64,8 @@ static Delegate GetSetObject_arrayBHandler () static void n_SetObject_arrayB (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - byte[] value = (byte[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (byte)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = (byte[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (byte)); __this.SetObject (value); if (value != null) JNIEnv.CopyArray (value, native_value); diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs index 949099fb8..22d9f2fd2 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericObjectPropertyImplementation.cs @@ -64,7 +64,7 @@ static Delegate GetGetObjectHandler () static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) { - global::Test.ME.GenericObjectPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Object); } #pragma warning restore 0169 @@ -80,8 +80,8 @@ static Delegate GetSetObject_Ljava_lang_Object_Handler () static void n_SetObject_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericObjectPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Object = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringImplementation.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringImplementation.cs index ce8075d6f..ca6c169de 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringImplementation.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringImplementation.cs @@ -64,8 +64,8 @@ static Delegate GetSetObject_arrayLjava_lang_String_Handler () static void n_SetObject_arrayLjava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericStringImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string[] value = (string[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (string)); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = (string[]) JNIEnv.GetArray (native_value, JniHandleOwnership.DoNotTransfer, typeof (string)); __this.SetObject (value); if (value != null) JNIEnv.CopyArray (value, native_value); diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringPropertyImplementation.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringPropertyImplementation.cs index 015ca2efd..6e7c440f2 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringPropertyImplementation.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.GenericStringPropertyImplementation.cs @@ -64,7 +64,7 @@ static Delegate GetGetObjectHandler () static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) { - global::Test.ME.GenericStringPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.NewString (__this.Object); } #pragma warning restore 0169 @@ -80,8 +80,8 @@ static Delegate GetSetObject_Ljava_lang_String_Handler () static void n_SetObject_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.GenericStringPropertyImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - string value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = JNIEnv.GetString (native_value, JniHandleOwnership.DoNotTransfer); __this.Object = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericInterface.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericInterface.cs index 2a8218821..a1e89d9b1 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericInterface.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericInterface.cs @@ -69,8 +69,8 @@ static Delegate GetSetObject_Ljava_lang_Object_Handler () static void n_SetObject_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.IGenericInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.SetObject (value); } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericPropertyInterface.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericPropertyInterface.cs index 4680102d0..e83728344 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericPropertyInterface.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.IGenericPropertyInterface.cs @@ -72,7 +72,7 @@ static Delegate GetGetObjectHandler () static IntPtr n_GetObject (IntPtr jnienv, IntPtr native__this) { - global::Test.ME.IGenericPropertyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); return JNIEnv.ToLocalJniHandle (__this.Object); } #pragma warning restore 0169 @@ -88,8 +88,8 @@ static Delegate GetSetObject_Ljava_lang_Object_Handler () static void n_SetObject_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.IGenericPropertyInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Object = value; } #pragma warning restore 0169 diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.ITestInterface.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.ITestInterface.cs index 640141dfc..0e6489315 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.ITestInterface.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.ITestInterface.cs @@ -62,14 +62,14 @@ public static partial class ITestInterfaceExtensions { public static void Append (this Test.ME.ITestInterface self, string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); self.Append (jls_value); jls_value?.Dispose (); } public static string Identity (this Test.ME.ITestInterface self, string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); global::Java.Lang.ICharSequence __result = self.IdentityFormatted (jls_value); var __rsval = __result?.ToString (); jls_value?.Dispose (); @@ -131,8 +131,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - global::Test.ME.ITestInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetSpanFlags (tag); return __ret; } @@ -145,7 +145,7 @@ public unsafe int GetSpanFlags (global::Java.Lang.Object tag) id_getSpanFlags_Ljava_lang_Object_ = JNIEnv.GetMethodID (class_ref, "getSpanFlags", "(Ljava/lang/Object;)I"); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (tag); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_getSpanFlags_Ljava_lang_Object_, __args); return __ret; } @@ -160,8 +160,8 @@ static Delegate GetAppend_Ljava_lang_CharSequence_Handler () static void n_Append_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.ITestInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Append (value); } #pragma warning restore 0169 @@ -189,8 +189,8 @@ static Delegate GetIdentity_Ljava_lang_CharSequence_Handler () static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.ITestInterface __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); IntPtr __ret = CharSequence.ToLocalJniHandle (__this.IdentityFormatted (value)); return __ret; } @@ -204,7 +204,7 @@ static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native_ IntPtr native_value = CharSequence.ToLocalJniHandle (value); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_value); - global::Java.Lang.ICharSequence __ret = global::Java.Lang.Object.GetObject (JNIEnv.CallObjectMethod (((global::Java.Lang.Object) this).Handle, id_identity_Ljava_lang_CharSequence_, __args), JniHandleOwnership.TransferLocalRef); + var __ret = global::Java.Lang.Object.GetObject (JNIEnv.CallObjectMethod (((global::Java.Lang.Object) this).Handle, id_identity_Ljava_lang_CharSequence_, __args), JniHandleOwnership.TransferLocalRef); JNIEnv.DeleteLocalRef (native_value); return __ret; } diff --git a/tests/generator-Tests/expected/TestInterface/Test.ME.TestInterfaceImplementation.cs b/tests/generator-Tests/expected/TestInterface/Test.ME.TestInterfaceImplementation.cs index 6310c5e3a..6f8aa5d10 100644 --- a/tests/generator-Tests/expected/TestInterface/Test.ME.TestInterfaceImplementation.cs +++ b/tests/generator-Tests/expected/TestInterface/Test.ME.TestInterfaceImplementation.cs @@ -87,8 +87,8 @@ static Delegate GetGetSpanFlags_Ljava_lang_Object_Handler () static int n_GetSpanFlags_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_tag) { - global::Test.ME.TestInterfaceImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var tag = global::Java.Lang.Object.GetObject (native_tag, JniHandleOwnership.DoNotTransfer); int __ret = __this.GetSpanFlags (tag); return __ret; } @@ -109,8 +109,8 @@ static Delegate GetAppend_Ljava_lang_CharSequence_Handler () static void n_Append_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.TestInterfaceImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); __this.Append (value); } #pragma warning restore 0169 @@ -121,7 +121,7 @@ static void n_Append_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__thi public void Append (string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); Append (jls_value); jls_value?.Dispose (); } @@ -137,8 +137,8 @@ static Delegate GetIdentity_Ljava_lang_CharSequence_Handler () static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native__this, IntPtr native_value) { - global::Test.ME.TestInterfaceImplementation __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.ICharSequence value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var value = global::Java.Lang.Object.GetObject (native_value, JniHandleOwnership.DoNotTransfer); IntPtr __ret = CharSequence.ToLocalJniHandle (__this.IdentityFormatted (value)); return __ret; } @@ -150,7 +150,7 @@ static IntPtr n_Identity_Ljava_lang_CharSequence_ (IntPtr jnienv, IntPtr native_ public string Identity (string value) { - global::Java.Lang.String jls_value = value == null ? null : new global::Java.Lang.String (value); + var jls_value = value == null ? null : new global::Java.Lang.String (value); global::Java.Lang.ICharSequence __result = IdentityFormatted (jls_value); var __rsval = __result?.ToString (); jls_value?.Dispose (); @@ -218,6 +218,7 @@ public override unsafe void Append (global::Java.Lang.ICharSequence value) JNIEnv.DeleteLocalRef (native_value); } } + } } diff --git a/tests/generator-Tests/expected/java.lang.Enum/Java.Lang.IComparable.cs b/tests/generator-Tests/expected/java.lang.Enum/Java.Lang.IComparable.cs index 490b28059..6ca25321d 100644 --- a/tests/generator-Tests/expected/java.lang.Enum/Java.Lang.IComparable.cs +++ b/tests/generator-Tests/expected/java.lang.Enum/Java.Lang.IComparable.cs @@ -69,8 +69,8 @@ static Delegate GetCompareTo_Ljava_lang_Object_Handler () static int n_CompareTo_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_another) { - global::Java.Lang.IComparable __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); - global::Java.Lang.Object another = global::Java.Lang.Object.GetObject (native_another, JniHandleOwnership.DoNotTransfer); + var __this = global::Java.Lang.Object.GetObject (jnienv, native__this, JniHandleOwnership.DoNotTransfer); + var another = global::Java.Lang.Object.GetObject (native_another, JniHandleOwnership.DoNotTransfer); int __ret = __this.CompareTo (another); return __ret; } @@ -84,7 +84,7 @@ public unsafe int CompareTo (global::Java.Lang.Object another) IntPtr native_another = JNIEnv.ToLocalJniHandle (another); JValue* __args = stackalloc JValue [1]; __args [0] = new JValue (native_another); - int __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_compareTo_Ljava_lang_Object_, __args); + var __ret = JNIEnv.CallIntMethod (((global::Java.Lang.Object) this).Handle, id_compareTo_Ljava_lang_Object_, __args); JNIEnv.DeleteLocalRef (native_another); return __ret; } diff --git a/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs index 6008ae6da..871d20de2 100644 --- a/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs @@ -25,7 +25,7 @@ public static void RegisterPackages () static Type Lookup (string[] mappings, string javaType) { - string managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); + var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); if (managedType == null) return null; return Type.GetType (managedType); diff --git a/tools/generator/Java.Interop.Tools.Generator.CodeGeneration/CodeGenerator.cs b/tools/generator/Java.Interop.Tools.Generator.CodeGeneration/CodeGenerator.cs index a6ffef5a1..e63116627 100644 --- a/tools/generator/Java.Interop.Tools.Generator.CodeGeneration/CodeGenerator.cs +++ b/tools/generator/Java.Interop.Tools.Generator.CodeGeneration/CodeGenerator.cs @@ -1109,7 +1109,7 @@ public virtual void WriteMethodCallback (Method method, string indent, GenBase t writer.WriteLine ($"{indent}[Obsolete]"); writer.WriteLine ("{0}{4}static {1} n_{2} (IntPtr jnienv, IntPtr native__this{3})", indent, method.RetVal.NativeType, method.Name + method.IDSignature, method.Parameters.GetCallbackSignature (opt), is_private); writer.WriteLine ("{0}{{", indent); - writer.WriteLine ("{0}\t{1} __this = global::Java.Lang.Object.GetObject<{1}> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);", indent, opt.GetOutputName (type.FullName)); + writer.WriteLine ("{0}\tvar __this = global::Java.Lang.Object.GetObject<{1}> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);", indent, opt.GetOutputName (type.FullName)); foreach (string s in method.Parameters.GetCallbackPrep (opt)) writer.WriteLine ("{0}\t{1}", indent, s); if (String.IsNullOrEmpty (property_name)) { @@ -1284,7 +1284,7 @@ public void WriteMethodInvokerBody (Method method, string indent) if (method.IsVoid) writer.WriteLine ("{0}{1};", indent, call); else - writer.WriteLine ("{0}{1}{2};", indent, method.Parameters.HasCleanup ? opt.GetOutputName (method.RetVal.FullName) + " __ret = " : "return ", method.RetVal.FromNative (opt, call, true)); + writer.WriteLine ("{0}{1}{2};", indent, method.Parameters.HasCleanup ? "var __ret = " : "return ", method.RetVal.FromNative (opt, call, true)); foreach (string cleanup in method.Parameters.GetCallCleanup (opt)) writer.WriteLine ("{0}{1}", indent, cleanup); @@ -1300,10 +1300,10 @@ void WriteMethodStringOverloadBody (Method method, string indent, bool haveSelf) string pname = p.Name; if (p.Type == "Java.Lang.ICharSequence") { pname = p.GetName ("jls_"); - writer.WriteLine ("{0}global::Java.Lang.String {1} = {2} == null ? null : new global::Java.Lang.String ({2});", indent, pname, p.Name); + writer.WriteLine ("{0}var {1} = {2} == null ? null : new global::Java.Lang.String ({2});", indent, pname, p.Name); } else if (p.Type == "Java.Lang.ICharSequence[]" || p.Type == "params Java.Lang.ICharSequence[]") { pname = p.GetName ("jlca_"); - writer.WriteLine ("{0}global::Java.Lang.ICharSequence[] {1} = CharSequence.ArrayFromStringArray({2});", indent, pname, p.Name); + writer.WriteLine ("{0}var {1} = CharSequence.ArrayFromStringArray({2});", indent, pname, p.Name); } if (call.Length > 0) call.Append (", "); @@ -1327,7 +1327,7 @@ void WriteMethodStringOverloadBody (Method method, string indent, bool haveSelf) if (p.Type == "Java.Lang.ICharSequence") writer.WriteLine ("{0}{1}?.Dispose ();", indent, p.GetName ("jls_")); else if (p.Type == "Java.Lang.ICharSequence[]") - writer.WriteLine ("{0}if ({1} != null) foreach (global::Java.Lang.String s in {1}) s?.Dispose ();", indent, p.GetName ("jlca_")); + writer.WriteLine ("{0}if ({1} != null) foreach (var s in {1}) s?.Dispose ();", indent, p.GetName ("jlca_")); } if (!method.RetVal.IsVoid) { writer.WriteLine ($"{indent}return __rsval;"); @@ -1741,11 +1741,11 @@ public void WritePropertyStringVariant (Property property, string indent) writer.WriteLine ("{0}\tset {{", indent); writer.WriteLine ("{0}\t\tglobal::Java.Lang.ICharSequence[] jlsa = CharSequence.ArrayFromStringArray (value);", indent); writer.WriteLine ("{0}\t\t{1} = jlsa;", indent, property.AdjustedName); - writer.WriteLine ("{0}\t\tforeach (global::Java.Lang.String jls in jlsa) if (jls != null) jls.Dispose ();", indent); + writer.WriteLine ("{0}\t\tforeach (var jls in jlsa) if (jls != null) jls.Dispose ();", indent); writer.WriteLine ("{0}\t}}", indent); } else { writer.WriteLine ("{0}\tset {{", indent); - writer.WriteLine ("{0}\t\tglobal::Java.Lang.String jls = value == null ? null : new global::Java.Lang.String (value);", indent); + writer.WriteLine ("{0}\t\tvar jls = value == null ? null : new global::Java.Lang.String (value);", indent); writer.WriteLine ("{0}\t\t{1} = jls;", indent, property.AdjustedName); writer.WriteLine ("{0}\t\tif (jls != null) jls.Dispose ();", indent); writer.WriteLine ("{0}\t}}", indent); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs index 914d48595..78be073c5 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs @@ -209,7 +209,7 @@ public static void GenerateTypeRegistrations (CodeGenerationOptions opt, Generat sw.WriteLine (); sw.WriteLine ("\t\tstatic Type Lookup (string[] mappings, string javaType)"); sw.WriteLine ("\t\t{"); - sw.WriteLine ("\t\t\tstring managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType);"); + sw.WriteLine ("\t\t\tvar managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType);"); sw.WriteLine ("\t\t\tif (managedType == null)"); sw.WriteLine ("\t\t\t\treturn null;"); sw.WriteLine ("\t\t\treturn Type.GetType (managedType);"); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs index 977ee8430..24fa892fa 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs @@ -710,7 +710,7 @@ public string [] PreCallback (CodeGenerationOptions opt, string var_name, bool o return new string []{ string.Format ("{0} {1} = {5}global::Java.Lang.Object.GetObject<{4}> ({2}, {3});", - opt.GetOutputName (FullName), + "var", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name)), owned ? "JniHandleOwnership.TransferLocalRef" : "JniHandleOwnership.DoNotTransfer", diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs index 4f4dff175..de42eb9fa 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs @@ -213,7 +213,7 @@ public string[] GetPreCallback (CodeGenerationOptions opt) else if (NeedsPrep) return sym.PreCallback (opt, Name, false); else - return new string[] { opt.GetOutputName (Type) + " " + opt.GetSafeIdentifier (Name) + " = " + FromNative (opt, false) + ";" }; + return new string[] { "var " + opt.GetSafeIdentifier (Name) + " = " + FromNative (opt, false) + ";" }; } public string Type { diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ArraySymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ArraySymbol.cs index b42412fe6..18365006c 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ArraySymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ArraySymbol.cs @@ -117,7 +117,7 @@ public string[] PostCall (CodeGenerationOptions opt, string var_name) public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { - return new string[] { String.Format ("{0}[] {1} = ({0}[]) JNIEnv.GetArray ({2}, JniHandleOwnership.DoNotTransfer, typeof ({3}));", opt.GetOutputName (ElementType), opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name)), opt.GetOutputName (sym.FullName)) }; + return new string[] { String.Format ("var {1} = ({0}[]) JNIEnv.GetArray ({2}, JniHandleOwnership.DoNotTransfer, typeof ({3}));", opt.GetOutputName (ElementType), opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name)), opt.GetOutputName (sym.FullName)) }; } public string[] PreCall (CodeGenerationOptions opt, string var_name) diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CharSequenceSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CharSequenceSymbol.cs index 329e66eb3..cadc2b749 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CharSequenceSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CharSequenceSymbol.cs @@ -87,7 +87,7 @@ public string[] PostCall (CodeGenerationOptions opt, string var_name) public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { - return new string[] { String.Format ("global::Java.Lang.ICharSequence {0} = global::Java.Lang.Object.GetObject ({1}, JniHandleOwnership.DoNotTransfer);", var_name, TypeNameUtilities.GetNativeName (var_name)) }; + return new string[] { String.Format ("var {0} = global::Java.Lang.Object.GetObject ({1}, JniHandleOwnership.DoNotTransfer);", var_name, TypeNameUtilities.GetNativeName (var_name)) }; } public string[] PreCall (CodeGenerationOptions opt, string var_name) diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericTypeParameter.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericTypeParameter.cs index d1f901910..8fd2c794f 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericTypeParameter.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericTypeParameter.cs @@ -98,7 +98,7 @@ public bool Validate (CodeGenerationOptions opt, GenericParameterDefinitionList public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { return new string[]{ - string.Format ("{0} {1} = global::Java.Lang.Object.GetObject<{0}> ({2}, {3});", + string.Format ("var {1} = global::Java.Lang.Object.GetObject<{0}> ({2}, {3});", opt.GetOutputName (FullName), var_name, opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name)), diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StreamSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StreamSymbol.cs index bf660341d..a4730d73d 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StreamSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StreamSymbol.cs @@ -107,7 +107,7 @@ public string[] PostCall (CodeGenerationOptions opt, string var_name) public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { return new string[]{ - string.Format ("System.IO.Stream {0} = global::Android.Runtime.{1}Invoker.FromJniHandle ({2}, {3});", + string.Format ("var {0} = global::Android.Runtime.{1}Invoker.FromJniHandle ({2}, {3});", var_name, base_name, opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name)), diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StringSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StringSymbol.cs index d78799149..d7a7e0c20 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StringSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StringSymbol.cs @@ -90,7 +90,7 @@ public string[] PostCall (CodeGenerationOptions opt, string var_name) public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { - return new string[] { String.Format ("string {0} = JNIEnv.GetString ({1}, JniHandleOwnership.DoNotTransfer);", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name))) }; + return new string[] { String.Format ("var {0} = JNIEnv.GetString ({1}, JniHandleOwnership.DoNotTransfer);", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name))) }; } public string[] PreCall (CodeGenerationOptions opt, string var_name) diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlPullParserSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlPullParserSymbol.cs index aff529793..9584a2f5a 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlPullParserSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlPullParserSymbol.cs @@ -87,7 +87,7 @@ public string[] PostCall (CodeGenerationOptions opt, string var_name) public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { - return new string[] { String.Format ("System.Xml.XmlReader {0} = global::Android.Runtime.XmlPullParserReader.FromJniHandle ({1}, JniHandleOwnership.DoNotTransfer);", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name))) }; + return new string[] { String.Format ("var {0} = global::Android.Runtime.XmlPullParserReader.FromJniHandle ({1}, JniHandleOwnership.DoNotTransfer);", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name))) }; } public string[] PreCall (CodeGenerationOptions opt, string var_name) diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlResourceParserSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlResourceParserSymbol.cs index fa8df65f4..9cb814582 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlResourceParserSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlResourceParserSymbol.cs @@ -87,7 +87,7 @@ public string[] PostCall (CodeGenerationOptions opt, string var_name) public string[] PreCallback (CodeGenerationOptions opt, string var_name, bool owned) { - return new string[] { String.Format ("System.Xml.XmlReader {0} = global::Android.Runtime.XmlResourceParserReader.FromJniHandle ({1}, JniHandleOwnership.DoNotTransfer);", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name))) }; + return new string[] { String.Format ("var {0} = global::Android.Runtime.XmlResourceParserReader.FromJniHandle ({1}, JniHandleOwnership.DoNotTransfer);", opt.GetSafeIdentifier (var_name), opt.GetSafeIdentifier (TypeNameUtilities.GetNativeName (var_name))) }; } public string[] PreCall (CodeGenerationOptions opt, string var_name)