diff --git a/Directory.Build.targets b/Directory.Build.targets index 2da41427e..e0ccee778 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/build-tools/jnienv-gen/Generator.cs b/build-tools/jnienv-gen/Generator.cs index 55263908b..9530d4be4 100644 --- a/build-tools/jnienv-gen/Generator.cs +++ b/build-tools/jnienv-gen/Generator.cs @@ -13,7 +13,7 @@ public static string FixupType (this string t) } } - partial class Generator + partial sealed class Generator { static string jnienv_g_c; static string jnienv_g_h; @@ -656,7 +656,7 @@ static void GenerateNativeLibSource (TextWriter source, TextWriter header, strin } } - class JniFunction { + sealed class JniFunction { public string DeclaringType; @@ -797,7 +797,7 @@ public static TypeInfo Create (string type, string managedType = null) string p; if (pointerMapping.TryGetValue (type, out p)) return new BuiltinTypeInfo (type, p); - if (type.EndsWith ("*", StringComparison.Ordinal)) + if (type.EndsWith ('*')) return new BuiltinTypeInfo (type, "IntPtr"); return new BuiltinTypeInfo (type, type); } @@ -843,7 +843,7 @@ public virtual string[] VerifyParameter (HandleStyle style, string variable) public virtual string[] GetManagedToMarshalCleanupStatements (HandleStyle style, string variable) => Array.Empty (); } - class BuiltinTypeInfo : TypeInfo { + sealed class BuiltinTypeInfo : TypeInfo { /// /// NOTE: .NET framework can't marshal this @@ -886,7 +886,7 @@ public override string[] VerifyParameter (HandleStyle style, string variable) { if (managed != "IntPtr") return new string [0]; - var variableName = variable.StartsWith ("@", StringComparison.Ordinal) + var variableName = variable.StartsWith ('@') ? variable.Substring (1) : variable; return new[] { @@ -896,7 +896,7 @@ public override string[] VerifyParameter (HandleStyle style, string variable) } } - class BooleanTypeInfo : TypeInfo { + sealed class BooleanTypeInfo : TypeInfo { public BooleanTypeInfo (string jni) : base (jni) @@ -926,7 +926,7 @@ public override string GetManagedToMarshalExpression (HandleStyle style, string } } - class StringTypeInfo : TypeInfo { + sealed class StringTypeInfo : TypeInfo { public StringTypeInfo (string jni) : base (jni) @@ -977,7 +977,7 @@ public override string[] GetMarshalToManagedStatements (HandleStyle style, strin public override string[] VerifyParameter (HandleStyle style, string variable) { - var variableName = variable.StartsWith ("@", StringComparison.Ordinal) + var variableName = variable.StartsWith ('@') ? variable.Substring (1) : variable; return new[] { @@ -1011,7 +1011,7 @@ public override string[] GetManagedToMarshalCleanupStatements (HandleStyle style } } - class JniReleaseArrayElementsModeTypeInfo : TypeInfo { + sealed class JniReleaseArrayElementsModeTypeInfo : TypeInfo { public JniReleaseArrayElementsModeTypeInfo () : base ("jint") @@ -1041,7 +1041,7 @@ public override string GetManagedToMarshalExpression (HandleStyle style, string } } - class ArrayTypeInfo : LocalReferenceTypeInfo { + sealed class ArrayTypeInfo : LocalReferenceTypeInfo { public ArrayTypeInfo (string jni) : base (jni) @@ -1090,7 +1090,7 @@ public override string GetManagedToMarshalExpression (HandleStyle style, string public override string[] VerifyParameter (HandleStyle style, string variable) { - var variableName = variable.StartsWith ("@", StringComparison.Ordinal) + var variableName = variable.StartsWith ('@') ? variable.Substring (1) : variable; switch (style) { @@ -1137,7 +1137,7 @@ protected virtual bool IsStatic { } } - class InstanceFieldTypeInfo : IdTypeInfo { + sealed class InstanceFieldTypeInfo : IdTypeInfo { public InstanceFieldTypeInfo (string jni) : base (jni, "JniFieldInfo") @@ -1145,7 +1145,7 @@ public InstanceFieldTypeInfo (string jni) } } - class InstanceMethodTypeInfo : IdTypeInfo { + sealed class InstanceMethodTypeInfo : IdTypeInfo { public InstanceMethodTypeInfo (string jni) : base (jni, "JniMethodInfo") @@ -1153,7 +1153,7 @@ public InstanceMethodTypeInfo (string jni) } } - class StaticFieldTypeInfo : IdTypeInfo { + sealed class StaticFieldTypeInfo : IdTypeInfo { public StaticFieldTypeInfo (string jni) : base (jni, "JniFieldInfo") @@ -1165,7 +1165,7 @@ protected override bool IsStatic { } } - class StaticMethodTypeInfo : IdTypeInfo { + sealed class StaticMethodTypeInfo : IdTypeInfo { public StaticMethodTypeInfo (string jni) : base (jni, "JniMethodInfo") @@ -1244,7 +1244,7 @@ public override string[] GetMarshalToManagedStatements (HandleStyle style, strin public override string[] VerifyParameter (HandleStyle style, string variable) { - var variableName = variable.StartsWith ("@", StringComparison.Ordinal) + var variableName = variable.StartsWith ('@') ? variable.Substring (1) : variable; switch (style) { @@ -1282,7 +1282,7 @@ public override string[] GetHandleCreationLogStatements (HandleStyle style, stri } } - class WeakGlobalReferenceTypeInfo : ObjectReferenceTypeInfo { + sealed class WeakGlobalReferenceTypeInfo : ObjectReferenceTypeInfo { public WeakGlobalReferenceTypeInfo (string jni) : base (jni, "JniObjectReferenceType.WeakGlobal") @@ -1290,7 +1290,7 @@ public WeakGlobalReferenceTypeInfo (string jni) } } - class GlobalReferenceTypeInfo : ObjectReferenceTypeInfo { + sealed class GlobalReferenceTypeInfo : ObjectReferenceTypeInfo { public GlobalReferenceTypeInfo (string jni) : base (jni, "JniObjectReferenceType.Global") @@ -1298,7 +1298,7 @@ public GlobalReferenceTypeInfo (string jni) } } - class JavaVMPointerTypeInfo : TypeInfo { + sealed class JavaVMPointerTypeInfo : TypeInfo { public JavaVMPointerTypeInfo (string jni) : base (jni) @@ -1353,7 +1353,7 @@ public override string[] GetManagedToMarshalCleanupStatements (HandleStyle style } } - class ParamInfo + sealed class ParamInfo { public TypeInfo Type; public string Name; diff --git a/src/Java.Base-ref.cs b/src/Java.Base-ref.cs index 9b3d18120..a4b7cf2d5 100644 --- a/src/Java.Base-ref.cs +++ b/src/Java.Base-ref.cs @@ -3539,7 +3539,7 @@ public sealed partial class Double : Java.Lang.Number, Java.Interop.IJavaPeerabl public const int MinExponent = -1022; public const double MinNormal = 2.2250738585072014E-308; public const double MinValue = 5E-324; - public const double NaN = 0.0 / 0.0; + public const double Nan = 0.0 / 0.0; public const double NegativeInfinity = -1.0 / 0.0; public const double PositiveInfinity = 1.0 / 0.0; public const int Size = 64; @@ -3737,7 +3737,7 @@ public sealed partial class Float : Java.Lang.Number, Java.Interop.IJavaPeerable public const int MinExponent = -126; public const float MinNormal = 1.1754944E-38f; public const float MinValue = 1E-45f; - public const float NaN = 0.0f / 0.0f; + public const float Nan = 0.0f / 0.0f; public const float NegativeInfinity = -1.0f / 0.0f; public const float PositiveInfinity = 1.0f / 0.0f; public const int Size = 32; diff --git a/src/Java.Base/Java.Lang/ICharSequence.cs b/src/Java.Base/Java.Lang/ICharSequence.cs index cff227468..b17965127 100644 --- a/src/Java.Base/Java.Lang/ICharSequence.cs +++ b/src/Java.Base/Java.Lang/ICharSequence.cs @@ -2,7 +2,7 @@ namespace Java.Lang { - partial class ICharSequenceInvoker : IEnumerable { + partial sealed class ICharSequenceInvoker : IEnumerable { } public static partial class ICharSequenceExtensions { diff --git a/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportAttribute.cs b/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportAttribute.cs index c2ef7ce00..c35cb57ae 100644 --- a/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportAttribute.cs +++ b/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportAttribute.cs @@ -11,7 +11,7 @@ namespace Java.Interop { #if !JCW_ONLY_TYPE_NAMES public #endif // !JCW_ONLY_TYPE_NAMES - partial class ExportAttribute : Attribute { + partial sealed class ExportAttribute : Attribute { public ExportAttribute () { diff --git a/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportFieldAttribute.cs b/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportFieldAttribute.cs index 753406e26..6084c4d4f 100644 --- a/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportFieldAttribute.cs +++ b/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportFieldAttribute.cs @@ -9,7 +9,7 @@ namespace Java.Interop { #if !JCW_ONLY_TYPE_NAMES public #endif // !JCW_ONLY_TYPE_NAMES - partial class ExportFieldAttribute : Attribute { + partial sealed class ExportFieldAttribute : Attribute { public ExportFieldAttribute (string name) { diff --git a/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportParameterAttribute.cs b/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportParameterAttribute.cs index ea6ceb619..1513469a7 100644 --- a/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportParameterAttribute.cs +++ b/src/Java.Interop.NamingCustomAttributes/Java.Interop/ExportParameterAttribute.cs @@ -9,7 +9,7 @@ namespace Java.Interop { #if !JCW_ONLY_TYPE_NAMES public #endif // !JCW_ONLY_TYPE_NAMES - partial class ExportParameterAttribute : Attribute { + partial sealed class ExportParameterAttribute : Attribute { public ExportParameterAttribute (ExportParameterKind kind) { diff --git a/src/Java.Interop.Tools.Generator/Enumification/ConstantEntry.cs b/src/Java.Interop.Tools.Generator/Enumification/ConstantEntry.cs index 6838e36c2..3705bac95 100644 --- a/src/Java.Interop.Tools.Generator/Enumification/ConstantEntry.cs +++ b/src/Java.Interop.Tools.Generator/Enumification/ConstantEntry.cs @@ -105,7 +105,7 @@ static ConstantEntry FromVersion1String (CsvParser parser, bool transientMode) EnumMember = parser.GetField (2), JavaSignature = parser.GetField (3), Value = parser.GetField (4), - IsFlags = parser.GetField (5).ToLowerInvariant () == "flags", + IsFlags = parser.GetField (5).Equals ("flags", StringComparison.InvariantCultureIgnoreCase), FieldAction = transientMode ? FieldAction.Remove : FieldAction.Keep }; @@ -134,7 +134,7 @@ static ConstantEntry FromVersion2String (CsvParser parser) EnumFullType = parser.GetField (4), EnumMember = parser.GetField (5), FieldAction = FromFieldActionString (parser.GetField (6)), - IsFlags = parser.GetField (7).ToLowerInvariant () == "flags", + IsFlags = parser.GetField (7).Equals ("flags", StringComparison.InvariantCultureIgnoreCase), DeprecatedSince = parser.GetFieldAsNullableAndroidSdkVersion (8) }; diff --git a/src/Java.Interop.Tools.Generator/Metadata/FixupXmlDocument.cs b/src/Java.Interop.Tools.Generator/Metadata/FixupXmlDocument.cs index 3c169f9ae..3c528bf8d 100644 --- a/src/Java.Interop.Tools.Generator/Metadata/FixupXmlDocument.cs +++ b/src/Java.Interop.Tools.Generator/Metadata/FixupXmlDocument.cs @@ -62,7 +62,7 @@ public void Apply (ApiXmlDocument apiDocument, string apiLevelString, int produc try { var nodes = apiDocument.ApiDocument.XPathSelectElements (path).ToArray (); - if (nodes.Any ()) + if (nodes.Length != 0) foreach (var node in nodes) node.Remove (); else diff --git a/src/Java.Interop.Tools.Generator/Metadata/NamespaceTransform.cs b/src/Java.Interop.Tools.Generator/Metadata/NamespaceTransform.cs index 4db92796e..dfefcd0a2 100644 --- a/src/Java.Interop.Tools.Generator/Metadata/NamespaceTransform.cs +++ b/src/Java.Interop.Tools.Generator/Metadata/NamespaceTransform.cs @@ -18,12 +18,12 @@ public NamespaceTransform (string oldValue, string newValue) OldValue = oldValue; NewValue = newValue; - if (OldValue.EndsWith (".", StringComparison.Ordinal)) { + if (OldValue.EndsWith ('.')) { IsStartsWith = true; OldValue = OldValue.Substring (0, OldValue.Length - 1); } - if (OldValue.StartsWith (".", StringComparison.Ordinal)) { + if (OldValue.StartsWith ('.')) { IsEndsWith = true; OldValue = OldValue.Substring (1); } @@ -57,7 +57,7 @@ public string Apply (string value) // Handle a "starts with" transform if (IsStartsWith) { if (value.StartsWith (OldValue, StringComparison.OrdinalIgnoreCase)) - return (NewValue + value.Substring (OldValue.Length)).TrimStart ('.'); + return (string.Concat (NewValue, value.AsSpan (OldValue.Length))).TrimStart ('.'); return value; } @@ -65,7 +65,7 @@ public string Apply (string value) // Handle an "ends with" transform if (IsEndsWith) { if (value.EndsWith (OldValue, StringComparison.OrdinalIgnoreCase)) - return (value.Substring (0, value.Length - OldValue.Length) + NewValue).TrimEnd ('.'); + return (string.Concat (value.AsSpan (0, value.Length - OldValue.Length), NewValue)).TrimEnd ('.'); return value; } diff --git a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.Adapters/XmlImporter.cs b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.Adapters/XmlImporter.cs index 32702c750..82fadf4ed 100644 --- a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.Adapters/XmlImporter.cs +++ b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.Adapters/XmlImporter.cs @@ -160,6 +160,8 @@ static CallableWrapperMethod ImportMethod (CallableWrapperType type, XElement xm return m; } + private static readonly char [] separator = new [] { ',' }; + static void FillInMethodDetails (CallableWrapperMethod method, XElement xml) { // Common between constructors and methods @@ -175,7 +177,7 @@ static void FillInMethodDetails (CallableWrapperMethod method, XElement xml) method.ActivateCall = xml.GetAttributeOrDefault ("activate_call", (string?) null); if (xml.GetAttributeOrDefault ("thrown_type_names", (string?) null) is string thrownTypeNames) - method.ThrownTypeNames = thrownTypeNames.Split (new [] { ',' }, StringSplitOptions.RemoveEmptyEntries); + method.ThrownTypeNames = thrownTypeNames.Split (separator, StringSplitOptions.RemoveEmptyEntries); ImportAnnotations (method.Annotations, xml.Element ("annotations")); } diff --git a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/CecilExtensions.cs b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/CecilExtensions.cs index 74e10e08c..3b269c611 100644 --- a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/CecilExtensions.cs +++ b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/CecilExtensions.cs @@ -126,7 +126,7 @@ static ExportAttribute ToExportAttribute (CustomAttribute attr, IMemberDefinitio if (attr.Properties.Count == 0) return new ExportAttribute (name); var typeArgs = (CustomAttributeArgument []) attr.Properties.FirstOrDefault (p => p.Name == "Throws").Argument.Value; - var thrown = typeArgs != null && typeArgs.Any () + var thrown = typeArgs != null && typeArgs.Length != 0 ? (from caa in typeArgs select JavaNativeTypeManager.Parse (GetJniTypeName ((TypeReference) caa.Value, cache))?.Type) .Where (v => v != null) .ToArray () diff --git a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/JavaStubParser.cs b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/JavaStubParser.cs index 00182bfb1..f03797042 100644 --- a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/JavaStubParser.cs +++ b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/JavaStubParser.cs @@ -666,7 +666,7 @@ void Flatten (List list, JavaType t) } } - class JavaNestedType : JavaMember + sealed class JavaNestedType : JavaMember { public JavaNestedType (JavaType? type) : base (type) diff --git a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.HtmlBnfTerms.cs b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.HtmlBnfTerms.cs index 82abd11c7..33da64082 100644 --- a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.HtmlBnfTerms.cs +++ b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.HtmlBnfTerms.cs @@ -298,7 +298,7 @@ static NonTerminal CreateEndElement (string endElement, Grammar grammar, bool op } // Based in part on WikiTextTerminal - class CharacterDataTerminal : Terminal { + sealed class CharacterDataTerminal : Terminal { char[]? _stopChars; @@ -357,7 +357,7 @@ public override void Init (GrammarData grammarData) } } - class PreBlockDeclarationBodyTerminal : Terminal { + sealed class PreBlockDeclarationBodyTerminal : Terminal { public PreBlockDeclarationBodyTerminal () : base ("
 body")
@@ -385,7 +385,7 @@ public override void Init (GrammarData grammarData)
 		}
 	}
 
-	class UnknownHtmlElementStartTerminal : Terminal {
+	sealed class UnknownHtmlElementStartTerminal : Terminal {
 
 		bool    addingRemarks;
 
diff --git a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs
index 2592762f0..9c435741f 100644
--- a/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs
+++ b/src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs
@@ -158,7 +158,7 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
 		}
 	}
 
-	class IgnorableCharTerminal : Terminal
+	sealed class IgnorableCharTerminal : Terminal
 	{
 		public IgnorableCharTerminal (string name)
 			: base (name)
diff --git a/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaMethodModel.cs b/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaMethodModel.cs
index 2588dfd6e..93fb55ef8 100644
--- a/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaMethodModel.cs
+++ b/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaMethodModel.cs
@@ -108,8 +108,7 @@ public void FindBaseMethod (JavaClassModel? type)
 		//	- TODO?: array indicator fixup ("T..." should match "T[]")
 		public static bool IsImplementing (JavaMethodModel derived, JavaMethodModel basis, IDictionary genericInstantiation)
 		{
-			if (genericInstantiation == null)
-				throw new ArgumentNullException ("genericInstantiation");
+			ArgumentNullException.ThrowIfNull (genericInstantiation);
 
 			if (basis.Name != derived.Name)
 				return false;
@@ -170,7 +169,7 @@ static bool IsParameterAssignableTo (JavaParameterModel dp, JavaParameterModel b
 
 		static bool IsConformantType (JavaTypeParameter typeParameter, JavaTypeReference? examinedType)
 		{
-			if (!typeParameter.GenericConstraints.Any ())
+			if (typeParameter.GenericConstraints.Count == 0)
 				return true;
 			// FIXME: implement correct generic constraint conformance check.
 			//Log.LogDebug ("NOTICE: generic constraint conformance check is not implemented, so the type might be actually compatible. Type parameter: {0}{1}, examined type: {2}",
diff --git a/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaTypeReference.cs b/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaTypeReference.cs
index 187530091..bc3e6e32d 100644
--- a/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaTypeReference.cs
+++ b/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaTypeReference.cs
@@ -46,8 +46,7 @@ public JavaTypeReference (string? constraintLabel, IEnumerable? wildcardConstraints)
 		{
-			if (referencedType == null)
-				throw new ArgumentNullException (nameof (referencedType));
+			ArgumentNullException.ThrowIfNull (referencedType);
 
 			SpecialName = referencedType.SpecialName;
 			WildcardBoundsType = wildcardBoundsType;
diff --git a/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JniTypeName.cs b/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JniTypeName.cs
index abd86cdbd..54f7d3834 100644
--- a/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JniTypeName.cs
+++ b/src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JniTypeName.cs
@@ -20,7 +20,7 @@ public static JniSignature Parse (string signature)
 			var jni = new JniSignature (JniTypeName.Parse (signature.Substring (idx)));
 
 			// Strip out return type
-			if (signature.StartsWith ("(", StringComparison.Ordinal)) {
+			if (signature.StartsWith ('(')) {
 				var e = signature.IndexOf (')');
 				signature = signature.Substring (1, e >= 0 ? e - 1 : signature.Length - 1);
 			}
@@ -71,7 +71,7 @@ public static JniTypeName Parse (string signature)
 
 						var r = Parse (signature.Substring (index));
 
-						return new JniTypeName (signature.Substring (0, index) + r.Jni, r.Type + "[]", r.IsKeyword);
+						return new JniTypeName (string.Concat (signature.AsSpan (0, index), r.Jni), r.Type + "[]", r.IsKeyword);
 					}
 				case 'B':
 					return new JniTypeName ("B", "byte", true);
diff --git a/src/Java.Interop.Tools.JavaTypeSystem/JavaTypeCollection.cs b/src/Java.Interop.Tools.JavaTypeSystem/JavaTypeCollection.cs
index 2c4f428b2..128ae934f 100644
--- a/src/Java.Interop.Tools.JavaTypeSystem/JavaTypeCollection.cs
+++ b/src/Java.Interop.Tools.JavaTypeSystem/JavaTypeCollection.cs
@@ -158,7 +158,7 @@ public CollectionResolutionResults ResolveCollection (TypeResolutionOptions? opt
 					}
 				}
 
-				if (unresolvables.Any ())
+				if (unresolvables.Count != 0)
 					results.Add (new CollectionResolutionResult (unresolvables));
 
 				// We may have removed a type that other types/members reference, so we have
diff --git a/src/Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings/JavaNativeTypeManager.cs b/src/Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings/JavaNativeTypeManager.cs
index efffef22e..762b88e82 100644
--- a/src/Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings/JavaNativeTypeManager.cs
+++ b/src/Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings/JavaNativeTypeManager.cs
@@ -62,7 +62,7 @@ static class JavaNativeTypeManager {
 
 		public static IEnumerable FromSignature (string signature)
 		{
-			if (signature.StartsWith ("(", StringComparison.Ordinal)) {
+			if (signature.Length > 0 && signature [0] == '(') {
 				int e = signature.IndexOf (')');
 				signature = signature.Substring (1, e >= 0 ? e-1 : signature.Length-1);
 			}
@@ -169,8 +169,12 @@ public static string ToJniName (Type type)
 
 		static string? ToJniName (Type type, ExportParameterKind exportKind)
 		{
+#if NETSTANDARD2_0
 			if (type == null)
-				throw new ArgumentNullException ("type");
+				throw new ArgumentNullException (nameof (type));
+#else
+			ArgumentNullException.ThrowIfNull (type);
+#endif
 
 			if (type.IsValueType)
 				return GetPrimitiveClass (type);
@@ -542,8 +546,12 @@ public static string ToJniName (TypeDefinition type, IMetadataResolver resolver)
 
 		static string? ToJniName (TypeDefinition type, ExportParameterKind exportKind, IMetadataResolver cache)
 		{
+#if NETSTANDARD2_0
 			if (type == null)
-				throw new ArgumentNullException ("type");
+				throw new ArgumentNullException (nameof (type));
+#else
+			ArgumentNullException.ThrowIfNull (type);
+#endif
 
 			if (type.IsValueType)
 				return GetPrimitiveClass (type, cache);
diff --git a/src/Java.Interop/Java.Interop/JavaArray.cs b/src/Java.Interop/Java.Interop/JavaArray.cs
index 61f2b5f1e..6d5c60881 100644
--- a/src/Java.Interop/Java.Interop/JavaArray.cs
+++ b/src/Java.Interop/Java.Interop/JavaArray.cs
@@ -94,15 +94,13 @@ internal static int CheckLength (int length)
 
 		internal static int CheckLength (IList value)
 		{
-			if (value == null)
-				throw new ArgumentNullException (nameof (value));
+			ArgumentNullException.ThrowIfNull (value);
 			return value.Count;
 		}
 
 		internal static IList ToList (IEnumerable value)
 		{
-			if (value == null)
-				throw new ArgumentNullException (nameof (value));
+			ArgumentNullException.ThrowIfNull (value);
 			if (value is IList list)
 				return list;
 			return value.ToList ();
@@ -239,8 +237,7 @@ bool IList.IsFixedSize {
 
 		void ICollection.CopyTo (Array array, int index)
 		{
-			if (array == null)
-				throw new ArgumentNullException (nameof (array));
+			ArgumentNullException.ThrowIfNull (array);
 			CheckArrayCopy (0, Length, index, array.Length, Length);
 			int len = Length;
 			for (int i = 0; i < len; i++)
@@ -326,16 +323,14 @@ internal bool IsDisposed {
 
 		public  IntPtr  Elements {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				return elements;
 			}
 		}
 
 		public int Size {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				return size;
 			}
 		}
@@ -349,8 +344,7 @@ public void CopyToJava ()
 
 		public void Release (JniReleaseArrayElementsMode releaseMode)
 		{
-			if (IsDisposed)
-				throw new ObjectDisposedException (GetType ().FullName);
+			ObjectDisposedException.ThrowIf (IsDisposed, this);
 			Synchronize (releaseMode);
 			elements = IntPtr.Zero;
 		}
diff --git a/src/Java.Interop/Java.Interop/JavaObjectArray.cs b/src/Java.Interop/Java.Interop/JavaObjectArray.cs
index c5a559e33..be808c510 100644
--- a/src/Java.Interop/Java.Interop/JavaObjectArray.cs
+++ b/src/Java.Interop/Java.Interop/JavaObjectArray.cs
@@ -139,8 +139,7 @@ public override int IndexOf (T item)
 
 		public override void CopyTo (T[] array, int arrayIndex)
 		{
-			if (array == null)
-				throw new ArgumentNullException (nameof (array));
+			ArgumentNullException.ThrowIfNull (array);
 			CheckArrayCopy (0, Length, arrayIndex, array.Length, Length);
 			CopyToList (array, arrayIndex);
 		}
diff --git a/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs b/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs
index a7f06c76f..2b7353a45 100644
--- a/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs
+++ b/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs
@@ -127,8 +127,7 @@ internal unsafe JniBooleanArrayElements (JniObjectReference arrayHandle, Boolean
 
 		public ref Boolean this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -214,8 +213,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Boolean[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -226,8 +224,7 @@ public override unsafe void CopyTo (int sourceIndex, Boolean[] destinationArray,
 
 		public override unsafe void CopyFrom (Boolean[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -331,8 +328,7 @@ internal unsafe JniSByteArrayElements (JniObjectReference arrayHandle, SByte* el
 
 		public ref SByte this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -418,8 +414,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, SByte[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -430,8 +425,7 @@ public override unsafe void CopyTo (int sourceIndex, SByte[] destinationArray, i
 
 		public override unsafe void CopyFrom (SByte[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -535,8 +529,7 @@ internal unsafe JniCharArrayElements (JniObjectReference arrayHandle, Char* elem
 
 		public ref Char this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -622,8 +615,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Char[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -634,8 +626,7 @@ public override unsafe void CopyTo (int sourceIndex, Char[] destinationArray, in
 
 		public override unsafe void CopyFrom (Char[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -739,8 +730,7 @@ internal unsafe JniInt16ArrayElements (JniObjectReference arrayHandle, Int16* el
 
 		public ref Int16 this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -826,8 +816,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Int16[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -838,8 +827,7 @@ public override unsafe void CopyTo (int sourceIndex, Int16[] destinationArray, i
 
 		public override unsafe void CopyFrom (Int16[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -943,8 +931,7 @@ internal unsafe JniInt32ArrayElements (JniObjectReference arrayHandle, Int32* el
 
 		public ref Int32 this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -1030,8 +1017,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Int32[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -1042,8 +1028,7 @@ public override unsafe void CopyTo (int sourceIndex, Int32[] destinationArray, i
 
 		public override unsafe void CopyFrom (Int32[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -1147,8 +1132,7 @@ internal unsafe JniInt64ArrayElements (JniObjectReference arrayHandle, Int64* el
 
 		public ref Int64 this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -1234,8 +1218,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Int64[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -1246,8 +1229,7 @@ public override unsafe void CopyTo (int sourceIndex, Int64[] destinationArray, i
 
 		public override unsafe void CopyFrom (Int64[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -1351,8 +1333,7 @@ internal unsafe JniSingleArrayElements (JniObjectReference arrayHandle, Single*
 
 		public ref Single this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -1438,8 +1419,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Single[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -1450,8 +1430,7 @@ public override unsafe void CopyTo (int sourceIndex, Single[] destinationArray,
 
 		public override unsafe void CopyFrom (Single[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
@@ -1555,8 +1534,7 @@ internal unsafe JniDoubleArrayElements (JniObjectReference arrayHandle, Double*
 
 		public ref Double this [int index] {
 			get {
-				if (IsDisposed)
-					throw new ObjectDisposedException (GetType ().FullName);
+				ObjectDisposedException.ThrowIf (IsDisposed, this);
 				unsafe {
 					return ref Elements [index];
 				}
@@ -1642,8 +1620,7 @@ public override unsafe void Clear ()
 
 		public override unsafe void CopyTo (int sourceIndex, Double[] destinationArray, int destinationIndex, int length)
 		{
-			if (destinationArray == null)
-				throw new ArgumentNullException (nameof (destinationArray));
+			ArgumentNullException.ThrowIfNull (destinationArray);
 			CheckArrayCopy (sourceIndex, Length, destinationIndex, destinationArray.Length, length);
 			if (destinationArray.Length == 0)
 				return;
@@ -1654,8 +1631,7 @@ public override unsafe void CopyTo (int sourceIndex, Double[] destinationArray,
 
 		public override unsafe void CopyFrom (Double[] sourceArray, int sourceIndex, int destinationIndex, int length)
 		{
-			if (sourceArray == null)
-				throw new ArgumentNullException (nameof (sourceArray));
+			ArgumentNullException.ThrowIfNull (sourceArray);
 			CheckArrayCopy (sourceIndex, sourceArray.Length, destinationIndex, Length, length);
 			if (sourceArray.Length == 0)
 				return;
diff --git a/src/Java.Interop/Java.Interop/JavaProxyObject.cs b/src/Java.Interop/Java.Interop/JavaProxyObject.cs
index 0050cf291..0b493fabf 100644
--- a/src/Java.Interop/Java.Interop/JavaProxyObject.cs
+++ b/src/Java.Interop/Java.Interop/JavaProxyObject.cs
@@ -31,8 +31,7 @@ public override JniPeerMembers JniPeerMembers {
 
 		JavaProxyObject (object value)
 		{
-			if (value == null)
-				throw new ArgumentNullException (nameof (value));
+			ArgumentNullException.ThrowIfNull (value);
 			Value = value;
 		}
 
diff --git a/src/Java.Interop/Java.Interop/JavaProxyThrowable.cs b/src/Java.Interop/Java.Interop/JavaProxyThrowable.cs
index 3fb2cc720..124a5b982 100644
--- a/src/Java.Interop/Java.Interop/JavaProxyThrowable.cs
+++ b/src/Java.Interop/Java.Interop/JavaProxyThrowable.cs
@@ -19,8 +19,7 @@ public JavaProxyThrowable (Exception exception)
 
 		static string GetMessage (Exception exception)
 		{
-			if (exception == null)
-				throw new ArgumentNullException (nameof (exception));
+			ArgumentNullException.ThrowIfNull (exception);
 			return exception.ToString ();
 		}
 	}
diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs b/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs
index 8211771e6..36e339f33 100644
--- a/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs
+++ b/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs
@@ -22,8 +22,7 @@ public static void ThrowNew (JniObjectReference klass, string message)
 			{
 				if (!klass.IsValid)
 					throw new ArgumentException (nameof (klass));
-				if (message == null)
-					throw new ArgumentNullException (nameof (message));
+				ArgumentNullException.ThrowIfNull (message);
 
 				int r = _ThrowNew (klass, message);
 				if (r != 0)
@@ -32,8 +31,7 @@ public static void ThrowNew (JniObjectReference klass, string message)
 
 			public static void Throw (Exception e)
 			{
-				if (e == null)
-					throw new ArgumentNullException (nameof (e));
+				ArgumentNullException.ThrowIfNull (e);
 				var je = e as JavaException;
 				if (je == null) {
 					je  = new JavaProxyThrowable (e);
diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs b/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs
index d8b9f652d..fc033e928 100644
--- a/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs
+++ b/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs
@@ -44,8 +44,7 @@ public static JniObjectReference FindClass (string classname)
 
 			static unsafe JniObjectReference TryFindClass (string classname, bool throwOnError)
 			{
-				if (classname == null)
-					throw new ArgumentNullException (nameof (classname));
+				ArgumentNullException.ThrowIfNull (classname);
 				if (classname.Length == 0)
 					throw new ArgumentException ("'classname' cannot be a zero-length string.", nameof (classname));
 
@@ -199,8 +198,7 @@ static IntPtr RawCallStaticObjectMethodA (IntPtr env, out IntPtr thrown, IntPtr
 
 			public static bool TryFindClass (string classname, out JniObjectReference instance)
 			{
-				if (classname == null)
-					throw new ArgumentNullException (nameof (classname));
+				ArgumentNullException.ThrowIfNull (classname);
 				if (classname.Length == 0)
 					throw new ArgumentException ("'classname' cannot be a zero-length string.", nameof (classname));
 
diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.cs b/src/Java.Interop/Java.Interop/JniEnvironment.cs
index 7e362241c..670ea99e2 100644
--- a/src/Java.Interop/Java.Interop/JniEnvironment.cs
+++ b/src/Java.Interop/Java.Interop/JniEnvironment.cs
@@ -244,7 +244,7 @@ internal    JniEnvironmentInfo (IntPtr environmentPointer, JniRuntime runtime)
 
 		internal unsafe JniObjectReference ToJavaName (string jniTypeName)
 		{
-			int index = jniTypeName.IndexOf ("/", StringComparison.Ordinal);
+			int index = jniTypeName.IndexOf ('/');
 
 			if (index == -1)
 				return JniEnvironment.Strings.NewString (jniTypeName);
diff --git a/src/Java.Interop/Java.Interop/JniMemberSignature.cs b/src/Java.Interop/Java.Interop/JniMemberSignature.cs
index dd6b71d4f..a22ae8d7e 100644
--- a/src/Java.Interop/Java.Interop/JniMemberSignature.cs
+++ b/src/Java.Interop/Java.Interop/JniMemberSignature.cs
@@ -104,8 +104,7 @@ internal static (int StartIndex, int Length) ExtractType (string signature, ref
 
 		internal static void AssertSignatureIndex (string signature, int index)
 		{
-			if (signature == null)
-				throw new ArgumentNullException (nameof (signature));
+			ArgumentNullException.ThrowIfNull (signature);
 			if (signature.Length == 0)
 				throw new ArgumentException ("Descriptor cannot be empty string", nameof (signature));
 			if (index >= signature.Length)
diff --git a/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs b/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs
index f08a48928..3352d763a 100644
--- a/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs
+++ b/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods.cs
@@ -56,9 +56,8 @@ internal void Dispose ()
 
 		public JniMethodInfo GetConstructor (string signature)
 		{
-			if (signature == null)
-				throw new ArgumentNullException (nameof (signature));
-			lock (InstanceMethods) {
+				ArgumentNullException.ThrowIfNull (signature);
+				lock (InstanceMethods) {
 				if (!InstanceMethods.TryGetValue (signature, out var m)) {
 					m = JniPeerType.GetConstructor (signature);
 					InstanceMethods.Add (signature, m);
@@ -159,14 +158,12 @@ public unsafe JniObjectReference StartCreateInstance (string constructorSignatur
 		{
 			#pragma warning disable CS1717
 			parameters = parameters;    // Silence CA1801
-			#pragma warning restore CS1717
+#pragma warning restore CS1717
 
-			if (constructorSignature == null)
-				throw new ArgumentNullException (nameof (constructorSignature));
-			if (declaringType == null)
-				throw new ArgumentNullException (nameof (declaringType));
+				ArgumentNullException.ThrowIfNull (constructorSignature);
+				ArgumentNullException.ThrowIfNull (declaringType);
 
-			var r   = GetConstructorsForType (declaringType)
+				var r   = GetConstructorsForType (declaringType)
 				.JniPeerType
 				.AllocObject ();
 			r.Flags = JniObjectReferenceFlags.Alloc;
@@ -191,12 +188,10 @@ internal unsafe JniObjectReference NewObject (string constructorSignature, Type
 
 		public unsafe void FinishCreateInstance (string constructorSignature, IJavaPeerable self, JniArgumentValue* parameters)
 		{
-			if (constructorSignature == null)
-				throw new ArgumentNullException (nameof (constructorSignature));
-			if (self == null)
-				throw new ArgumentNullException (nameof (self));
+				ArgumentNullException.ThrowIfNull (constructorSignature);
+				ArgumentNullException.ThrowIfNull (self);
 
-			var methods = GetConstructorsForType (self.GetType ());
+				var methods = GetConstructorsForType (self.GetType ());
 			var ctor    = methods.GetConstructor (constructorSignature);
 			JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, ctor, parameters);
 		}
diff --git a/src/Java.Interop/Java.Interop/JniPeerMembers.cs b/src/Java.Interop/Java.Interop/JniPeerMembers.cs
index 1b64266f9..ec727c258 100644
--- a/src/Java.Interop/Java.Interop/JniPeerMembers.cs
+++ b/src/Java.Interop/Java.Interop/JniPeerMembers.cs
@@ -31,12 +31,10 @@ static string GetReplacementType (string jniPeerTypeName)
 
 		JniPeerMembers (string jniPeerTypeName, Type managedPeerType, bool checkManagedPeerType, bool isInterface = false)
 		{
-			if (jniPeerTypeName == null)
-				throw new ArgumentNullException (nameof (jniPeerTypeName));
+			ArgumentNullException.ThrowIfNull (jniPeerTypeName);
 
 			if (checkManagedPeerType) {
-				if (managedPeerType == null)
-					throw new ArgumentNullException (nameof (managedPeerType));
+				ArgumentNullException.ThrowIfNull (managedPeerType);
 				if (!typeof (IJavaPeerable).IsAssignableFrom (managedPeerType))
 					throw new ArgumentException ("'managedPeerType' must implement the IJavaPeerable interface.", nameof (managedPeerType));
 
@@ -143,8 +141,7 @@ protected virtual JniPeerMembers GetPeerMembers (IJavaPeerable value)
 
 		internal static void AssertSelf (IJavaPeerable self)
 		{
-			if (self == null)
-				throw new ArgumentNullException (nameof (self));
+			ArgumentNullException.ThrowIfNull (self);
 
 			var peer    = self.PeerReference;
 			if (!peer.IsValid)
@@ -154,9 +151,8 @@ internal static void AssertSelf (IJavaPeerable self)
 
 		internal static int GetSignatureSeparatorIndex (string encodedMember)
 		{
-			if (encodedMember == null)
-				throw new ArgumentNullException (nameof (encodedMember));
-			int n = encodedMember.IndexOf (".", StringComparison.Ordinal);
+			ArgumentNullException.ThrowIfNull (encodedMember);
+			int n = encodedMember.IndexOf ('.');
 			if (n < 0)
 				throw new ArgumentException (
 						"Invalid encoding; 'encodedMember' should be encoded as \".\".",
diff --git a/src/Java.Interop/Java.Interop/JniRuntime.JniMarshalMemberBuilder.cs b/src/Java.Interop/Java.Interop/JniRuntime.JniMarshalMemberBuilder.cs
index 7d8de27cc..a44003b10 100644
--- a/src/Java.Interop/Java.Interop/JniRuntime.JniMarshalMemberBuilder.cs
+++ b/src/Java.Interop/Java.Interop/JniRuntime.JniMarshalMemberBuilder.cs
@@ -40,8 +40,7 @@ protected JniMarshalMemberBuilder ()
 
 			public virtual void OnSetRuntime (JniRuntime runtime)
 			{
-				if (disposed)
-					throw new ObjectDisposedException (GetType ().Name);
+				ObjectDisposedException.ThrowIf (disposed, this);
 
 				this.runtime = runtime;
 			}
diff --git a/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs b/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs
index 379b70847..be1811ab6 100644
--- a/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs
+++ b/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs
@@ -141,8 +141,7 @@ public JniTypeSignature GetTypeSignature (Type type)
 			{
 				AssertValid ();
 
-				if (type == null)
- 					throw new ArgumentNullException (nameof (type));
+				ArgumentNullException.ThrowIfNull (type);
 
 				var builtIn = GetBuiltInTypeSignature (type);
 				return builtIn.IsValid ? builtIn : GetTypeSignatureCore (type);
diff --git a/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs b/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs
index 6ba8d5dae..d1a647647 100644
--- a/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs
+++ b/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs
@@ -53,8 +53,7 @@ public      JniRuntime  Runtime {
 
 			public virtual void OnSetRuntime (JniRuntime runtime)
 			{
-				if (disposed)
-					throw new ObjectDisposedException (GetType ().Name);
+				ObjectDisposedException.ThrowIf (disposed, this);
 
 				this.runtime = runtime;
 			}
@@ -72,8 +71,7 @@ protected virtual void Dispose (bool disposing)
 
 			protected void EnsureNotDisposed ()
 			{
-				if (disposed)
-					throw new ObjectDisposedException (GetType ().Name);
+				ObjectDisposedException.ThrowIf (disposed, this);
 			}
 
 			public abstract void WaitForGCBridgeProcessing ();
@@ -105,8 +103,7 @@ public virtual void DisposePeer (IJavaPeerable value)
 			{
 				EnsureNotDisposed ();
 
-				if (value == null)
-					throw new ArgumentNullException (nameof (value));
+				ArgumentNullException.ThrowIfNull (value);
 
 				if (!value.PeerReference.IsValid)
 					return;
@@ -143,8 +140,7 @@ public virtual void DisposePeerUnlessReferenced (IJavaPeerable value)
 			{
 				EnsureNotDisposed ();
 
-				if (value == null)
-					throw new ArgumentNullException (nameof (value));
+				ArgumentNullException.ThrowIfNull (value);
 
 				var h = value.PeerReference;
 				if (!h.IsValid)
diff --git a/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniTypeManager.cs b/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniTypeManager.cs
index b98ec2843..da14d793b 100644
--- a/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniTypeManager.cs
+++ b/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniTypeManager.cs
@@ -108,8 +108,7 @@ protected override IEnumerable GetSimpleReferences (Type type)
 			{
 				AssertValid ();
 
-				if (type == null)
-					throw new ArgumentNullException (nameof (type));
+				ArgumentNullException.ThrowIfNull (type);
 				if (type.IsArray)
 					throw new ArgumentException ("Array type '" + type.FullName + "' is not supported.", nameof (type));
 
@@ -475,7 +474,7 @@ bool FindAndCallRegisterMethod (
 				bool found = false;
 
 				foreach (var methodInfo in marshalType.GetRuntimeMethods ()) {
-					if (methodInfo.GetCustomAttribute (typeof (JniAddNativeMethodRegistrationAttribute)) == null) {
+					if (methodInfo.GetCustomAttribute () == null) {
 						continue;
 					}
 
@@ -485,7 +484,7 @@ bool FindAndCallRegisterMethod (
 						throw new InvalidOperationException ($"The method `{declaringTypeName}.{methodInfo}` marked with [{nameof (JniAddNativeMethodRegistrationAttribute)}] must be static!");
 					}
 
-					var register = (Action)methodInfo.CreateDelegate (typeof (Action));
+					var register = methodInfo.CreateDelegate> ();
 					register (arguments);
 
 					found = true;
diff --git a/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniValueManager.cs b/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniValueManager.cs
index 3282e906d..e9dbbad33 100644
--- a/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniValueManager.cs
+++ b/src/Java.Interop/Java.Interop/JniRuntime.ReflectionJniValueManager.cs
@@ -46,8 +46,7 @@ public override void ActivatePeer (
 
 			protected override void ConstructPeerCore (IJavaPeerable peer, ref JniObjectReference reference, JniObjectReferenceOptions options)
 			{
-				if (peer == null)
-					throw new ArgumentNullException (nameof (peer));
+				ArgumentNullException.ThrowIfNull (peer);
 
 				var newRef  = peer.PeerReference;
 				if (newRef.IsValid) {
@@ -415,7 +414,7 @@ protected virtual bool TryConstructPeer (
 			{
 				EnsureNotDisposed ();
 
-				var m   = GetValueMarshaler (typeof (T));
+				var m   = GetValueMarshaler ();
 				var r   = m as JniValueMarshaler;
 				if (r != null)
 					return r;
@@ -430,8 +429,7 @@ protected override JniValueMarshaler GetValueMarshalerCore (Type type)
 			{
 				EnsureNotDisposed ();
 
-				if (type == null)
-					throw new ArgumentNullException (nameof (type));
+				ArgumentNullException.ThrowIfNull (type);
 				if (type.ContainsGenericParameters)
 					throw new ArgumentException ("Generic type definitions are not supported.", nameof (type));
 
diff --git a/src/Java.Interop/Java.Interop/JniRuntime.cs b/src/Java.Interop/Java.Interop/JniRuntime.cs
index 3a68f9b46..c28b61b95 100644
--- a/src/Java.Interop/Java.Interop/JniRuntime.cs
+++ b/src/Java.Interop/Java.Interop/JniRuntime.cs
@@ -155,8 +155,7 @@ public static JniRuntime CurrentRuntime {
 
 		public static void SetCurrent (JniRuntime newCurrent)
 		{
-			if (newCurrent == null)
-				throw new ArgumentNullException (nameof (newCurrent));
+			ArgumentNullException.ThrowIfNull (newCurrent);
 			lock (Runtimes) {
 				Runtimes [newCurrent.InvocationPointer] = newCurrent;
 			}
@@ -179,8 +178,7 @@ public static void SetCurrent (JniRuntime newCurrent)
 
 		protected JniRuntime (CreationOptions options)
 		{
-			if (options == null)
-				throw new ArgumentNullException (nameof (options));
+			ArgumentNullException.ThrowIfNull (options);
 			if (options.InvocationPointer == IntPtr.Zero && options.EnvironmentPointer == IntPtr.Zero)
 				throw new ArgumentException ("Need either options.InvocationPointer or options.EnvironmentPointer!", nameof (options));
 
@@ -412,8 +410,7 @@ internal void Track (JniType value)
 		internal void UnTrack (IntPtr key)
 		{
 			lock (TrackedInstances) {
-				if (TrackedInstances.ContainsKey (key))
-					TrackedInstances.Remove (key);
+				TrackedInstances.Remove (key);
 			}
 		}
 
diff --git a/src/Java.Interop/Java.Interop/JniType.cs b/src/Java.Interop/Java.Interop/JniType.cs
index c17488e45..9d2fbabfa 100644
--- a/src/Java.Interop/Java.Interop/JniType.cs
+++ b/src/Java.Interop/Java.Interop/JniType.cs
@@ -93,8 +93,7 @@ public void RegisterWithRuntime ()
 		[MethodImpl (MethodImplOptions.AggressiveInlining)]
 		void AssertValid ()
 		{
-			if (!PeerReference.IsValid)
-				throw new ObjectDisposedException (GetType ().FullName);
+			ObjectDisposedException.ThrowIf (!PeerReference.IsValid, this);
 		}
 
 		public static JniType GetCachedJniType ([NotNull] ref JniType? cachedType, string classname)
@@ -133,8 +132,7 @@ public bool IsAssignableFrom (JniType c)
 		{
 			AssertValid ();
 
-			if (c == null)
-				throw new ArgumentNullException (nameof (c));
+			ArgumentNullException.ThrowIfNull (c);
 			if (!c.PeerReference.IsValid)
 				throw new ArgumentException ("'c' has an invalid handle.", nameof (c));
 
@@ -157,8 +155,7 @@ public void RegisterNativeMethods (params JniNativeMethodRegistration[] methods)
 		{
 			AssertValid ();
 
-			if (methods == null)
-				throw new ArgumentNullException (nameof (methods));
+			ArgumentNullException.ThrowIfNull (methods);
 
 			JniEnvironment.Types.RegisterNatives (PeerReference, methods, checked ((int)methods.Length));
 			// Prevents method delegates from being GC'd so long as this type remains
diff --git a/src/Java.Interop/Java.Interop/JniTypeSignature.cs b/src/Java.Interop/Java.Interop/JniTypeSignature.cs
index 743a936e5..f551e7bfb 100644
--- a/src/Java.Interop/Java.Interop/JniTypeSignature.cs
+++ b/src/Java.Interop/Java.Interop/JniTypeSignature.cs
@@ -40,6 +40,8 @@ public      string      Name {
 			get {return ArrayRank == 0 ? SimpleReference ?? throw new InvalidOperationException (): QualifiedReference;}
 		}
 
+		private static readonly char [] anyOf = new []{ '.', ';' };
+
 		public JniTypeSignature (string? simpleReference, int arrayRank = 0, bool keyword = false)
 		{
 			if (simpleReference != null) {
@@ -165,7 +167,7 @@ public static bool TryParse (string signature, [NotNullWhen (true)] out JniTypeS
 				n   = signature;
 				break;
 			}
-			int bad = n.IndexOfAny (new[]{ '.', ';' });
+			int bad = n.IndexOfAny (anyOf);
 			if (bad >= 0)
 				return new ArgumentException (
 						string.Format ("Malformed JNI type reference: contains '{0}': {1}", n [bad], signature),
diff --git a/src/Java.Interop/Java.Interop/JniTypeSignatureAttribute.cs b/src/Java.Interop/Java.Interop/JniTypeSignatureAttribute.cs
index 6fc4814c5..40388a52b 100644
--- a/src/Java.Interop/Java.Interop/JniTypeSignatureAttribute.cs
+++ b/src/Java.Interop/Java.Interop/JniTypeSignatureAttribute.cs
@@ -6,7 +6,7 @@
 namespace Java.Interop
 {
 	[AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
-	public sealed class JniTypeSignatureAttribute : Attribute {
+	internal sealed class JniTypeSignatureAttribute : Attribute {
 
 		int arrayRank;
 
diff --git a/src/Java.Interop/Java.Interop/JniValueMarshaler.cs b/src/Java.Interop/Java.Interop/JniValueMarshaler.cs
index 19015c6ee..acf562a6e 100644
--- a/src/Java.Interop/Java.Interop/JniValueMarshaler.cs
+++ b/src/Java.Interop/Java.Interop/JniValueMarshaler.cs
@@ -191,8 +191,7 @@ protected Expression ReturnObjectReferenceToJni (JniValueMarshalerContext contex
 		{
 			Func    m = JniEnvironment.References.NewReturnToJniRef;
 			var r   = Expression.Variable (MarshalType, namePrefix + "_rtn");
-			if (context == null)
-				throw new ArgumentNullException (nameof (context));
+			ArgumentNullException.ThrowIfNull (context);
 			context.LocalVariables.Add (r);
 			context.CreationStatements.Add (
 				Expression.Assign (r,
diff --git a/src/Java.Interop/Java.Interop/JniValueMarshalerAttribute.cs b/src/Java.Interop/Java.Interop/JniValueMarshalerAttribute.cs
index 717fb30c6..74126afaf 100644
--- a/src/Java.Interop/Java.Interop/JniValueMarshalerAttribute.cs
+++ b/src/Java.Interop/Java.Interop/JniValueMarshalerAttribute.cs
@@ -19,8 +19,7 @@ public JniValueMarshalerAttribute (
 				[DynamicallyAccessedMembers (ParameterlessConstructors)]
 				Type marshalerType)
 		{
-			if (marshalerType == null)
-				throw new ArgumentNullException (nameof (marshalerType));
+			ArgumentNullException.ThrowIfNull (marshalerType);
 			if (!typeof (JniValueMarshaler).IsAssignableFrom (marshalerType))
 				throw new ArgumentException (
 						string.Format ("`{0}` must inherit from JniValueMarshaler!", marshalerType.FullName),
diff --git a/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs b/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs
index c92d69b5a..64bc555d5 100644
--- a/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs
+++ b/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs
@@ -54,10 +54,8 @@ public JreRuntimeOptions AddOption (string option)
 
 		public JreRuntimeOptions AddSystemProperty (string name, string value)
 		{
-			if (name == null)
-				throw new ArgumentNullException ("name");
-			if (value == null)
-				throw new ArgumentNullException ("value");
+			ArgumentNullException.ThrowIfNull (name);
+			ArgumentNullException.ThrowIfNull (value);
 			if (name == "java.class.path")
 				throw new ArgumentException ("Do not use AddSystemProperty() for the 'java.class.path' property. Add to the ClassPath collection instead.", "name");
 			Options.Add (string.Format ("-D{0}={1}", name, value));
@@ -73,8 +71,7 @@ public JreRuntime CreateJreVM ()
 
 		public JreRuntime CreateJreVM (JniRuntime.JniTypeManager typeManager)
 		{
-			if (typeManager == null)
-				throw new ArgumentNullException (nameof (typeManager));
+			ArgumentNullException.ThrowIfNull (typeManager);
 			return new JreRuntime (this, typeManager);
 		}
 	}
@@ -89,16 +86,14 @@ static JreRuntime ()
 		[RequiresUnreferencedCode ("The default JRE type manager is reflection-based and is not trimming-compatible.")]
 		static unsafe JreRuntimeOptions CreateJreVM (JreRuntimeOptions builder)
 		{
-			if (builder == null)
-				throw new ArgumentNullException ("builder");
+			ArgumentNullException.ThrowIfNull (builder);
 			builder.TypeManager     ??= new JreTypeManager (builder.typeMappings);
 			return CreateJreVMCore (builder);
 		}
 
 		static unsafe JreRuntimeOptions CreateJreVMWithoutDefaultTypeManager (JreRuntimeOptions builder)
 		{
-			if (builder == null)
-				throw new ArgumentNullException ("builder");
+			ArgumentNullException.ThrowIfNull (builder);
 			if (builder.TypeManager == null)
 				throw new InvalidOperationException ($"Member `{nameof (JniRuntime.CreationOptions)}.{nameof (JniRuntime.CreationOptions.TypeManager)}` must be set.");
 			return CreateJreVMCore (builder);
@@ -201,10 +196,8 @@ internal protected JreRuntime (JreRuntimeOptions builder, JniRuntime.JniTypeMana
 
 		static JreRuntimeOptions SetTypeManager (JreRuntimeOptions builder, JniRuntime.JniTypeManager typeManager)
 		{
-			if (builder == null)
-				throw new ArgumentNullException ("builder");
-			if (typeManager == null)
-				throw new ArgumentNullException (nameof (typeManager));
+			ArgumentNullException.ThrowIfNull (builder);
+			ArgumentNullException.ThrowIfNull (typeManager);
 			builder.TypeManager = typeManager;
 			return builder;
 		}
@@ -379,20 +372,24 @@ static JreNativeMethods ()
 		}
 
 
-		[DllImport (JavaInteropLib, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern void java_interop_free (IntPtr p);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial void java_interop_free (IntPtr p);
 
-		[DllImport (JavaInteropLib, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_jvm_load_with_error_message (string path, out IntPtr message);
+		[LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_jvm_load_with_error_message (string path, out IntPtr message);
 
-		[DllImport (JavaInteropLib, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_jvm_create (out IntPtr javavm, out IntPtr jnienv, ref JavaVMInitArgs args);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_jvm_create (out IntPtr javavm, out IntPtr jnienv, ref JavaVMInitArgs args);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_jvm_list ([Out] IntPtr[]? handles, int bufLen, out int nVMs);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_jvm_list ([Out] IntPtr[]? handles, int bufLen, out int nVMs);
 
-		[DllImport ("kernel32", CharSet=CharSet.Unicode)]
-		internal static extern int AddDllDirectory (string NewDirectory);
+		[LibraryImport ("kernel32", StringMarshalling = StringMarshalling.Utf16)]
+		internal static partial int AddDllDirectory (string NewDirectory);
 	}
 }
 
diff --git a/src/Java.Runtime.Environment/Java.Interop/ManagedValueManager.cs b/src/Java.Runtime.Environment/Java.Interop/ManagedValueManager.cs
index a17c3ae2e..0cb1ecd65 100644
--- a/src/Java.Runtime.Environment/Java.Interop/ManagedValueManager.cs
+++ b/src/Java.Runtime.Environment/Java.Interop/ManagedValueManager.cs
@@ -61,8 +61,7 @@ public override void AddPeer (IJavaPeerable value)
 				throw new ObjectDisposedException (nameof (ManagedValueManager));
 
 			var r = value.PeerReference;
-			if (!r.IsValid)
-				throw new ObjectDisposedException (value.GetType ().FullName);
+			ObjectDisposedException.ThrowIf (!r.IsValid, value);
 
 			if (r.Type != JniObjectReferenceType.Global) {
 				value.SetPeerReference (r.NewGlobalRef ());
@@ -149,8 +148,7 @@ public override void RemovePeer (IJavaPeerable value)
 			if (RegisteredInstances == null)
 				throw new ObjectDisposedException (nameof (ManagedValueManager));
 
-			if (value == null)
-				throw new ArgumentNullException (nameof (value));
+			ArgumentNullException.ThrowIfNull (value);
 
 			int key = value.JniIdentityHashCode;
 			lock (RegisteredInstances) {
diff --git a/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeObjectReferenceManager.cs b/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeObjectReferenceManager.cs
index 47812f237..0acc1db11 100644
--- a/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeObjectReferenceManager.cs
+++ b/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeObjectReferenceManager.cs
@@ -204,47 +204,61 @@ static byte ToByte (JniObjectReferenceType type)
 
 	partial class JreNativeMethods {
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_get_gref_count        (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_get_gref_count        (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_get_weak_gref_count   (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_get_weak_gref_count   (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern IntPtr java_interop_gc_bridge_lref_get_log_file  (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial IntPtr java_interop_gc_bridge_lref_get_log_file  (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_lref_set_log_level    (IntPtr bridge, int level);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_lref_set_log_level    (IntPtr bridge, int level);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern void java_interop_gc_bridge_lref_log_message     (IntPtr bridge, int level,      string? message);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial void java_interop_gc_bridge_lref_log_message     (IntPtr bridge, int level,      string? message);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern void java_interop_gc_bridge_lref_log_new         (IntPtr bridge, int lref_count, IntPtr curHandle, byte curType, IntPtr newHandle, byte newType, string? thread_name, long thread_id, string? from);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial void java_interop_gc_bridge_lref_log_new         (IntPtr bridge, int lref_count, IntPtr curHandle, byte curType, IntPtr newHandle, byte newType, string? thread_name, long thread_id, string? from);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern void java_interop_gc_bridge_lref_log_delete      (IntPtr bridge, int lref_count, IntPtr handle,    byte type,                                    string? thread_name, long thread_id, string? from);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial void java_interop_gc_bridge_lref_log_delete      (IntPtr bridge, int lref_count, IntPtr handle,    byte type,                                    string? thread_name, long thread_id, string? from);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern IntPtr java_interop_gc_bridge_gref_get_log_file  (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial IntPtr java_interop_gc_bridge_gref_get_log_file  (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_gref_set_log_level    (IntPtr bridge, int level);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_gref_set_log_level    (IntPtr bridge, int level);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern void java_interop_gc_bridge_gref_log_message     (IntPtr bridge, int level,      string? message);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial void java_interop_gc_bridge_gref_log_message     (IntPtr bridge, int level,      string? message);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_gref_log_new          (IntPtr bridge,                 IntPtr curHandle, byte curType, IntPtr newHandle, byte newType, string? thread_name, long thread_id, string? from);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_gref_log_new          (IntPtr bridge,                 IntPtr curHandle, byte curType, IntPtr newHandle, byte newType, string? thread_name, long thread_id, string? from);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_gref_log_delete       (IntPtr bridge,                 IntPtr handle,    byte type,                                    string? thread_name, long thread_id, string? from);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_gref_log_delete       (IntPtr bridge,                 IntPtr handle,    byte type,                                    string? thread_name, long thread_id, string? from);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_weak_gref_log_new     (IntPtr bridge,                 IntPtr curHandle, byte curType, IntPtr newHandle, byte newType, string? thread_name, long thread_id, string? from);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_weak_gref_log_new     (IntPtr bridge,                 IntPtr curHandle, byte curType, IntPtr newHandle, byte newType, string? thread_name, long thread_id, string? from);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_weak_gref_log_delete  (IntPtr bridge,                 IntPtr handle,    byte type,                                    string? thread_name, long thread_id, string? from);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_weak_gref_log_delete  (IntPtr bridge,                 IntPtr handle,    byte type,                                    string? thread_name, long thread_id, string? from);
 	}
 }
 
diff --git a/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeValueManager.cs b/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeValueManager.cs
index 2d9e409a4..8d60c2faf 100644
--- a/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeValueManager.cs
+++ b/src/Java.Runtime.Environment/Java.Interop/MonoRuntimeValueManager.cs
@@ -129,8 +129,7 @@ public override void AddPeer (IJavaPeerable value)
 				throw new ObjectDisposedException (nameof (MonoRuntimeValueManager));
 
 			var r = value.PeerReference;
-			if (!r.IsValid)
-				throw new ObjectDisposedException (value.GetType ().FullName);
+			ObjectDisposedException.ThrowIf (!r.IsValid, value);
 			var o = PeekPeer (value.PeerReference);
 			if (o != null)
 				return;
@@ -199,8 +198,7 @@ public override void RemovePeer (IJavaPeerable value)
 			if (RegisteredInstances == null)
 				throw new ObjectDisposedException (nameof (MonoRuntimeValueManager));
 
-			if (value == null)
-				throw new ArgumentNullException (nameof (value));
+			ArgumentNullException.ThrowIfNull (value);
 
 			int key = value.JniIdentityHashCode;
 			lock (RegisteredInstances) {
@@ -374,35 +372,45 @@ partial class JreNativeMethods {
 
 		const   string JavaInteropLib = "java-interop";
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern IntPtr java_interop_gc_bridge_get_current ();
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial IntPtr java_interop_gc_bridge_get_current ();
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_set_current_once (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_set_current_once (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_register_hooks (IntPtr bridge, GCBridgeUseWeakReferenceKind weak_ref_kind);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_register_hooks (IntPtr bridge, GCBridgeUseWeakReferenceKind weak_ref_kind);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern IntPtr java_interop_gc_bridge_new (IntPtr jvm);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial IntPtr java_interop_gc_bridge_new (IntPtr jvm);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_free (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_free (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_add_current_app_domain (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_add_current_app_domain (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_remove_current_app_domain (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_remove_current_app_domain (IntPtr bridge);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_set_bridge_processing_field (IntPtr bridge, RuntimeTypeHandle type_handle, string field_name);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_set_bridge_processing_field (IntPtr bridge, RuntimeTypeHandle type_handle, string field_name);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern int java_interop_gc_bridge_register_bridgeable_type (IntPtr bridge, RuntimeTypeHandle type_handle);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial int java_interop_gc_bridge_register_bridgeable_type (IntPtr bridge, RuntimeTypeHandle type_handle);
 
-		[DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl)]
-		internal static extern void java_interop_gc_bridge_wait_for_bridge_processing (IntPtr bridge);
+		[LibraryImport (JavaInteropLib)]
+		[UnmanagedCallConv (CallConvs = [typeof (CallConvCdecl)])]
+		internal static partial void java_interop_gc_bridge_wait_for_bridge_processing (IntPtr bridge);
 	}
 
 	sealed class OverrideStackTrace : Exception {
diff --git a/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/ManagedTypeFinderCecil.cs b/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/ManagedTypeFinderCecil.cs
index 1181081e2..9a0c8258a 100644
--- a/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/ManagedTypeFinderCecil.cs
+++ b/src/Xamarin.Android.Tools.AnnotationSupport.Cecil/ManagedTypeFinderCecil.cs
@@ -29,11 +29,11 @@ protected override void OnAnnotationsParsed (IEnumerable itemsToB
 				// saved in a static class (because C# interface cannot have consts) and
 				// they have identical [Register]-ed Java names as that of the corresponding interface types.
 				// In this java-C# matcher we don't need those consts-only classes, so filter them out.
-				.Where (t => (t.IsInterface || t.BaseType == null || t.BaseType.FullName != "System.Object") && (t.Methods.Where (m => !m.IsConstructor).Any () || t.Properties.Any ()))
+				.Where (t => (t.IsInterface || t.BaseType == null || t.BaseType.FullName != "System.Object") && (t.Methods.Where (m => !m.IsConstructor).Any () || t.Properties.Count != 0))
 				// This condition would also look weird, but some managed types have manual binding with
 				// [Register] attribute, namely ArrayAdapter. They don't come up with
 				// JavaTypeParametersAttribute, so we have to exclude them.
-				.Where (t => !t.GenericParameters.Any ())
+				.Where (t => t.GenericParameters.Count == 0)
 				.Select (t => t.Wrap ())
 				.ToArray ();
 
diff --git a/src/Xamarin.Android.Tools.AnnotationSupport/AnnotationExtensions.cs b/src/Xamarin.Android.Tools.AnnotationSupport/AnnotationExtensions.cs
index a56c05ae6..f4e462937 100644
--- a/src/Xamarin.Android.Tools.AnnotationSupport/AnnotationExtensions.cs
+++ b/src/Xamarin.Android.Tools.AnnotationSupport/AnnotationExtensions.cs
@@ -24,8 +24,7 @@ public static IEnumerable Data (this IEnumerable
 
 		public static IEnumerable GetAnnotations (this  AndroidAnnotationsSupport api, ManagedApiQuery query)
 		{
-			if (query == null)
-				throw new ArgumentNullException (nameof (query));
+			ArgumentNullException.ThrowIfNull (query);
 			if (query.TypeName == null)
 				throw new ArgumentNullException ("TypeName must not be null");
 
@@ -75,36 +74,30 @@ static bool IsProperty (AnnotatedItem item, string propertyName)
 		[Obsolete ("Use GetAnnotations() overload.")]
 		public static IEnumerable GetMethodsAnnotations (this AndroidAnnotationsSupport api, string managedTypeName, string managedMethodName)
 		{
-			if (managedMethodName == null)
-				throw new ArgumentNullException (nameof (managedMethodName));
+			ArgumentNullException.ThrowIfNull (managedMethodName);
 			return GetAnnotations (api, managedTypeName, managedMethodName);
 		}
 
 		[Obsolete ("Use GetAnnotations() overload.")]
 		public static IEnumerable GetFieldAnnotations (this AndroidAnnotationsSupport api, string managedTypeName, string managedPropertyName)
 		{
-			if (managedPropertyName == null)
-				throw new ArgumentNullException (nameof (managedPropertyName));
+			ArgumentNullException.ThrowIfNull (managedPropertyName);
 			return GetAnnotations (api, managedTypeName, managedPropertyName);
 		}
 
 		[Obsolete ("Use GetAnnotations() overload.")]
 		public static IEnumerable GetMethodAnnotations (this AndroidAnnotationsSupport api, string managedTypeName, string managedMethodName, string [] managedParameterTypes)
 		{
-			if (managedMethodName == null)
-				throw new ArgumentNullException (nameof (managedMethodName));
-			if (managedParameterTypes == null)
-				throw new ArgumentNullException (nameof (managedParameterTypes));
+			ArgumentNullException.ThrowIfNull (managedMethodName);
+			ArgumentNullException.ThrowIfNull (managedParameterTypes);
 			return GetAnnotations (api, managedTypeName, managedMethodName, managedParameterTypes);
 		}
 
 		[Obsolete ("Use GetAnnotations() overload.")]
 		public static IEnumerable GetParameterAnnotations (this AndroidAnnotationsSupport api, string managedTypeName, string managedMethodName, string [] managedParameterTypes, int parameterIndex)
 		{
-			if (managedMethodName == null)
-				throw new ArgumentNullException (nameof (managedMethodName));
-			if (managedParameterTypes == null)
-				throw new ArgumentNullException (nameof (managedParameterTypes));
+			ArgumentNullException.ThrowIfNull (managedMethodName);
+			ArgumentNullException.ThrowIfNull (managedParameterTypes);
 			return GetAnnotations (api, managedTypeName, managedMethodName, managedParameterTypes, parameterIndex);
 		}
 
@@ -130,8 +123,7 @@ public static AnnotationData GetIntDef (this AndroidAnnotationsSupport api, Mana
 		[Obsolete ("Use GetIntDef(ManagedApiQuery)")]
 		public static AnnotationData GetFieldIntDef (this AndroidAnnotationsSupport api, string managedTypeName, string managedPropertyName)
 		{
-			if (managedPropertyName == null)
-				throw new ArgumentNullException (nameof (managedPropertyName));
+			ArgumentNullException.ThrowIfNull (managedPropertyName);
 			return api.GetAnnotations (managedTypeName, managedPropertyName).Data ().FirstOrDefault (is_intdef);
 		}
 
@@ -140,28 +132,23 @@ public static AnnotationData GetFieldIntDef (this AndroidAnnotationsSupport api,
 		[Obsolete ("Use GetIntDef(ManagedApiQuery)")]
 		public static AnnotationData GetPropertyIntDef (this AndroidAnnotationsSupport api, string managedTypeName, string managedPropertyName)
 		{
-			if (managedPropertyName == null)
-				throw new ArgumentNullException (nameof (managedPropertyName));
+			ArgumentNullException.ThrowIfNull (managedPropertyName);
 			return api.GetAnnotations (managedTypeName, managedPropertyName).Data ().FirstOrDefault (is_intdef);
 		}
 
 		[Obsolete ("Use GetIntDef(ManagedApiQuery)")]
 		public static AnnotationData GetMethodReturnIntDef (this AndroidAnnotationsSupport api, string managedTypeName, string managedMethodName, string [] managedParameterTypes)
 		{
-			if (managedMethodName == null)
-				throw new ArgumentNullException (nameof (managedMethodName));
-			if (managedParameterTypes == null)
-				throw new ArgumentNullException (nameof (managedParameterTypes));
+			ArgumentNullException.ThrowIfNull (managedMethodName);
+			ArgumentNullException.ThrowIfNull (managedParameterTypes);
 			return api.GetAnnotations (managedTypeName, managedMethodName, managedParameterTypes).Data ().FirstOrDefault (is_intdef);
 		}
 
 		[Obsolete ("Use GetIntDef(ManagedApiQuery)")]
 		public static AnnotationData GetMethodParameterIntDef (this AndroidAnnotationsSupport api, string managedTypeName, string managedMethodName, string [] managedParameterTypes, int parameterIndex)
 		{
-			if (managedMethodName == null)
-				throw new ArgumentNullException (nameof (managedMethodName));
-			if (managedParameterTypes == null)
-				throw new ArgumentNullException (nameof (managedParameterTypes));
+			ArgumentNullException.ThrowIfNull (managedMethodName);
+			ArgumentNullException.ThrowIfNull (managedParameterTypes);
 			return api.GetAnnotations (managedTypeName, managedMethodName, managedParameterTypes, parameterIndex).Data ().FirstOrDefault (is_intdef);
 		}
 
diff --git a/src/Xamarin.Android.Tools.AnnotationSupport/ManagedTypeFinders/ManagedTypeFinder.cs b/src/Xamarin.Android.Tools.AnnotationSupport/ManagedTypeFinders/ManagedTypeFinder.cs
index 3517594a2..ac23bc1fb 100644
--- a/src/Xamarin.Android.Tools.AnnotationSupport/ManagedTypeFinders/ManagedTypeFinder.cs
+++ b/src/Xamarin.Android.Tools.AnnotationSupport/ManagedTypeFinders/ManagedTypeFinder.cs
@@ -74,7 +74,7 @@ public virtual void PrepareContextTypes (IType [] types)
 
 			foreach (var p in maptmp)
 				// We don't want *Invoker classes to overwrite this mapping, so check name and skip them.
-				if (!typemap.ContainsKey (p.JavaName) || GetManagedName (typemap [p.JavaName]) == GetManagedName (p.Managed) + "Invoker")
+				if (!typemap.TryGetValue (p.JavaName, out var value) || GetManagedName (value) == GetManagedName (p.Managed) + "Invoker")
 					typemap [p.JavaName] = p.Managed;
 		}
 
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApi.XmlModel.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApi.XmlModel.cs
index d19d8174e..99e736680 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApi.XmlModel.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApi.XmlModel.cs
@@ -161,7 +161,7 @@ public override string ToString ()
 	}
 
 
-	class ManagedType : JavaType
+	sealed class ManagedType : JavaType
 	{
 		static JavaPackage dummy_system_package, dummy_system_io_package, dummy_system_xml_package;
 		static JavaType system_object, system_exception, system_io_stream, system_xml_xmlreader;
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiDefectFinderExtensions.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiDefectFinderExtensions.cs
index 0136d86a4..89490bb05 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiDefectFinderExtensions.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiDefectFinderExtensions.cs
@@ -21,7 +21,7 @@ static void FindParametersDefects (this JavaMethodBase methodBase)
 		{
 			int dummy;
 			foreach (var p in methodBase.Parameters) {
-				if ((p.Name?.StartsWith ("p", StringComparison.Ordinal) ?? false) &&
+				if ((p.Name?.StartsWith ('p') ?? false) &&
 						int.TryParse (p.Name.Substring (1), out dummy)) {
 					Log.LogWarning ("Warning: {0} in {1} has 'unnamed' parameters", methodBase.Parent, methodBase);
 					break; // reporting once is enough.
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiGenericInheritanceMapperExtensions.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiGenericInheritanceMapperExtensions.cs
index 73b93e16f..5ccd5604e 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiGenericInheritanceMapperExtensions.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiGenericInheritanceMapperExtensions.cs
@@ -42,7 +42,7 @@ static void PrepareGenericInheritanceMapping (this JavaClass cls)
 						 (def, use) => new KeyValuePair (def, use))
 						 .Where (p => p.Value.ReferencedTypeParameter == null || p.Key.Name != p.Value.ReferencedTypeParameter.Name))
 						dic.Add (new JavaTypeReference (kvp.Key, null), kvp.Value);
-					if (dic.Any ()) {
+					if (dic.Count != 0) {
 						cls.GenericInheritanceMapping = dic;
 					}
 					else
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiTypeResolverExtensions.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiTypeResolverExtensions.cs
index 36fa3f624..58319ba93 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiTypeResolverExtensions.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaApiTypeResolverExtensions.cs
@@ -4,7 +4,7 @@
 
 namespace Xamarin.Android.Tools.ApiXmlAdjuster
 {
-	class JavaTypeResolutionException : Exception
+	sealed class JavaTypeResolutionException : Exception
 	{
 		public JavaTypeResolutionException (string message) : base (message)
 		{
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeReference.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeReference.cs
index 8ca86ff2d..15f747fd1 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeReference.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeReference.cs
@@ -75,8 +75,7 @@ public JavaTypeReference (string? constraintLabel, IEnumerable? wildcardConstraints)
 		{
-			if (referencedType == null)
-				throw new ArgumentNullException ("referencedType");
+			ArgumentNullException.ThrowIfNull (referencedType);
 			SpecialName = referencedType.SpecialName;
 			WildcardBoundsType = wildcardBoundsType;
 			WildcardConstraints = wildcardConstraints?.ToList ();
@@ -88,16 +87,14 @@ public JavaTypeReference (JavaTypeReference referencedType, string? arrayPart, s
 		
 		public JavaTypeReference (JavaTypeParameter referencedTypeParameter, string? arrayPart)
 		{
-			if (referencedTypeParameter == null)
-				throw new ArgumentNullException ("referencedTypeParameter");
+			ArgumentNullException.ThrowIfNull (referencedTypeParameter);
 			ReferencedTypeParameter = referencedTypeParameter;
 			ArrayPart = arrayPart;
 		}
 		
 		public JavaTypeReference (JavaType referencedType, IList? typeParameters, string? arrayPart)
 		{
-			if (referencedType == null)
-				throw new ArgumentNullException ("referencedType");
+			ArgumentNullException.ThrowIfNull (referencedType);
 			ReferencedType = referencedType;
 			TypeParameters = typeParameters;
 			ArrayPart = arrayPart;
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeResolutionUtil.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeResolutionUtil.cs
index aa50be957..3303f2a64 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeResolutionUtil.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/JavaTypeResolutionUtil.cs
@@ -22,8 +22,7 @@ static V Get (this IDictionary dic, K key)
 		//	- TODO?: array indicator fixup ("T..." should match "T[]")
 		public static bool IsImplementing (this JavaMethod derived, JavaMethod basis, IDictionary genericInstantiation)
 		{
-			if (genericInstantiation == null)
-				throw new ArgumentNullException ("genericInstantiation");
+			ArgumentNullException.ThrowIfNull (genericInstantiation);
 
 			if (basis.Name != derived.Name)
 				return false;
diff --git a/src/Xamarin.Android.Tools.ApiXmlAdjuster/XmlUtil.cs b/src/Xamarin.Android.Tools.ApiXmlAdjuster/XmlUtil.cs
index 6e92c7274..8704a9457 100644
--- a/src/Xamarin.Android.Tools.ApiXmlAdjuster/XmlUtil.cs
+++ b/src/Xamarin.Android.Tools.ApiXmlAdjuster/XmlUtil.cs
@@ -6,7 +6,7 @@
 
 namespace Xamarin.Android.Tools.ApiXmlAdjuster
 {
-	class XmlUtil
+	sealed class XmlUtil
 	{
 		static string GetLocation (XmlReader reader)
 		{
diff --git a/src/Xamarin.Android.Tools.Bytecode/AttributeInfo.cs b/src/Xamarin.Android.Tools.Bytecode/AttributeInfo.cs
index 85a8387b8..83d92797f 100644
--- a/src/Xamarin.Android.Tools.Bytecode/AttributeInfo.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/AttributeInfo.cs
@@ -59,10 +59,8 @@ public class AttributeInfo {
 
 		protected AttributeInfo (ConstantPool constantPool, ushort nameIndex, Stream stream)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (constantPool);
+			ArgumentNullException.ThrowIfNull (stream);
 
 			ConstantPool    = constantPool;
 			this.nameIndex  = nameIndex;
@@ -192,8 +190,7 @@ public sealed class CodeExceptionTableEntry {
 
 		public CodeExceptionTableEntry (ConstantPool constantPool)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
+			ArgumentNullException.ThrowIfNull (constantPool);
 
 			ConstantPool    = constantPool;
 		}
@@ -344,8 +341,7 @@ public sealed class InnerClassInfo {
 
 		public InnerClassInfo (ConstantPool constantPool)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
+			ArgumentNullException.ThrowIfNull (constantPool);
 
 			ConstantPool    = constantPool;
 		}
@@ -422,8 +418,7 @@ public sealed class LocalVariableTableEntry {
 
 		public LocalVariableTableEntry (ConstantPool constantPool)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
+			ArgumentNullException.ThrowIfNull (constantPool);
 
 			ConstantPool    = constantPool;
 		}
diff --git a/src/Xamarin.Android.Tools.Bytecode/ClassFile.cs b/src/Xamarin.Android.Tools.Bytecode/ClassFile.cs
index ebd012291..1bdcf64a7 100644
--- a/src/Xamarin.Android.Tools.Bytecode/ClassFile.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/ClassFile.cs
@@ -29,8 +29,7 @@ public sealed class ClassFile {
 
 		public ClassFile (Stream stream)
 		{
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (stream);
 
 			uint magic;
 			if (!IsClassFile (stream, out magic))
@@ -61,8 +60,7 @@ public ClassFile (Stream stream)
 
 		public static bool IsClassFile (Stream stream)
 		{
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (stream);
 			try {
 				var magic = stream.ReadNetworkUInt32 ();
 				if (magic != unchecked ((uint) 0xcafebabe))
@@ -75,8 +73,7 @@ public static bool IsClassFile (Stream stream)
 
 		static bool IsClassFile (Stream stream, out uint magic)
 		{
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (stream);
 			try {
 				magic = stream.ReadNetworkUInt32 ();
 				if (magic != unchecked ((uint) 0xcafebabe))
diff --git a/src/Xamarin.Android.Tools.Bytecode/ClassPath.cs b/src/Xamarin.Android.Tools.Bytecode/ClassPath.cs
index 03f011c3d..96e91e413 100644
--- a/src/Xamarin.Android.Tools.Bytecode/ClassPath.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/ClassPath.cs
@@ -61,8 +61,7 @@ public void Load (string filePath)
 
 		public void Load (Stream jarStream, bool leaveOpen = false)
 		{
-			if (jarStream == null)
-				throw new ArgumentNullException (nameof (jarStream));
+			ArgumentNullException.ThrowIfNull (jarStream);
 
 			using (var jar = CreateZipArchive (jarStream, leaveOpen)) {
 				foreach (var entry in jar.Entries) {
@@ -127,8 +126,7 @@ public ReadOnlyDictionary> GetPackages ()
 
 		public static bool IsJarFile (string jarFile)
 		{
-			if (jarFile == null)
-				throw new ArgumentNullException ("jarFile");
+			ArgumentNullException.ThrowIfNull (jarFile);
 			try {
 				using (var f = File.OpenRead (jarFile))
 				using (new ZipArchive (f)) {
@@ -142,8 +140,7 @@ public static bool IsJarFile (string jarFile)
 
 		public static bool IsJmodFile (string jmodFile)
 		{
-			if (jmodFile == null)
-				throw new ArgumentNullException (nameof (jmodFile));
+			ArgumentNullException.ThrowIfNull (jmodFile);
 			try {
 				using var f = File.OpenRead (jmodFile);
 				var h = new byte[4];
@@ -173,7 +170,7 @@ public static bool IsJmodFile (string jmodFile)
 
 		bool IsGeneratedName (string parameterName)
 		{
-			return parameterName.StartsWith ("p", StringComparison.Ordinal) && parameterName.Length > 1 && Char.IsDigit (parameterName [1]);
+			return parameterName.StartsWith ('p') && parameterName.Length > 1 && Char.IsDigit (parameterName [1]);
 		}
 
 		IEnumerable GetDescendants (ClassFile theClass, IList classFiles)
@@ -256,7 +253,7 @@ void FixUpParametersFromClasses ()
 
 				List implementations = GetDescendants (abstractClass, classFiles)
 					.ToList();
-				if (!implementations.Any ())
+				if (implementations.Count == 0)
 					continue;
 				FixUpParameters (abstractClass, implementations);
 			}
@@ -265,7 +262,7 @@ void FixUpParametersFromClasses ()
 						(c.AccessFlags & ClassAccessFlags.Interface) != 0)) {
 				List implementations = GetInterfaceImplemetations (iface, classFiles)
 					.ToList();
-				if (!implementations.Any ())
+				if (implementations.Count == 0)
 					continue;
 				for (int i=0; i < implementations.Count; i++) {
 					implementations.AddRange ( GetDescendants (implementations [i], classFiles)
@@ -329,7 +326,7 @@ void FixupParametersFromDocs (XElement api, string path)
 								javaType: (string?) p.Attribute ("type") ?? ""))
 						.ToArray ();
 
-					if (!parameterTypes.Any ())
+					if (parameterTypes.Length == 0)
 						continue;
 
 					var nameInfo = new JavaMethodParameterNameInfo (
diff --git a/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs b/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs
index 946898ec7..c3a19fa8d 100644
--- a/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/ConstantPool.cs
@@ -13,8 +13,7 @@ public class ConstantPool : Collection {
 
 		public ConstantPool (Stream stream)
 		{
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (stream);
 
 			// indexes are one-based;
 			// "The constant_pool table is indexed from 1 to constant_pool_count-1."
@@ -63,10 +62,8 @@ internal    virtual     bool                    EntryRequiresTwoSlots {
 
 		public ConstantPoolItem (ConstantPool constantPool, Stream stream)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (constantPool);
+			ArgumentNullException.ThrowIfNull (stream);
 
 			ConstantPool    = constantPool;
 		}
diff --git a/src/Xamarin.Android.Tools.Bytecode/Fields.cs b/src/Xamarin.Android.Tools.Bytecode/Fields.cs
index 0a0ddfd27..8a582ae38 100644
--- a/src/Xamarin.Android.Tools.Bytecode/Fields.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/Fields.cs
@@ -12,10 +12,8 @@ public sealed class Fields : Collection {
 
 		public Fields (ConstantPool constantPool, ClassFile declaringClass, Stream stream)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (constantPool);
+			ArgumentNullException.ThrowIfNull (stream);
 
 			ConstantPool    = constantPool;
 			var count       = stream.ReadNetworkUInt16 ();
diff --git a/src/Xamarin.Android.Tools.Bytecode/Interfaces.cs b/src/Xamarin.Android.Tools.Bytecode/Interfaces.cs
index 45eb30e9f..159329a1f 100644
--- a/src/Xamarin.Android.Tools.Bytecode/Interfaces.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/Interfaces.cs
@@ -13,10 +13,8 @@ public sealed class Interfaces : Collection {
 
 		public Interfaces (ConstantPool constantPool, Stream stream)
 		{
-			if (constantPool == null)
-				throw new ArgumentNullException ("constantPool");
-			if (stream == null)
-				throw new ArgumentNullException ("stream");
+			ArgumentNullException.ThrowIfNull (constantPool);
+			ArgumentNullException.ThrowIfNull (stream);
 
 			ConstantPool    = constantPool;
 			var count   = stream.ReadNetworkUInt16 ();
diff --git a/src/Xamarin.Android.Tools.Bytecode/JavaDocumentScraper.cs b/src/Xamarin.Android.Tools.Bytecode/JavaDocumentScraper.cs
index 2ac11584e..72c347f71 100644
--- a/src/Xamarin.Android.Tools.Bytecode/JavaDocumentScraper.cs
+++ b/src/Xamarin.Android.Tools.Bytecode/JavaDocumentScraper.cs
@@ -33,7 +33,7 @@
 
 namespace Xamarin.Android.Tools.Bytecode
 {
-	class DroidDocScraper : AndroidDocScraper
+	sealed class DroidDocScraper : AndroidDocScraper
 	{
 		const String pattern_head_droiddoc = ".*.*", "" };
 
 		protected override IEnumerable GetContentLines (string path)
 		{
@@ -72,7 +73,7 @@ protected override IEnumerable GetContentLines (string path)
 				// ... is the basic structure so  is used as the end of member, but we also use 

here. // Sometimes another can appear after "" (for the end of context member) and that messes regex match. // So, with any

, we interrupt consecutive matches. - prev_contents = all.Split (new string [] { "

", "" }, StringSplitOptions.RemoveEmptyEntries); + prev_contents = all.Split (separator, StringSplitOptions.RemoveEmptyEntries); return prev_contents; } } @@ -83,7 +84,7 @@ protected override bool ShouldResetMatchBuffer (string text) } } - class JavaDocScraper : AndroidDocScraper + sealed class JavaDocScraper : AndroidDocScraper { const String pattern_head_javadoc = " tags, so remove all of them. - while (value.IndexOf ("<", StringComparison.Ordinal) >= 0 && - value.IndexOf (">", StringComparison.Ordinal) > value.IndexOf ("<", StringComparison.Ordinal)) - value = value.Substring (0, value.IndexOf ("<", StringComparison.Ordinal)) + - value.Substring (value.IndexOf (">", StringComparison.Ordinal) + 1); + while (value.IndexOf ('<') >= 0 && + value.IndexOf ('>') > value.IndexOf ('<')) + value = string.Concat (value.AsSpan (0, value.IndexOf ('<')), value.AsSpan (value.IndexOf ('>') + 1)); return value; } } @@ -150,9 +150,8 @@ protected AndroidDocScraper (string dir, String patternHead, String? resetPatter protected AndroidDocScraper (string dir, String patternHead, String? resetPatternHead, String parameterPairSplitter, bool continuousParamLines, string openMethod, string paramSep, string closeMethod, string? postCloseMethodParens) { - if (dir == null) - throw new ArgumentNullException ("dir"); - + ArgumentNullException.ThrowIfNull (dir); + pattern_head = patternHead; reset_pattern_head = resetPatternHead; parameter_pair_splitter = new string [] { (parameterPairSplitter != null ? parameterPairSplitter : "\\s+") }; @@ -186,7 +185,7 @@ protected virtual bool ShouldResetMatchBuffer (string text) { // sometimes we get incomplete tag, so cache it until it gets complete or matched. // I *know* this is a hack. - return reset_pattern_head == null || text.EndsWith (">", StringComparison.Ordinal) || !continuous_param_lines && !text.StartsWith (reset_pattern_head, StringComparison.Ordinal); + return reset_pattern_head == null || text.EndsWith ('>') || !continuous_param_lines && !text.StartsWith (reset_pattern_head, StringComparison.Ordinal); } protected virtual string StripTagsFromParameters (string value) @@ -219,10 +218,9 @@ protected virtual string StripTagsFromParameters (string value) buffer.Append (param_sep); var ptype = ptypes [i]; if (ShouldEliminateGenericArguments) - while (ptype.IndexOf ("<", StringComparison.Ordinal) > 0 && - ptype.IndexOf (">", StringComparison.Ordinal) > ptype.IndexOf ("<", StringComparison.Ordinal)) - ptype = ptype.Substring (0, ptype.IndexOf ("<", StringComparison.Ordinal)) + - ptype.Substring (ptype.IndexOf (">", StringComparison.Ordinal) + 1); + while (ptype.IndexOf ('<') > 0 && + ptype.IndexOf ('>') > ptype.IndexOf ('<')) + ptype = string.Concat (ptype.AsSpan (0, ptype.IndexOf ('<')), ptype.AsSpan (ptype.IndexOf ('>') + 1)); buffer.Append (ptype.Replace ('$', '.')); } if (ShouldEscapeBrackets) @@ -245,7 +243,7 @@ protected virtual string StripTagsFromParameters (string value) var matcher = pattern.Match (text); if (matcher.Success) { var plist = matcher.Groups [1]; - String[] parms = StripTagsFromParameters (plist.Value).Split (new string [] { ", " }, StringSplitOptions.RemoveEmptyEntries); + String[] parms = StripTagsFromParameters (plist.Value).Split (separator, StringSplitOptions.RemoveEmptyEntries); if (parms.Length != ptypes.Length) { Log.Warning (1, "failed matching {0} (expected {1} params, got {2} params)", buffer, ptypes.Length, parms.Length); return null; @@ -273,7 +271,8 @@ protected virtual string StripTagsFromParameters (string value) static Dictionary>? deprecatedFields; static Dictionary>? deprecatedMethods; - + private static readonly string [] separator = new string [] { ", " }; + public static void LoadXml (String filename) { try { @@ -378,7 +377,7 @@ public static JavaDocletType GetDocletType (string path) rawXML.IndexOf ("= 0)) kind = JavaDocletType._ApiXml; else if (rawXML.StartsWith ("package", StringComparison.Ordinal) || - rawXML.StartsWith (";", StringComparison.Ordinal)) { + rawXML.StartsWith (';')) { kind = JavaDocletType.JavaApiParameterNamesXml; } } @@ -449,7 +448,7 @@ bool ParameterTypesMatch (XElement parameter, string ptype) if (!jtype.StartsWith (".*", StringComparison.Ordinal)) { return jtype == ptype; } - jtype = "." + jtype.Substring (".*".Length); + jtype = string.Concat (".", jtype.AsSpan (".*".Length)); return ptype.EndsWith (jtype, StringComparison.Ordinal); } } diff --git a/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs b/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs index 63136d1fe..714b4d25a 100644 --- a/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs +++ b/src/Xamarin.Android.Tools.Bytecode/JavaParameterNamesLoader.cs @@ -17,25 +17,25 @@ public JavaParameterNamesLoader(string path) packages = this.LoadParameterFixupDescription(path); } - class Parameter + sealed class Parameter { public string? Type { get; set; } public string? Name { get; set; } } - class Method + sealed class Method { public string? Name { get; set; } public List? Parameters { get; set; } } - class Type + sealed class Type { public string? Name { get; set; } public List? Methods { get; set; } } - class Package + sealed class Package { public string? Name { get; set; } public List? Types { get; set; } @@ -78,8 +78,8 @@ List LoadParameterFixupDescription (string path) int currentLine = 0; foreach (var l in File.ReadAllLines (path)) { currentLine++; - var line = l.IndexOf (";", StringComparison.Ordinal) >= 0 - ? l.Substring (0, l.IndexOf (";", StringComparison.Ordinal)).TrimEnd (' ', '\t') + var line = l.IndexOf (';') >= 0 + ? l.Substring (0, l.IndexOf (';')).TrimEnd (' ', '\t') : l; if (line.Trim ().Length == 0) continue; @@ -89,13 +89,13 @@ List LoadParameterFixupDescription (string path) fixup.Add (new Package { Name = package, Types = types }); continue; } else if (line.StartsWith (" ", StringComparison.Ordinal)) { - int open = line.IndexOf ("(", StringComparison.Ordinal); + int open = line.IndexOf ('('); if (open < 0) throw new ArgumentException ($"Unexpected line in {path} line {currentLine}: {line}"); string parameters = line.Substring (open + 1).TrimEnd (')'); string name = line.Substring (4, open - 4); if (name.FirstOrDefault () == '<') // generic method can begin with type parameters. - name = name.Substring (name.IndexOf (" ", StringComparison.Ordinal) + 1); + name = name.Substring (name.IndexOf (' ') + 1); methods.Add (new Method { Name = name, Parameters = parameters.Replace (", ", "\0").Split ('\0') @@ -103,10 +103,10 @@ List LoadParameterFixupDescription (string path) .Select (a => new Parameter { Type = string.Join (" ", a.Take (a.Length - 1)).Replace (",", ", "), Name = a.Last () }).ToList () }); } else { - type = line.Substring (line.IndexOf (" ", 2, StringComparison.Ordinal) + 1); + type = line.Substring (line.IndexOf (' ', 2) + 1); // To match type name from class-parse, we need to strip off generic arguments here (generics are erased). - if (type.IndexOf ("<", StringComparison.Ordinal) > 0) - type = type.Substring (0, type.IndexOf ("<", StringComparison.Ordinal)); + if (type.IndexOf ('<') > 0) + type = type.Substring (0, type.IndexOf ('<')); methods = new List (); types.Add (new Type { Name = type, Methods = methods }); } diff --git a/src/Xamarin.Android.Tools.Bytecode/Kotlin/JvmNameResolver.cs b/src/Xamarin.Android.Tools.Bytecode/Kotlin/JvmNameResolver.cs index a61ae4fb1..f6a9f7193 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Kotlin/JvmNameResolver.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Kotlin/JvmNameResolver.cs @@ -5,7 +5,7 @@ namespace Xamarin.Android.Tools.Bytecode { // https://github.com/JetBrains/kotlin/blob/master/core/metadata.jvm/src/org/jetbrains/kotlin/metadata/jvm/deserialization/JvmNameResolver.kt - class JvmNameResolver + sealed class JvmNameResolver { readonly List records = new List (); readonly List strings; @@ -55,7 +55,7 @@ public string GetString (int index) val = val.Replace ('$', '.'); else if (record.operation == StringTableTypes.Record.Operation.DescToClassId) { if (val.Length >= 2) - val = val.Substring (1, val.Length - 1); + val = val.Substring (1); val = val.Replace ('$', '.'); } diff --git a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinClassMetadata.cs b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinClassMetadata.cs index de5a5513e..b107bcabe 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinClassMetadata.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinClassMetadata.cs @@ -263,8 +263,8 @@ public string GetFlags () { var sb = new StringBuilder (); - foreach (var f in Enum.GetNames (typeof (KotlinFunctionFlags))) { - if (Flags.HasFlag ((KotlinFunctionFlags)Enum.Parse (typeof (KotlinFunctionFlags), f))) + foreach (var f in Enum.GetNames ()) { + if (Flags.HasFlag (Enum.Parse (f))) sb.Append (f); } diff --git a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinFixups.cs b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinFixups.cs index 56ded5131..8be8f4b35 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinFixups.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinFixups.cs @@ -460,13 +460,13 @@ static bool TypesMatch (TypeInfo javaType, KotlinType kotlinType, KotlinFile? ko // Sometimes Kotlin keeps its native types rather than converting them to Java native types // ie: "Lkotlin/UShort;" instead of "S" - if (javaType.BinaryName.StartsWith ("L", StringComparison.Ordinal) && javaType.BinaryName.EndsWith (";", StringComparison.Ordinal)) { + if (javaType.BinaryName.StartsWith ('L') && javaType.BinaryName.EndsWith (';')) { if (KotlinUtilities.ConvertKotlinClassToJava (javaType.BinaryName.Substring (1, javaType.BinaryName.Length - 2)) == KotlinUtilities.ConvertKotlinTypeSignature (kotlinType, kotlinFile)) return true; } // Same for some arrays - if (javaType.BinaryName.StartsWith ("[L", StringComparison.Ordinal) && javaType.BinaryName.EndsWith (";", StringComparison.Ordinal)) { + if (javaType.BinaryName.StartsWith ("[L", StringComparison.Ordinal) && javaType.BinaryName.EndsWith (';')) { if ("[" + KotlinUtilities.ConvertKotlinClassToJava (javaType.BinaryName.Substring (2, javaType.BinaryName.Length - 3)) == KotlinUtilities.ConvertKotlinTypeSignature (kotlinType, kotlinFile)) return true; } diff --git a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinProtobufDefinition.cs b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinProtobufDefinition.cs index 2dd0c8639..ae5fadbe6 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinProtobufDefinition.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinProtobufDefinition.cs @@ -4,7 +4,7 @@ // Consider using 'partial classes' to extend these types // Input: my.proto -#pragma warning disable CS1591, CS0612, CS3021, IDE1006 +#pragma warning disable CS1591, CS0612, CS3021, IDE1006, CA1852 namespace org.jetbrains.kotlin.metadata.jvm { diff --git a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinUtilities.cs b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinUtilities.cs index e27b04c09..7e84b078a 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinUtilities.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Kotlin/KotlinUtilities.cs @@ -73,7 +73,7 @@ public static ParameterInfo[] GetFilteredParameters (this MethodInfo method) { // Kotlin adds this to some constructors but I cannot tell which ones, // so we'll just ignore them if we see them on the Java side - return method.GetParameters ().Where (p => p.Type.BinaryName != "Lkotlin/jvm/internal/DefaultConstructorMarker;" && !p.Name.StartsWith ("$", StringComparison.Ordinal)).ToArray (); + return method.GetParameters ().Where (p => p.Type.BinaryName != "Lkotlin/jvm/internal/DefaultConstructorMarker;" && !p.Name.StartsWith ('$')).ToArray (); } public static string GetMethodNameWithoutUnsignedSuffix (this MethodInfo method) @@ -92,7 +92,7 @@ public static string GetMethodNameWithoutUnsignedSuffix (string name) var index = name.IndexOf ('-'); - return index >= 0 ? name.Substring (0, index) + dollar_suffix : name; + return index >= 0 ? string.Concat (name.AsSpan (0, index), dollar_suffix) : name; } public static bool IsDefaultConstructorMarker (this MethodInfo method) @@ -141,13 +141,13 @@ public static string ConstructJvmSignature (this KotlinFunction function) public static bool IsPubliclyVisible (this KotlinPropertyFlags flags) => flags.HasFlag (KotlinPropertyFlags.Public) || flags.HasFlag (KotlinPropertyFlags.Protected); - public static bool IsUnnamedParameter (this ParameterInfo parameter) => parameter.Name.Length > 1 && parameter.Name.StartsWith ("p", StringComparison.Ordinal) && int.TryParse (parameter.Name.Substring (1), out var _); + public static bool IsUnnamedParameter (this ParameterInfo parameter) => parameter.Name.Length > 1 && parameter.Name.StartsWith ('p') && int.TryParse (parameter.Name.AsSpan (1), out var _); - public static bool IsCompilerNamed (this ParameterInfo parameter) => parameter.Name.Length > 0 && parameter.Name.StartsWith ("$", StringComparison.Ordinal); + public static bool IsCompilerNamed (this ParameterInfo parameter) => parameter.Name.Length > 0 && parameter.Name.StartsWith ('$'); public static bool IsUnnamedParameter (this KotlinValueParameter parameter) => parameter.Name?.Length > 1 && - parameter.Name.StartsWith ("p", StringComparison.Ordinal) && - int.TryParse (parameter.Name.Substring (1), out var _); + parameter.Name.StartsWith ('p') && + int.TryParse (parameter.Name.AsSpan (1), out var _); static Dictionary unsigned_type_map = new Dictionary { { "kotlin/UInt", "I" }, diff --git a/src/Xamarin.Android.Tools.Bytecode/Signatures.cs b/src/Xamarin.Android.Tools.Bytecode/Signatures.cs index e514b9d2a..28d03ac6c 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Signatures.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Signatures.cs @@ -55,8 +55,7 @@ internal static string ExtractType (string signature, ref int index) internal static void AssertSignatureIndex (string signature, int index) { - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (signature); if (signature.Length == 0) throw new ArgumentException ("Descriptor cannot be empty string", "descriptor"); if (index >= signature.Length) diff --git a/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs b/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs index b6df82728..924ea0591 100644 --- a/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs +++ b/src/Xamarin.Android.Tools.Bytecode/XmlClassDeclarationBuilder.cs @@ -19,8 +19,7 @@ bool IsInterface { public XmlClassDeclarationBuilder (ClassFile classFile) { - if (classFile == null) - throw new ArgumentNullException ("classFile"); + ArgumentNullException.ThrowIfNull (classFile); this.classFile = classFile; signature = classFile.GetSignature (); @@ -238,7 +237,7 @@ static StringBuilder AppendGenericTypeNameFromSignature (StringBuilder typeBuild typeBuilder.Append ("? super "); return AppendGenericTypeNameFromSignature (typeBuilder, value, ref index); } - typeBuilder.Append ("/* should not be reached */").Append (value.Substring (index)); + typeBuilder.Append ("/* should not be reached */").Append (value.AsSpan (index)); index = value.Length; return typeBuilder; } @@ -397,9 +396,9 @@ IEnumerable GetMethodParameters (MethodInfo method) var genericType = p.Type.TypeSignature; var varargArray = (i == (parameters.Length - 1)) && varargs; if (varargArray) { - Debug.Assert (p.Type.BinaryName.StartsWith ("[", StringComparison.Ordinal), + Debug.Assert (p.Type.BinaryName.StartsWith ('['), "Varargs parameters MUST be arrays!"); - Debug.Assert (p.Type.TypeSignature != null && p.Type.TypeSignature.StartsWith ("[", StringComparison.Ordinal), + Debug.Assert (p.Type.TypeSignature != null && p.Type.TypeSignature.StartsWith ('['), "Varargs parameters MUST be arrays!"); type = type.Substring (1); genericType = genericType?.Substring (1); diff --git a/src/java-interop/.gitignore b/src/java-interop/.gitignore deleted file mode 100644 index dd69cf665..000000000 --- a/src/java-interop/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -coreclr.exp -jni.c -jni.g.cs diff --git a/src/java-interop/CMakeLists.txt b/src/java-interop/CMakeLists.txt deleted file mode 100644 index e5c70c813..000000000 --- a/src/java-interop/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -cmake_minimum_required(VERSION 3.10.2) - -project( - java-interop - DESCRIPTION "Java.Interop native support" - HOMEPAGE_URL "https://github.com/dotnet/java-interop/" - LANGUAGES CXX C -) - -set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_VISIBILITY_PRESET hidden) - -option(ENABLE_MONO_INTEGRATION "Require Mono runtime" OFF) -option(ENABLE_OSX_ARCHITECTURES "macOS architectures" "") - -set(CMAKE_OSX_ARCHITECTURES ${ENABLE_OSX_ARCHITECTURES}) - -set(JAVA_INTEROP_CORE_SOURCES - java-interop-dlfcn.cc - java-interop-jvm.cc - java-interop-logger.cc - java-interop-util.cc - java-interop.cc - ${JNI_C_PATH} -) -set(JAVA_INTEROP_MONO_SOURCES - java-interop-gc-bridge-mono.cc - java-interop-mono.cc -) - -add_compile_definitions("JAVA_INTEROP_DLL_EXPORT") -add_compile_definitions("JI_DLL_EXPORT") - -foreach(dir in ${JDK_INCLUDE_LIST}) - include_directories(${dir}) -endforeach() - -set(LINK_FLAGS "") - -if(ENABLE_MONO_INTEGRATION) - foreach(dir in ${MONO_INCLUDE_LIST}) - include_directories(${dir}) - endforeach() - list(APPEND LINK_FLAGS ${MONO_LINK_FLAGS}) - set(JAVA_INTEROP_SOURCES ${JAVA_INTEROP_CORE_SOURCES} ${JAVA_INTEROP_MONO_SOURCES}) -else() - set(JAVA_INTEROP_SOURCES ${JAVA_INTEROP_CORE_SOURCES}) -endif() - -add_library( - java-interop - SHARED - ${JAVA_INTEROP_SOURCES} -) -target_link_libraries( - java-interop - ${LINK_FLAGS} -) diff --git a/src/java-interop/coreclr.def b/src/java-interop/coreclr.def deleted file mode 100644 index 6eb946c9e..000000000 --- a/src/java-interop/coreclr.def +++ /dev/null @@ -1,20 +0,0 @@ -LIBRARY CORECLR - -EXPORTS - mono_class_from_mono_type - mono_class_get_field_from_name - mono_class_get_name - mono_class_get_namespace - mono_class_is_subclass_of - mono_class_vtable - mono_domain_get - mono_field_get_value - mono_field_set_value - mono_field_static_set_value - mono_gc_register_bridge_callbacks - mono_gc_wait_for_bridge_processing - mono_object_get_class - mono_thread_attach - mono_thread_current - mono_thread_get_managed_id - mono_thread_get_name_utf8 diff --git a/src/java-interop/coreclr.lib b/src/java-interop/coreclr.lib deleted file mode 100644 index aa421bc7b..000000000 Binary files a/src/java-interop/coreclr.lib and /dev/null differ diff --git a/src/java-interop/java-interop-dlfcn.cc b/src/java-interop/java-interop-dlfcn.cc deleted file mode 100644 index 0ce625687..000000000 --- a/src/java-interop/java-interop-dlfcn.cc +++ /dev/null @@ -1,194 +0,0 @@ -#include "java-interop.h" -#include "java-interop-dlfcn.h" -#include "java-interop-util.h" - -#ifdef _WINDOWS -#include -#else -#include -#include -#endif - -namespace microsoft::java_interop { - -static char * -_get_last_dlerror () -{ -#ifdef _WINDOWS - - DWORD error = GetLastError (); - if (error == ERROR_SUCCESS /* 0 */) { - return nullptr; - } - - wchar_t *buf = nullptr; - - DWORD size = FormatMessageW ( - /* dwFlags */ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - /* lpSource */ NULL, - /* dwMessageId */ error, - /* dwLanguageId */ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), - /* lpBuffer */ (LPWSTR) &buf, - /* nSize */ 0, - /* Arguments */ NULL - ); - if (size == 0) - return nullptr; - - char *message = utf16_to_utf8 (buf); - LocalFree (buf); - - return message; - -#else // ndef _WINDOWS - - return java_interop_strdup (dlerror ()); - -#endif // ndef _WINDOWS -} - -static void -_free_error (char **error) -{ - if (error == nullptr) - return; - java_interop_free (*error); - *error = nullptr; -} - -static void -_set_error (char **error, const char *message) -{ - if (error == nullptr) - return; - *error = java_interop_strdup (message); -} - -static void -_set_error_to_last_error (char **error) -{ - if (error == nullptr) - return; - *error = _get_last_dlerror (); -} - -void* -java_interop_lib_load (const char *path, [[maybe_unused]] unsigned int flags, char **error) -{ - _free_error (error); - if (path == nullptr) { - _set_error (error, "path=nullptr is not supported"); - return nullptr; - } - - void *handle = nullptr; - -#ifdef _WINDOWS - - wchar_t *wpath = utf8_to_utf16 (path); - if (wpath == nullptr) { - _set_error (error, "could not convert path to UTF-16"); - return nullptr; - } - HMODULE module = LoadLibraryExW ( - /* lpLibFileName */ wpath, - /* hFile */ nullptr, - /* dwFlags */ LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_USER_DIRS | LOAD_LIBRARY_SEARCH_SYSTEM32 - ); - java_interop_free (wpath); - - handle = reinterpret_cast(module); - -#else // ndef _WINDOWS - - int mode = 0; - if ((flags & JAVA_INTEROP_LIB_LOAD_GLOBALLY) == JAVA_INTEROP_LIB_LOAD_GLOBALLY) { - mode = RTLD_GLOBAL; - } - if ((flags & JAVA_INTEROP_LIB_LOAD_LOCALLY) == JAVA_INTEROP_LIB_LOAD_LOCALLY) { - mode = RTLD_LOCAL; - } - - if (mode == 0) { - mode = RTLD_LOCAL; - } - mode |= RTLD_NOW; - - handle = dlopen (path, mode); - -#endif // ndef _WINDOWS - - if (handle == nullptr) { - _set_error_to_last_error (error); - } - - return handle; -} - -void* -java_interop_lib_symbol (void *library, const char *symbol, char **error) -{ - _free_error (error); - - if (library == nullptr) { - _set_error (error, "library=nullptr"); - return nullptr; - } - if (symbol == nullptr) { - _set_error (error, "symbol=nullptr"); - return nullptr; - } - - void *address = nullptr; - -#ifdef _WINDOWS - - HMODULE module = reinterpret_cast(library); - FARPROC a = GetProcAddress (module, symbol); - address = reinterpret_cast(a); - -#else // ndef _WINDOWS - - address = dlsym (library, symbol); - -#endif // ndef _WINDOWS - - if (address == nullptr) { - _set_error_to_last_error (error); - } - - return address; -} - -int -java_interop_lib_close (void* library, char **error) -{ - _free_error (error); - if (library == nullptr) { - _set_error (error, "library=nullptr"); - return JAVA_INTEROP_LIB_INVALID_PARAM; - } - - int r = 0; - -#ifdef _WINDOWS - HMODULE h = reinterpret_cast(library); - BOOL v = FreeLibrary (h); - if (!v) { - r = JAVA_INTEROP_LIB_CLOSE_FAILED; - } -#else // ndef _WINDOWS - r = dlclose (library); - if (r != 0) { - r = JAVA_INTEROP_LIB_CLOSE_FAILED; - } -#endif // ndef _WINDOWS - - if (r != 0) { - _set_error_to_last_error (error); - } - - return r; -} - -} // namespace microsoft::java_interop diff --git a/src/java-interop/java-interop-dlfcn.h b/src/java-interop/java-interop-dlfcn.h deleted file mode 100644 index 0411c7e39..000000000 --- a/src/java-interop/java-interop-dlfcn.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef INC_JAVA_INTEROP_DLFCN_H -#define INC_JAVA_INTEROP_DLFCN_H - -#include "java-interop.h" - -namespace microsoft::java_interop { - -// Possible flags values for java_interop_lib_load -constexpr unsigned int JAVA_INTEROP_LIB_LOAD_GLOBALLY = (1 << 0); -constexpr unsigned int JAVA_INTEROP_LIB_LOAD_LOCALLY = (1 << 1); - - -// Possible error codes from java_interop_lib_close -constexpr int JAVA_INTEROP_LIB_FAILED = -1000; -constexpr int JAVA_INTEROP_LIB_CLOSE_FAILED = JAVA_INTEROP_LIB_FAILED-1; -constexpr int JAVA_INTEROP_LIB_INVALID_PARAM = JAVA_INTEROP_LIB_FAILED-2; - -JAVA_INTEROP_BEGIN_DECLS - -JAVA_INTEROP_API void* java_interop_lib_load (const char *path, unsigned int flags, char **error); -JAVA_INTEROP_API void* java_interop_lib_symbol (void* library, const char *symbol, char **error); -JAVA_INTEROP_API int java_interop_lib_close (void* library, char **error); - -JAVA_INTEROP_END_DECLS - -} - -#endif /* INC_JAVA_INTEROP_DLFCN_H */ diff --git a/src/java-interop/java-interop-gc-bridge-mono.cc b/src/java-interop/java-interop-gc-bridge-mono.cc deleted file mode 100644 index cebe8ece9..000000000 --- a/src/java-interop/java-interop-gc-bridge-mono.cc +++ /dev/null @@ -1,1399 +0,0 @@ -#define __STDC_FORMAT_MACROS - -#include -#include -#include -#include - -#include "java-interop.h" -#include "java-interop-gc-bridge.h" -#include "java-interop-mono.h" -#include "java-interop-util.h" - -#ifdef _WINDOWS -#include -#include -#endif - -#ifdef __linux__ - #include - #include -#endif /* !defined (__linux__) */ - -#if defined (ANDROID) - #include "logger.h" -#endif /* !defined (ANDROID) */ - -#if defined (ANDROID) || defined (XAMARIN_ANDROID_DYLIB_MONO) -using namespace xamarin::android; -#endif - -typedef struct MonoJavaGCBridgeInfo { - MonoClass *klass; - MonoClassField *jniObjectReferenceControlBlock; -} MonoJavaGCBridgeInfo; - -typedef struct JniObjectReferenceControlBlock { - jobject handle; - int handle_type; - jobject weak_handle; - int refs_added; -} JniObjectReferenceControlBlock; - -#define NUM_GC_BRIDGE_TYPES (4) - -struct JavaInteropGCBridge { - - JavaVM *jvm; - - MonoClass *BridgeProcessing_type; - MonoClassField *BridgeProcessing_field; - - int BridgeProcessing_vtables_count, BridgeProcessing_vtables_length; - MonoDomain **BridgeProcessing_domains; - MonoVTable **BridgeProcessing_vtables; - - int num_bridge_types; - MonoJavaGCBridgeInfo mono_java_gc_bridge_info [NUM_GC_BRIDGE_TYPES]; - - int gc_disabled; - - int gc_gref_count; - int gc_weak_gref_count; - - jobject Runtime_instance; - jmethodID Runtime_gc; - - jclass WeakReference_class; - jmethodID WeakReference_init; - jmethodID WeakReference_get; - - jclass GCUserPeerable_class; - jmethodID GCUserPeerable_add; - jmethodID GCUserPeerable_clear; - - FILE *gref_log, *lref_log; - char *gref_path, *lref_path; - int gref_log_level, lref_log_level; - int gref_cleanup, lref_cleanup; - - JavaInteropMarkCrossReferencesCallback mark_cross_references; -}; - -static jobject -lref_to_gref (JNIEnv *env, jobject lref) -{ - jobject g; - if (lref == 0) - return 0; - g = env->NewGlobalRef (lref); - env->DeleteLocalRef (lref); - return g; -} - -static JNIEnv* -ensure_jnienv (JavaInteropGCBridge *bridge) -{ - JavaVM *jvm = bridge->jvm; - JNIEnv *env; - if (bridge->jvm->GetEnv ((void**)&env, JNI_VERSION_1_6) != JNI_OK || env == NULL) { - mono_thread_attach (mono_domain_get ()); - jvm->GetEnv ((void**)&env, JNI_VERSION_1_6); - } - return env; -} - -static int -java_interop_gc_bridge_destroy (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - JNIEnv *env = ensure_jnienv (bridge); - if (env != NULL) { - env->DeleteGlobalRef (bridge->Runtime_instance); - env->DeleteGlobalRef (bridge->WeakReference_class); - env->DeleteGlobalRef (bridge->GCUserPeerable_class); - - bridge->Runtime_instance = NULL; - bridge->WeakReference_class = NULL; - - bridge->GCUserPeerable_class = NULL; - } - - if (bridge->gref_log != NULL && bridge->gref_cleanup) { - fclose (bridge->gref_log); - } - bridge->gref_log = NULL; - - free (bridge->gref_path); - bridge->gref_path = NULL; - - if (bridge->lref_log != NULL && bridge->lref_cleanup) { - fclose (bridge->lref_log); - } - bridge->lref_log = NULL; - - free (bridge->lref_path); - bridge->lref_path = NULL; - - free (bridge->BridgeProcessing_domains); - free (bridge->BridgeProcessing_vtables); - bridge->BridgeProcessing_domains = NULL; - bridge->BridgeProcessing_vtables = NULL; - bridge->BridgeProcessing_vtables_count = 0; - bridge->BridgeProcessing_vtables_length = 0; - - return 0; -} - -#ifdef _WINDOWS -static char* -_ji_realpath_win_loop (wchar_t* wpath, DWORD len) -{ - DWORD retval; - char* fullpath = NULL; - wchar_t *allocated_buffer = static_cast (xmalloc (sizeof (wchar_t)*len)); - - while (1) { - retval = GetFullPathNameW (wpath, len, allocated_buffer, NULL); - - if (retval == 0) - break; - - if (retval < len && allocated_buffer [retval] == '\0') { - fullpath = utf16_to_utf8 (allocated_buffer); - break; - } - - // other thread probably called chdir () - // be on the safe side and allocate more space in case it will happen again - len = retval*2; - allocated_buffer = static_cast (xrealloc (allocated_buffer, sizeof (wchar_t)*len)); - } - - free (allocated_buffer); - - return fullpath; -} -#endif - -static char* -ji_realpath (const char *path) -{ - if (path == NULL) - return NULL; - -#ifndef _WINDOWS - char *rp = realpath (path, NULL); - if (rp == NULL) { - return strdup (path); - } - return rp; -#else -#define BUFSIZE 512 - - wchar_t *wpath = utf8_to_utf16 (path); - char *fullpath = NULL; - wchar_t buffer [BUFSIZE]; - DWORD retval = GetFullPathNameW (wpath, BUFSIZE, buffer, NULL); - - do { - if (retval == 0) - break; - - if (retval < BUFSIZE) { - fullpath = utf16_to_utf8 (buffer); - break; - } - - fullpath = _ji_realpath_win_loop (wpath, retval); - } while (0); - - free (wpath); - - return fullpath; -#endif -} - -static FILE * -open_log_file (const char *path, FILE *alt, const char *alt_path, const char *envVar, int *cleanup, char **rpath) -{ - path = path ? path : getenv (envVar); - if (path == NULL) - return NULL; - - *cleanup = 0; - if (strlen (path) == 0) - return stdout; - - char *rp = ji_realpath (path); - if (rp != NULL && alt_path != NULL && strcmp (rp, alt_path) == 0) { - free (rp); - return alt; - } - - FILE *f = fopen (path, "w"); - if (f == NULL) { - free (rp); - return NULL; - } - - if (rpath) { - *rpath = rp; - } else { - free (rp); - } - - *cleanup = 1; - return f; -} - -JavaInteropGCBridge* -java_interop_gc_bridge_new (JavaVM *jvm) -{ - if (jvm == NULL) - return NULL; - -#if defined (XAMARIN_ANDROID_DYLIB_MONO) - if (!monodroid_dylib_mono_init (monodroid_get_dylib (), NULL)) { - log_fatal (LOG_DEFAULT, "mono runtime initialization error: %s", dlerror ()); - exit (FATAL_EXIT_CANNOT_FIND_MONO); - } -#endif /* defined (XAMARIN_ANDROID_DYLIB_MONO) */ - - JavaInteropGCBridge bridge; - memset (&bridge, 0, sizeof (bridge)); - - bridge.jvm = jvm; - - JNIEnv *env; - if (jvm->GetEnv ((void**) &env, JNI_VERSION_1_6) != JNI_OK) - return NULL; - - jclass Runtime_class = env->FindClass ("java/lang/Runtime"); - if (Runtime_class != NULL) { - bridge.Runtime_gc = env->GetMethodID (Runtime_class, "gc", "()V"); - - jmethodID Runtime_getRuntime = env->GetStaticMethodID (Runtime_class, "getRuntime", "()Ljava/lang/Runtime;"); - bridge.Runtime_instance = Runtime_getRuntime - ? lref_to_gref (env, env->CallStaticObjectMethod (Runtime_class, Runtime_getRuntime)) - : NULL; - - env->DeleteLocalRef (Runtime_class); - } - - jclass WeakReference_class = env->FindClass ("java/lang/ref/WeakReference"); - if (WeakReference_class != NULL) { - bridge.WeakReference_init = env->GetMethodID (WeakReference_class, "", "(Ljava/lang/Object;)V"); - bridge.WeakReference_get = env->GetMethodID (WeakReference_class, "get", "()Ljava/lang/Object;"); - bridge.WeakReference_class = static_cast(lref_to_gref (env, WeakReference_class)); - } - - jclass GCUserPeerable_class = env->FindClass ("net/dot/jni/GCUserPeerable"); - if (GCUserPeerable_class) { - bridge.GCUserPeerable_add = env->GetMethodID (GCUserPeerable_class, "jiAddManagedReference", "(Ljava/lang/Object;)V"); - bridge.GCUserPeerable_clear = env->GetMethodID (GCUserPeerable_class, "jiClearManagedReferences", "()V"); - bridge.GCUserPeerable_class = static_cast(lref_to_gref (env, GCUserPeerable_class)); - fflush (stdout); - } - - JavaInteropGCBridge *p = static_cast(calloc (1, sizeof (JavaInteropGCBridge))); - - if (p == NULL || bridge.jvm == NULL || - bridge.Runtime_instance == NULL || bridge.Runtime_gc == NULL || - bridge.WeakReference_class == NULL || bridge.WeakReference_init == NULL || bridge.WeakReference_get == NULL) { - java_interop_gc_bridge_destroy (&bridge); - free (p); - return NULL; - } - - *p = bridge; - - p->gref_log = open_log_file (NULL, NULL, NULL, "JAVA_INTEROP_GREF_LOG", &p->gref_cleanup, &p->gref_path); - p->lref_log = open_log_file (NULL, p->gref_log, p->gref_path, "JAVA_INTEROP_LREF_LOG", &p->lref_cleanup, &p->lref_path); - - return p; -} - -int -java_interop_gc_bridge_free (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - int r = java_interop_gc_bridge_destroy (bridge); - free (bridge); - - return r; -} - -int -java_interop_gc_bridge_enable (JavaInteropGCBridge *bridge, int enable) -{ - if (!bridge) - return -1; - - bridge->gc_disabled = !enable; - - return 0; -} - -int -java_interop_gc_bridge_set_bridge_processing_field ( - JavaInteropGCBridge *bridge, - struct JavaInterop_System_RuntimeTypeHandle type_handle, - char *field_name) -{ - if (bridge == NULL || type_handle.value == NULL || field_name == NULL) - return -1; - - MonoType *type = static_cast(type_handle.value); - - bridge->BridgeProcessing_type = mono_class_from_mono_type (type); - bridge->BridgeProcessing_field = mono_class_get_field_from_name (bridge->BridgeProcessing_type, field_name); - - return 0; -} - -int -java_interop_gc_bridge_register_bridgeable_type ( - JavaInteropGCBridge *bridge, - struct JavaInterop_System_RuntimeTypeHandle type_handle) -{ - if (bridge == NULL || type_handle.value == NULL) - return -1; - - if (bridge->num_bridge_types >= NUM_GC_BRIDGE_TYPES) - return -1; - - MonoType *type = static_cast(type_handle.value); - int i = bridge->num_bridge_types; - MonoJavaGCBridgeInfo *info = &bridge->mono_java_gc_bridge_info [i]; - - info->klass = mono_class_from_mono_type (type); - - info->jniObjectReferenceControlBlock = mono_class_get_field_from_name (info->klass, const_cast ("jniObjectReferenceControlBlock")); - - if (info->klass == NULL || info->jniObjectReferenceControlBlock == NULL) - return -1; - bridge->num_bridge_types++; - return 0; -} - -int -java_interop_gc_bridge_get_gref_count (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - return bridge->gc_gref_count; -} - -int -java_interop_gc_bridge_get_weak_gref_count (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - return bridge->gc_weak_gref_count; -} - -int -java_interop_gc_bridge_gref_set_log_file ( - JavaInteropGCBridge *bridge, - const char *gref_log_file) -{ - if (bridge == NULL) - return -1; - - if (bridge->gref_log && bridge->gref_cleanup) { - fclose (bridge->gref_log); - } - - bridge->gref_log = open_log_file (gref_log_file, bridge->lref_log, bridge->lref_path, "JAVA_INTEROP_GREF_LOG", &bridge->gref_cleanup, &bridge->gref_path); - - return 0; -} - -FILE* -java_interop_gc_bridge_gref_get_log_file ( - JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return NULL; - - return bridge->gref_log; -} - -int -java_interop_gc_bridge_gref_set_log_level ( - JavaInteropGCBridge *bridge, - int level) -{ - if (bridge == NULL) - return -1; - - bridge->gref_log_level = level; - return 0; -} - -void -java_interop_gc_bridge_gref_log_message ( - JavaInteropGCBridge *bridge, - int level, - const char *message) -{ - if (!bridge || !bridge->gref_log || bridge->gref_log_level < level) - return; - fprintf (bridge->gref_log, "%s", message); - fflush (bridge->gref_log); -} - -int -java_interop_gc_bridge_lref_set_log_file ( - JavaInteropGCBridge *bridge, - const char *lref_log_file) -{ - if (bridge == NULL) - return -1; - - if (bridge->lref_log && bridge->lref_cleanup) { - fclose (bridge->lref_log); - } - - bridge->lref_log = open_log_file (lref_log_file, bridge->gref_log, bridge->gref_path, "JAVA_INTEROP_LREF_LOG", &bridge->lref_cleanup, &bridge->lref_path); - - return 0; -} - -FILE* -java_interop_gc_bridge_lref_get_log_file ( - JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return NULL; - - return bridge->lref_log; -} - -int -java_interop_gc_bridge_lref_set_log_level ( - JavaInteropGCBridge *bridge, - int level) -{ - if (bridge == NULL) - return -1; - - bridge->lref_log_level = level; - return 0; -} - -void -java_interop_gc_bridge_lref_log_message ( - JavaInteropGCBridge *bridge, - int level, - const char *message) -{ - if (!bridge || !bridge->lref_log || bridge->lref_log_level < level) - return; - fprintf (bridge->lref_log, "%s", message); - fflush (bridge->lref_log); -} - -static void -log_gref (JavaInteropGCBridge *bridge, const char *format, ...) -{ - va_list args; - - if (!bridge->gref_log) - return; - - va_start (args, format); - vfprintf (bridge->gref_log, format, args); - fflush (bridge->gref_log); - va_end (args); -} - -static char -get_object_ref_type (JNIEnv *env, jobject handle) -{ - if (handle == NULL) - return 'I'; - jobjectRefType value = env->GetObjectRefType (handle); - switch (value) { - case JNIInvalidRefType: return 'I'; - case JNILocalRefType: return 'L'; - case JNIGlobalRefType: return 'G'; - case JNIWeakGlobalRefType: return 'W'; - default: return '*'; - } -} - -static int -gref_inc (JavaInteropGCBridge *bridge) -{ -#if _WINDOWS - return InterlockedIncrement ((LONG volatile*) &bridge->gc_gref_count); -#else // !_WINDOWS - return __sync_add_and_fetch (&bridge->gc_gref_count, 1); -#endif // _!WINDOWS -} - -static int -gref_dec (JavaInteropGCBridge *bridge) -{ -#if _WINDOWS - return InterlockedDecrement ((LONG volatile*) &bridge->gc_gref_count); -#else // !_WINDOWS - return __sync_sub_and_fetch (&bridge->gc_gref_count, 1); -#endif // _!WINDOWS -} - -#if defined (ANDROID) - #define WRITE_ANDROID_MESSAGE_RETURN(ret, category, format, ...) do { \ - if ((log_categories & category) == 0) \ - return ret; \ - log_info (category, format, __VA_ARGS__); \ - } while (0) -#else /* ndef ANDROID */ - #define WRITE_ANDROID_MESSAGE_RETURN(ret, category, format, ...) do { \ - } while (0) -#endif /* ndef ANDROID */ - -#define WRITE_LOG_MESSAGE_RETURN(ret, category, to, from, format, ...) do { \ - WRITE_ANDROID_MESSAGE_RETURN(ret, category, format, __VA_ARGS__); \ - if (!to) \ - return ret; \ - fprintf (to, format "\n", __VA_ARGS__); \ - fprintf (to, "%s\n", from); \ - fflush (to); \ -} while (0) - -int -java_interop_gc_bridge_gref_log_new ( - JavaInteropGCBridge *bridge, - jobject curHandle, - char curType, - jobject newHandle, - char newType, - const char *thread_name, - int64_t thread_id, - const char *from) -{ - if (!bridge) - return -1; - - int c = gref_inc (bridge); - - WRITE_LOG_MESSAGE_RETURN(c, LOG_GREF, bridge->gref_log, from, - "+g+ grefc %i gwrefc %i obj-handle %p/%c -> new-handle %p/%c from thread '%s'(%" PRId64 ")", - c, - bridge->gc_weak_gref_count, - curHandle, - curType, - newHandle, - newType, - thread_name, - thread_id); - - return c; -} - -int -java_interop_gc_bridge_gref_log_delete ( - JavaInteropGCBridge *bridge, - jobject handle, - char type, - const char *thread_name, - int64_t thread_id, - const char *from) -{ - if (!bridge) - return -1; - - int c = gref_dec (bridge); - - WRITE_LOG_MESSAGE_RETURN(c, LOG_GREF, bridge->gref_log, from, - "-g- grefc %i gwrefc %i handle %p/%c from thread '%s'(%" PRId64 ")", - c, - bridge->gc_weak_gref_count, - handle, - type, - thread_name, - thread_id); - - return c; -} - -void -java_interop_gc_bridge_lref_log_new ( - JavaInteropGCBridge *bridge, - int lref_count, - jobject curHandle, - char curType, - jobject newHandle, - char newType, - const char *thread_name, - int64_t thread_id, - const char *from) -{ - if (!bridge) - return; - - if (newHandle) { - WRITE_LOG_MESSAGE_RETURN(, LOG_LREF, bridge->lref_log, from, - "+l+ lrefc %i obj-handle %p/%c -> new-handle %p/%c from thread '%s'(%" PRId64 ")", - lref_count, - curHandle, - curType, - newHandle, - newType, - thread_name, - thread_id); - } - else { - WRITE_LOG_MESSAGE_RETURN(, LOG_LREF, bridge->lref_log, from, - "+l+ lrefc %i handle %p/%c from thread '%s'(%" PRId64 ")", - lref_count, - curHandle, - curType, - thread_name, - thread_id); - } -} - -void -java_interop_gc_bridge_lref_log_delete ( - JavaInteropGCBridge *bridge, - int lref_count, - jobject handle, - char type, - const char *thread_name, - int64_t thread_id, - const char *from) -{ - if (!bridge) - return; - - WRITE_LOG_MESSAGE_RETURN(, LOG_LREF, bridge->lref_log, from, - "-l- lrefc %i handle %p/%c from thread '%s'(%" PRId64 ")", - lref_count, - handle, - type, - thread_name, - thread_id); -} - -int -java_interop_gc_bridge_weak_gref_log_new ( - JavaInteropGCBridge *bridge, - jobject curHandle, - char curType, - jobject newHandle, - char newType, - const char *thread_name, - int64_t thread_id, - const char *from) -{ - if (!bridge) - return -1; - - int c = ++bridge->gc_weak_gref_count; - - WRITE_LOG_MESSAGE_RETURN(c, LOG_GREF, bridge->gref_log, from, - "+w+ grefc %i gwrefc %i obj-handle %p/%c -> new-handle %p/%c from thread '%s'(%" PRId64 ")", - bridge->gc_gref_count, - bridge->gc_weak_gref_count, - curHandle, - curType, - newHandle, - newType, - thread_name, - thread_id); - - return c; -} - -int -java_interop_gc_bridge_weak_gref_log_delete ( - JavaInteropGCBridge *bridge, - jobject handle, - char type, - const char *thread_name, - int64_t thread_id, - const char *from) -{ - if (!bridge) - return -1; - - int c = bridge->gc_weak_gref_count--; - - WRITE_LOG_MESSAGE_RETURN(c, LOG_GREF, bridge->gref_log, from, - "-w- grefc %i gwrefc %i handle %p/%c from thread '%s'(%" PRId64 ")", - bridge->gc_gref_count, - bridge->gc_weak_gref_count, - handle, - type, - thread_name, - thread_id); - - return c; -} - -static int -get_gc_bridge_index (JavaInteropGCBridge *bridge, MonoClass *klass) -{ - int i; - int f = 0; - - for (i = 0; i < NUM_GC_BRIDGE_TYPES; ++i) { - MonoClass *k = bridge->mono_java_gc_bridge_info [i].klass; - if (k == NULL) { - f++; - continue; - } - if (klass == k || mono_class_is_subclass_of (klass, k, 0)) - return i; - } - return f == NUM_GC_BRIDGE_TYPES - ? (int) -NUM_GC_BRIDGE_TYPES - : -1; -} - -static MonoJavaGCBridgeInfo * -get_gc_bridge_info_for_class (JavaInteropGCBridge *bridge, MonoClass *klass) -{ - int i; - - if (klass == NULL) - return NULL; - - i = get_gc_bridge_index (bridge, klass); - if (i < 0) - return NULL; - return &bridge->mono_java_gc_bridge_info [i]; -} - -static MonoJavaGCBridgeInfo * -get_gc_bridge_info_for_object (JavaInteropGCBridge *bridge, MonoObject *object) -{ - if (object == NULL) - return NULL; - return get_gc_bridge_info_for_class (bridge, mono_object_get_class (object)); -} - -static JniObjectReferenceControlBlock* -get_gc_control_block_for_object (JavaInteropGCBridge *bridge, MonoObject *obj) -{ - MonoJavaGCBridgeInfo *bridge_info = get_gc_bridge_info_for_object (bridge, obj); - if (bridge_info == NULL) - return NULL; - - JniObjectReferenceControlBlock *control_block; - mono_field_get_value (obj, bridge_info->jniObjectReferenceControlBlock, &control_block); - return control_block; -} - -typedef mono_bool (*MonodroidGCTakeRefFunc) (JavaInteropGCBridge *bridge, JNIEnv *env, MonoObject *obj, const char *thread_name, int64_t thread_id); - -static MonodroidGCTakeRefFunc take_global_ref; -static MonodroidGCTakeRefFunc take_weak_global_ref; - -static mono_bool -take_global_ref_java (JavaInteropGCBridge *bridge, JNIEnv *env, MonoObject *obj, const char *thread_name, int64_t thread_id) -{ - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (bridge, obj); - if (control_block == NULL) - return 0; - - jobject weak = control_block->weak_handle; - - jobject handle = env->CallObjectMethod (weak, bridge->WeakReference_get); - log_gref (bridge, "*try_take_global_2_1 obj=%p -> wref=%p handle=%p\n", obj, weak, handle); - - if (handle) { - jobject h = env->NewGlobalRef (handle); - env->DeleteLocalRef (handle); - handle = h; - java_interop_gc_bridge_gref_log_new (bridge, weak, get_object_ref_type (env, weak), - handle, get_object_ref_type (env, handle), thread_name, thread_id, "take_global_ref_java"); - } - java_interop_gc_bridge_weak_gref_log_delete (bridge, weak, get_object_ref_type (env, weak), thread_name, thread_id, "take_global_ref_java"); - env->DeleteGlobalRef (weak); - weak = NULL; - - control_block->weak_handle = weak; - control_block->handle = handle; - control_block->handle_type = JNIGlobalRefType; - - return handle != NULL; -} - -static mono_bool -take_weak_global_ref_java (JavaInteropGCBridge *bridge, JNIEnv *env, MonoObject *obj, const char *thread_name, int64_t thread_id) -{ - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (bridge, obj); - if (control_block == NULL) - return 0; - - jobject handle = control_block->handle; - - jobject weaklocal = env->NewObject (bridge->WeakReference_class, bridge->WeakReference_init, handle); - jobject weakglobal = env->NewGlobalRef (weaklocal); - env->DeleteLocalRef (weaklocal); - - log_gref (bridge, "*take_weak_2_1 obj=%p -> wref=%p handle=%p\n", obj, weakglobal, handle); - java_interop_gc_bridge_weak_gref_log_new (bridge, handle, get_object_ref_type (env, handle), - weakglobal, get_object_ref_type (env, weakglobal), thread_name, thread_id, "take_weak_global_ref_2_1_compat"); - - java_interop_gc_bridge_gref_log_delete (bridge, handle, get_object_ref_type (env, handle), thread_name, thread_id, "take_weak_global_ref_2_1_compat"); - env->DeleteGlobalRef (handle); - control_block->handle = NULL; - control_block->weak_handle = weakglobal; - - return 1; -} - -static mono_bool -take_global_ref_jni (JavaInteropGCBridge *bridge, JNIEnv *env, MonoObject *obj, const char *thread_name, int64_t thread_id) -{ - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (bridge, obj); - if (control_block == NULL) - return 0; - - jobject weak = control_block->handle; - jobject handle = env->NewGlobalRef (weak); - log_gref (bridge, "*try_take_global obj=%p -> wref=%p handle=%p\n", obj, weak, handle); - - if (handle) { - java_interop_gc_bridge_gref_log_new (bridge, weak, get_object_ref_type (env, weak), - handle, get_object_ref_type (env, handle), - thread_name, thread_id, - "take_global_ref_jni"); - } - - java_interop_gc_bridge_weak_gref_log_delete (bridge, weak, 'W', - thread_name, thread_id, "take_global_ref_jni"); - env->DeleteWeakGlobalRef (weak); - - control_block->handle = handle; - control_block->handle_type = JNIGlobalRefType; - - return handle != NULL; -} - -static mono_bool -take_weak_global_ref_jni (JavaInteropGCBridge *bridge, JNIEnv *env, MonoObject *obj, const char *thread_name, int64_t thread_id) -{ - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (bridge, obj); - if (control_block == NULL) - return 0; - - jobject handle = control_block->handle; - - log_gref (bridge, "*take_weak obj=%p; handle=%p\n", obj, handle); - - jobject weak = env->NewWeakGlobalRef (handle); - java_interop_gc_bridge_weak_gref_log_new (bridge, handle, get_object_ref_type (env, handle), - weak, get_object_ref_type (env, weak), - thread_name, thread_id, "take_weak_global_ref_jni"); - - java_interop_gc_bridge_gref_log_delete (bridge, handle, get_object_ref_type (env, handle), - thread_name, thread_id, "take_weak_global_ref_jni"); - env->DeleteGlobalRef (handle); - - control_block->handle = weak; - control_block->handle_type = JNIWeakGlobalRefType; - - return 1; -} - -static jmethodID -get_add_reference_method (JavaInteropGCBridge *bridge, JNIEnv *env, jobject obj, [[maybe_unused]] MonoClass *mclass) -{ - if (!obj) - return NULL; - if (bridge->GCUserPeerable_class && env->IsInstanceOf (obj, bridge->GCUserPeerable_class)) { - return bridge->GCUserPeerable_add; - } - jclass klass = env->GetObjectClass (obj); - jmethodID add = env->GetMethodID (klass, "monodroidAddReference", "(Ljava/lang/Object;)V"); - if (!add) - env->ExceptionClear (); - env->DeleteLocalRef (klass); - return add; -} - -static mono_bool -add_reference (JavaInteropGCBridge *bridge, JNIEnv *env, MonoObject *obj, JniObjectReferenceControlBlock *control_block, MonoObject *reffed_obj) -{ - MonoClass *klass = mono_object_get_class (obj); - - jobject handle = control_block->handle; - - jmethodID add_method_id = get_add_reference_method (bridge, env, handle, klass); - if (add_method_id) { - JniObjectReferenceControlBlock *reffed_control_block = get_gc_control_block_for_object (bridge, reffed_obj); - if (reffed_control_block == NULL) - return 0; - jobject reffed_handle = reffed_control_block->handle; - env->CallVoidMethod (handle, add_method_id, reffed_handle); -#if DEBUG - if (bridge->gref_log_level > 1) - log_gref (bridge, - "added reference for object of class %s.%s to object of class %s.%s\n", - mono_class_get_namespace (klass), - mono_class_get_name (klass), - mono_class_get_namespace (mono_object_get_class (reffed_obj)), - mono_class_get_name (mono_object_get_class (reffed_obj))); -#endif - return 1; - } - -#if DEBUG - if (bridge->gref_log_level > 1) - log_gref (bridge, - "Missing monodroidAddReference method for object of class %s.%s\n", - mono_class_get_namespace (klass), - mono_class_get_name (klass)); -#endif - - return 0; -} - -static void -set_bridge_processing (JavaInteropGCBridge *bridge, mono_bool value) -{ - int count = bridge->BridgeProcessing_vtables_count; - for (int i = 0; i < count; ++i) { - MonoVTable *v = bridge->BridgeProcessing_vtables [i]; - if (!v) { - continue; - } - - mono_field_static_set_value (v, bridge->BridgeProcessing_field, &value); - } -} - -static void -gc_prepare_for_java_collection (JavaInteropGCBridge *bridge, JNIEnv *env, int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs, const char *thread_name, int64_t thread_id) -{ - set_bridge_processing (bridge, 1); - - int ref_val = 1; - /* add java refs for items on the list which reference each other */ - for (int i = 0; i < num_sccs; i++) { - MonoGCBridgeSCC *scc = sccs [i]; - - JniObjectReferenceControlBlock *control_block = NULL; - - /* start at the second item, ref j from j-1 */ - for (int j = 1; j < scc->num_objs; j++) { - control_block = get_gc_control_block_for_object (bridge, scc->objs [j-1]); - if (control_block != NULL && add_reference (bridge, env, scc->objs [j-1], control_block, scc->objs [j])) { - control_block->refs_added = ref_val; - } - } - /* ref the first from the last */ - if (scc->num_objs > 1) { - control_block = get_gc_control_block_for_object (bridge, scc->objs [scc->num_objs-1]); - if (control_block != NULL && add_reference (bridge, env, scc->objs [scc->num_objs-1], control_block, scc->objs [0])) { - control_block->refs_added = ref_val; - } - } - } - - /* add the cross scc refs */ - for (int i = 0; i < num_xrefs; i++) { - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (bridge, sccs [xrefs [i].src_scc_index]->objs [0]); - if (control_block != NULL && add_reference (bridge, env, sccs [xrefs [i].src_scc_index]->objs [0], control_block, sccs [xrefs [i].dst_scc_index]->objs [0])) { - control_block->refs_added = ref_val; - } - } - - // switch to weak refs - for (int i = 0; i < num_sccs; i++) - for (int j = 0; j < sccs [i]->num_objs; j++) - take_weak_global_ref (bridge, env, sccs [i]->objs [j], thread_name, thread_id); -} - -static jmethodID -get_clear_references_method (JavaInteropGCBridge *bridge, JNIEnv *env, jobject obj) -{ - if (!obj) - return NULL; - if (bridge->GCUserPeerable_class && env->IsInstanceOf (obj, bridge->GCUserPeerable_class)) { - return bridge->GCUserPeerable_clear; - } - jclass klass = env->GetObjectClass (obj); - jmethodID clear = env->GetMethodID (klass, "monodroidClearReferences", "()V"); - if (!clear) - env->ExceptionClear (); - env->DeleteLocalRef (klass); - return clear; -} - -static void -gc_cleanup_after_java_collection (JavaInteropGCBridge *bridge, JNIEnv *env, int num_sccs, MonoGCBridgeSCC **sccs, const char *thread_name, int64_t thread_id) -{ - int total = 0; - int alive = 0; - - for (int i = 0; i < num_sccs; i++) - for (int j = 0; j < sccs [i]->num_objs; j++, total++) - take_global_ref (bridge, env, sccs [i]->objs [j], thread_name, thread_id); - - /* clear the cross references on any remaining items */ - for (int i = 0; i < num_sccs; i++) { - sccs [i]->is_alive = 0; - for (int j = 0; j < sccs [i]->num_objs; j++) { - MonoObject *obj = sccs [i]->objs [j]; - - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (bridge, obj); - if (control_block == NULL) - continue; - - jobject jref = control_block->handle; - if (jref) { - alive++; - if (j > 0) - assert (sccs [i]->is_alive); - sccs [i]->is_alive = 1; - int refs_added = control_block->refs_added; - if (refs_added) { - jmethodID clear_method_id = get_clear_references_method (bridge, env, jref); - if (clear_method_id) { - env->CallVoidMethod (jref, clear_method_id); - } else { -#if DEBUG - if (bridge->gref_log_level > 1) { - MonoClass *klass = mono_object_get_class (obj); - log_gref (bridge, - "Missing monodroidClearReferences method for object of class %s.%s\n", - mono_class_get_namespace (klass), - mono_class_get_name (klass)); - } -#endif - } - } - } else { - assert (!sccs [i]->is_alive); - } - } - } -#if DEBUG - log_gref (bridge, "GC cleanup summary: %d objects tested - resurrecting %d.\n", total, alive); -#endif - - set_bridge_processing (bridge, 0); -} - -static void -java_gc (JavaInteropGCBridge *bridge, JNIEnv *env) -{ - env->CallVoidMethod (bridge->Runtime_instance, bridge->Runtime_gc); -} - -int -java_interop_gc_bridge_add_current_app_domain (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - if (bridge->BridgeProcessing_type == NULL) - return -1; - - MonoDomain *domain = mono_domain_get (); - if (domain == NULL) - return -1; - - int count = bridge->BridgeProcessing_vtables_count; - for (int i = 0; i < count; ++i) { - MonoDomain **domains = bridge->BridgeProcessing_domains; - MonoVTable **vtables = bridge->BridgeProcessing_vtables; - if (domains [i] == NULL) { - domains [i] = domain; - vtables [i] = mono_class_vtable (domain, bridge->BridgeProcessing_type); - return 0; - } - } - - if (bridge->BridgeProcessing_vtables_count == bridge->BridgeProcessing_vtables_length) { - int new_length = bridge->BridgeProcessing_vtables_length + 1; - MonoDomain **new_domains = static_cast(calloc (new_length, sizeof (MonoDomain*))); - MonoVTable **new_vtbles = static_cast(calloc (new_length, sizeof (MonoVTable*))); - if (new_domains == NULL || new_vtbles == NULL) { - free (new_domains); - free (new_vtbles); - return -1; - } - bridge->BridgeProcessing_vtables_length = new_length; - memcpy (new_domains, bridge->BridgeProcessing_domains, bridge->BridgeProcessing_vtables_count); - memcpy (new_vtbles, bridge->BridgeProcessing_vtables, bridge->BridgeProcessing_vtables_count); - free (bridge->BridgeProcessing_domains); - free (bridge->BridgeProcessing_vtables); - bridge->BridgeProcessing_domains = new_domains; - bridge->BridgeProcessing_vtables = new_vtbles; - } - int i = bridge->BridgeProcessing_vtables_count++; - - bridge->BridgeProcessing_domains [i] = domain; - bridge->BridgeProcessing_vtables [i] = mono_class_vtable (domain, bridge->BridgeProcessing_type); - - return 0; -} - -int -java_interop_gc_bridge_remove_current_app_domain (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - MonoDomain *domain = mono_domain_get (); - if (domain == NULL) - return -1; - - int count = bridge->BridgeProcessing_vtables_count; - for (int i = 0; i < count; ++i) { - if (bridge->BridgeProcessing_domains [i] == domain) { - bridge->BridgeProcessing_domains [i] = NULL; - bridge->BridgeProcessing_vtables [i] = NULL; - return 0; - } - } - return -1; -} - -static JavaInteropGCBridge *mono_bridge; - -JavaInteropGCBridge* -java_interop_gc_bridge_get_current (void) -{ - return mono_bridge; -} - -int -java_interop_gc_bridge_set_current_once (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - mono_bridge = bridge; - return 0; -} - -static MonoGCBridgeObjectKind -gc_bridge_class_kind (MonoClass *klass) -{ - int i; - if (mono_bridge->gc_disabled) - return MonoGCBridgeObjectKind::GC_BRIDGE_TRANSPARENT_CLASS; - - i = get_gc_bridge_index (mono_bridge, klass); - if (i == -NUM_GC_BRIDGE_TYPES) { - log_gref (mono_bridge, - "asked if a class %s.%s is a bridge before we inited GC Bridge Types!\n", - mono_class_get_namespace (klass), - mono_class_get_name (klass)); - return MonoGCBridgeObjectKind::GC_BRIDGE_TRANSPARENT_CLASS; - } - - if (i >= 0) { - return MonoGCBridgeObjectKind::GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS; - } - - return MonoGCBridgeObjectKind::GC_BRIDGE_TRANSPARENT_CLASS; -} - -static mono_bool -gc_is_bridge_object (MonoObject *object) -{ - - JniObjectReferenceControlBlock *control_block = get_gc_control_block_for_object (mono_bridge, object); - if (control_block == NULL) - return 0;; - - void *handle = control_block->handle; - if (handle == NULL) { -#if DEBUG - MonoClass *mclass = mono_object_get_class (object); - log_gref (mono_bridge, - "object of class %s.%s with null handle\n", - mono_class_get_namespace (mclass), - mono_class_get_name (mclass)); -#endif - return 0; - } - - return 1; -} - -static char * -get_thread_name (void) -{ - MonoThread *thread = mono_thread_current (); - return mono_thread_get_name_utf8 (thread); -} - -static int64_t -get_thread_id (void) -{ - MonoThread *thread = mono_thread_current (); - return mono_thread_get_managed_id (thread); -} - -static void -gc_cross_references (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs) -{ - if (mono_bridge->gc_disabled) - return; - - JavaInteropGCBridge *bridge = mono_bridge; - - char *thread_name = get_thread_name (); - int64_t thread_id = get_thread_id (); - -#if DEBUG - if (bridge->gref_log_level > 1) { - log_gref (bridge, "cross references callback invoked with %d sccs and %d xrefs.\n", num_sccs, num_xrefs); - - for (int i = 0; i < num_sccs; ++i) { - log_gref (bridge, "group %d with %d objects\n", i, sccs [i]->num_objs); - for (int j = 0; j < sccs [i]->num_objs; ++j) { - MonoObject *obj = sccs [i]->objs [j]; - MonoClass *klass = mono_object_get_class (obj); - log_gref (bridge, - "\tobj %p [%s::%s]\n", - obj, - mono_class_get_namespace (klass), - mono_class_get_name (klass)); - } - } - - for (int i = 0; i < num_xrefs; ++i) - log_gref (bridge, "xref [%d] %d -> %d\n", i, xrefs [i].src_scc_index, xrefs [i].dst_scc_index); - } -#endif - - JNIEnv *env = ensure_jnienv (bridge); - if (env != NULL) { - gc_prepare_for_java_collection (bridge, env, num_sccs, sccs, num_xrefs, xrefs, thread_name, thread_id); - java_gc (bridge, env); - gc_cleanup_after_java_collection (bridge, env, num_sccs, sccs, thread_name, thread_id); - } - - free (thread_name); -} - -static void -managed_gc_cross_references (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs) -{ - if (mono_bridge->mark_cross_references == NULL) { - assert (!"mono_bridge->mark_cross_references is NULL; WE SHOULD NOT BE EXECUTING"); - return; - } - int i; - - Srij_MarkCrossReferences cross_references = {}; - - cross_references.ComponentsLen = (void*) (intptr_t) num_sccs; - cross_references.Components = (Srij_StronglyConnectedComponent*) calloc (num_sccs, sizeof (Srij_StronglyConnectedComponent)); - for (i = 0; i < num_sccs; ++i) { - Srij_StronglyConnectedComponent *scc = &cross_references.Components [i]; - - scc->Count = (void*) (intptr_t) sccs [i]->num_objs; - scc->Context = (void**) calloc (sccs [i]->num_objs, sizeof (void*)); - for (int j = 0; j < sccs [i]->num_objs; ++j) { - MonoObject *obj = sccs [i]->objs [j]; - scc->Context [j] = get_gc_control_block_for_object (mono_bridge, obj); - } - } - - cross_references.CrossReferencesLen = (void*) (intptr_t) num_xrefs; - cross_references.CrossReferences = (Srij_ComponentCrossReference*) calloc (num_xrefs, sizeof (Srij_ComponentCrossReference)); - for (i = 0; i < num_xrefs; ++i) { - Srij_ComponentCrossReference *xref = &cross_references.CrossReferences [i]; - xref->SourceGroupIndex = (void*) (intptr_t) xrefs [i].src_scc_index; - xref->DestinationGroupIndex = (void*) (intptr_t) xrefs [i].dst_scc_index; - } - - mono_bridge->mark_cross_references (&cross_references); - - for (i = 0; i < num_sccs; ++i) { - Srij_StronglyConnectedComponent *scc = &cross_references.Components [i]; - sccs [i]->is_alive = scc->IsAlive; - } -} - -int -java_interop_gc_bridge_register_hooks (JavaInteropGCBridge *bridge, int weak_ref_kind) -{ - if (bridge == NULL) - return -1; - if (mono_bridge != bridge) - return -1; - - const char *message = NULL; - - MonoGCBridgeCallbacks bridge_cbs; - memset (&bridge_cbs, 0, sizeof (bridge_cbs)); - - switch (weak_ref_kind) { - case JAVA_INTEROP_GC_BRIDGE_USE_WEAK_REFERENCE_KIND_JAVA: - message = "Using java.lang.ref.WeakReference for JNI Weak References."; - take_global_ref = take_global_ref_java; - take_weak_global_ref = take_weak_global_ref_java; - break; - case JAVA_INTEROP_GC_BRIDGE_USE_WEAK_REFERENCE_KIND_JNI: - message = "Using JNIEnv::NewWeakGlobalRef() for JNI Weak References."; - take_global_ref = take_global_ref_jni; - take_weak_global_ref = take_weak_global_ref_jni; - break; - default: - return -1; - } - - log_gref (mono_bridge, "%s\n", message); - - bridge_cbs.bridge_version = SGEN_BRIDGE_VERSION; - bridge_cbs.bridge_class_kind = gc_bridge_class_kind; - bridge_cbs.is_bridge_object = gc_is_bridge_object; - bridge_cbs.cross_references = bridge->mark_cross_references - ? managed_gc_cross_references - : gc_cross_references; - - mono_gc_register_bridge_callbacks (&bridge_cbs); - - return 0; -} - -int -java_interop_gc_bridge_wait_for_bridge_processing (JavaInteropGCBridge *bridge) -{ - if (bridge == NULL) - return -1; - - mono_gc_wait_for_bridge_processing (); - return 0; -} - -int -java_interop_gc_bridge_set_mark_cross_references (JavaInteropGCBridge *bridge, JavaInteropMarkCrossReferencesCallback markCrossReferences) -{ - if (bridge == NULL) - return -1; - - bridge->mark_cross_references = markCrossReferences; - - return 0; -} - -int -java_interop_gc_bridge_release_mark_cross_references_resources (JavaInteropGCBridge *bridge, Srij_MarkCrossReferences *crossReferences) -{ - if (bridge == NULL || crossReferences == NULL) - return -1; - - // leak it… - return 0; -} diff --git a/src/java-interop/java-interop-gc-bridge.h b/src/java-interop/java-interop-gc-bridge.h deleted file mode 100644 index 6715b33be..000000000 --- a/src/java-interop/java-interop-gc-bridge.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef INC_JAVA_INTEROP_GC_BRIDGE_H -#define INC_JAVA_INTEROP_GC_BRIDGE_H - -#include -#include "java-interop.h" - -#include - -JAVA_INTEROP_BEGIN_DECLS - -typedef struct JavaInteropGCBridge JavaInteropGCBridge; - -typedef enum JavaInteropGCBridgeUseWeakReferenceKind { - JAVA_INTEROP_GC_BRIDGE_USE_WEAK_REFERENCE_KIND_JAVA, - JAVA_INTEROP_GC_BRIDGE_USE_WEAK_REFERENCE_KIND_JNI, -} JavaInteropGCBridgeUseWeakReferenceKind; - -struct JavaInterop_System_RuntimeTypeHandle { - void *value; -}; - -typedef struct Srij_ComponentCrossReference { - void *SourceGroupIndex; - void *DestinationGroupIndex; -} Srij_ComponentCrossReference; - -typedef struct Srij_StronglyConnectedComponent { - int IsAlive; - void *Count; - void **Context; -} Srij_StronglyConnectedComponent; - -typedef struct Srij_MarkCrossReferences { - void *ComponentsLen; - Srij_StronglyConnectedComponent *Components; - void* CrossReferencesLen; - Srij_ComponentCrossReference *CrossReferences; -} Srij_MarkCrossReferences; - -typedef void (*JavaInteropMarkCrossReferencesCallback) (Srij_MarkCrossReferences *crossReferences); - -JAVA_INTEROP_API JavaInteropGCBridge *java_interop_gc_bridge_get_current (void); -JAVA_INTEROP_API int java_interop_gc_bridge_set_current_once (JavaInteropGCBridge *bridge); - -JAVA_INTEROP_API JavaInteropGCBridge *java_interop_gc_bridge_new (JavaVM *jvm); -JAVA_INTEROP_API int java_interop_gc_bridge_free (JavaInteropGCBridge *bridge); - -JAVA_INTEROP_API int java_interop_gc_bridge_register_hooks (JavaInteropGCBridge *bridge, int weak_ref_kind); -JAVA_INTEROP_API int java_interop_gc_bridge_wait_for_bridge_processing (JavaInteropGCBridge *bridge); - -JAVA_INTEROP_API int java_interop_gc_bridge_add_current_app_domain (JavaInteropGCBridge *bridge); -JAVA_INTEROP_API int java_interop_gc_bridge_remove_current_app_domain (JavaInteropGCBridge *bridge); - -JAVA_INTEROP_API int java_interop_gc_bridge_set_bridge_processing_field (JavaInteropGCBridge *bridge, struct JavaInterop_System_RuntimeTypeHandle type_handle, char *field_name); - -JAVA_INTEROP_API int java_interop_gc_bridge_set_mark_cross_references (JavaInteropGCBridge *bridge, JavaInteropMarkCrossReferencesCallback markCrossReferences); -JAVA_INTEROP_API int java_interop_gc_bridge_release_mark_cross_references_resources (JavaInteropGCBridge *bridge, Srij_MarkCrossReferences *crossReferences); - -JAVA_INTEROP_API int java_interop_gc_bridge_register_bridgeable_type (JavaInteropGCBridge *bridge, struct JavaInterop_System_RuntimeTypeHandle type_handle); -JAVA_INTEROP_API int java_interop_gc_bridge_enable (JavaInteropGCBridge *bridge, int enable); - -JAVA_INTEROP_API int java_interop_gc_bridge_get_gref_count (JavaInteropGCBridge *bridge); -JAVA_INTEROP_API int java_interop_gc_bridge_get_weak_gref_count (JavaInteropGCBridge *bridge); - -JAVA_INTEROP_API int java_interop_gc_bridge_lref_set_log_file (JavaInteropGCBridge *bridge, const char *gref_log_file); -JAVA_INTEROP_API FILE* java_interop_gc_bridge_lref_get_log_file (JavaInteropGCBridge *bridge); -JAVA_INTEROP_API int java_interop_gc_bridge_lref_set_log_level (JavaInteropGCBridge *bridge, int level); -JAVA_INTEROP_API void java_interop_gc_bridge_lref_log_message (JavaInteropGCBridge *bridge, int level, const char *message); -JAVA_INTEROP_API void java_interop_gc_bridge_lref_log_new (JavaInteropGCBridge *bridge, int lref_count, jobject curHandle, char curType, jobject newHandle, char newType, const char *thread_name, int64_t thread_id, const char *from); -JAVA_INTEROP_API void java_interop_gc_bridge_lref_log_delete (JavaInteropGCBridge *bridge, int lref_count, jobject handle, char type, const char *thread_name, int64_t thread_id, const char *from); - -JAVA_INTEROP_API int java_interop_gc_bridge_gref_set_log_file (JavaInteropGCBridge *bridge, const char *gref_log_file); -JAVA_INTEROP_API FILE* java_interop_gc_bridge_gref_get_log_file (JavaInteropGCBridge *bridge); -JAVA_INTEROP_API int java_interop_gc_bridge_gref_set_log_level (JavaInteropGCBridge *bridge, int level); -JAVA_INTEROP_API void java_interop_gc_bridge_gref_log_message (JavaInteropGCBridge *bridge, int level, const char *message); -JAVA_INTEROP_API int java_interop_gc_bridge_gref_log_new (JavaInteropGCBridge *bridge, jobject curHandle, char curType, jobject newHandle, char newType, const char *thread_name, int64_t thread_id, const char *from); -JAVA_INTEROP_API int java_interop_gc_bridge_gref_log_delete (JavaInteropGCBridge *bridge, jobject handle, char type, const char *thread_name, int64_t thread_id, const char *from); - -JAVA_INTEROP_API int java_interop_gc_bridge_weak_gref_log_new (JavaInteropGCBridge *bridge, jobject curHandle, char curType, jobject newHandle, char newType, const char *thread_name, int64_t thread_id, const char *from); -JAVA_INTEROP_API int java_interop_gc_bridge_weak_gref_log_delete (JavaInteropGCBridge *bridge, jobject handle, char type, const char *thread_name, int64_t thread_id, const char *from); - -JAVA_INTEROP_END_DECLS - -#endif /* ndef INC_JAVA_INTEROP_GC_BRIDGE_H */ - diff --git a/src/java-interop/java-interop-jvm.cc b/src/java-interop/java-interop-jvm.cc deleted file mode 100644 index 48132f02c..000000000 --- a/src/java-interop/java-interop-jvm.cc +++ /dev/null @@ -1,100 +0,0 @@ -#include - -#include "java-interop-jvm.h" -#include "java-interop-dlfcn.h" -#include "java-interop-logger.h" -#include "java-interop-util.h" - -using namespace microsoft::java_interop; - -typedef int (JNICALL *java_interop_JNI_CreateJavaVM_fptr) (JavaVM **p_vm, void **p_env, void *vm_args); -typedef int (JNICALL *java_interop_JNI_GetCreatedJavaVMs_fptr) (JavaVM **vmBuf, int bufLen, int *nVMs); - -struct DylibJVM { - void *dl_handle; - java_interop_JNI_CreateJavaVM_fptr JNI_CreateJavaVM; - java_interop_JNI_GetCreatedJavaVMs_fptr JNI_GetCreatedJavaVMs; -}; - -static struct DylibJVM *jvm; - -int -java_interop_jvm_load_with_error_message (const char *path, char **error_message) -{ - if (error_message) { - *error_message = NULL; - } - - if (jvm != NULL) { - return JAVA_INTEROP_JVM_FAILED_ALREADY_LOADED; - } - - jvm = static_cast(calloc (1, sizeof (DylibJVM))); - if (!jvm) { - return JAVA_INTEROP_JVM_FAILED_OOM; - } - - char *error = nullptr; - jvm->dl_handle = java_interop_lib_load (path, JAVA_INTEROP_LIB_LOAD_LOCALLY, &error); - if (!jvm->dl_handle) { - if (error_message) { - *error_message = error; - error = nullptr; - } - java_interop_free (error); - free (jvm); - jvm = NULL; - return JAVA_INTEROP_JVM_FAILED_NOT_LOADED; - } - - int symbols_missing = 0; - -#define LOAD_SYMBOL_CAST(symbol, Type) do { \ - error = nullptr; \ - jvm->symbol = reinterpret_cast(java_interop_lib_symbol (jvm->dl_handle, #symbol, &error)); \ - if (!jvm->symbol) { \ - log_error (LOG_DEFAULT, "Failed to load JVM symbol: %s: %s", #symbol, error); \ - symbols_missing = 1; \ - java_interop_free (error); \ - error = nullptr; \ - } \ - } while (0) -#define LOAD_SYMBOL(symbol) LOAD_SYMBOL_CAST(symbol, java_interop_ ## symbol ## _fptr) - - LOAD_SYMBOL(JNI_CreateJavaVM); - LOAD_SYMBOL(JNI_GetCreatedJavaVMs); - -#undef LOAD_SYMBOL_CAST -#undef LOAD_SYMBOL - - if (symbols_missing) { - java_interop_lib_close (jvm->dl_handle, nullptr); - free (jvm); - jvm = NULL; - return JAVA_INTEROP_JVM_FAILED_SYMBOL_MISSING; - } - - return 0; -} - -int -java_interop_jvm_load (const char *path) -{ - return java_interop_jvm_load_with_error_message (path, NULL); -} - -#define ji_return_val_if_fail(expr, val) do { if (!(expr)) return (val); } while (0) - -int java_interop_jvm_create (JavaVM **p_vm, void **p_env, void *vm_args) -{ - ji_return_val_if_fail (jvm != NULL, JAVA_INTEROP_JVM_FAILED_NOT_LOADED); - - return (*jvm->JNI_CreateJavaVM) (p_vm, p_env, vm_args); -} - -int java_interop_jvm_list (JavaVM **vmBuf, int bufLen, int *nVMs) -{ - ji_return_val_if_fail (jvm != NULL, JAVA_INTEROP_JVM_FAILED_NOT_LOADED); - - return (*jvm->JNI_GetCreatedJavaVMs) (vmBuf, bufLen, nVMs); -} diff --git a/src/java-interop/java-interop-jvm.h b/src/java-interop/java-interop-jvm.h deleted file mode 100644 index 1086a92fb..000000000 --- a/src/java-interop/java-interop-jvm.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef INC_JAVA_INTEROP_JVM_H -#define INC_JAVA_INTEROP_JVM_H - -#include - -#include "java-interop.h" - -JAVA_INTEROP_BEGIN_DECLS - -#define JAVA_INTEROP_JVM_FAILED (-1000) -#define JAVA_INTEROP_JVM_FAILED_ALREADY_LOADED (JAVA_INTEROP_JVM_FAILED-1) -#define JAVA_INTEROP_JVM_FAILED_NOT_LOADED (JAVA_INTEROP_JVM_FAILED-2) -#define JAVA_INTEROP_JVM_FAILED_OOM (JAVA_INTEROP_JVM_FAILED-3) -#define JAVA_INTEROP_JVM_FAILED_SYMBOL_MISSING (JAVA_INTEROP_JVM_FAILED-4) - -JAVA_INTEROP_API int java_interop_jvm_load (const char *path); -JAVA_INTEROP_API int java_interop_jvm_load_with_error_message (const char *path, char **error); -JAVA_INTEROP_API int java_interop_jvm_create (JavaVM **p_vm, void **p_env, void *vm_args); -JAVA_INTEROP_API int java_interop_jvm_list (JavaVM **vmBuf, int bufLen, int *nVMs); - -JAVA_INTEROP_END_DECLS - - -#endif /* ndef INC_JAVA_INTEROP_JVM_H */ diff --git a/src/java-interop/java-interop-logger.cc b/src/java-interop/java-interop-logger.cc deleted file mode 100644 index 14fc4fe65..000000000 --- a/src/java-interop/java-interop-logger.cc +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include - -#ifndef _MSC_VER -#include -#endif // ndef _MSC_VER - -#include "java-interop-logger.h" - -#define LOG_VA_ARGS(_kind_,_category_,_format_) \ - do { \ - const char* _kind = (_kind_); \ - LogCategories _cat = (_category_); \ - va_list args; \ - va_start (args, _format_); \ - log_vprint (_kind, CATEGORY_NAME (_cat), (_format_), args); \ - va_end (args); \ - } while (0) - -// Must match the same ordering as LogCategories -static const char* log_names[] = { - "*none*", - "javainterop", - "javainterop-assembly", - "javainterop-debug", - "javainterop-gc", - "javainterop-gref", - "javainterop-lref", - "javainterop-timing", - "javainterop-bundle", - "javainterop-network", - "javainterop-netlink", - "*error*", -}; - -#if defined(_MSC_VER) -#pragma intrinsic(_BitScanForward) -static inline unsigned long ffs (unsigned long value) -{ - unsigned long index; - unsigned char isNonzero = _BitScanForward (&index, value); - return isNonzero ? (index + 1) : 0; -} -#elif defined(__i386__) && defined(__GNUC__) -#define ffs(__value__) __builtin_ffs ((__value__)) -#elif defined(__x86_64__) && defined(__GNUC__) -#define ffs(__value__) __builtin_ffsll ((__value__)) -#endif - -// ffs(value) returns index of lowest bit set in `value` -#define CATEGORY_NAME(value) (value == 0 ? log_names [0] : log_names [ffs (value)]) - -static void -log_vprint (const char* kind, const char* tag, const char* fmt, va_list ap) -{ - printf ("%s: [%s] ", kind, tag); - vprintf (fmt, ap); - putchar ('\n'); - fflush (stdout); -} - -unsigned int log_categories = 0xFFFFFFFF; - -void -log_error (LogCategories category, const char *format, ...) -{ - LOG_VA_ARGS ("error", category, format); -} - -void -log_fatal (LogCategories category, const char *format, ...) -{ - LOG_VA_ARGS ("fatal error", category, format); -} - -void -log_info_nocheck (LogCategories category, const char *format, ...) -{ - if ((log_categories & category) == 0) - return; - - LOG_VA_ARGS ("info", category, format); -} - -void -log_warn (LogCategories category, const char *format, ...) -{ - LOG_VA_ARGS ("warning", category, format); -} - -void -log_debug_nocheck (LogCategories category, const char *format, ...) -{ - if ((log_categories & category) == 0) - return; - - LOG_VA_ARGS ("debug", category, format); -} diff --git a/src/java-interop/java-interop-logger.h b/src/java-interop/java-interop-logger.h deleted file mode 100644 index 57e4cd0ae..000000000 --- a/src/java-interop/java-interop-logger.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __JAVA_INTEROP_LOGGER_H__ -#define __JAVA_INTEROP_LOGGER_H__ - -// Keep in sync with java-interop-logger.c's LogCategories enum -typedef enum _LogCategories { - LOG_NONE = 0, - LOG_DEFAULT = 1 << 0, - LOG_ASSEMBLY = 1 << 1, - LOG_DEBUGGER = 1 << 2, - LOG_GC = 1 << 3, - LOG_GREF = 1 << 4, - LOG_LREF = 1 << 5, - LOG_TIMING = 1 << 6, - LOG_BUNDLE = 1 << 7, - LOG_NET = 1 << 8, - LOG_NETLINK = 1 << 9, -} LogCategories; - -extern unsigned int log_categories; - -void log_error (LogCategories category, const char *format, ...); - -void log_fatal (LogCategories category, const char *format, ...); - -void log_info_nocheck (LogCategories category, const char *format, ...); - -void log_warn (LogCategories category, const char *format, ...); - -void log_debug_nocheck (LogCategories category, const char *format, ...); - -#define DO_LOG(_level, _category_, ...) \ - do { \ - if ((log_categories & ((_category_))) != 0) { \ - ::log_ ## _level ## _nocheck ((_category_), __VA_ARGS__); \ - } \ - } while (0) - -#define log_debug(_category_, ...) DO_LOG (debug, (_category_), __VA_ARGS__) -#define log_info(_category_, ...) DO_LOG (info, (_category_), __VA_ARGS__) - -#endif /* __JAVA_INTEROP_LOGGER_H__ */ diff --git a/src/java-interop/java-interop-mono.cc b/src/java-interop/java-interop-mono.cc deleted file mode 100644 index a3a1487e7..000000000 --- a/src/java-interop/java-interop-mono.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include "java-interop-mono.h" - - diff --git a/src/java-interop/java-interop-mono.h b/src/java-interop/java-interop-mono.h deleted file mode 100644 index 16ec344a5..000000000 --- a/src/java-interop/java-interop-mono.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef INC_JAVA_INTEROP_MONO_H -#define INC_JAVA_INTEROP_MONO_H - -#include "java-interop.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -JAVA_INTEROP_BEGIN_DECLS - -JAVA_INTEROP_END_DECLS - -#endif /* ndef INC_JAVA_INTEROP_MONO_H */ diff --git a/src/java-interop/java-interop-util.cc b/src/java-interop/java-interop-util.cc deleted file mode 100644 index d80f22249..000000000 --- a/src/java-interop/java-interop-util.cc +++ /dev/null @@ -1,51 +0,0 @@ -#ifdef _WINDOWS -#include -#include -#include - -char* -utf16_to_utf8 (const wchar_t *widestr) -{ - int required_size = WideCharToMultiByte (CP_UTF8, 0, widestr, -1, NULL, 0, NULL, NULL); - if (required_size <= 0) { - return nullptr; - } - - char *mbstr = static_cast (calloc (required_size, sizeof (char))); - if (mbstr == nullptr) { - return nullptr; - } - - int converted_size = WideCharToMultiByte (CP_UTF8, 0, widestr, -1, mbstr, required_size, NULL, NULL); - assert (converted_size == required_size); - if (required_size != converted_size) { - free (mbstr); - return nullptr; - } - - return mbstr; -} - -wchar_t* -utf8_to_utf16 (const char *mbstr) -{ - int required_chars = MultiByteToWideChar (CP_UTF8, 0, mbstr, -1, NULL, 0); - if (required_chars <= 0) { - return nullptr; - } - - wchar_t *widestr = static_cast (calloc (required_chars, sizeof (wchar_t))); - if (widestr == nullptr) { - return nullptr; - } - - int converted_chars = MultiByteToWideChar (CP_UTF8, 0, mbstr, -1, widestr, required_chars); - assert (converted_chars == required_chars); - if (required_chars != converted_chars) { - free (widestr); - return nullptr; - } - - return widestr; -} -#endif // def _WINDOWS diff --git a/src/java-interop/java-interop-util.h b/src/java-interop/java-interop-util.h deleted file mode 100644 index a76060d3f..000000000 --- a/src/java-interop/java-interop-util.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef __JAVA_INTEROP_UTIL_H__ -#define __JAVA_INTEROP_UTIL_H__ - -#include - -#ifdef _WINDOWS -/* Those two conversion functions are only properly implemented on Windows - * because that's the only place where they should be useful. - */ -char* utf16_to_utf8 (const wchar_t *widestr); -wchar_t* utf8_to_utf16 (const char *mbstr); -#endif // def _WINDOWS - -#include "java-interop-logger.h" - -enum FatalExitCodes { - FATAL_EXIT_CANNOT_FIND_MONO = 1, - FATAL_EXIT_ATTACH_JVM_FAILED = 2, - FATAL_EXIT_DEBUGGER_CONNECT = 3, - FATAL_EXIT_CANNOT_FIND_JNIENV = 4, - FATAL_EXIT_CANNOT_FIND_APK = 10, - FATAL_EXIT_TRIAL_EXPIRED = 11, - FATAL_EXIT_PTHREAD_FAILED = 12, - FATAL_EXIT_MISSING_ASSEMBLY = 13, - FATAL_EXIT_CANNOT_LOAD_BUNDLE = 14, - FATAL_EXIT_CANNOT_FIND_LIBMONOSGEN = 15, - FATAL_EXIT_NO_ASSEMBLIES = 'A', - FATAL_EXIT_MONO_MISSING_SYMBOLS = 'B', - FATAL_EXIT_FORK_FAILED = 'F', - FATAL_EXIT_MISSING_INIT = 'I', - FATAL_EXIT_MISSING_TIMEZONE_MEMBERS = 'T', - FATAL_EXIT_MISSING_ZIPALIGN = 'Z', - FATAL_EXIT_OUT_OF_MEMORY = 'M', - FATAL_EXIT_JVM_MISSING_SYMBOLS = 'J', -}; - -static inline void* -_assert_valid_pointer (void *p, size_t size) -{ - if (!p) { - if (size == 0) { - /* In this case it's "ok" to return NULL, although a malloc - * implementation may choose to do something else - */ - return p; - } - - log_fatal (LOG_DEFAULT, "Out of memory!"); - std::exit (FATAL_EXIT_OUT_OF_MEMORY); - } - - return p; -} - -static inline void* -xmalloc (size_t size) -{ - return _assert_valid_pointer (malloc (size), size); -} - -static inline void* -xrealloc (void *ptr, size_t size) -{ - return _assert_valid_pointer (realloc (ptr, size), size); -} - -static inline void* -xcalloc (size_t nmemb, size_t size) -{ - return _assert_valid_pointer (calloc (nmemb, size), nmemb * size); -} - -#endif /* __JAVA_INTEROP_UTIL_H__ */ diff --git a/src/java-interop/java-interop.cc b/src/java-interop/java-interop.cc deleted file mode 100644 index 282333753..000000000 --- a/src/java-interop/java-interop.cc +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -#include "java-interop.h" - -#ifdef _WINDOWS -// Warning C4996: 'strdup': The POSIX name for this item is deprecated. -#define strdup _strdup -#endif // ndef _WINDOWS - -char* -java_interop_strdup (const char* value) -{ - return strdup (value); -} - -void -java_interop_free (void *p) -{ - free (p); -} - diff --git a/src/java-interop/java-interop.h b/src/java-interop/java-interop.h deleted file mode 100644 index 1a2051215..000000000 --- a/src/java-interop/java-interop.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef INC_JAVA_INTEROP_H -#define INC_JAVA_INTEROP_H - -#include - -#if defined(_MSC_VER) - - #define JAVA_INTEROP_API_EXPORT __declspec(dllexport) - #define JAVA_INTEROP_API_IMPORT __declspec(dllimport) - -#else /* defined(_MSC_VER */ - - #ifdef __GNUC__ - #define JAVA_INTEROP_API_EXPORT __attribute__ ((visibility ("default"))) - #else - #define JAVA_INTEROP_API_EXPORT - #endif - #define JAVA_INTEROP_API_IMPORT - -#endif /* !defined(_MSC_VER) */ - -#if defined(MONO_DLL_EXPORT) || defined(JAVA_INTEROP_DLL_EXPORT) - #define JAVA_INTEROP_API JAVA_INTEROP_API_EXPORT -#elif defined(MONO_DLL_IMPORT) || defined(JAVA_INTEROP_DLL_IMPORT) - #define JAVA_INTEROP_API JAVA_INTEROP_API_IMPORT -#else /* !defined(MONO_DLL_IMPORT) && !defined(MONO_DLL_EXPORT) */ - #define JAVA_INTEROP_API -#endif /* MONO_DLL_EXPORT... */ - -#ifdef __cplusplus - #define JAVA_INTEROP_BEGIN_DECLS extern "C" { - #define JAVA_INTEROP_END_DECLS } -#else /* ndef __cplusplus */ - #define JAVA_INTEROP_BEGIN_DECLS - #define JAVA_INTEROP_END_DECLS -#endif /* ndef __cplusplus */ - -JAVA_INTEROP_BEGIN_DECLS - -JAVA_INTEROP_API char *java_interop_strdup (const char* value); -JAVA_INTEROP_API void java_interop_free (void *p); - -JAVA_INTEROP_END_DECLS - -#endif /* ndef INC_JAVA_INTEROP_H */ diff --git a/src/java-interop/java-interop.targets b/src/java-interop/java-interop.targets deleted file mode 100644 index 9d35aaa47..000000000 --- a/src/java-interop/java-interop.targets +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - <_JavaInteropLibName Condition=" $([MSBuild]::IsOSPlatform ('osx')) ">libjava-interop.dylib - <_JavaInteropLibName Condition=" $([MSBuild]::IsOSPlatform ('linux')) ">libjava-interop.so - <_JavaInteropLibName Condition=" $([MSBuild]::IsOSPlatform ('windows')) ">java-interop.dll - - - - - PreserveNewest - $(_JavaInteropLibName) - - - - - - - - - - - - - - - <_PrepareArch Condition=" '$(NETCoreSdkRuntimeIdentifier)' == 'win-x64' ">x86_amd64 - - - - <_CmakeOsxArch Condition=" '$(NETCoreSdkRuntimeIdentifier)' == 'osx-x64' ">x86_64 - <_CmakeOsxArch Condition=" '$(NETCoreSdkRuntimeIdentifier)' == 'osx-arm64' ">arm64 - - - - <_MonoNativePath>$(NuGetPackageRoot)microsoft.netcore.app.runtime.mono.$(NETCoreSdkRuntimeIdentifier)/$(DotNetRuntimePacksVersion)/runtimes/$(NETCoreSdkRuntimeIdentifier)/native/ - <_MonoIncludePath>$(_MonoNativePath)include/mono-2.0 - <_DEnableMono>-DENABLE_MONO_INTEGRATION=ON - <_DEnableOsxArchitectures Condition=" $([MSBuild]::IsOSPlatform ('osx')) ">"-DENABLE_OSX_ARCHITECTURES=$(_CmakeOsxArch)" - <_DMonoDirs>"-DMONO_INCLUDE_LIST=$(_MonoIncludePath)" - <_DJdkDirs>"-DJDK_INCLUDE_LIST=@(JdkIncludePath, ';')" - <_DJni_c>"-DJNI_C_PATH=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)jni.c" - <_MonoLinkFlags Condition=" $([MSBuild]::IsOSPlatform ('windows')) " >$(MSBuildThisFileDirectory)coreclr.lib - <_MonoLinkFlags Condition=" !$([MSBuild]::IsOSPlatform ('windows')) ">-L $(_MonoNativePath) -lcoreclr - <_DMonoLinkFlags>"-DMONO_LINK_FLAGS=$(_MonoLinkFlags)" - <_ExtraArgs>$([MSBuild]::Escape('$(_DJdkDirs) $(_DJni_c) $(_DEnableMono) $(_DMonoDirs) $(_DMonoLinkFlags) $(_DEnableOsxArchitectures)')) - - - - - - - - - - - - <_Cmake - Condition=" '$(PrepareNativeToolchain)' != '' " - Include="PrepareNativeToolchain=$(PrepareNativeToolchain) $(_PrepareArch)" - /> - <_Cmake Include="CmakePath=$(CmakePath)" /> - <_Cmake Include="CmakeGenerator=$(CmakeGenerator)" /> - <_Cmake Include="CmakeSourceDir=$(MSBuildThisFileDirectory)" /> - <_Cmake Include="CmakeBuildDir=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)" /> - <_Cmake Include="CmakeExtraArgs=$(_ExtraArgs)" /> - - - - - - - - - - - - - - - - diff --git a/src/utils/StringRocks.cs b/src/utils/StringRocks.cs index 971856dbb..cf2071f21 100644 --- a/src/utils/StringRocks.cs +++ b/src/utils/StringRocks.cs @@ -21,7 +21,7 @@ public static string MemberToPascalCase (string value) if (string.IsNullOrEmpty (value)) return value; - if (value.Contains (".")) + if (value.Contains ('.')) throw new NotSupportedException ("Methods cannot contain '.'."); return ToPascalCasePart (value, 1); diff --git a/tests/Java.Base-Tests/Java.Base/JavaVMFixture.cs b/tests/Java.Base-Tests/Java.Base/JavaVMFixture.cs index 7864b05cd..bf0ba101d 100644 --- a/tests/Java.Base-Tests/Java.Base/JavaVMFixture.cs +++ b/tests/Java.Base-Tests/Java.Base/JavaVMFixture.cs @@ -11,11 +11,12 @@ namespace Java.BaseTests { partial class JavaVMFixture { + private static readonly string [] jars = new []{ "java.base-tests.jar" }; static partial void CreateJavaVM () { var c = new TestJVM ( - jars: new[]{ "java.base-tests.jar" }, + jars: jars, typeMappings: new Dictionary () { ["java/lang/Float"] = typeof (Java.Lang.Float), ["example/MyIntConsumer"] = typeof (MyIntConsumer), diff --git a/tests/Java.Interop-Tests/Java.Interop/JavaObjectArrayTest.cs b/tests/Java.Interop-Tests/Java.Interop/JavaObjectArrayTest.cs index f28fd7c02..c8730ae3a 100644 --- a/tests/Java.Interop-Tests/Java.Interop/JavaObjectArrayTest.cs +++ b/tests/Java.Interop-Tests/Java.Interop/JavaObjectArrayTest.cs @@ -123,8 +123,13 @@ public void ObjectArrayType () [TestFixture] public class JavaObjectArray_JavaInt32Array_ContractTest : JavaObjectArrayContractTest { - protected override JavaInt32Array CreateValueA () {return new JavaInt32Array (new[]{1});} - protected override JavaInt32Array CreateValueB () {return new JavaInt32Array (new[]{2});} + private static readonly int [] valueA = new []{1}; + + protected override JavaInt32Array CreateValueA () {return new JavaInt32Array (valueA);} + + private static readonly int [] valueB = new []{2}; + + protected override JavaInt32Array CreateValueB () {return new JavaInt32Array (valueB);} [Test] public void ObjectArrayType () diff --git a/tests/Java.Interop-Tests/Java.Interop/JavaVMFixture.cs b/tests/Java.Interop-Tests/Java.Interop/JavaVMFixture.cs index d1b37858e..a8b5a7cae 100644 --- a/tests/Java.Interop-Tests/Java.Interop/JavaVMFixture.cs +++ b/tests/Java.Interop-Tests/Java.Interop/JavaVMFixture.cs @@ -103,7 +103,7 @@ IEnumerable CreateSimpleReferencesEnumerator (Type type) var slash = jniSimpleReference.LastIndexOf ('/'); var desugarType = slash <= 0 ? "Desugar" + jniSimpleReference - : jniSimpleReference.Substring (0, slash+1) + "Desugar" + jniSimpleReference.Substring (slash+1); + : string.Concat (jniSimpleReference.AsSpan (0, slash+1), "Desugar", jniSimpleReference.AsSpan (slash+1)); // These types likely won't ever exist on Desktop, but providing // "potentially non-existent" types ensures that we don't throw @@ -144,7 +144,7 @@ IEnumerable CreateSimpleReferencesEnumerator (Type type) var targetSig = r.TargetSignature; var paramCount = r.ParamCount; if (targetSig == null && r.TurnStatic) { - targetSig = $"(L{jniSourceType};" + jniMethodSignature.Substring ("(".Length); + targetSig = string.Concat ($"(L{jniSourceType};", jniMethodSignature.AsSpan ("(".Length)); paramCount = paramCount ?? JniMemberSignature.GetParameterCountFromMethodSignature (jniMethodSignature); paramCount++; } diff --git a/tests/Java.Interop-Tests/Java.Interop/JniMarshalTests.cs b/tests/Java.Interop-Tests/Java.Interop/JniMarshalTests.cs index 372fb9c30..8a8ca0a49 100644 --- a/tests/Java.Interop-Tests/Java.Interop/JniMarshalTests.cs +++ b/tests/Java.Interop-Tests/Java.Interop/JniMarshalTests.cs @@ -9,6 +9,9 @@ namespace Java.InteropTests [TestFixture] public class JniMarshalTests { + private static readonly int [] objA = new []{ 1, 2, 3 }; + private static readonly int [] objB = new []{ 1, 2, 3 }; + [Test] public void RecursiveEquals () { @@ -17,9 +20,9 @@ public void RecursiveEquals () Assert.IsFalse (JniMarshal.RecursiveEquals (new object (), null)); Assert.IsTrue (JniMarshal.RecursiveEquals (1, 1)); Assert.IsFalse (JniMarshal.RecursiveEquals (1, 2)); - Assert.IsTrue (JniMarshal.RecursiveEquals (new[]{ 1, 2, 3 }, new[]{ 1, 2, 3 })); - Assert.IsFalse (JniMarshal.RecursiveEquals (new[]{ 1, 2, 3 }, new[]{ 1, 2 })); - Assert.IsFalse (JniMarshal.RecursiveEquals (new[]{ 1, 2 }, new[]{ 1, 2, 3 })); + Assert.IsTrue (JniMarshal.RecursiveEquals (objA, objB)); + Assert.IsFalse (JniMarshal.RecursiveEquals (objA, new[]{ 1, 2 })); + Assert.IsFalse (JniMarshal.RecursiveEquals (new[]{ 1, 2 }, objB)); Assert.IsFalse (JniMarshal.RecursiveEquals (new[]{ 1, 2 }, null)); Assert.IsFalse (JniMarshal.RecursiveEquals (null, new[]{ 1, 2 })); Assert.IsTrue (JniMarshal.RecursiveEquals ( diff --git a/tests/Java.Interop-Tests/Java.Interop/JniPeerMembersExtensions.cs b/tests/Java.Interop-Tests/Java.Interop/JniPeerMembersExtensions.cs index 0bbe6cb74..9158033fb 100644 --- a/tests/Java.Interop-Tests/Java.Interop/JniPeerMembersExtensions.cs +++ b/tests/Java.Interop-Tests/Java.Interop/JniPeerMembersExtensions.cs @@ -14,8 +14,7 @@ public static unsafe JniObjectReference StartGenericCreateInstance ( Type declaringType, T value) { - if (peer == null) - throw new ArgumentNullException (nameof (peer)); + ArgumentNullException.ThrowIfNull (peer); _ = value; return peer.StartCreateInstance (constructorSignature, declaringType, null); @@ -29,10 +28,8 @@ public static unsafe void FinishGenericCreateInstance< IJavaPeerable self, T value) { - if (peer == null) - throw new ArgumentNullException (nameof (peer)); - if (self == null) - throw new ArgumentNullException (nameof (self)); + ArgumentNullException.ThrowIfNull (peer); + ArgumentNullException.ThrowIfNull (self); var __vm = JniEnvironment.Runtime.ValueManager.GetValueMarshaler (); var arg = __vm.CreateGenericArgumentState (value); @@ -55,10 +52,8 @@ public static unsafe void InvokeGenericVirtualVoidMethod< IJavaPeerable self, T value) { - if (peer == null) - throw new ArgumentNullException (nameof (peer)); - if (self == null) - throw new ArgumentNullException (nameof (self)); + ArgumentNullException.ThrowIfNull (peer); + ArgumentNullException.ThrowIfNull (self); var __vm = JniEnvironment.Runtime.ValueManager.GetValueMarshaler (); var arg = __vm.CreateGenericArgumentState (value); @@ -81,10 +76,8 @@ public static unsafe int InvokeGenericVirtualInt32Method< IJavaPeerable self, T value) { - if (peer == null) - throw new ArgumentNullException (nameof (peer)); - if (self == null) - throw new ArgumentNullException (nameof (self)); + ArgumentNullException.ThrowIfNull (peer); + ArgumentNullException.ThrowIfNull (self); var __vm = JniEnvironment.Runtime.ValueManager.GetValueMarshaler (); var arg = __vm.CreateGenericArgumentState (value); @@ -106,8 +99,7 @@ public static unsafe int InvokeGenericInt32Method< string encodedMember, T value) { - if (peer == null) - throw new ArgumentNullException (nameof (peer)); + ArgumentNullException.ThrowIfNull (peer); var __vm = JniEnvironment.Runtime.ValueManager.GetValueMarshaler (); var arg = __vm.CreateGenericArgumentState (value); diff --git a/tests/Java.Interop-Tests/Java.Interop/JniValueMarshalerContractTests.cs b/tests/Java.Interop-Tests/Java.Interop/JniValueMarshalerContractTests.cs index 3c5668b66..1b2d05b06 100644 --- a/tests/Java.Interop-Tests/Java.Interop/JniValueMarshalerContractTests.cs +++ b/tests/Java.Interop-Tests/Java.Interop/JniValueMarshalerContractTests.cs @@ -262,7 +262,7 @@ protected virtual string GetExpectedReturnValueFromManagedExpression (string jvm void CheckExpression (JniValueMarshalerContext context, string expected, Expression ret) { var body = Expression.Block (context.CreationStatements.Concat (new[]{ ret })); - var cleanup = context.CleanupStatements.Any () + var cleanup = context.CleanupStatements.Count != 0 ? (Expression) Expression.Block (context.CleanupStatements.Reverse ()) : (Expression) Expression.Empty (); var expr = Expression.TryFinally (body, cleanup); @@ -463,9 +463,12 @@ public abstract class JniInt32ArrayValueMarshalerContractTests< protected abstract string ValueMarshalerSourceType {get;} protected override T Value { - get {return CreateArray (new[]{ 1, 2, 3 });} + get {return CreateArray (int32Array);} } + private static readonly int [] int32Array = new []{ 1, 2, 3 }; + private static readonly int [] int32Array0 = new []{ 1 }; + protected override bool Equals (T x, T y) { return x.SequenceEqual (y); @@ -474,7 +477,7 @@ protected override bool Equals (T x, T y) [Test] public unsafe void DestroyGenericArgumentState_UpdatesSource () { - var a = CreateArray (new[]{ 1 }); + var a = CreateArray (int32Array0); var s = marshaler.CreateGenericObjectReferenceArgumentState (a); fixed (int *p = new[]{3}) JniEnvironment.Arrays.SetIntArrayRegion (s.ReferenceValue, 0, 1, p); @@ -523,6 +526,8 @@ public class JniValueMarshaler_Int32Array_ContractTests : JniInt32ArrayValueMars protected override string ValueMarshalerSourceType {get {return "int[]";}} + private static readonly int [] int32Array = new []{ 1 }; + [Test] public unsafe void CreateGenericObjectReferenceArgumentState_OutParameterDoesNotCopy () { @@ -537,7 +542,7 @@ public unsafe void CreateGenericObjectReferenceArgumentState_OutParameterDoesNot [Test] public unsafe void DestroyGenericArgumentState_InParameterDoesNotUpdatesSource () { - var a = CreateArray (new[]{ 1 }); + var a = CreateArray (int32Array); var s = marshaler.CreateGenericObjectReferenceArgumentState (a); fixed (int *p = new[]{3}) JniEnvironment.Arrays.SetIntArrayRegion (s.ReferenceValue, 0, 1, p); diff --git a/tests/Java.Interop.Tools.Generator-Tests/Enumification/ConstantEntryTests.cs b/tests/Java.Interop.Tools.Generator-Tests/Enumification/ConstantEntryTests.cs index 49f544ecf..fd3260cbb 100644 --- a/tests/Java.Interop.Tools.Generator-Tests/Enumification/ConstantEntryTests.cs +++ b/tests/Java.Interop.Tools.Generator-Tests/Enumification/ConstantEntryTests.cs @@ -4,7 +4,7 @@ namespace Java.Interop.Tools.Generator_Tests { - public class ConstantEntryTests + internal sealed class ConstantEntryTests { [Test] public void ParseEnumMapV1 () diff --git a/tests/Java.Interop.Tools.Generator-Tests/Metadata/NamespaceTransformTests.cs b/tests/Java.Interop.Tools.Generator-Tests/Metadata/NamespaceTransformTests.cs index 7da4b2cd0..a20132131 100644 --- a/tests/Java.Interop.Tools.Generator-Tests/Metadata/NamespaceTransformTests.cs +++ b/tests/Java.Interop.Tools.Generator-Tests/Metadata/NamespaceTransformTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.Generator_Tests { - public class NamespaceTransformTests + internal sealed class NamespaceTransformTests { [Test] public void ParseNamespaceTransform () diff --git a/tests/Java.Interop.Tools.Generator-Tests/Utilities/AndroidSdkVersionTests.cs b/tests/Java.Interop.Tools.Generator-Tests/Utilities/AndroidSdkVersionTests.cs index dbe107168..ce081c71b 100644 --- a/tests/Java.Interop.Tools.Generator-Tests/Utilities/AndroidSdkVersionTests.cs +++ b/tests/Java.Interop.Tools.Generator-Tests/Utilities/AndroidSdkVersionTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.Generator_Tests; [TestFixture] -public class AndroidSdkVersionTests +internal sealed class AndroidSdkVersionTests { [Test] public void CompareTo() diff --git a/tests/Java.Interop.Tools.Generator-Tests/Utilities/NamingConverterTests.cs b/tests/Java.Interop.Tools.Generator-Tests/Utilities/NamingConverterTests.cs index 53c57befd..a6cf6bc4b 100644 --- a/tests/Java.Interop.Tools.Generator-Tests/Utilities/NamingConverterTests.cs +++ b/tests/Java.Interop.Tools.Generator-Tests/Utilities/NamingConverterTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.Generator_Tests; [TestFixture] -public class NamingConverterTests +internal sealed class NamingConverterTests { [Test] public void ParseApiLevel_Exceptions () diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/BroadcastReceiverAttribute.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/BroadcastReceiverAttribute.cs index 5c5dac36e..489ec6bc7 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/BroadcastReceiverAttribute.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/BroadcastReceiverAttribute.cs @@ -2,7 +2,7 @@ namespace Android.Content { - partial class BroadcastReceiverAttribute : Attribute, Java.Interop.IJniNameProviderAttribute { + partial sealed class BroadcastReceiverAttribute : Attribute, Java.Interop.IJniNameProviderAttribute { public string Name { get; set; } } } diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/ContentProviderAttribute.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/ContentProviderAttribute.cs index 3021f14d3..4e3220400 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/ContentProviderAttribute.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Android.Content/ContentProviderAttribute.cs @@ -2,7 +2,7 @@ namespace Android.Content { - partial class ContentProviderAttribute : Attribute, Java.Interop.IJniNameProviderAttribute { + partial sealed class ContentProviderAttribute : Attribute, Java.Interop.IJniNameProviderAttribute { public string Name { get; set; } } } diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/Crc64Tests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/Crc64Tests.cs index 468514155..eb892fd38 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/Crc64Tests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/Crc64Tests.cs @@ -6,7 +6,7 @@ namespace Java.Interop.Tools.JavaCallableWrappersTests { [TestFixture] - public class Crc64Tests + internal class Crc64Tests { static string ToHash (string value) { diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/DirectoryAssemblyResolverTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/DirectoryAssemblyResolverTests.cs index c2d48837f..952e46b66 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/DirectoryAssemblyResolverTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/DirectoryAssemblyResolverTests.cs @@ -7,7 +7,7 @@ namespace Java.Interop.Tools.JavaCallableWrappersTests { [TestFixture] - public class DirectoryAssemblyResolverTests + internal class DirectoryAssemblyResolverTests { static void Log (TraceLevel level, string message) { diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/IdentifierValidatorTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/IdentifierValidatorTests.cs index 772383627..5cc7d3112 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/IdentifierValidatorTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/IdentifierValidatorTests.cs @@ -10,7 +10,7 @@ namespace Java.Interop.Tools.JavaCallableWrappersTests { [TestFixture] - public class IdentifierValidatorTests + internal class IdentifierValidatorTests { [Test] public void CreateValidIdentifier_Simple () diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs index 1f4fcd558..791f3a3b4 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs @@ -19,7 +19,7 @@ namespace Java.Interop.Tools.JavaCallableWrappersTests { [TestFixture] - public class JavaCallableWrapperGeneratorTests + internal class JavaCallableWrapperGeneratorTests { [Test] public void ConstructorExceptions () diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs index 6f38eaba6..6e4e2aa11 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs @@ -9,7 +9,7 @@ namespace Java.Interop.Tools.JavaCallableWrappersTests { [TestFixture] - public class JavaNativeTypeManagerTests + internal class JavaNativeTypeManagerTests { PackageNamingPolicy existingValue; diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/SupportDeclarations.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/SupportDeclarations.cs index 0e6307cf0..73039c130 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/SupportDeclarations.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/SupportDeclarations.cs @@ -24,7 +24,7 @@ protected virtual void OnCreate () } [Register ("android/app/Application$ActivityLifecycleCallbacks", DoNotGenerateAcw = true)] - public partial interface IActivityLifecycleCallbacks { + internal partial interface IActivityLifecycleCallbacks { [Register ( name: "onActivityCreated", signature: "(Landroid/app/Activity;Landroid/os/Bundle;)V", @@ -32,7 +32,7 @@ public partial interface IActivityLifecycleCallbacks { void OnActivityCreated (Android.App.Activity activity, global::Android.OS.Bundle savedInstanceState); } - internal class IActivityLifecycleCallbacksInvoker : Java.Lang.Object, IActivityLifecycleCallbacks { + internal sealed class IActivityLifecycleCallbacksInvoker : Java.Lang.Object, IActivityLifecycleCallbacks { static Delegate GetOnActivityCreated_Landroid_app_Activity_Landroid_os_Bundle_Handler () { return null; @@ -66,7 +66,7 @@ public virtual void OnCreate (Java.Lang.Object arguments) namespace Android.OS { [Register ("android/os/Bundle", DoNotGenerateAcw = true)] - class Bundle : Java.Lang.Object + sealed class Bundle : Java.Lang.Object { } } @@ -86,7 +86,7 @@ class Object : Android.Runtime.IJavaObject } [Register ("java/lang/Throwable", DoNotGenerateAcw = true)] - class Throwable : Exception, Android.Runtime.IJavaObject + sealed class Throwable : Exception, Android.Runtime.IJavaObject { } } @@ -157,19 +157,19 @@ abstract class AbstractClass : Java.Lang.Object } [Register ("my.AbstractClass")] - class AbstractClassInvoker : AbstractClass + sealed class AbstractClassInvoker : AbstractClass { } [Activity (Name = "activity.Name")] - class ActivityName : Java.Lang.Object + sealed class ActivityName : Java.Lang.Object { } [Application (Name = "application.Name")] class ApplicationName : Application { - public class ActivityLifecycleCallbacks : Java.Lang.Object, Application.IActivityLifecycleCallbacks + internal sealed class ActivityLifecycleCallbacks : Java.Lang.Object, Application.IActivityLifecycleCallbacks { public void OnActivityCreated (Activity activity, global::Android.OS.Bundle savedInstanceState) { @@ -177,7 +177,7 @@ public void OnActivityCreated (Activity activity, global::Android.OS.Bundle save } } - class IndirectApplication : ApplicationName + sealed class IndirectApplication : ApplicationName { protected override void OnCreate () { @@ -185,29 +185,29 @@ protected override void OnCreate () } } - class DefaultName : Java.Lang.Object + sealed class DefaultName : Java.Lang.Object { - public class A : Java.Lang.Object + internal sealed class A : Java.Lang.Object { - public class B : Java.Lang.Object + internal sealed class B : Java.Lang.Object { } } - public class C + internal sealed class C { - public class D : Java.Lang.Object + internal sealed class D : Java.Lang.Object { } } } [Instrumentation (Name = "instrumentation.Name")] - class InstrumentationName : Java.Lang.Object + sealed class InstrumentationName : Java.Lang.Object { } [ContentProvider (Name = "provider.Name")] - class ProviderName : Java.Lang.Object + sealed class ProviderName : Java.Lang.Object { } @@ -216,7 +216,7 @@ class NonStaticOuterClass : Java.Lang.Object { [Register ("register/NonStaticOuterClass$NonStaticInnerClass", DoNotGenerateAcw = true)] - public class NonStaticInnerClass : Java.Lang.Object + internal class NonStaticInnerClass : Java.Lang.Object { public NonStaticInnerClass (NonStaticOuterClass __self) { @@ -224,9 +224,9 @@ public NonStaticInnerClass (NonStaticOuterClass __self) } } - class ExampleOuterClass : NonStaticOuterClass + sealed class ExampleOuterClass : NonStaticOuterClass { - public class ExampleInnerClass : NonStaticInnerClass + internal sealed class ExampleInnerClass : NonStaticInnerClass { public ExampleInnerClass (ExampleOuterClass outer) : base (outer) @@ -236,29 +236,29 @@ public ExampleInnerClass (ExampleOuterClass outer) } [Activity (Name = "my.ExampleActivity")] - class ExampleActivity : Activity + sealed class ExampleActivity : Activity { } [Instrumentation (Name = "my.ExampleInstrumentation")] - class ExampleInstrumentation : Instrumentation + sealed class ExampleInstrumentation : Instrumentation { } [BroadcastReceiver (Name = "receiver.Name")] - class ReceiverName : Java.Lang.Object + sealed class ReceiverName : Java.Lang.Object { } [Register ("register.Name")] - class RegisterName : Java.Lang.Object + sealed class RegisterName : Java.Lang.Object { - public class DefaultNestedName : Java.Lang.Object + internal sealed class DefaultNestedName : Java.Lang.Object { } [Register ("register.Name$Override")] - public class OverrideNestedName : Java.Lang.Object + internal sealed class OverrideNestedName : Java.Lang.Object { } } @@ -278,25 +278,25 @@ public virtual void Bar () } [Register ("Kotlin.InvalidRegisterNameSubclass")] - class KotlinInvalidImplRegisterName : KotlinInvalidRegisterName + sealed class KotlinInvalidImplRegisterName : KotlinInvalidRegisterName { [Register ("foo-impl")] public override void Foo () => base.Foo (); } [Register ("Kotlin.InvalidRegisterNameSubclass")] - class KotlinInvalidHashRegisterName : KotlinInvalidRegisterName + sealed class KotlinInvalidHashRegisterName : KotlinInvalidRegisterName { [Register ("foo-f8k2a13")] public override void Bar () => base.Foo (); } [Service (Name = "service.Name")] - class ServiceName : Java.Lang.Object + sealed class ServiceName : Java.Lang.Object { } - class ExportsMembers : Java.Lang.Object + sealed class ExportsMembers : Java.Lang.Object { [ExportField ("STATIC_INSTANCE")] public static ExportsMembers GetInstance () @@ -338,7 +338,7 @@ public void methodThatThrowsEmptyArray () } [Register ("register.ExportsConstructors")] - class ExportsConstructors : Java.Lang.Object + sealed class ExportsConstructors : Java.Lang.Object { [Export] public ExportsConstructors () { } @@ -348,7 +348,7 @@ public ExportsConstructors (int value) { } } [Register ("register.ExportsThrowsConstructors")] - class ExportsThrowsConstructors : Java.Lang.Object + sealed class ExportsThrowsConstructors : Java.Lang.Object { [Export (Throws = new [] { typeof (Java.Lang.Throwable) })] public ExportsThrowsConstructors () { } @@ -361,7 +361,7 @@ public ExportsThrowsConstructors (string value) { } } [JniTypeSignature ("register/JavaInteropExample")] - class JavaInteropExample : Java.Lang.Object { + sealed class JavaInteropExample : Java.Lang.Object { [JavaCallableConstructor(SuperConstructorExpression="")] @@ -373,6 +373,6 @@ public void Example () {} } [Register (nameof (GlobalClass))] -class GlobalClass : Java.Lang.Object +sealed class GlobalClass : Java.Lang.Object { } diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/TypeNameMapGeneratorTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/TypeNameMapGeneratorTests.cs index 1f6f764ec..7a4ffb232 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/TypeNameMapGeneratorTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/TypeNameMapGeneratorTests.cs @@ -20,7 +20,7 @@ namespace Xamarin.Android.ToolsTests { [TestFixture] - public class TypeNameMapGeneratorTests + internal class TypeNameMapGeneratorTests { [Test] public void ConstructorExceptions () diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/XmlImporterTests.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/XmlImporterTests.cs index 6486045ae..eef11ad03 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/XmlImporterTests.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/XmlImporterTests.cs @@ -7,7 +7,7 @@ namespace Java.Interop.Tools.JavaCallableWrappersTests { [TestFixture] - public class XmlImporterTests + internal class XmlImporterTests { PackageNamingPolicy existingValue; diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableAttribute.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableAttribute.cs index 8b8c7d0f6..ec0675b4b 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableAttribute.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableAttribute.cs @@ -4,7 +4,7 @@ namespace Java.Interop { [AttributeUsage (AttributeTargets.Method, AllowMultiple=false)] - public sealed class JavaCallableAttribute : Attribute { + internal sealed class JavaCallableAttribute : Attribute { public JavaCallableAttribute () { diff --git a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableConstructorAttribute.cs b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableConstructorAttribute.cs index 23370d4cb..43b27a1bc 100644 --- a/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableConstructorAttribute.cs +++ b/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop/JavaCallableConstructorAttribute.cs @@ -4,7 +4,7 @@ namespace Java.Interop { [AttributeUsage (AttributeTargets.Constructor, AllowMultiple=false)] - public sealed class JavaCallableConstructorAttribute : Attribute { + internal sealed class JavaCallableConstructorAttribute : Attribute { public JavaCallableConstructorAttribute () { diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/JavaStubParserTests.cs b/tests/Java.Interop.Tools.JavaSource-Tests/JavaStubParserTests.cs index 92ea2b779..3b2f16adf 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/JavaStubParserTests.cs +++ b/tests/Java.Interop.Tools.JavaSource-Tests/JavaStubParserTests.cs @@ -9,7 +9,7 @@ namespace Java.Interop.Tools.JavaSource.Tests { [TestFixture] - public class JavaStubParserTests + internal sealed class JavaStubParserTests { [Test] public void TryParse_EmptySource () diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.BlockTagsBnfTermsTests.cs b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.BlockTagsBnfTermsTests.cs index ae4f3af4b..4a316735a 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.BlockTagsBnfTermsTests.cs +++ b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.BlockTagsBnfTermsTests.cs @@ -12,7 +12,7 @@ namespace Java.Interop.Tools.JavaSource.Tests { [TestFixture] - public class SourceJavadocToXmldocGrammarBlockTagsBnfTermsTests : SourceJavadocToXmldocGrammarFixture { + internal sealed class SourceJavadocToXmldocGrammarBlockTagsBnfTermsTests : SourceJavadocToXmldocGrammarFixture { [Test] public void ApiSinceDeclaration () diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.HtmlBnfTermsTests.cs b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.HtmlBnfTermsTests.cs index 5f5061f2d..6004aae8c 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.HtmlBnfTermsTests.cs +++ b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.HtmlBnfTermsTests.cs @@ -15,7 +15,7 @@ namespace Java.Interop.Tools.JavaSource.Tests { [TestFixture] - public class SourceJavadocToXmldocGrammarHtmlBnfTermsTests : SourceJavadocToXmldocGrammarFixture { + internal sealed class SourceJavadocToXmldocGrammarHtmlBnfTermsTests : SourceJavadocToXmldocGrammarFixture { [Test] public void PBlockDeclaration () diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.InlineTagsBnfTermsTests.cs b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.InlineTagsBnfTermsTests.cs index 35076a3b6..7ffddf7c0 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.InlineTagsBnfTermsTests.cs +++ b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammar.InlineTagsBnfTermsTests.cs @@ -12,7 +12,7 @@ namespace Java.Interop.Tools.JavaSource.Tests { [TestFixture] - public class SourceJavadocToXmldocGrammarInlineTagsBnfTermsTests : SourceJavadocToXmldocGrammarFixture { + internal sealed class SourceJavadocToXmldocGrammarInlineTagsBnfTermsTests : SourceJavadocToXmldocGrammarFixture { [Test] public void CodeDeclaration () diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammarFixture.cs b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammarFixture.cs index 3362db412..84e25d367 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammarFixture.cs +++ b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocGrammarFixture.cs @@ -15,7 +15,7 @@ namespace Java.Interop.Tools.JavaSource.Tests { [TestFixture] - public class SourceJavadocToXmldocGrammarFixture { + internal class SourceJavadocToXmldocGrammarFixture { protected const string DocRootPrefixActual = "https://developer.android.com"; protected const string DocRootPrefixExpected = DocRootPrefixActual + "/"; diff --git a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocParserTests.cs b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocParserTests.cs index a586f744d..c23cae423 100644 --- a/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocParserTests.cs +++ b/tests/Java.Interop.Tools.JavaSource-Tests/SourceJavadocToXmldocParserTests.cs @@ -15,7 +15,7 @@ namespace Java.Interop.Tools.JavaSource.Tests { [TestFixture] - public class SourceJavadocToXmldocParserTests : SourceJavadocToXmldocGrammarFixture { + internal sealed class SourceJavadocToXmldocParserTests : SourceJavadocToXmldocGrammarFixture { [Test, TestCaseSource (nameof (TryParse_Success))] public void TryParse (ParseResult parseResult) @@ -253,7 +253,7 @@ more description {{e.g. something}} here. Include @ character. }, }; - public class ParseResult { + internal sealed class ParseResult { public string Javadoc; public string FullXml; public string IntelliSenseXml; diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/BaseMethodTests.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/BaseMethodTests.cs index d9f7eb3c8..a74be4865 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/BaseMethodTests.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/BaseMethodTests.cs @@ -8,7 +8,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { [TestFixture] - public class BaseMethodTests + internal sealed class BaseMethodTests { JavaTypeCollection api; diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/GenericInheritanceMappingTests.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/GenericInheritanceMappingTests.cs index 4d1c74242..067df87ae 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/GenericInheritanceMappingTests.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/GenericInheritanceMappingTests.cs @@ -6,7 +6,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { [TestFixture] - public class GenericInheritanceMappingTests + internal sealed class GenericInheritanceMappingTests { JavaTypeCollection api; diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaApiTestHelper.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaApiTestHelper.cs index 182b40d8d..548908ce3 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaApiTestHelper.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaApiTestHelper.cs @@ -4,7 +4,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { - public class JavaApiTestHelper + internal sealed class JavaApiTestHelper { static readonly string TopDir = Path.Combine (Path.GetDirectoryName (typeof (JavaApiTestHelper).Assembly.Location), "..", ".."); static readonly string ApiPath = Path.Combine (TopDir, "tests", "Java.Interop.Tools.JavaTypeSystem-Tests", "api-24.xml.in"); diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeCollectionTests.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeCollectionTests.cs index 06faf1eb2..837ff5ba9 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeCollectionTests.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeCollectionTests.cs @@ -6,7 +6,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { [TestFixture] - public class JavaTypeCollectionTests + internal sealed class JavaTypeCollectionTests { JavaTypeCollection api; diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeModelsTests.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeModelsTests.cs index 1ee28de00..cfff810a7 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeModelsTests.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeModelsTests.cs @@ -8,7 +8,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { [TestFixture] - public class JavaTypeModelsTests + internal sealed class JavaTypeModelsTests { JavaTypeCollection api; diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeNameTests.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeNameTests.cs index e052dc52f..e2bea985e 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeNameTests.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeNameTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { [TestFixture] - public class JavaTypeNameTests + internal sealed class JavaTypeNameTests { [Test] public void ParseName () diff --git a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeReferenceTests.cs b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeReferenceTests.cs index 90ae8d5b3..233bcf118 100644 --- a/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeReferenceTests.cs +++ b/tests/Java.Interop.Tools.JavaTypeSystem-Tests/JavaTypeReferenceTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.JavaTypeSystem.Tests { [TestFixture] - public class JavaTypeReferenceTests + internal sealed class JavaTypeReferenceTests { [Test] public void TypeReferenceEquals () diff --git a/tests/Java.Interop.Tools.Maven-Tests/DependenciesTests.cs b/tests/Java.Interop.Tools.Maven-Tests/DependenciesTests.cs index 903771349..6016b3c57 100644 --- a/tests/Java.Interop.Tools.Maven-Tests/DependenciesTests.cs +++ b/tests/Java.Interop.Tools.Maven-Tests/DependenciesTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.Maven_Tests; -public class DependenciesTests +internal sealed class DependenciesTests { [Test] [TestCase ("dev.chrisbanes.snapper:snapper:0.3.0", "androidx.compose.foundation:foundation:1.2.1 - compile;org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 - compile")] diff --git a/tests/Java.Interop.Tools.Maven-Tests/Extensions/MavenProjectResolver.cs b/tests/Java.Interop.Tools.Maven-Tests/Extensions/MavenProjectResolver.cs index 1d208c327..c5ea31081 100644 --- a/tests/Java.Interop.Tools.Maven-Tests/Extensions/MavenProjectResolver.cs +++ b/tests/Java.Interop.Tools.Maven-Tests/Extensions/MavenProjectResolver.cs @@ -6,7 +6,7 @@ namespace Java.Interop.Tools.Maven_Tests.Extensions; -class MavenProjectResolver : IProjectResolver +sealed class MavenProjectResolver : IProjectResolver { readonly IMavenRepository repository; diff --git a/tests/Java.Interop.Tools.Maven-Tests/MavenVersionRangeTests.cs b/tests/Java.Interop.Tools.Maven-Tests/MavenVersionRangeTests.cs index 02575bb7f..1a86dee42 100644 --- a/tests/Java.Interop.Tools.Maven-Tests/MavenVersionRangeTests.cs +++ b/tests/Java.Interop.Tools.Maven-Tests/MavenVersionRangeTests.cs @@ -3,7 +3,7 @@ namespace Java.Interop.Tools.Maven_Tests; -public class MavenVersionRangeTests +internal sealed class MavenVersionRangeTests { [Test] public void ParseTest () diff --git a/tests/Java.Interop.Tools.Maven-Tests/MavenVersionTests.cs b/tests/Java.Interop.Tools.Maven-Tests/MavenVersionTests.cs index 3140d7dcb..64894680b 100644 --- a/tests/Java.Interop.Tools.Maven-Tests/MavenVersionTests.cs +++ b/tests/Java.Interop.Tools.Maven-Tests/MavenVersionTests.cs @@ -3,7 +3,7 @@ namespace Java.Interop.Tools.Maven_Tests; -public class MavenVersionTests +internal sealed class MavenVersionTests { [Test] public void ParseTest () diff --git a/tests/Java.Interop.Tools.Maven-Tests/ProjectResolverTests.cs b/tests/Java.Interop.Tools.Maven-Tests/ProjectResolverTests.cs index 716e7ebdc..ee4efb90a 100644 --- a/tests/Java.Interop.Tools.Maven-Tests/ProjectResolverTests.cs +++ b/tests/Java.Interop.Tools.Maven-Tests/ProjectResolverTests.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.Maven_Tests; -public class ProjectResolverTests +internal sealed class ProjectResolverTests { [Test] public void ResolveRawProject_Success () diff --git a/tests/Java.Interop.Tools.Maven-Tests/PropertySubstitutionTests.cs b/tests/Java.Interop.Tools.Maven-Tests/PropertySubstitutionTests.cs index ac6110c2b..dd7a3e86e 100644 --- a/tests/Java.Interop.Tools.Maven-Tests/PropertySubstitutionTests.cs +++ b/tests/Java.Interop.Tools.Maven-Tests/PropertySubstitutionTests.cs @@ -4,7 +4,7 @@ namespace Java.Interop.Tools.Maven_Tests; -public class PropertySubstitutionTests +internal sealed class PropertySubstitutionTests { [Test] public void Resolve_ExplicitProperty () diff --git a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/GenericInheritanceMappingTest.cs b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/GenericInheritanceMappingTest.cs index 6c02cfaeb..476427ab1 100644 --- a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/GenericInheritanceMappingTest.cs +++ b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/GenericInheritanceMappingTest.cs @@ -5,7 +5,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster.Tests { [TestFixture] - public class GenericInheritanceMappingTest + internal sealed class GenericInheritanceMappingTest { JavaApi api; diff --git a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTest.cs b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTest.cs index 727bffe62..3ccd0fa7b 100644 --- a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTest.cs +++ b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTest.cs @@ -6,7 +6,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster.Tests { [TestFixture] - public class JavaApiTest + internal sealed class JavaApiTest { JavaApi api; diff --git a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTestHelper.cs b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTestHelper.cs index f3eef3e9a..5b675d6b4 100644 --- a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTestHelper.cs +++ b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/JavaApiTestHelper.cs @@ -4,7 +4,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster.Tests { - public class JavaApiTestHelper + internal sealed class JavaApiTestHelper { static readonly string TopDir = Path.Combine ( Path.GetDirectoryName (typeof (JavaApiTestHelper).Assembly.Location), diff --git a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/OverrideMarkerTest.cs b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/OverrideMarkerTest.cs index 085d0ddbe..7d712f407 100644 --- a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/OverrideMarkerTest.cs +++ b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/OverrideMarkerTest.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster.Tests { [TestFixture] - public class OverrideMarkerTest + internal sealed class OverrideMarkerTest { JavaApi api; diff --git a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/TypeResolverTest.cs b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/TypeResolverTest.cs index 479d29c9e..cf9e495c7 100644 --- a/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/TypeResolverTest.cs +++ b/tests/Xamarin.Android.Tools.ApiXmlAdjuster-Tests/TypeResolverTest.cs @@ -8,7 +8,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster.Tests { [TestFixture] - public class TypeResolverTest + internal sealed class TypeResolverTest { JavaApi api; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileFixture.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileFixture.cs index 51795a60c..b84e993c1 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileFixture.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileFixture.cs @@ -10,7 +10,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { - public class ClassFileFixture { + internal class ClassFileFixture { static void OnLog (TraceLevel level, int verbosity, string format, object[] args) { diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileTests.cs index 465b64ba0..d705e51e7 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ClassFileTests.cs @@ -8,7 +8,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class ClassFileTests { + internal sealed class ClassFileTests { [Test] public void Constructor_Exceptions () diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ConfiguredJdkInfo.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ConfiguredJdkInfo.cs index 9126fbeaa..e583115f0 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ConfiguredJdkInfo.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ConfiguredJdkInfo.cs @@ -30,7 +30,7 @@ static string ReadJavaSdkDirectoryFromJdkInfoProps () return null; } var buildName = testDir.Replace ("Test", "Build"); - if (buildName.IndexOf ("-", StringComparison.Ordinal) >= 0) { + if (buildName.IndexOf ('-') >= 0) { buildName = buildName.Substring (0, buildName.IndexOf ('-')); } var jdkPropFile = Path.Combine (binDir, buildName, "JdkInfo.props"); diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedFieldDeclaration.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedFieldDeclaration.cs index 10d49adc4..55050f1c9 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedFieldDeclaration.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedFieldDeclaration.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { - class ExpectedFieldDeclaration { + sealed class ExpectedFieldDeclaration { public string Name; public string Descriptor; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedInnerClassInfo.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedInnerClassInfo.cs index 4775edabf..948483a7e 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedInnerClassInfo.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedInnerClassInfo.cs @@ -6,7 +6,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { - class ExpectedInnerClassInfo { + sealed class ExpectedInnerClassInfo { public string InnerClassName; public string OuterClassName; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedMethodDeclaration.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedMethodDeclaration.cs index 440c90507..625554fa1 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedMethodDeclaration.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedMethodDeclaration.cs @@ -8,7 +8,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { - class ExpectedMethodDeclaration { + sealed class ExpectedMethodDeclaration { public string Name; public MethodAccessFlags AccessFlags; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedTypeDeclaration.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedTypeDeclaration.cs index d45cf6d4b..d28df3e11 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedTypeDeclaration.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ExpectedTypeDeclaration.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { - class ExpectedTypeDeclaration { + sealed class ExpectedTypeDeclaration { public ushort MajorVersion; public ushort MinorVersion; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/IJavaInterfaceTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/IJavaInterfaceTests.cs index 1f4a210ad..09ff1e3d9 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/IJavaInterfaceTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/IJavaInterfaceTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class IJavaInterfaceTests : ClassFileFixture { + internal sealed class IJavaInterfaceTests : ClassFileFixture { const string JavaType = "IJavaInterface"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaAnnotationTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaAnnotationTests.cs index 5309a7b51..52d435b19 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaAnnotationTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaAnnotationTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaAnnotationTests : ClassFileFixture { + internal sealed class JavaAnnotationTests : ClassFileFixture { const string JavaType = "JavaAnnotation"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaEnumTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaEnumTests.cs index 50ee71e25..1701882ae 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaEnumTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaEnumTests.cs @@ -11,7 +11,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaEnumTests : ClassFileFixture { + internal sealed class JavaEnumTests : ClassFileFixture { const string JavaType = "JavaEnum"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1MyStringListTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1MyStringListTests.cs index 661b33852..49ebdd874 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1MyStringListTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1MyStringListTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaType_1MyStringListTests : ClassFileFixture { + internal sealed class JavaType_1MyStringListTests : ClassFileFixture { const string JavaType = "JavaType$1MyStringList"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1Tests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1Tests.cs index c8bcb0e44..c8e9fef3d 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1Tests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.1Tests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaType_1Tests : ClassFileFixture { + internal sealed class JavaType_1Tests : ClassFileFixture { const string JavaType = "JavaType$1"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.ASCTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.ASCTests.cs index c8bc6d01c..d3dcace87 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.ASCTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.ASCTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaType_ASCTests : ClassFileFixture { + internal sealed class JavaType_ASCTests : ClassFileFixture { const string JavaType = "JavaType$ASC"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.PSCTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.PSCTests.cs index e7c2977a0..0fa93723d 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.PSCTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.PSCTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaType_PSCTests : ClassFileFixture { + internal sealed class JavaType_PSCTests : ClassFileFixture { const string JavaType = "JavaType$PSC"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNC.RPNCTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNC.RPNCTests.cs index 9957bf876..26f05d933 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNC.RPNCTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNC.RPNCTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaType_RNC_RPNCTests : ClassFileFixture { + internal sealed class JavaType_RNC_RPNCTests : ClassFileFixture { const string JavaType = "JavaType$RNC$RPNC"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNCTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNCTests.cs index 92e8f1d02..11c08181b 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNCTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaType.RNCTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaType_RNCTests : ClassFileFixture { + internal sealed class JavaType_RNCTests : ClassFileFixture { const string JavaType = "JavaType$RNC"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeNoParametersTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeNoParametersTests.cs index 13c33b063..de0a5ff58 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeNoParametersTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeNoParametersTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaTypeNoParametersTests : ClassFileFixture { + internal sealed class JavaTypeNoParametersTests : ClassFileFixture { const string JavaType = "JavaTypeNoParameters"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs index 4ec9dbe3d..8335bee67 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JavaTypeTests.cs @@ -11,7 +11,8 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JavaTypeTests : ClassFileFixture { + internal sealed class JavaTypeTests : ClassFileFixture { + private static readonly string [] interfaceBounds = new [] { "Ljava/lang/Comparable;" }; [Test] public void ClassFile_WithJavaType_class () @@ -271,7 +272,7 @@ public void ClassFile_WithJavaType_class () ReturnDescriptor = "V", TypeParameters = { new TypeParameterInfo ("T", "Ljava/lang/Object;"), - new TypeParameterInfo ("TExtendsNumber", "Ljava/lang/Number;", new [] { "Ljava/lang/Comparable;" }), + new TypeParameterInfo ("TExtendsNumber", "Ljava/lang/Number;", interfaceBounds), new TypeParameterInfo ("TThrowable", "Ljava/lang/Throwable;"), }, Parameters = { diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/JvmOverloadsConstructorTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/JvmOverloadsConstructorTests.cs index f9fd5cec7..4b886ffb2 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/JvmOverloadsConstructorTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/JvmOverloadsConstructorTests.cs @@ -11,7 +11,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class JvmOverloadsConstructorTests : ClassFileFixture { + internal sealed class JvmOverloadsConstructorTests : ClassFileFixture { const string ClassFile = "JvmOverloadsConstructor.class"; const string XmlFile = "JvmOverloadsConstructor.xml"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinFixupsTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinFixupsTests.cs index e92deeb95..0eb67314c 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinFixupsTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinFixupsTests.cs @@ -9,7 +9,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class KotlinFixupsTests : ClassFileFixture + internal sealed class KotlinFixupsTests : ClassFileFixture { [Test] public void HideInternalClass () diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinInlineClassCollisionTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinInlineClassCollisionTests.cs index 3a26fcd1f..34aade82c 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinInlineClassCollisionTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinInlineClassCollisionTests.cs @@ -10,7 +10,7 @@ namespace Xamarin.Android.Tools.BytecodeTests // the generator's KotlinFixups must now de-collide) is actually what kotlinc // emits for @JvmInline value-class parameters. See dotnet/java-interop#1431. [TestFixture] - public class KotlinInlineClassCollisionTests : ClassFileFixture + internal sealed class KotlinInlineClassCollisionTests : ClassFileFixture { [Test] public void Widgets_HasCollidingHashMangledSiblings () @@ -35,6 +35,8 @@ public void Widgets_HasCollidingHashMangledSiblings () "Expected one unique `tint-(F)V` (MyDp) that should survive deduplication."); } + private static readonly string [] expected = new [] { "(F)F", "(FF)F" }; + [Test] public void Widgets_HasNonCollidingHashMangledOverloads () { @@ -46,7 +48,7 @@ public void Widgets_HasNonCollidingHashMangledOverloads () Assert.AreEqual (2, pads.Count); CollectionAssert.AreEquivalent ( - new [] { "(F)F", "(FF)F" }, + expected, pads.Select (m => m.Descriptor).ToArray (), "`pad` overloads have distinct JVM signatures and should both survive after rename."); } diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinMetadataTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinMetadataTests.cs index cf3e97ff1..3642438e6 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinMetadataTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/KotlinMetadataTests.cs @@ -6,7 +6,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class KotlinMetadataTests : ClassFileFixture + internal sealed class KotlinMetadataTests : ClassFileFixture { [Test] public void PublicKotlinClassFile () diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ModuleInfoTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ModuleInfoTests.cs index 035cc7083..5943083cb 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ModuleInfoTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ModuleInfoTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class ModuleInfoTests : ClassFileFixture { + internal sealed class ModuleInfoTests : ClassFileFixture { const string JavaType = "module-info"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/NonGenericGlobalTypeTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/NonGenericGlobalTypeTests.cs index 706660a9f..03ad254e7 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/NonGenericGlobalTypeTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/NonGenericGlobalTypeTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class NonGenericGlobalTypeTests : ClassFileFixture { + internal sealed class NonGenericGlobalTypeTests : ClassFileFixture { const string JavaType = "NonGenericGlobalType"; diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/NullableAnnotationTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/NullableAnnotationTests.cs index e1020792c..9b05da460 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/NullableAnnotationTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/NullableAnnotationTests.cs @@ -8,7 +8,7 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class NullableAnnotationTests : ClassFileFixture + internal sealed class NullableAnnotationTests : ClassFileFixture { [Test] public void RuntimeInvisibleAnnotations () diff --git a/tests/Xamarin.Android.Tools.Bytecode-Tests/ParameterFixupTests.cs b/tests/Xamarin.Android.Tools.Bytecode-Tests/ParameterFixupTests.cs index 7ed2eb372..3804d15b1 100644 --- a/tests/Xamarin.Android.Tools.Bytecode-Tests/ParameterFixupTests.cs +++ b/tests/Xamarin.Android.Tools.Bytecode-Tests/ParameterFixupTests.cs @@ -6,12 +6,13 @@ namespace Xamarin.Android.Tools.BytecodeTests { [TestFixture] - public class ParameterFixupTests : ClassFileFixture { + internal sealed class ParameterFixupTests : ClassFileFixture { + private static readonly string [] classResources = new [] {"IParameterInterface.class","ParameterAbstractClass.class", "ParameterClass.class", "ParameterClass2.class"}; [Test] public void XmlDeclaration_FixedUpFromOtherClasses () { - AssertXmlDeclaration (new [] {"IParameterInterface.class","ParameterAbstractClass.class", "ParameterClass.class", "ParameterClass2.class"}, "ParameterFixup.xml"); + AssertXmlDeclaration (classResources, "ParameterFixup.xml"); } [Test] @@ -64,7 +65,7 @@ public void XmlDeclaration_FixedUpFromUnresolvedApiXmlDocumentation () public void XmlDeclaration_DoesNotThrowAnExceptionIfDocumentationNotFound () { try { - AssertXmlDeclaration (new [] {"IParameterInterface.class","ParameterAbstractClass.class", "ParameterClass.class", "ParameterClass2.class"}, "ParameterFixup.xml", "SomeNonExistantPath"); + AssertXmlDeclaration (classResources, "ParameterFixup.xml", "SomeNonExistantPath"); } catch (Exception ex) { Assert.Fail ("An unexpected exception was thrown : {0}", ex); } @@ -103,6 +104,9 @@ public void DocletType_ShouldDetectDroidDocs () Assert.AreEqual(JavaDocletType.DroidDoc2, JavaMethodParameterNameProvider.GetDocletType(droidDocsPath)); } + private static readonly string [] typeEvaluatorResources = new string [] { "TypeEvaluator.class" }; + internal static readonly string [] classResourcesArray = new string [] { "NestedInterface$DnsSdTxtRecordListener.class" }; + [Test] public void XmlDeclaration_FixedUpFromParameterDescription () { @@ -111,7 +115,7 @@ public void XmlDeclaration_FixedUpFromParameterDescription () try { tempFile = LoadToTempFile ("ParameterDescription.txt"); - AssertXmlDeclaration (new string [] { "TypeEvaluator.class" }, "ParameterFixupFromDocs.xml", tempFile); + AssertXmlDeclaration (typeEvaluatorResources, "ParameterFixupFromDocs.xml", tempFile); } finally { if (File.Exists (tempFile)) @@ -121,7 +125,7 @@ public void XmlDeclaration_FixedUpFromParameterDescription () try { tempFile = LoadToTempFile ("ParameterDescription.txt"); - AssertXmlDeclaration (new string [] { "NestedInterface$DnsSdTxtRecordListener.class" }, "ParameterFixupFromDescriptionText.xml", tempFile); + AssertXmlDeclaration (classResourcesArray, "ParameterFixupFromDescriptionText.xml", tempFile); } finally { if (File.Exists (tempFile)) File.Delete (tempFile); diff --git a/tests/Xamarin.SourceWriter-Tests/ClassWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/ClassWriterTests.cs index ad2e9a523..16f32d1ab 100644 --- a/tests/Xamarin.SourceWriter-Tests/ClassWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/ClassWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class ClassWriterTests + internal sealed class ClassWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/ConstructorWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/ConstructorWriterTests.cs index 06bffefd4..804e4bae9 100644 --- a/tests/Xamarin.SourceWriter-Tests/ConstructorWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/ConstructorWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class ConstructorWriterTests + internal sealed class ConstructorWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/DelegateWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/DelegateWriterTests.cs index f4352366b..a3340898f 100644 --- a/tests/Xamarin.SourceWriter-Tests/DelegateWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/DelegateWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class DelegateWriterTests + internal sealed class DelegateWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/EventWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/EventWriterTests.cs index 17bb39495..70ff82036 100644 --- a/tests/Xamarin.SourceWriter-Tests/EventWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/EventWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class EventWriterTests + internal sealed class EventWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/FieldWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/FieldWriterTests.cs index 6f79df7d7..ee8200b9e 100644 --- a/tests/Xamarin.SourceWriter-Tests/FieldWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/FieldWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class FieldWriterTests + internal sealed class FieldWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/InterfaceWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/InterfaceWriterTests.cs index f45b4c744..a431c259a 100644 --- a/tests/Xamarin.SourceWriter-Tests/InterfaceWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/InterfaceWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class InterfaceWriterTests + internal sealed class InterfaceWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/MethodWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/MethodWriterTests.cs index 1507aea6f..b836f6e1b 100644 --- a/tests/Xamarin.SourceWriter-Tests/MethodWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/MethodWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class MethodWriterTests + internal sealed class MethodWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/PropertyWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/PropertyWriterTests.cs index 5d2acf406..cf3addcd2 100644 --- a/tests/Xamarin.SourceWriter-Tests/PropertyWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/PropertyWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class PropertyWriterTests + internal sealed class PropertyWriterTests { [Test] public void Basics () diff --git a/tests/Xamarin.SourceWriter-Tests/TypeReferenceWriterTests.cs b/tests/Xamarin.SourceWriter-Tests/TypeReferenceWriterTests.cs index 548c9e042..0cfd8aaec 100644 --- a/tests/Xamarin.SourceWriter-Tests/TypeReferenceWriterTests.cs +++ b/tests/Xamarin.SourceWriter-Tests/TypeReferenceWriterTests.cs @@ -7,7 +7,7 @@ namespace Xamarin.SourceWriter.Tests { [TestFixture] - public class TypeReferenceWriterTests + internal sealed class TypeReferenceWriterTests { [Test] public void Constructor () diff --git a/tests/generator-Tests/Integration-Tests/AccessModifiers.cs b/tests/generator-Tests/Integration-Tests/AccessModifiers.cs index 1f0f8fb33..4109a255e 100644 --- a/tests/generator-Tests/Integration-Tests/AccessModifiers.cs +++ b/tests/generator-Tests/Integration-Tests/AccessModifiers.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class AccessModifiers : BaseGeneratorTest + internal sealed class AccessModifiers : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Adapters.cs b/tests/generator-Tests/Integration-Tests/Adapters.cs index d10be6e40..c7db15f30 100644 --- a/tests/generator-Tests/Integration-Tests/Adapters.cs +++ b/tests/generator-Tests/Integration-Tests/Adapters.cs @@ -4,10 +4,12 @@ namespace generatortests { [TestFixture] - public class Adapters : BaseGeneratorTest + internal sealed class Adapters : BaseGeneratorTest { protected override bool TryJavaInterop1 => true; + private static readonly string [] additionalSupportPaths = new []{ "expected.ji/Adapters/SupportFiles" }; + [Test] public void GeneratedOK () { @@ -15,7 +17,7 @@ public void GeneratedOK () outputRelativePath: "Adapters", apiDescriptionFile: "expected.ji/Adapters/Adapters.xml", expectedRelativePath: "Adapters", - additionalSupportPaths: new[]{ "expected.ji/Adapters/SupportFiles" }); + additionalSupportPaths: additionalSupportPaths); } } } diff --git a/tests/generator-Tests/Integration-Tests/Android_Graphics_Color.cs b/tests/generator-Tests/Integration-Tests/Android_Graphics_Color.cs index b3645bb9b..dd38dfa81 100644 --- a/tests/generator-Tests/Integration-Tests/Android_Graphics_Color.cs +++ b/tests/generator-Tests/Integration-Tests/Android_Graphics_Color.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Android_Graphics_Color : BaseGeneratorTest + internal sealed class Android_Graphics_Color : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Arrays.cs b/tests/generator-Tests/Integration-Tests/Arrays.cs index 651c03397..c5678a7bc 100644 --- a/tests/generator-Tests/Integration-Tests/Arrays.cs +++ b/tests/generator-Tests/Integration-Tests/Arrays.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Arrays : BaseGeneratorTest + internal sealed class Arrays : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/BaseGeneratorTest.cs b/tests/generator-Tests/Integration-Tests/BaseGeneratorTest.cs index e399831d1..490cf6157 100644 --- a/tests/generator-Tests/Integration-Tests/BaseGeneratorTest.cs +++ b/tests/generator-Tests/Integration-Tests/BaseGeneratorTest.cs @@ -9,7 +9,7 @@ namespace generatortests { - public class BaseGeneratorTest + internal class BaseGeneratorTest { StringWriter sw = null; diff --git a/tests/generator-Tests/Integration-Tests/CSharpKeywords.cs b/tests/generator-Tests/Integration-Tests/CSharpKeywords.cs index ab7333b54..b567fd225 100644 --- a/tests/generator-Tests/Integration-Tests/CSharpKeywords.cs +++ b/tests/generator-Tests/Integration-Tests/CSharpKeywords.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class CSharpKeywords : BaseGeneratorTest + internal sealed class CSharpKeywords : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Compiler.cs b/tests/generator-Tests/Integration-Tests/Compiler.cs index d227479ea..c1513ed99 100644 --- a/tests/generator-Tests/Integration-Tests/Compiler.cs +++ b/tests/generator-Tests/Integration-Tests/Compiler.cs @@ -12,7 +12,7 @@ namespace generatortests { - public static class Compiler + internal static class Compiler { private static string supportFilePath = typeof (Compiler).Assembly.Location; private static string unitTestFrameworkAssemblyPath = typeof (Assert).Assembly.Location; diff --git a/tests/generator-Tests/Integration-Tests/Constructors.cs b/tests/generator-Tests/Integration-Tests/Constructors.cs index 4882f4720..d48b33e02 100644 --- a/tests/generator-Tests/Integration-Tests/Constructors.cs +++ b/tests/generator-Tests/Integration-Tests/Constructors.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Constructors : BaseGeneratorTest + internal sealed class Constructors : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Core_ClassParse.cs b/tests/generator-Tests/Integration-Tests/Core_ClassParse.cs index 8954c5649..e3c1ef7cf 100644 --- a/tests/generator-Tests/Integration-Tests/Core_ClassParse.cs +++ b/tests/generator-Tests/Integration-Tests/Core_ClassParse.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Core_ClassParse : BaseGeneratorTest + internal sealed class Core_ClassParse : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Core_Jar2Xml.cs b/tests/generator-Tests/Integration-Tests/Core_Jar2Xml.cs index 3ec77c2e6..8dc980b07 100644 --- a/tests/generator-Tests/Integration-Tests/Core_Jar2Xml.cs +++ b/tests/generator-Tests/Integration-Tests/Core_Jar2Xml.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Core_Jar2Xml : BaseGeneratorTest + internal sealed class Core_Jar2Xml : BaseGeneratorTest { protected override bool TryJavaInterop1 => false; diff --git a/tests/generator-Tests/Integration-Tests/GenericArguments.cs b/tests/generator-Tests/Integration-Tests/GenericArguments.cs index de97f10bf..28e8ec31d 100644 --- a/tests/generator-Tests/Integration-Tests/GenericArguments.cs +++ b/tests/generator-Tests/Integration-Tests/GenericArguments.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class GenericArguments : BaseGeneratorTest + internal sealed class GenericArguments : BaseGeneratorTest { protected override bool TryJavaInterop1 => false; diff --git a/tests/generator-Tests/Integration-Tests/InterfaceMethodsConflict.cs b/tests/generator-Tests/Integration-Tests/InterfaceMethodsConflict.cs index c5dda3916..fa4e42034 100644 --- a/tests/generator-Tests/Integration-Tests/InterfaceMethodsConflict.cs +++ b/tests/generator-Tests/Integration-Tests/InterfaceMethodsConflict.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class InterfaceMethodsConflict : BaseGeneratorTest + internal sealed class InterfaceMethodsConflict : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Interfaces.cs b/tests/generator-Tests/Integration-Tests/Interfaces.cs index 82575d755..993a13010 100644 --- a/tests/generator-Tests/Integration-Tests/Interfaces.cs +++ b/tests/generator-Tests/Integration-Tests/Interfaces.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Interfaces : BaseGeneratorTest + internal sealed class Interfaces : BaseGeneratorTest { public Interfaces () { diff --git a/tests/generator-Tests/Integration-Tests/Java_Lang_Enum.cs b/tests/generator-Tests/Integration-Tests/Java_Lang_Enum.cs index eb9451042..fc1c7c794 100644 --- a/tests/generator-Tests/Integration-Tests/Java_Lang_Enum.cs +++ b/tests/generator-Tests/Integration-Tests/Java_Lang_Enum.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Java_Lang_Enum : BaseGeneratorTest + internal sealed class Java_Lang_Enum : BaseGeneratorTest { protected override bool TryJavaInterop1 => true; diff --git a/tests/generator-Tests/Integration-Tests/Java_Lang_Object.cs b/tests/generator-Tests/Integration-Tests/Java_Lang_Object.cs index 7aeff7b15..0308a0afe 100644 --- a/tests/generator-Tests/Integration-Tests/Java_Lang_Object.cs +++ b/tests/generator-Tests/Integration-Tests/Java_Lang_Object.cs @@ -7,7 +7,7 @@ namespace generatortests { [TestFixture] - public class Java_Lang_Object : BaseGeneratorTest + internal sealed class Java_Lang_Object : BaseGeneratorTest { [Test] public void Generated_OK () diff --git a/tests/generator-Tests/Integration-Tests/Java_Util_List.cs b/tests/generator-Tests/Integration-Tests/Java_Util_List.cs index 19da2f51e..36e321d3b 100644 --- a/tests/generator-Tests/Integration-Tests/Java_Util_List.cs +++ b/tests/generator-Tests/Integration-Tests/Java_Util_List.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class Java_Util_List : BaseGeneratorTest + internal sealed class Java_Util_List : BaseGeneratorTest { protected override bool TryJavaInterop1 => true; diff --git a/tests/generator-Tests/Integration-Tests/NestedTypes.cs b/tests/generator-Tests/Integration-Tests/NestedTypes.cs index 54085667a..8d0f0e805 100644 --- a/tests/generator-Tests/Integration-Tests/NestedTypes.cs +++ b/tests/generator-Tests/Integration-Tests/NestedTypes.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class NestedTypes : BaseGeneratorTest + internal sealed class NestedTypes : BaseGeneratorTest { protected override bool TryJavaInterop1 => true; diff --git a/tests/generator-Tests/Integration-Tests/NonStaticFields.cs b/tests/generator-Tests/Integration-Tests/NonStaticFields.cs index bd56d4d4c..e9f8ea888 100644 --- a/tests/generator-Tests/Integration-Tests/NonStaticFields.cs +++ b/tests/generator-Tests/Integration-Tests/NonStaticFields.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class NonStaticFields : BaseGeneratorTest + internal sealed class NonStaticFields : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/NormalMethods.cs b/tests/generator-Tests/Integration-Tests/NormalMethods.cs index a30350685..048193d9c 100644 --- a/tests/generator-Tests/Integration-Tests/NormalMethods.cs +++ b/tests/generator-Tests/Integration-Tests/NormalMethods.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class NormalMethods : BaseGeneratorTest + internal sealed class NormalMethods : BaseGeneratorTest { protected override bool TryJavaInterop1 => false; diff --git a/tests/generator-Tests/Integration-Tests/NormalProperties.cs b/tests/generator-Tests/Integration-Tests/NormalProperties.cs index 97e973b3f..1d5efa652 100644 --- a/tests/generator-Tests/Integration-Tests/NormalProperties.cs +++ b/tests/generator-Tests/Integration-Tests/NormalProperties.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class NormalProperties : BaseGeneratorTest + internal sealed class NormalProperties : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/PamareterXPath.cs b/tests/generator-Tests/Integration-Tests/PamareterXPath.cs index 229af5e6e..6632a1f6e 100644 --- a/tests/generator-Tests/Integration-Tests/PamareterXPath.cs +++ b/tests/generator-Tests/Integration-Tests/PamareterXPath.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class ParameterXPath : BaseGeneratorTest + internal sealed class ParameterXPath : BaseGeneratorTest { protected override bool TryJavaInterop1 => true; diff --git a/tests/generator-Tests/Integration-Tests/StaticFields.cs b/tests/generator-Tests/Integration-Tests/StaticFields.cs index ecb22dac6..767a8cd84 100644 --- a/tests/generator-Tests/Integration-Tests/StaticFields.cs +++ b/tests/generator-Tests/Integration-Tests/StaticFields.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class StaticFields : BaseGeneratorTest + internal sealed class StaticFields : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/StaticMethods.cs b/tests/generator-Tests/Integration-Tests/StaticMethods.cs index cb33ce955..083dbbc34 100644 --- a/tests/generator-Tests/Integration-Tests/StaticMethods.cs +++ b/tests/generator-Tests/Integration-Tests/StaticMethods.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class StaticMethods : BaseGeneratorTest + internal sealed class StaticMethods : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/StaticProperties.cs b/tests/generator-Tests/Integration-Tests/StaticProperties.cs index 0e25b3fe4..750ac7ba6 100644 --- a/tests/generator-Tests/Integration-Tests/StaticProperties.cs +++ b/tests/generator-Tests/Integration-Tests/StaticProperties.cs @@ -4,7 +4,7 @@ namespace generatortests { [TestFixture] - public class StaticProperties : BaseGeneratorTest + internal sealed class StaticProperties : BaseGeneratorTest { [Test] public void GeneratedOK () diff --git a/tests/generator-Tests/Integration-Tests/Streams.cs b/tests/generator-Tests/Integration-Tests/Streams.cs index e27cfc3d6..baff01612 100644 --- a/tests/generator-Tests/Integration-Tests/Streams.cs +++ b/tests/generator-Tests/Integration-Tests/Streams.cs @@ -4,8 +4,10 @@ namespace generatortests { [TestFixture] - public class Streams : BaseGeneratorTest + internal sealed class Streams : BaseGeneratorTest { + private static readonly string [] additionalSupportPaths = new []{ "expected.ji/Streams/SupportFiles" }; + [Test] public void GeneratedOK () { @@ -13,7 +15,7 @@ public void GeneratedOK () outputRelativePath: "Streams", apiDescriptionFile: "expected.ji/Streams/Streams.xml", expectedRelativePath: "Streams", - additionalSupportPaths: new[]{ "expected.ji/Streams/SupportFiles" }); + additionalSupportPaths: additionalSupportPaths); } } } diff --git a/tests/generator-Tests/SupportFiles/RegisterAttribute.cs b/tests/generator-Tests/SupportFiles/RegisterAttribute.cs index 2da73db47..39d60a422 100644 --- a/tests/generator-Tests/SupportFiles/RegisterAttribute.cs +++ b/tests/generator-Tests/SupportFiles/RegisterAttribute.cs @@ -5,7 +5,7 @@ namespace Android.Runtime { [AttributeUsage (AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Property)] - public sealed class RegisterAttribute : Attribute { + internal sealed class RegisterAttribute : Attribute { public RegisterAttribute (string name) { diff --git a/tests/generator-Tests/Unit-Tests/AdjusterTests.cs b/tests/generator-Tests/Unit-Tests/AdjusterTests.cs index e6f68a741..b9e32b004 100644 --- a/tests/generator-Tests/Unit-Tests/AdjusterTests.cs +++ b/tests/generator-Tests/Unit-Tests/AdjusterTests.cs @@ -12,7 +12,7 @@ namespace generatortests //For now this is a basic smoke test to validate the `generator --only-xml-adjuster` option // In the future, it should be expanded to fully test the Adjuster class [TestFixture] - public class AdjusterTests + internal sealed class AdjusterTests { Adjuster adjuster; CodeGenerationOptions options; diff --git a/tests/generator-Tests/Unit-Tests/BlittableTypeTests.cs b/tests/generator-Tests/Unit-Tests/BlittableTypeTests.cs index 11b49c10d..4f4bc0068 100644 --- a/tests/generator-Tests/Unit-Tests/BlittableTypeTests.cs +++ b/tests/generator-Tests/Unit-Tests/BlittableTypeTests.cs @@ -6,7 +6,7 @@ namespace generatortests; [TestFixture] -class BlittableTypeTests : CodeGeneratorTestBase +sealed class BlittableTypeTests : CodeGeneratorTestBase { protected override CodeGenerationTarget Target => CodeGenerationTarget.XAJavaInterop1; diff --git a/tests/generator-Tests/Unit-Tests/CodeGenerationOptionsTests.cs b/tests/generator-Tests/Unit-Tests/CodeGenerationOptionsTests.cs index 5ab2aceb4..3d3fa2ee9 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGenerationOptionsTests.cs +++ b/tests/generator-Tests/Unit-Tests/CodeGenerationOptionsTests.cs @@ -6,7 +6,7 @@ namespace generatortests { [TestFixture] - public class CodeGenerationOptionsTests + internal sealed class CodeGenerationOptionsTests { [Test] public void GetOutputNameUseGlobal () diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorContextTests.cs b/tests/generator-Tests/Unit-Tests/CodeGeneratorContextTests.cs index c0501a3bc..81d0d31dd 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorContextTests.cs +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorContextTests.cs @@ -6,7 +6,7 @@ namespace generatortests { [TestFixture] - public class CodeGeneratorContextTests + internal sealed class CodeGeneratorContextTests { [Test] public void GetContextTypeMember () diff --git a/tests/generator-Tests/Unit-Tests/CodeGeneratorTests.cs b/tests/generator-Tests/Unit-Tests/CodeGeneratorTests.cs index bc7adf68e..0e9e6fcc0 100644 --- a/tests/generator-Tests/Unit-Tests/CodeGeneratorTests.cs +++ b/tests/generator-Tests/Unit-Tests/CodeGeneratorTests.cs @@ -1245,14 +1245,14 @@ static string StripRegisterAttributes (string str) int index; while ((index = str.IndexOf ("[Register", StringComparison.Ordinal)) > -1) - str = str.Substring (0, index) + str.Substring (str.IndexOf (']', index) + 1); + str = string.Concat (str.AsSpan (0, index), str.AsSpan (str.IndexOf (']', index) + 1)); return str; } } [TestFixture] - class JavaInteropCodeGeneratorTests : AnyJavaInteropCodeGeneratorTests + sealed class JavaInteropCodeGeneratorTests : AnyJavaInteropCodeGeneratorTests { protected override CodeGenerationTarget Target => CodeGenerationTarget.JavaInterop1; protected override string CommonDirectoryOverride => "JavaInterop1"; @@ -1324,7 +1324,7 @@ public void StringPropertyOverride ([Values("true", "false")] string final) } [TestFixture] - class XAJavaInteropCodeGeneratorTests : AnyJavaInteropCodeGeneratorTests + sealed class XAJavaInteropCodeGeneratorTests : AnyJavaInteropCodeGeneratorTests { protected override CodeGenerationTarget Target => CodeGenerationTarget.XAJavaInterop1; diff --git a/tests/generator-Tests/Unit-Tests/DefaultInterfaceMethodsTests.cs b/tests/generator-Tests/Unit-Tests/DefaultInterfaceMethodsTests.cs index 7269620a0..d028d1573 100644 --- a/tests/generator-Tests/Unit-Tests/DefaultInterfaceMethodsTests.cs +++ b/tests/generator-Tests/Unit-Tests/DefaultInterfaceMethodsTests.cs @@ -15,7 +15,7 @@ class JavaInteropDefaultInterfaceMethodsTests : DefaultInterfaceMethodsTests #endif // TODO_JAVA_INTEROP1 [TestFixture] - class XAJavaInteropDefaultInterfaceMethodsTests : DefaultInterfaceMethodsTests + sealed class XAJavaInteropDefaultInterfaceMethodsTests : DefaultInterfaceMethodsTests { protected override CodeGenerationTarget Target => CodeGenerationTarget.XAJavaInterop1; } diff --git a/tests/generator-Tests/Unit-Tests/EnumGeneratorTests.cs b/tests/generator-Tests/Unit-Tests/EnumGeneratorTests.cs index f000b1497..99fc9575f 100644 --- a/tests/generator-Tests/Unit-Tests/EnumGeneratorTests.cs +++ b/tests/generator-Tests/Unit-Tests/EnumGeneratorTests.cs @@ -14,7 +14,7 @@ namespace generatortests { [TestFixture] - class EnumGeneratorTests : CodeGeneratorTestBase + sealed class EnumGeneratorTests : CodeGeneratorTestBase { protected new EnumGenerator generator; diff --git a/tests/generator-Tests/Unit-Tests/EnumMappingsTests.cs b/tests/generator-Tests/Unit-Tests/EnumMappingsTests.cs index b8adbb59f..4464fd615 100644 --- a/tests/generator-Tests/Unit-Tests/EnumMappingsTests.cs +++ b/tests/generator-Tests/Unit-Tests/EnumMappingsTests.cs @@ -13,7 +13,7 @@ namespace generatortests { [TestFixture] - public class EnumMappingsTests + internal sealed class EnumMappingsTests { [Test] public void BasicEnumificationTest () @@ -85,6 +85,8 @@ public void FlagsEnumerationTest () Assert.AreEqual (true, enums.Single ().Value.BitField); } + private static readonly string [] enumFlags = new [] { "Org.XmlPull.V1.XmlPullParserNode" }; + [Test] public void ExternalFlagsEnumerationTest () { @@ -94,7 +96,7 @@ public void ExternalFlagsEnumerationTest () var sr = new StringReader (csv); var removes = new List> (); - var enums = mappings.ParseFieldMappings (sr, new [] { "Org.XmlPull.V1.XmlPullParserNode" }, new AndroidSdkVersion (30), removes); + var enums = mappings.ParseFieldMappings (sr, enumFlags, new AndroidSdkVersion (30), removes); Assert.AreEqual (true, enums.Single ().Value.BitField); } @@ -248,7 +250,7 @@ public void ExternalFlagsEnumerationV2Test () var sr = new StringReader (csv); var removes = new List> (); - var enums = mappings.ParseFieldMappings (sr, new [] { "Org.XmlPull.V1.XmlPullParserNode" }, new AndroidSdkVersion (30), removes); + var enums = mappings.ParseFieldMappings (sr, enumFlags, new AndroidSdkVersion (30), removes); Assert.AreEqual (true, enums.Single ().Value.BitField); } diff --git a/tests/generator-Tests/Unit-Tests/FixupXmlDocumentTests.cs b/tests/generator-Tests/Unit-Tests/FixupXmlDocumentTests.cs index 728b3c2cd..e4d62e67d 100644 --- a/tests/generator-Tests/Unit-Tests/FixupXmlDocumentTests.cs +++ b/tests/generator-Tests/Unit-Tests/FixupXmlDocumentTests.cs @@ -6,7 +6,7 @@ namespace generatortests { [TestFixture] - public class FixupXmlDocumentTests + internal sealed class FixupXmlDocumentTests { [Test] public void RemoveNode () diff --git a/tests/generator-Tests/Unit-Tests/GenBaseTests.cs b/tests/generator-Tests/Unit-Tests/GenBaseTests.cs index 02e494b4f..5b78a1323 100644 --- a/tests/generator-Tests/Unit-Tests/GenBaseTests.cs +++ b/tests/generator-Tests/Unit-Tests/GenBaseTests.cs @@ -9,7 +9,7 @@ namespace generatortests { [TestFixture] - public class GenBaseTests + internal sealed class GenBaseTests { CodeGenerationOptions options = new CodeGenerationOptions (); diff --git a/tests/generator-Tests/Unit-Tests/InterfaceConstantsTests.cs b/tests/generator-Tests/Unit-Tests/InterfaceConstantsTests.cs index 0b3124b31..81131c2d7 100644 --- a/tests/generator-Tests/Unit-Tests/InterfaceConstantsTests.cs +++ b/tests/generator-Tests/Unit-Tests/InterfaceConstantsTests.cs @@ -5,7 +5,7 @@ namespace generatortests { [TestFixture] - class XAJavaInteropInterfaceConstantsTests : InterfaceConstantsTests + sealed class XAJavaInteropInterfaceConstantsTests : InterfaceConstantsTests { protected override Xamarin.Android.Binder.CodeGenerationTarget Target => Xamarin.Android.Binder.CodeGenerationTarget.XAJavaInterop1; } diff --git a/tests/generator-Tests/Unit-Tests/InterfaceTests.cs b/tests/generator-Tests/Unit-Tests/InterfaceTests.cs index d619910fd..bffa4dd93 100644 --- a/tests/generator-Tests/Unit-Tests/InterfaceTests.cs +++ b/tests/generator-Tests/Unit-Tests/InterfaceTests.cs @@ -5,7 +5,7 @@ namespace generatortests { - public class InterfaceTests + internal sealed class InterfaceTests { [Test] public void ValidateInterfaceMethods () diff --git a/tests/generator-Tests/Unit-Tests/KotlinFixupsTests.cs b/tests/generator-Tests/Unit-Tests/KotlinFixupsTests.cs index 326fd7ab7..488349b5b 100644 --- a/tests/generator-Tests/Unit-Tests/KotlinFixupsTests.cs +++ b/tests/generator-Tests/Unit-Tests/KotlinFixupsTests.cs @@ -11,7 +11,7 @@ namespace generatortests { [TestFixture] - public class KotlinFixupsTests + internal sealed class KotlinFixupsTests { [Test] public void CreateMethod_EnsureKotlinImplFix () @@ -89,6 +89,8 @@ public void NonCollidingHashSiblings_AreBothKept () Assert.IsTrue (klass.Methods.All (m => m.Name == "Add")); } + private static readonly string [] expected = new [] { "long", "float" }; + [Test] public void MixedCollidingAndUniqueHashSiblings () { @@ -113,7 +115,7 @@ public void MixedCollidingAndUniqueHashSiblings () Assert.AreEqual (2, klass.Methods.Count); Assert.IsTrue (klass.Methods.All (m => m.Name == "Add")); - CollectionAssert.AreEquivalent (new [] { "long", "float" }, klass.Methods.Select (m => m.Parameters [0].RawNativeType).ToArray ()); + CollectionAssert.AreEquivalent (expected, klass.Methods.Select (m => m.Parameters [0].RawNativeType).ToArray ()); } [Test, NonParallelizable] diff --git a/tests/generator-Tests/Unit-Tests/ManagedExtensionsTests.cs b/tests/generator-Tests/Unit-Tests/ManagedExtensionsTests.cs index 562afb84a..d0292a052 100644 --- a/tests/generator-Tests/Unit-Tests/ManagedExtensionsTests.cs +++ b/tests/generator-Tests/Unit-Tests/ManagedExtensionsTests.cs @@ -9,7 +9,7 @@ namespace generatortests { [TestFixture] - public class ManagedExtensionsTests + internal sealed class ManagedExtensionsTests { [Test] public void StripArity () diff --git a/tests/generator-Tests/Unit-Tests/ManagedTests.cs b/tests/generator-Tests/Unit-Tests/ManagedTests.cs index 746e4709d..4ae197542 100644 --- a/tests/generator-Tests/Unit-Tests/ManagedTests.cs +++ b/tests/generator-Tests/Unit-Tests/ManagedTests.cs @@ -9,16 +9,16 @@ namespace Java.Lang { [Register ("java/lang/Object")] - public class Object { } + internal class Object { } [Register ("java/lang/String")] - public sealed class String : Object { } + internal sealed class String : Object { } } namespace Com.Mypackage { [Register ("com/mypackage/foo")] - public class Foo : Java.Lang.Object + internal sealed class Foo : Java.Lang.Object { [Register ("foo", "()V", "")] public Foo () { } @@ -40,21 +40,21 @@ public void UnknownTypes (object unknown) { } } [Register ("com/mypackage/service")] - public interface IService { } + internal interface IService { } [Register ("com/mypackage/FieldClass")] - public class FieldClass : Java.Lang.Object + internal sealed class FieldClass : Java.Lang.Object { public NestedFieldClass field; - public class NestedFieldClass : Java.Lang.Object { } + internal sealed class NestedFieldClass : Java.Lang.Object { } } } namespace GenericTestClasses { - public class MyCollection : List + internal sealed class MyCollection : List { [Register ("mycollection", "()V", "")] public MyCollection (List p0, List p1) @@ -76,7 +76,7 @@ public Dictionary> DoStuff (IEnumerable", "(Ljava/lang/String;Ljava/lang/String;)", "")] public NullableClass (string notnull, string? nullable) @@ -98,7 +98,7 @@ public NullableClass (string notnull, string? nullable) namespace generatortests { [TestFixture] - public class ManagedTests + internal sealed class ManagedTests { string tempFile; ModuleDefinition module; diff --git a/tests/generator-Tests/Unit-Tests/NRTJavaInteropCodeGeneratorTests.cs b/tests/generator-Tests/Unit-Tests/NRTJavaInteropCodeGeneratorTests.cs index d86486258..3d8e6abf8 100644 --- a/tests/generator-Tests/Unit-Tests/NRTJavaInteropCodeGeneratorTests.cs +++ b/tests/generator-Tests/Unit-Tests/NRTJavaInteropCodeGeneratorTests.cs @@ -5,7 +5,7 @@ namespace generatortests { [TestFixture] - class NRTJavaInteropCodeGeneratorTests : CodeGeneratorTests + sealed class NRTJavaInteropCodeGeneratorTests : CodeGeneratorTests { protected override CodeGenerationTarget Target => CodeGenerationTarget.XAJavaInterop1; diff --git a/tests/generator-Tests/Unit-Tests/ReportTests.cs b/tests/generator-Tests/Unit-Tests/ReportTests.cs index 65a73e3ad..8957227a3 100644 --- a/tests/generator-Tests/Unit-Tests/ReportTests.cs +++ b/tests/generator-Tests/Unit-Tests/ReportTests.cs @@ -9,7 +9,7 @@ namespace generatortests { - public class ReportTests + internal sealed class ReportTests { [Test] public void FormatTests () diff --git a/tests/generator-Tests/Unit-Tests/SealedProtectedFixupsTests.cs b/tests/generator-Tests/Unit-Tests/SealedProtectedFixupsTests.cs index 5b9897d0c..5c018c3b5 100644 --- a/tests/generator-Tests/Unit-Tests/SealedProtectedFixupsTests.cs +++ b/tests/generator-Tests/Unit-Tests/SealedProtectedFixupsTests.cs @@ -8,7 +8,7 @@ namespace generatortests { [TestFixture] - public class SealedProtectedFixupsTests + internal sealed class SealedProtectedFixupsTests { private CodeGenerationOptions options = new CodeGenerationOptions (); diff --git a/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExplicitInterfaceImplementationTests.cs b/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExplicitInterfaceImplementationTests.cs index 9bb1d05f6..d47213fe2 100644 --- a/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExplicitInterfaceImplementationTests.cs +++ b/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExplicitInterfaceImplementationTests.cs @@ -6,7 +6,7 @@ namespace generatortests.SourceWriters { [TestFixture] - public class MethodExplicitInterfaceImplementationTests : SourceWritersTestBase + internal sealed class MethodExplicitInterfaceImplementationTests : SourceWritersTestBase { [Test] public void MethodExplicitInterfaceImplementation () diff --git a/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExtensionAsyncWrapperTests.cs b/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExtensionAsyncWrapperTests.cs index ab3f4f616..7c0c3f148 100644 --- a/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExtensionAsyncWrapperTests.cs +++ b/tests/generator-Tests/Unit-Tests/SourceWriters/MethodExtensionAsyncWrapperTests.cs @@ -6,7 +6,7 @@ namespace generatortests.SourceWriters { [TestFixture] - public class MethodExtensionAsyncWrapperTests : SourceWritersTestBase + internal sealed class MethodExtensionAsyncWrapperTests : SourceWritersTestBase { [Test] public void MethodExtensionAsyncWrapper () diff --git a/tests/generator-Tests/Unit-Tests/SourceWriters/PeerMembersFieldTests.cs b/tests/generator-Tests/Unit-Tests/SourceWriters/PeerMembersFieldTests.cs index 947ae59be..a5fa40b80 100644 --- a/tests/generator-Tests/Unit-Tests/SourceWriters/PeerMembersFieldTests.cs +++ b/tests/generator-Tests/Unit-Tests/SourceWriters/PeerMembersFieldTests.cs @@ -6,7 +6,7 @@ namespace generatortests.SourceWriters { [TestFixture] - public class PeerMembersFieldTests : SourceWritersTestBase + internal sealed class PeerMembersFieldTests : SourceWritersTestBase { [Test] public void PeerMembersField_Class () diff --git a/tests/generator-Tests/Unit-Tests/SourceWriters/SourceWritersTestBase.cs b/tests/generator-Tests/Unit-Tests/SourceWriters/SourceWritersTestBase.cs index edffa935a..9458f8c8f 100644 --- a/tests/generator-Tests/Unit-Tests/SourceWriters/SourceWritersTestBase.cs +++ b/tests/generator-Tests/Unit-Tests/SourceWriters/SourceWritersTestBase.cs @@ -6,7 +6,7 @@ namespace generatortests.SourceWriters { [TestFixture] - public class SourceWritersTestBase + internal class SourceWritersTestBase { protected string GetOutput (ISourceWriter writer) { diff --git a/tests/generator-Tests/Unit-Tests/SourceWriters/WeakImplementorFieldTests.cs b/tests/generator-Tests/Unit-Tests/SourceWriters/WeakImplementorFieldTests.cs index c5aa53c7a..c4983bba6 100644 --- a/tests/generator-Tests/Unit-Tests/SourceWriters/WeakImplementorFieldTests.cs +++ b/tests/generator-Tests/Unit-Tests/SourceWriters/WeakImplementorFieldTests.cs @@ -5,7 +5,7 @@ namespace generatortests.SourceWriters { [TestFixture] - public class WeakImplementorFieldTests : SourceWritersTestBase + internal sealed class WeakImplementorFieldTests : SourceWritersTestBase { [Test] public void WeakImplementorField_Regular () diff --git a/tests/generator-Tests/Unit-Tests/SupportTypes.cs b/tests/generator-Tests/Unit-Tests/SupportTypes.cs index 54fcf6b70..457fa54ab 100644 --- a/tests/generator-Tests/Unit-Tests/SupportTypes.cs +++ b/tests/generator-Tests/Unit-Tests/SupportTypes.cs @@ -3,7 +3,7 @@ namespace generatortests { - class TestClass : ClassGen + sealed class TestClass : ClassGen { public TestClass (string baseType, string javaName) : base (new TestBaseSupport (javaName)) { @@ -13,7 +13,7 @@ public TestClass (string baseType, string javaName) : base (new TestBaseSupport } } - class TestBaseSupport : GenBaseSupport + sealed class TestBaseSupport : GenBaseSupport { public TestBaseSupport (string javaName) { @@ -29,7 +29,7 @@ public TestBaseSupport (string javaName) } } - class TestField : Field + sealed class TestField : Field { public TestField (string type, string name) { @@ -85,7 +85,7 @@ public TestField SetValue (string value) } } - class TestMethod : Method + sealed class TestMethod : Method { public TestMethod (GenBase @class, string name, string @return = "void") : base (@class) { @@ -167,7 +167,7 @@ public TestMethod SetDefaultInterfaceMethod () } } - class TestCtor : Ctor + sealed class TestCtor : Ctor { public TestCtor (GenBase @class, string name) : base (@class) { @@ -205,7 +205,7 @@ public TestCtor SetVisibility (string value) } } - class TestInterface : InterfaceGen + sealed class TestInterface : InterfaceGen { public TestInterface (string argsType, string javaName) : base (new TestBaseSupport (javaName)) { diff --git a/tests/generator-Tests/Unit-Tests/SymbolTableTests.cs b/tests/generator-Tests/Unit-Tests/SymbolTableTests.cs index 13b7bb880..16a4d5355 100644 --- a/tests/generator-Tests/Unit-Tests/SymbolTableTests.cs +++ b/tests/generator-Tests/Unit-Tests/SymbolTableTests.cs @@ -7,7 +7,7 @@ namespace generatortests { [TestFixture] - public class SymbolTableTests + internal sealed class SymbolTableTests { [Test] public void FindGenericTypes () diff --git a/tests/generator-Tests/Unit-Tests/TypeNameUtilitiesTests.cs b/tests/generator-Tests/Unit-Tests/TypeNameUtilitiesTests.cs index 2eaddf859..e82232b4f 100644 --- a/tests/generator-Tests/Unit-Tests/TypeNameUtilitiesTests.cs +++ b/tests/generator-Tests/Unit-Tests/TypeNameUtilitiesTests.cs @@ -6,7 +6,7 @@ namespace generatortests { [TestFixture] - public class TypeNameUtilitiesTests + internal sealed class TypeNameUtilitiesTests { [Test] public void MangleName () diff --git a/tests/generator-Tests/Unit-Tests/XmlApiImporterTests.cs b/tests/generator-Tests/Unit-Tests/XmlApiImporterTests.cs index 472be69f4..dfc9a4be1 100644 --- a/tests/generator-Tests/Unit-Tests/XmlApiImporterTests.cs +++ b/tests/generator-Tests/Unit-Tests/XmlApiImporterTests.cs @@ -9,7 +9,7 @@ namespace generatortests { [TestFixture] - public class XmlApiImporterTests + internal sealed class XmlApiImporterTests { CodeGenerationOptions opt = new CodeGenerationOptions (); diff --git a/tests/generator-Tests/Unit-Tests/XmlTests.cs b/tests/generator-Tests/Unit-Tests/XmlTests.cs index 44a1b55dc..94d2efbe6 100644 --- a/tests/generator-Tests/Unit-Tests/XmlTests.cs +++ b/tests/generator-Tests/Unit-Tests/XmlTests.cs @@ -8,7 +8,7 @@ namespace generatortests { [TestFixture] - public class XmlTests + internal sealed class XmlTests { XDocument xml; XElement package; diff --git a/tests/invocation-overhead/jni.cs b/tests/invocation-overhead/jni.cs index 7f8a432bb..6b42ec84c 100644 --- a/tests/invocation-overhead/jni.cs +++ b/tests/invocation-overhead/jni.cs @@ -1174,10 +1174,9 @@ internal static unsafe int _ThrowNew (JniObjectReference type, string message) { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.ThrowNew (__info.EnvironmentPointer, type.Handle, message); return tmp; } @@ -1203,10 +1202,9 @@ public static unsafe void ExceptionClear () public static unsafe void FatalError (string message) { - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; __info.Invoker.FatalError (__info.EnvironmentPointer, message); } @@ -1224,12 +1222,10 @@ public static unsafe JniFieldInfo GetFieldID (JniObjectReference type, string na { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetFieldID (__info.EnvironmentPointer, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -1245,9 +1241,8 @@ public static unsafe JniObjectReference GetObjectField (JniObjectReference insta { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1261,9 +1256,8 @@ public static unsafe bool GetBooleanField (JniObjectReference instance, JniField { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1276,9 +1270,8 @@ public static unsafe sbyte GetByteField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1291,9 +1284,8 @@ public static unsafe char GetCharField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1306,9 +1298,8 @@ public static unsafe short GetShortField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1321,9 +1312,8 @@ public static unsafe int GetIntField (JniObjectReference instance, JniFieldInfo { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1336,9 +1326,8 @@ public static unsafe long GetLongField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1351,9 +1340,8 @@ public static unsafe float GetFloatField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1366,9 +1354,8 @@ public static unsafe double GetDoubleField (JniObjectReference instance, JniFiel { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1381,9 +1368,8 @@ public static unsafe void SetObjectField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1395,9 +1381,8 @@ public static unsafe void SetBooleanField (JniObjectReference instance, JniField { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1409,9 +1394,8 @@ public static unsafe void SetByteField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1423,9 +1407,8 @@ public static unsafe void SetCharField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1437,9 +1420,8 @@ public static unsafe void SetShortField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1451,9 +1433,8 @@ public static unsafe void SetIntField (JniObjectReference instance, JniFieldInfo { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1465,9 +1446,8 @@ public static unsafe void SetLongField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1479,9 +1459,8 @@ public static unsafe void SetFloatField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1493,9 +1472,8 @@ public static unsafe void SetDoubleField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -1510,12 +1488,10 @@ public static unsafe JniMethodInfo GetMethodID (JniObjectReference type, string { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetMethodID (__info.EnvironmentPointer, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -1531,9 +1507,8 @@ public static unsafe JniObjectReference CallObjectMethod (JniObjectReference ins { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1552,9 +1527,8 @@ public static unsafe JniObjectReference CallObjectMethod (JniObjectReference ins { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1573,9 +1547,8 @@ public static unsafe bool CallBooleanMethod (JniObjectReference instance, JniMet { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1593,9 +1566,8 @@ public static unsafe bool CallBooleanMethod (JniObjectReference instance, JniMet { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1613,9 +1585,8 @@ public static unsafe sbyte CallByteMethod (JniObjectReference instance, JniMetho { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1633,9 +1604,8 @@ public static unsafe sbyte CallByteMethod (JniObjectReference instance, JniMetho { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1653,9 +1623,8 @@ public static unsafe char CallCharMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1673,9 +1642,8 @@ public static unsafe char CallCharMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1693,9 +1661,8 @@ public static unsafe short CallShortMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1713,9 +1680,8 @@ public static unsafe short CallShortMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1733,9 +1699,8 @@ public static unsafe int CallIntMethod (JniObjectReference instance, JniMethodIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1753,9 +1718,8 @@ public static unsafe int CallIntMethod (JniObjectReference instance, JniMethodIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1773,9 +1737,8 @@ public static unsafe long CallLongMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1793,9 +1756,8 @@ public static unsafe long CallLongMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1813,9 +1775,8 @@ public static unsafe float CallFloatMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1833,9 +1794,8 @@ public static unsafe float CallFloatMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1853,9 +1813,8 @@ public static unsafe double CallDoubleMethod (JniObjectReference instance, JniMe { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1873,9 +1832,8 @@ public static unsafe double CallDoubleMethod (JniObjectReference instance, JniMe { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1893,9 +1851,8 @@ public static unsafe void CallVoidMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1912,9 +1869,8 @@ public static unsafe void CallVoidMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1933,9 +1889,8 @@ public static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectRef throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1956,9 +1911,8 @@ public static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectRef throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -1979,9 +1933,8 @@ public static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference instan throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2001,9 +1954,8 @@ public static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference instan throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2023,9 +1975,8 @@ public static unsafe sbyte CallNonvirtualByteMethod (JniObjectReference instance throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2045,9 +1996,8 @@ public static unsafe sbyte CallNonvirtualByteMethod (JniObjectReference instance throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2067,9 +2017,8 @@ public static unsafe char CallNonvirtualCharMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2089,9 +2038,8 @@ public static unsafe char CallNonvirtualCharMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2111,9 +2059,8 @@ public static unsafe short CallNonvirtualShortMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2133,9 +2080,8 @@ public static unsafe short CallNonvirtualShortMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2155,9 +2101,8 @@ public static unsafe int CallNonvirtualIntMethod (JniObjectReference instance, J throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2177,9 +2122,8 @@ public static unsafe int CallNonvirtualIntMethod (JniObjectReference instance, J throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2199,9 +2143,8 @@ public static unsafe long CallNonvirtualLongMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2221,9 +2164,8 @@ public static unsafe long CallNonvirtualLongMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2243,9 +2185,8 @@ public static unsafe float CallNonvirtualFloatMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2265,9 +2206,8 @@ public static unsafe float CallNonvirtualFloatMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2287,9 +2227,8 @@ public static unsafe double CallNonvirtualDoubleMethod (JniObjectReference insta throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2309,9 +2248,8 @@ public static unsafe double CallNonvirtualDoubleMethod (JniObjectReference insta throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2331,9 +2269,8 @@ public static unsafe void CallNonvirtualVoidMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2352,9 +2289,8 @@ public static unsafe void CallNonvirtualVoidMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2452,9 +2388,8 @@ internal static unsafe JniObjectReference _NewObject (JniObjectReference type, J { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2473,9 +2408,8 @@ internal static unsafe JniObjectReference _NewObject (JniObjectReference type, J { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2578,9 +2512,8 @@ public static unsafe JniObjectReference ToReflectedMethod (JniObjectReference ty { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -2599,9 +2532,8 @@ public static unsafe JniObjectReference ToReflectedField (JniObjectReference typ { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -2623,12 +2555,10 @@ public static unsafe JniFieldInfo GetStaticFieldID (JniObjectReference type, str { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetStaticFieldID (__info.EnvironmentPointer, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -2644,9 +2574,8 @@ public static unsafe JniObjectReference GetStaticObjectField (JniObjectReference { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2660,9 +2589,8 @@ public static unsafe bool GetStaticBooleanField (JniObjectReference type, JniFie { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2675,9 +2603,8 @@ public static unsafe sbyte GetStaticByteField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2690,9 +2617,8 @@ public static unsafe char GetStaticCharField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2705,9 +2631,8 @@ public static unsafe short GetStaticShortField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2720,9 +2645,8 @@ public static unsafe int GetStaticIntField (JniObjectReference type, JniFieldInf { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2735,9 +2659,8 @@ public static unsafe long GetStaticLongField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2750,9 +2673,8 @@ public static unsafe float GetStaticFloatField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2765,9 +2687,8 @@ public static unsafe double GetStaticDoubleField (JniObjectReference type, JniFi { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2780,9 +2701,8 @@ public static unsafe void SetStaticObjectField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2794,9 +2714,8 @@ public static unsafe void SetStaticBooleanField (JniObjectReference type, JniFie { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2808,9 +2727,8 @@ public static unsafe void SetStaticByteField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2822,9 +2740,8 @@ public static unsafe void SetStaticCharField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2836,9 +2753,8 @@ public static unsafe void SetStaticShortField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2850,9 +2766,8 @@ public static unsafe void SetStaticIntField (JniObjectReference type, JniFieldIn { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2864,9 +2779,8 @@ public static unsafe void SetStaticLongField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2878,9 +2792,8 @@ public static unsafe void SetStaticFloatField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2892,9 +2805,8 @@ public static unsafe void SetStaticDoubleField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -2909,12 +2821,10 @@ public static unsafe JniMethodInfo GetStaticMethodID (JniObjectReference type, s { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetStaticMethodID (__info.EnvironmentPointer, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -2930,9 +2840,8 @@ public static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReferen { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -2951,9 +2860,8 @@ public static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReferen { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -2972,9 +2880,8 @@ public static unsafe bool CallStaticBooleanMethod (JniObjectReference type, JniM { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -2992,9 +2899,8 @@ public static unsafe bool CallStaticBooleanMethod (JniObjectReference type, JniM { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3012,9 +2918,8 @@ public static unsafe sbyte CallStaticByteMethod (JniObjectReference type, JniMet { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3032,9 +2937,8 @@ public static unsafe sbyte CallStaticByteMethod (JniObjectReference type, JniMet { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3052,9 +2956,8 @@ public static unsafe char CallStaticCharMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3072,9 +2975,8 @@ public static unsafe char CallStaticCharMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3092,9 +2994,8 @@ public static unsafe short CallStaticShortMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3112,9 +3013,8 @@ public static unsafe short CallStaticShortMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3132,9 +3032,8 @@ public static unsafe int CallStaticIntMethod (JniObjectReference type, JniMethod { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3152,9 +3051,8 @@ public static unsafe int CallStaticIntMethod (JniObjectReference type, JniMethod { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3172,9 +3070,8 @@ public static unsafe long CallStaticLongMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3192,9 +3089,8 @@ public static unsafe long CallStaticLongMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3212,9 +3108,8 @@ public static unsafe float CallStaticFloatMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3232,9 +3127,8 @@ public static unsafe float CallStaticFloatMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3252,9 +3146,8 @@ public static unsafe double CallStaticDoubleMethod (JniObjectReference type, Jni { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3272,9 +3165,8 @@ public static unsafe double CallStaticDoubleMethod (JniObjectReference type, Jni { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3292,9 +3184,8 @@ public static unsafe void CallStaticVoidMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3311,9 +3202,8 @@ public static unsafe void CallStaticVoidMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -3376,9 +3266,8 @@ public static partial class Types { public static unsafe JniObjectReference DefineClass (string name, JniObjectReference loader, IntPtr buffer, int bufferLength) { - if (name == null) - throw new ArgumentNullException ("name"); - if (!loader.IsValid) + ArgumentNullException.ThrowIfNull (name); + if (!loader.IsValid) throw new ArgumentException ("Handle must be valid.", "loader"); if (buffer == IntPtr.Zero) throw new ArgumentException ("'buffer' must not be IntPtr.Zero.", "buffer"); @@ -3396,10 +3285,9 @@ public static unsafe JniObjectReference DefineClass (string name, JniObjectRefer internal static unsafe JniObjectReference _FindClass (string classname) { - if (classname == null) - throw new ArgumentNullException ("classname"); + ArgumentNullException.ThrowIfNull (classname); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.FindClass (__info.EnvironmentPointer, classname); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -3514,7 +3402,7 @@ public unsafe JniEnvironmentInvoker (JniNativeInterfaceStruct* p) public JniFunc_JNIEnvPtr_int GetVersion { get { if (_GetVersion == null) - _GetVersion = (JniFunc_JNIEnvPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetVersion, typeof (JniFunc_JNIEnvPtr_int)); + _GetVersion = Marshal.GetDelegateForFunctionPointer (env.GetVersion); return _GetVersion; } } @@ -3523,7 +3411,7 @@ public JniFunc_JNIEnvPtr_int GetVersion { public JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject DefineClass { get { if (_DefineClass == null) - _DefineClass = (JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.DefineClass, typeof (JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject)); + _DefineClass = Marshal.GetDelegateForFunctionPointer (env.DefineClass); return _DefineClass; } } @@ -3532,7 +3420,7 @@ public JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject DefineClass { public JniFunc_JNIEnvPtr_string_jobject FindClass { get { if (_FindClass == null) - _FindClass = (JniFunc_JNIEnvPtr_string_jobject) Marshal.GetDelegateForFunctionPointer (env.FindClass, typeof (JniFunc_JNIEnvPtr_string_jobject)); + _FindClass = Marshal.GetDelegateForFunctionPointer (env.FindClass); return _FindClass; } } @@ -3541,7 +3429,7 @@ public JniFunc_JNIEnvPtr_string_jobject FindClass { public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedMethod { get { if (_FromReflectedMethod == null) - _FromReflectedMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr)); + _FromReflectedMethod = Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod); return _FromReflectedMethod; } } @@ -3550,7 +3438,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedField { get { if (_FromReflectedField == null) - _FromReflectedField = (JniFunc_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.FromReflectedField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr)); + _FromReflectedField = Marshal.GetDelegateForFunctionPointer (env.FromReflectedField); return _FromReflectedField; } } @@ -3559,7 +3447,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedField { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedMethod { get { if (_ToReflectedMethod == null) - _ToReflectedMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject)); + _ToReflectedMethod = Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod); return _ToReflectedMethod; } } @@ -3568,7 +3456,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedMethod { public JniFunc_JNIEnvPtr_jobject_jobject GetSuperclass { get { if (_GetSuperclass == null) - _GetSuperclass = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.GetSuperclass, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _GetSuperclass = Marshal.GetDelegateForFunctionPointer (env.GetSuperclass); return _GetSuperclass; } } @@ -3577,7 +3465,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject GetSuperclass { public JniFunc_JNIEnvPtr_jobject_jobject_byte IsAssignableFrom { get { if (_IsAssignableFrom == null) - _IsAssignableFrom = (JniFunc_JNIEnvPtr_jobject_jobject_byte) Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom, typeof (JniFunc_JNIEnvPtr_jobject_jobject_byte)); + _IsAssignableFrom = Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom); return _IsAssignableFrom; } } @@ -3586,7 +3474,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_byte IsAssignableFrom { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedField { get { if (_ToReflectedField == null) - _ToReflectedField = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject)); + _ToReflectedField = Marshal.GetDelegateForFunctionPointer (env.ToReflectedField); return _ToReflectedField; } } @@ -3595,7 +3483,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedField { public JniFunc_JNIEnvPtr_jobject_int Throw { get { if (_Throw == null) - _Throw = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.Throw, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _Throw = Marshal.GetDelegateForFunctionPointer (env.Throw); return _Throw; } } @@ -3604,7 +3492,7 @@ public JniFunc_JNIEnvPtr_jobject_int Throw { public JniFunc_JNIEnvPtr_jobject_string_int ThrowNew { get { if (_ThrowNew == null) - _ThrowNew = (JniFunc_JNIEnvPtr_jobject_string_int) Marshal.GetDelegateForFunctionPointer (env.ThrowNew, typeof (JniFunc_JNIEnvPtr_jobject_string_int)); + _ThrowNew = Marshal.GetDelegateForFunctionPointer (env.ThrowNew); return _ThrowNew; } } @@ -3613,7 +3501,7 @@ public JniFunc_JNIEnvPtr_jobject_string_int ThrowNew { public JniFunc_JNIEnvPtr_jobject ExceptionOccurred { get { if (_ExceptionOccurred == null) - _ExceptionOccurred = (JniFunc_JNIEnvPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred, typeof (JniFunc_JNIEnvPtr_jobject)); + _ExceptionOccurred = Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred); return _ExceptionOccurred; } } @@ -3622,7 +3510,7 @@ public JniFunc_JNIEnvPtr_jobject ExceptionOccurred { public JniAction_JNIEnvPtr ExceptionDescribe { get { if (_ExceptionDescribe == null) - _ExceptionDescribe = (JniAction_JNIEnvPtr) Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe, typeof (JniAction_JNIEnvPtr)); + _ExceptionDescribe = Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe); return _ExceptionDescribe; } } @@ -3631,7 +3519,7 @@ public JniAction_JNIEnvPtr ExceptionDescribe { public JniAction_JNIEnvPtr ExceptionClear { get { if (_ExceptionClear == null) - _ExceptionClear = (JniAction_JNIEnvPtr) Marshal.GetDelegateForFunctionPointer (env.ExceptionClear, typeof (JniAction_JNIEnvPtr)); + _ExceptionClear = Marshal.GetDelegateForFunctionPointer (env.ExceptionClear); return _ExceptionClear; } } @@ -3640,7 +3528,7 @@ public JniAction_JNIEnvPtr ExceptionClear { public JniAction_JNIEnvPtr_string FatalError { get { if (_FatalError == null) - _FatalError = (JniAction_JNIEnvPtr_string) Marshal.GetDelegateForFunctionPointer (env.FatalError, typeof (JniAction_JNIEnvPtr_string)); + _FatalError = Marshal.GetDelegateForFunctionPointer (env.FatalError); return _FatalError; } } @@ -3649,7 +3537,7 @@ public JniAction_JNIEnvPtr_string FatalError { public JniFunc_JNIEnvPtr_int_int PushLocalFrame { get { if (_PushLocalFrame == null) - _PushLocalFrame = (JniFunc_JNIEnvPtr_int_int) Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame, typeof (JniFunc_JNIEnvPtr_int_int)); + _PushLocalFrame = Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame); return _PushLocalFrame; } } @@ -3658,7 +3546,7 @@ public JniFunc_JNIEnvPtr_int_int PushLocalFrame { public JniFunc_JNIEnvPtr_jobject_jobject PopLocalFrame { get { if (_PopLocalFrame == null) - _PopLocalFrame = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _PopLocalFrame = Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame); return _PopLocalFrame; } } @@ -3667,7 +3555,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject PopLocalFrame { public JniFunc_JNIEnvPtr_jobject_jobject NewGlobalRef { get { if (_NewGlobalRef == null) - _NewGlobalRef = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _NewGlobalRef = Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef); return _NewGlobalRef; } } @@ -3676,7 +3564,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject NewGlobalRef { public JniAction_JNIEnvPtr_IntPtr DeleteGlobalRef { get { if (_DeleteGlobalRef == null) - _DeleteGlobalRef = (JniAction_JNIEnvPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef, typeof (JniAction_JNIEnvPtr_IntPtr)); + _DeleteGlobalRef = Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef); return _DeleteGlobalRef; } } @@ -3685,7 +3573,7 @@ public JniAction_JNIEnvPtr_IntPtr DeleteGlobalRef { public JniAction_JNIEnvPtr_IntPtr DeleteLocalRef { get { if (_DeleteLocalRef == null) - _DeleteLocalRef = (JniAction_JNIEnvPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef, typeof (JniAction_JNIEnvPtr_IntPtr)); + _DeleteLocalRef = Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef); return _DeleteLocalRef; } } @@ -3694,7 +3582,7 @@ public JniAction_JNIEnvPtr_IntPtr DeleteLocalRef { public JniFunc_JNIEnvPtr_jobject_jobject_byte IsSameObject { get { if (_IsSameObject == null) - _IsSameObject = (JniFunc_JNIEnvPtr_jobject_jobject_byte) Marshal.GetDelegateForFunctionPointer (env.IsSameObject, typeof (JniFunc_JNIEnvPtr_jobject_jobject_byte)); + _IsSameObject = Marshal.GetDelegateForFunctionPointer (env.IsSameObject); return _IsSameObject; } } @@ -3703,7 +3591,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_byte IsSameObject { public JniFunc_JNIEnvPtr_jobject_jobject NewLocalRef { get { if (_NewLocalRef == null) - _NewLocalRef = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLocalRef, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _NewLocalRef = Marshal.GetDelegateForFunctionPointer (env.NewLocalRef); return _NewLocalRef; } } @@ -3712,7 +3600,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject NewLocalRef { public JniFunc_JNIEnvPtr_int_int EnsureLocalCapacity { get { if (_EnsureLocalCapacity == null) - _EnsureLocalCapacity = (JniFunc_JNIEnvPtr_int_int) Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity, typeof (JniFunc_JNIEnvPtr_int_int)); + _EnsureLocalCapacity = Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity); return _EnsureLocalCapacity; } } @@ -3721,7 +3609,7 @@ public JniFunc_JNIEnvPtr_int_int EnsureLocalCapacity { public JniFunc_JNIEnvPtr_jobject_jobject AllocObject { get { if (_AllocObject == null) - _AllocObject = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.AllocObject, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _AllocObject = Marshal.GetDelegateForFunctionPointer (env.AllocObject); return _AllocObject; } } @@ -3730,7 +3618,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject AllocObject { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject NewObject { get { if (_NewObject == null) - _NewObject = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObject, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _NewObject = Marshal.GetDelegateForFunctionPointer (env.NewObject); return _NewObject; } } @@ -3739,7 +3627,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject NewObject { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject NewObjectA { get { if (_NewObjectA == null) - _NewObjectA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _NewObjectA = Marshal.GetDelegateForFunctionPointer (env.NewObjectA); return _NewObjectA; } } @@ -3748,7 +3636,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject NewObjectA { public JniFunc_JNIEnvPtr_jobject_jobject GetObjectClass { get { if (_GetObjectClass == null) - _GetObjectClass = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectClass, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _GetObjectClass = Marshal.GetDelegateForFunctionPointer (env.GetObjectClass); return _GetObjectClass; } } @@ -3757,7 +3645,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject GetObjectClass { public JniFunc_JNIEnvPtr_jobject_jobject_byte IsInstanceOf { get { if (_IsInstanceOf == null) - _IsInstanceOf = (JniFunc_JNIEnvPtr_jobject_jobject_byte) Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf, typeof (JniFunc_JNIEnvPtr_jobject_jobject_byte)); + _IsInstanceOf = Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf); return _IsInstanceOf; } } @@ -3766,7 +3654,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_byte IsInstanceOf { public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetMethodID { get { if (_GetMethodID == null) - _GetMethodID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetMethodID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetMethodID = Marshal.GetDelegateForFunctionPointer (env.GetMethodID); return _GetMethodID; } } @@ -3775,7 +3663,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetMethodID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallObjectMethod { get { if (_CallObjectMethod == null) - _CallObjectMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _CallObjectMethod = Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod); return _CallObjectMethod; } } @@ -3784,7 +3672,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallObjectMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallObjectMethodA { get { if (_CallObjectMethodA == null) - _CallObjectMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _CallObjectMethodA = Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA); return _CallObjectMethodA; } } @@ -3793,7 +3681,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallObjectMe public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallBooleanMethod { get { if (_CallBooleanMethod == null) - _CallBooleanMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _CallBooleanMethod = Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod); return _CallBooleanMethod; } } @@ -3802,7 +3690,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallBooleanMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallBooleanMethodA { get { if (_CallBooleanMethodA == null) - _CallBooleanMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte)); + _CallBooleanMethodA = Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA); return _CallBooleanMethodA; } } @@ -3811,7 +3699,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallBooleanMeth public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallByteMethod { get { if (_CallByteMethod == null) - _CallByteMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallByteMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _CallByteMethod = Marshal.GetDelegateForFunctionPointer (env.CallByteMethod); return _CallByteMethod; } } @@ -3820,7 +3708,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallByteMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallByteMethodA { get { if (_CallByteMethodA == null) - _CallByteMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallByteMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte)); + _CallByteMethodA = Marshal.GetDelegateForFunctionPointer (env.CallByteMethodA); return _CallByteMethodA; } } @@ -3829,7 +3717,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallByteMethod public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallCharMethod { get { if (_CallCharMethod == null) - _CallCharMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _CallCharMethod = Marshal.GetDelegateForFunctionPointer (env.CallCharMethod); return _CallCharMethod; } } @@ -3838,7 +3726,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallCharMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallCharMethodA { get { if (_CallCharMethodA == null) - _CallCharMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char)); + _CallCharMethodA = Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA); return _CallCharMethodA; } } @@ -3847,7 +3735,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallCharMethodA public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallShortMethod { get { if (_CallShortMethod == null) - _CallShortMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _CallShortMethod = Marshal.GetDelegateForFunctionPointer (env.CallShortMethod); return _CallShortMethod; } } @@ -3856,7 +3744,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallShortMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallShortMethodA { get { if (_CallShortMethodA == null) - _CallShortMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short)); + _CallShortMethodA = Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA); return _CallShortMethodA; } } @@ -3865,7 +3753,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallShortMetho public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallIntMethod { get { if (_CallIntMethod == null) - _CallIntMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _CallIntMethod = Marshal.GetDelegateForFunctionPointer (env.CallIntMethod); return _CallIntMethod; } } @@ -3874,7 +3762,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallIntMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallIntMethodA { get { if (_CallIntMethodA == null) - _CallIntMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int)); + _CallIntMethodA = Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA); return _CallIntMethodA; } } @@ -3883,7 +3771,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallIntMethodA { public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallLongMethod { get { if (_CallLongMethod == null) - _CallLongMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _CallLongMethod = Marshal.GetDelegateForFunctionPointer (env.CallLongMethod); return _CallLongMethod; } } @@ -3892,7 +3780,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallLongMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallLongMethodA { get { if (_CallLongMethodA == null) - _CallLongMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long)); + _CallLongMethodA = Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA); return _CallLongMethodA; } } @@ -3901,7 +3789,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallLongMethodA public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallFloatMethod { get { if (_CallFloatMethod == null) - _CallFloatMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _CallFloatMethod = Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod); return _CallFloatMethod; } } @@ -3910,7 +3798,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallFloatMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallFloatMethodA { get { if (_CallFloatMethodA == null) - _CallFloatMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float)); + _CallFloatMethodA = Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA); return _CallFloatMethodA; } } @@ -3919,7 +3807,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallFloatMetho public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallDoubleMethod { get { if (_CallDoubleMethod == null) - _CallDoubleMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _CallDoubleMethod = Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod); return _CallDoubleMethod; } } @@ -3928,7 +3816,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallDoubleMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallDoubleMethodA { get { if (_CallDoubleMethodA == null) - _CallDoubleMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double)); + _CallDoubleMethodA = Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA); return _CallDoubleMethodA; } } @@ -3937,7 +3825,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallDoubleMet public JniAction_JNIEnvPtr_jobject_IntPtr CallVoidMethod { get { if (_CallVoidMethod == null) - _CallVoidMethod = (JniAction_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod, typeof (JniAction_JNIEnvPtr_jobject_IntPtr)); + _CallVoidMethod = Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod); return _CallVoidMethod; } } @@ -3946,7 +3834,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr CallVoidMethod { public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallVoidMethodA { get { if (_CallVoidMethodA == null) - _CallVoidMethodA = (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr)); + _CallVoidMethodA = Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA); return _CallVoidMethodA; } } @@ -3955,7 +3843,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallVoidMethodA { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject CallNonvirtualObjectMethod { get { if (_CallNonvirtualObjectMethod == null) - _CallNonvirtualObjectMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject)); + _CallNonvirtualObjectMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod); return _CallNonvirtualObjectMethod; } } @@ -3964,7 +3852,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject CallNonvirtualObjectMeth public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject CallNonvirtualObjectMethodA { get { if (_CallNonvirtualObjectMethodA == null) - _CallNonvirtualObjectMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _CallNonvirtualObjectMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA); return _CallNonvirtualObjectMethodA; } } @@ -3973,7 +3861,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject Call public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte CallNonvirtualBooleanMethod { get { if (_CallNonvirtualBooleanMethod == null) - _CallNonvirtualBooleanMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte)); + _CallNonvirtualBooleanMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod); return _CallNonvirtualBooleanMethod; } } @@ -3982,7 +3870,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte CallNonvirtualBooleanMethod public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte CallNonvirtualBooleanMethodA { get { if (_CallNonvirtualBooleanMethodA == null) - _CallNonvirtualBooleanMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte)); + _CallNonvirtualBooleanMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA); return _CallNonvirtualBooleanMethodA; } } @@ -3991,7 +3879,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte CallNon public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte CallNonvirtualByteMethod { get { if (_CallNonvirtualByteMethod == null) - _CallNonvirtualByteMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte)); + _CallNonvirtualByteMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethod); return _CallNonvirtualByteMethod; } } @@ -4000,7 +3888,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte CallNonvirtualByteMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte CallNonvirtualByteMethodA { get { if (_CallNonvirtualByteMethodA == null) - _CallNonvirtualByteMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte)); + _CallNonvirtualByteMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethodA); return _CallNonvirtualByteMethodA; } } @@ -4009,7 +3897,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte CallNo public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char CallNonvirtualCharMethod { get { if (_CallNonvirtualCharMethod == null) - _CallNonvirtualCharMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char)); + _CallNonvirtualCharMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod); return _CallNonvirtualCharMethod; } } @@ -4018,7 +3906,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char CallNonvirtualCharMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char CallNonvirtualCharMethodA { get { if (_CallNonvirtualCharMethodA == null) - _CallNonvirtualCharMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char)); + _CallNonvirtualCharMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA); return _CallNonvirtualCharMethodA; } } @@ -4027,7 +3915,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char CallNon public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short CallNonvirtualShortMethod { get { if (_CallNonvirtualShortMethod == null) - _CallNonvirtualShortMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short)); + _CallNonvirtualShortMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod); return _CallNonvirtualShortMethod; } } @@ -4036,7 +3924,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short CallNonvirtualShortMethod public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short CallNonvirtualShortMethodA { get { if (_CallNonvirtualShortMethodA == null) - _CallNonvirtualShortMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short)); + _CallNonvirtualShortMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA); return _CallNonvirtualShortMethodA; } } @@ -4045,7 +3933,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short CallNo public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int CallNonvirtualIntMethod { get { if (_CallNonvirtualIntMethod == null) - _CallNonvirtualIntMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int)); + _CallNonvirtualIntMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod); return _CallNonvirtualIntMethod; } } @@ -4054,7 +3942,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int CallNonvirtualIntMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int CallNonvirtualIntMethodA { get { if (_CallNonvirtualIntMethodA == null) - _CallNonvirtualIntMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int)); + _CallNonvirtualIntMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA); return _CallNonvirtualIntMethodA; } } @@ -4063,7 +3951,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int CallNonv public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long CallNonvirtualLongMethod { get { if (_CallNonvirtualLongMethod == null) - _CallNonvirtualLongMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long)); + _CallNonvirtualLongMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod); return _CallNonvirtualLongMethod; } } @@ -4072,7 +3960,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long CallNonvirtualLongMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long CallNonvirtualLongMethodA { get { if (_CallNonvirtualLongMethodA == null) - _CallNonvirtualLongMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long)); + _CallNonvirtualLongMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA); return _CallNonvirtualLongMethodA; } } @@ -4081,7 +3969,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long CallNon public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float CallNonvirtualFloatMethod { get { if (_CallNonvirtualFloatMethod == null) - _CallNonvirtualFloatMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float)); + _CallNonvirtualFloatMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod); return _CallNonvirtualFloatMethod; } } @@ -4090,7 +3978,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float CallNonvirtualFloatMethod public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float CallNonvirtualFloatMethodA { get { if (_CallNonvirtualFloatMethodA == null) - _CallNonvirtualFloatMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float)); + _CallNonvirtualFloatMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA); return _CallNonvirtualFloatMethodA; } } @@ -4099,7 +3987,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float CallNo public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double CallNonvirtualDoubleMethod { get { if (_CallNonvirtualDoubleMethod == null) - _CallNonvirtualDoubleMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double)); + _CallNonvirtualDoubleMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod); return _CallNonvirtualDoubleMethod; } } @@ -4108,7 +3996,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double CallNonvirtualDoubleMetho public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double CallNonvirtualDoubleMethodA { get { if (_CallNonvirtualDoubleMethodA == null) - _CallNonvirtualDoubleMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double)); + _CallNonvirtualDoubleMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA); return _CallNonvirtualDoubleMethodA; } } @@ -4117,7 +4005,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double CallN public JniAction_JNIEnvPtr_jobject_jobject_IntPtr CallNonvirtualVoidMethod { get { if (_CallNonvirtualVoidMethod == null) - _CallNonvirtualVoidMethod = (JniAction_JNIEnvPtr_jobject_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod, typeof (JniAction_JNIEnvPtr_jobject_jobject_IntPtr)); + _CallNonvirtualVoidMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod); return _CallNonvirtualVoidMethod; } } @@ -4126,7 +4014,7 @@ public JniAction_JNIEnvPtr_jobject_jobject_IntPtr CallNonvirtualVoidMethod { public JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr CallNonvirtualVoidMethodA { get { if (_CallNonvirtualVoidMethodA == null) - _CallNonvirtualVoidMethodA = (JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA, typeof (JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr)); + _CallNonvirtualVoidMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA); return _CallNonvirtualVoidMethodA; } } @@ -4135,7 +4023,7 @@ public JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr CallNonvir public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetFieldID { get { if (_GetFieldID == null) - _GetFieldID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFieldID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetFieldID = Marshal.GetDelegateForFunctionPointer (env.GetFieldID); return _GetFieldID; } } @@ -4144,7 +4032,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetFieldID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetObjectField { get { if (_GetObjectField == null) - _GetObjectField = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _GetObjectField = Marshal.GetDelegateForFunctionPointer (env.GetObjectField); return _GetObjectField; } } @@ -4153,7 +4041,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetObjectField { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetBooleanField { get { if (_GetBooleanField == null) - _GetBooleanField = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.GetBooleanField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _GetBooleanField = Marshal.GetDelegateForFunctionPointer (env.GetBooleanField); return _GetBooleanField; } } @@ -4162,7 +4050,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetBooleanField { public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetByteField { get { if (_GetByteField == null) - _GetByteField = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetByteField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _GetByteField = Marshal.GetDelegateForFunctionPointer (env.GetByteField); return _GetByteField; } } @@ -4171,7 +4059,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetByteField { public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetCharField { get { if (_GetCharField == null) - _GetCharField = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.GetCharField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _GetCharField = Marshal.GetDelegateForFunctionPointer (env.GetCharField); return _GetCharField; } } @@ -4180,7 +4068,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetCharField { public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetShortField { get { if (_GetShortField == null) - _GetShortField = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.GetShortField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _GetShortField = Marshal.GetDelegateForFunctionPointer (env.GetShortField); return _GetShortField; } } @@ -4189,7 +4077,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetShortField { public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetIntField { get { if (_GetIntField == null) - _GetIntField = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetIntField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _GetIntField = Marshal.GetDelegateForFunctionPointer (env.GetIntField); return _GetIntField; } } @@ -4198,7 +4086,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetIntField { public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetLongField { get { if (_GetLongField == null) - _GetLongField = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.GetLongField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _GetLongField = Marshal.GetDelegateForFunctionPointer (env.GetLongField); return _GetLongField; } } @@ -4207,7 +4095,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetLongField { public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetFloatField { get { if (_GetFloatField == null) - _GetFloatField = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.GetFloatField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _GetFloatField = Marshal.GetDelegateForFunctionPointer (env.GetFloatField); return _GetFloatField; } } @@ -4216,7 +4104,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetFloatField { public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetDoubleField { get { if (_GetDoubleField == null) - _GetDoubleField = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.GetDoubleField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _GetDoubleField = Marshal.GetDelegateForFunctionPointer (env.GetDoubleField); return _GetDoubleField; } } @@ -4225,7 +4113,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetDoubleField { public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetObjectField { get { if (_SetObjectField == null) - _SetObjectField = (JniAction_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.SetObjectField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_jobject)); + _SetObjectField = Marshal.GetDelegateForFunctionPointer (env.SetObjectField); return _SetObjectField; } } @@ -4234,7 +4122,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetObjectField { public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetBooleanField { get { if (_SetBooleanField == null) - _SetBooleanField = (JniAction_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.SetBooleanField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_byte)); + _SetBooleanField = Marshal.GetDelegateForFunctionPointer (env.SetBooleanField); return _SetBooleanField; } } @@ -4243,7 +4131,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetBooleanField { public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetByteField { get { if (_SetByteField == null) - _SetByteField = (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetByteField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte)); + _SetByteField = Marshal.GetDelegateForFunctionPointer (env.SetByteField); return _SetByteField; } } @@ -4252,7 +4140,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetByteField { public JniAction_JNIEnvPtr_jobject_IntPtr_char SetCharField { get { if (_SetCharField == null) - _SetCharField = (JniAction_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.SetCharField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_char)); + _SetCharField = Marshal.GetDelegateForFunctionPointer (env.SetCharField); return _SetCharField; } } @@ -4261,7 +4149,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_char SetCharField { public JniAction_JNIEnvPtr_jobject_IntPtr_short SetShortField { get { if (_SetShortField == null) - _SetShortField = (JniAction_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.SetShortField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_short)); + _SetShortField = Marshal.GetDelegateForFunctionPointer (env.SetShortField); return _SetShortField; } } @@ -4270,7 +4158,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_short SetShortField { public JniAction_JNIEnvPtr_jobject_IntPtr_int SetIntField { get { if (_SetIntField == null) - _SetIntField = (JniAction_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.SetIntField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_int)); + _SetIntField = Marshal.GetDelegateForFunctionPointer (env.SetIntField); return _SetIntField; } } @@ -4279,7 +4167,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_int SetIntField { public JniAction_JNIEnvPtr_jobject_IntPtr_long SetLongField { get { if (_SetLongField == null) - _SetLongField = (JniAction_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.SetLongField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_long)); + _SetLongField = Marshal.GetDelegateForFunctionPointer (env.SetLongField); return _SetLongField; } } @@ -4288,7 +4176,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_long SetLongField { public JniAction_JNIEnvPtr_jobject_IntPtr_float SetFloatField { get { if (_SetFloatField == null) - _SetFloatField = (JniAction_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.SetFloatField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_float)); + _SetFloatField = Marshal.GetDelegateForFunctionPointer (env.SetFloatField); return _SetFloatField; } } @@ -4297,7 +4185,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_float SetFloatField { public JniAction_JNIEnvPtr_jobject_IntPtr_double SetDoubleField { get { if (_SetDoubleField == null) - _SetDoubleField = (JniAction_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.SetDoubleField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_double)); + _SetDoubleField = Marshal.GetDelegateForFunctionPointer (env.SetDoubleField); return _SetDoubleField; } } @@ -4306,7 +4194,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_double SetDoubleField { public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticMethodID { get { if (_GetStaticMethodID == null) - _GetStaticMethodID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetStaticMethodID = Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID); return _GetStaticMethodID; } } @@ -4315,7 +4203,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticMethodID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallStaticObjectMethod { get { if (_CallStaticObjectMethod == null) - _CallStaticObjectMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _CallStaticObjectMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod); return _CallStaticObjectMethod; } } @@ -4324,7 +4212,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallStaticObjectMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallStaticObjectMethodA { get { if (_CallStaticObjectMethodA == null) - _CallStaticObjectMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _CallStaticObjectMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA); return _CallStaticObjectMethodA; } } @@ -4333,7 +4221,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallStaticOb public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallStaticBooleanMethod { get { if (_CallStaticBooleanMethod == null) - _CallStaticBooleanMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _CallStaticBooleanMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod); return _CallStaticBooleanMethod; } } @@ -4342,7 +4230,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallStaticBooleanMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallStaticBooleanMethodA { get { if (_CallStaticBooleanMethodA == null) - _CallStaticBooleanMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte)); + _CallStaticBooleanMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA); return _CallStaticBooleanMethodA; } } @@ -4351,7 +4239,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallStaticBoole public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallStaticByteMethod { get { if (_CallStaticByteMethod == null) - _CallStaticByteMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _CallStaticByteMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethod); return _CallStaticByteMethod; } } @@ -4360,7 +4248,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallStaticByteMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallStaticByteMethodA { get { if (_CallStaticByteMethodA == null) - _CallStaticByteMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte)); + _CallStaticByteMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethodA); return _CallStaticByteMethodA; } } @@ -4369,7 +4257,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallStaticByte public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallStaticCharMethod { get { if (_CallStaticCharMethod == null) - _CallStaticCharMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _CallStaticCharMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod); return _CallStaticCharMethod; } } @@ -4378,7 +4266,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallStaticCharMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallStaticCharMethodA { get { if (_CallStaticCharMethodA == null) - _CallStaticCharMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char)); + _CallStaticCharMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA); return _CallStaticCharMethodA; } } @@ -4387,7 +4275,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallStaticCharM public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallStaticShortMethod { get { if (_CallStaticShortMethod == null) - _CallStaticShortMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _CallStaticShortMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod); return _CallStaticShortMethod; } } @@ -4396,7 +4284,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallStaticShortMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallStaticShortMethodA { get { if (_CallStaticShortMethodA == null) - _CallStaticShortMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short)); + _CallStaticShortMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA); return _CallStaticShortMethodA; } } @@ -4405,7 +4293,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallStaticShor public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallStaticIntMethod { get { if (_CallStaticIntMethod == null) - _CallStaticIntMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _CallStaticIntMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod); return _CallStaticIntMethod; } } @@ -4414,7 +4302,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallStaticIntMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallStaticIntMethodA { get { if (_CallStaticIntMethodA == null) - _CallStaticIntMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int)); + _CallStaticIntMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA); return _CallStaticIntMethodA; } } @@ -4423,7 +4311,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallStaticIntMet public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallStaticLongMethod { get { if (_CallStaticLongMethod == null) - _CallStaticLongMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _CallStaticLongMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod); return _CallStaticLongMethod; } } @@ -4432,7 +4320,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallStaticLongMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallStaticLongMethodA { get { if (_CallStaticLongMethodA == null) - _CallStaticLongMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long)); + _CallStaticLongMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA); return _CallStaticLongMethodA; } } @@ -4441,7 +4329,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallStaticLongM public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallStaticFloatMethod { get { if (_CallStaticFloatMethod == null) - _CallStaticFloatMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _CallStaticFloatMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod); return _CallStaticFloatMethod; } } @@ -4450,7 +4338,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallStaticFloatMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallStaticFloatMethodA { get { if (_CallStaticFloatMethodA == null) - _CallStaticFloatMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float)); + _CallStaticFloatMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA); return _CallStaticFloatMethodA; } } @@ -4459,7 +4347,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallStaticFloa public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallStaticDoubleMethod { get { if (_CallStaticDoubleMethod == null) - _CallStaticDoubleMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _CallStaticDoubleMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod); return _CallStaticDoubleMethod; } } @@ -4468,7 +4356,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallStaticDoubleMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallStaticDoubleMethodA { get { if (_CallStaticDoubleMethodA == null) - _CallStaticDoubleMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double)); + _CallStaticDoubleMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA); return _CallStaticDoubleMethodA; } } @@ -4477,7 +4365,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallStaticDou public JniAction_JNIEnvPtr_jobject_IntPtr CallStaticVoidMethod { get { if (_CallStaticVoidMethod == null) - _CallStaticVoidMethod = (JniAction_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod, typeof (JniAction_JNIEnvPtr_jobject_IntPtr)); + _CallStaticVoidMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod); return _CallStaticVoidMethod; } } @@ -4486,7 +4374,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr CallStaticVoidMethod { public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallStaticVoidMethodA { get { if (_CallStaticVoidMethodA == null) - _CallStaticVoidMethodA = (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr)); + _CallStaticVoidMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA); return _CallStaticVoidMethodA; } } @@ -4495,7 +4383,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallStaticVoidMeth public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticFieldID { get { if (_GetStaticFieldID == null) - _GetStaticFieldID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetStaticFieldID = Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID); return _GetStaticFieldID; } } @@ -4504,7 +4392,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticFieldID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetStaticObjectField { get { if (_GetStaticObjectField == null) - _GetStaticObjectField = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _GetStaticObjectField = Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField); return _GetStaticObjectField; } } @@ -4513,7 +4401,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetStaticObjectField { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetStaticBooleanField { get { if (_GetStaticBooleanField == null) - _GetStaticBooleanField = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _GetStaticBooleanField = Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField); return _GetStaticBooleanField; } } @@ -4522,7 +4410,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetStaticBooleanField { public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetStaticByteField { get { if (_GetStaticByteField == null) - _GetStaticByteField = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _GetStaticByteField = Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField); return _GetStaticByteField; } } @@ -4531,7 +4419,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetStaticByteField { public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetStaticCharField { get { if (_GetStaticCharField == null) - _GetStaticCharField = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _GetStaticCharField = Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField); return _GetStaticCharField; } } @@ -4540,7 +4428,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetStaticCharField { public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetStaticShortField { get { if (_GetStaticShortField == null) - _GetStaticShortField = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _GetStaticShortField = Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField); return _GetStaticShortField; } } @@ -4549,7 +4437,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetStaticShortField { public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetStaticIntField { get { if (_GetStaticIntField == null) - _GetStaticIntField = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _GetStaticIntField = Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField); return _GetStaticIntField; } } @@ -4558,7 +4446,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetStaticIntField { public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetStaticLongField { get { if (_GetStaticLongField == null) - _GetStaticLongField = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _GetStaticLongField = Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField); return _GetStaticLongField; } } @@ -4567,7 +4455,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetStaticLongField { public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetStaticFloatField { get { if (_GetStaticFloatField == null) - _GetStaticFloatField = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _GetStaticFloatField = Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField); return _GetStaticFloatField; } } @@ -4576,7 +4464,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetStaticFloatField { public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetStaticDoubleField { get { if (_GetStaticDoubleField == null) - _GetStaticDoubleField = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _GetStaticDoubleField = Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField); return _GetStaticDoubleField; } } @@ -4585,7 +4473,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetStaticDoubleField { public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetStaticObjectField { get { if (_SetStaticObjectField == null) - _SetStaticObjectField = (JniAction_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_jobject)); + _SetStaticObjectField = Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField); return _SetStaticObjectField; } } @@ -4594,7 +4482,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetStaticObjectField { public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetStaticBooleanField { get { if (_SetStaticBooleanField == null) - _SetStaticBooleanField = (JniAction_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_byte)); + _SetStaticBooleanField = Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField); return _SetStaticBooleanField; } } @@ -4603,7 +4491,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetStaticBooleanField { public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetStaticByteField { get { if (_SetStaticByteField == null) - _SetStaticByteField = (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte)); + _SetStaticByteField = Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField); return _SetStaticByteField; } } @@ -4612,7 +4500,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetStaticByteField { public JniAction_JNIEnvPtr_jobject_IntPtr_char SetStaticCharField { get { if (_SetStaticCharField == null) - _SetStaticCharField = (JniAction_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_char)); + _SetStaticCharField = Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField); return _SetStaticCharField; } } @@ -4621,7 +4509,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_char SetStaticCharField { public JniAction_JNIEnvPtr_jobject_IntPtr_short SetStaticShortField { get { if (_SetStaticShortField == null) - _SetStaticShortField = (JniAction_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_short)); + _SetStaticShortField = Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField); return _SetStaticShortField; } } @@ -4630,7 +4518,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_short SetStaticShortField { public JniAction_JNIEnvPtr_jobject_IntPtr_int SetStaticIntField { get { if (_SetStaticIntField == null) - _SetStaticIntField = (JniAction_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_int)); + _SetStaticIntField = Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField); return _SetStaticIntField; } } @@ -4639,7 +4527,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_int SetStaticIntField { public JniAction_JNIEnvPtr_jobject_IntPtr_long SetStaticLongField { get { if (_SetStaticLongField == null) - _SetStaticLongField = (JniAction_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_long)); + _SetStaticLongField = Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField); return _SetStaticLongField; } } @@ -4648,7 +4536,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_long SetStaticLongField { public JniAction_JNIEnvPtr_jobject_IntPtr_float SetStaticFloatField { get { if (_SetStaticFloatField == null) - _SetStaticFloatField = (JniAction_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_float)); + _SetStaticFloatField = Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField); return _SetStaticFloatField; } } @@ -4657,7 +4545,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_float SetStaticFloatField { public JniAction_JNIEnvPtr_jobject_IntPtr_double SetStaticDoubleField { get { if (_SetStaticDoubleField == null) - _SetStaticDoubleField = (JniAction_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_double)); + _SetStaticDoubleField = Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField); return _SetStaticDoubleField; } } @@ -4666,7 +4554,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_double SetStaticDoubleField { public JniFunc_JNIEnvPtr_charPtr_int_jobject NewString { get { if (_NewString == null) - _NewString = (JniFunc_JNIEnvPtr_charPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewString, typeof (JniFunc_JNIEnvPtr_charPtr_int_jobject)); + _NewString = Marshal.GetDelegateForFunctionPointer (env.NewString); return _NewString; } } @@ -4675,7 +4563,7 @@ public JniFunc_JNIEnvPtr_charPtr_int_jobject NewString { public JniFunc_JNIEnvPtr_jobject_int GetStringLength { get { if (_GetStringLength == null) - _GetStringLength = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetStringLength, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _GetStringLength = Marshal.GetDelegateForFunctionPointer (env.GetStringLength); return _GetStringLength; } } @@ -4684,7 +4572,7 @@ public JniFunc_JNIEnvPtr_jobject_int GetStringLength { public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetStringChars { get { if (_GetStringChars == null) - _GetStringChars = (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringChars, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr)); + _GetStringChars = Marshal.GetDelegateForFunctionPointer (env.GetStringChars); return _GetStringChars; } } @@ -4693,7 +4581,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetStringChars { public JniAction_JNIEnvPtr_jobject_charPtr ReleaseStringChars { get { if (_ReleaseStringChars == null) - _ReleaseStringChars = (JniAction_JNIEnvPtr_jobject_charPtr) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars, typeof (JniAction_JNIEnvPtr_jobject_charPtr)); + _ReleaseStringChars = Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars); return _ReleaseStringChars; } } @@ -4702,7 +4590,7 @@ public JniAction_JNIEnvPtr_jobject_charPtr ReleaseStringChars { public JniFunc_JNIEnvPtr_string_jobject NewStringUTF { get { if (_NewStringUTF == null) - _NewStringUTF = (JniFunc_JNIEnvPtr_string_jobject) Marshal.GetDelegateForFunctionPointer (env.NewStringUTF, typeof (JniFunc_JNIEnvPtr_string_jobject)); + _NewStringUTF = Marshal.GetDelegateForFunctionPointer (env.NewStringUTF); return _NewStringUTF; } } @@ -4711,7 +4599,7 @@ public JniFunc_JNIEnvPtr_string_jobject NewStringUTF { public JniFunc_JNIEnvPtr_jobject_int GetStringUTFLength { get { if (_GetStringUTFLength == null) - _GetStringUTFLength = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _GetStringUTFLength = Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength); return _GetStringUTFLength; } } @@ -4720,7 +4608,7 @@ public JniFunc_JNIEnvPtr_jobject_int GetStringUTFLength { public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringUTFChars { get { if (_GetStringUTFChars == null) - _GetStringUTFChars = (JniFunc_JNIEnvPtr_jobject_boolPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_string)); + _GetStringUTFChars = Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars); return _GetStringUTFChars; } } @@ -4729,7 +4617,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringUTFChars { public JniAction_JNIEnvPtr_jobject_string ReleaseStringUTFChars { get { if (_ReleaseStringUTFChars == null) - _ReleaseStringUTFChars = (JniAction_JNIEnvPtr_jobject_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars, typeof (JniAction_JNIEnvPtr_jobject_string)); + _ReleaseStringUTFChars = Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars); return _ReleaseStringUTFChars; } } @@ -4738,7 +4626,7 @@ public JniAction_JNIEnvPtr_jobject_string ReleaseStringUTFChars { public JniFunc_JNIEnvPtr_jobject_int GetArrayLength { get { if (_GetArrayLength == null) - _GetArrayLength = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetArrayLength, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _GetArrayLength = Marshal.GetDelegateForFunctionPointer (env.GetArrayLength); return _GetArrayLength; } } @@ -4747,7 +4635,7 @@ public JniFunc_JNIEnvPtr_jobject_int GetArrayLength { public JniFunc_JNIEnvPtr_int_jobject_jobject_jobject NewObjectArray { get { if (_NewObjectArray == null) - _NewObjectArray = (JniFunc_JNIEnvPtr_int_jobject_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectArray, typeof (JniFunc_JNIEnvPtr_int_jobject_jobject_jobject)); + _NewObjectArray = Marshal.GetDelegateForFunctionPointer (env.NewObjectArray); return _NewObjectArray; } } @@ -4756,7 +4644,7 @@ public JniFunc_JNIEnvPtr_int_jobject_jobject_jobject NewObjectArray { public JniFunc_JNIEnvPtr_jobject_int_jobject GetObjectArrayElement { get { if (_GetObjectArrayElement == null) - _GetObjectArrayElement = (JniFunc_JNIEnvPtr_jobject_int_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement, typeof (JniFunc_JNIEnvPtr_jobject_int_jobject)); + _GetObjectArrayElement = Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement); return _GetObjectArrayElement; } } @@ -4765,7 +4653,7 @@ public JniFunc_JNIEnvPtr_jobject_int_jobject GetObjectArrayElement { public JniAction_JNIEnvPtr_jobject_int_jobject SetObjectArrayElement { get { if (_SetObjectArrayElement == null) - _SetObjectArrayElement = (JniAction_JNIEnvPtr_jobject_int_jobject) Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement, typeof (JniAction_JNIEnvPtr_jobject_int_jobject)); + _SetObjectArrayElement = Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement); return _SetObjectArrayElement; } } @@ -4774,7 +4662,7 @@ public JniAction_JNIEnvPtr_jobject_int_jobject SetObjectArrayElement { public JniFunc_JNIEnvPtr_int_jobject NewBooleanArray { get { if (_NewBooleanArray == null) - _NewBooleanArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewBooleanArray = Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray); return _NewBooleanArray; } } @@ -4783,7 +4671,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewBooleanArray { public JniFunc_JNIEnvPtr_int_jobject NewByteArray { get { if (_NewByteArray == null) - _NewByteArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewByteArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewByteArray = Marshal.GetDelegateForFunctionPointer (env.NewByteArray); return _NewByteArray; } } @@ -4792,7 +4680,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewByteArray { public JniFunc_JNIEnvPtr_int_jobject NewCharArray { get { if (_NewCharArray == null) - _NewCharArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewCharArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewCharArray = Marshal.GetDelegateForFunctionPointer (env.NewCharArray); return _NewCharArray; } } @@ -4801,7 +4689,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewCharArray { public JniFunc_JNIEnvPtr_int_jobject NewShortArray { get { if (_NewShortArray == null) - _NewShortArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewShortArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewShortArray = Marshal.GetDelegateForFunctionPointer (env.NewShortArray); return _NewShortArray; } } @@ -4810,7 +4698,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewShortArray { public JniFunc_JNIEnvPtr_int_jobject NewIntArray { get { if (_NewIntArray == null) - _NewIntArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewIntArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewIntArray = Marshal.GetDelegateForFunctionPointer (env.NewIntArray); return _NewIntArray; } } @@ -4819,7 +4707,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewIntArray { public JniFunc_JNIEnvPtr_int_jobject NewLongArray { get { if (_NewLongArray == null) - _NewLongArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLongArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewLongArray = Marshal.GetDelegateForFunctionPointer (env.NewLongArray); return _NewLongArray; } } @@ -4828,7 +4716,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewLongArray { public JniFunc_JNIEnvPtr_int_jobject NewFloatArray { get { if (_NewFloatArray == null) - _NewFloatArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewFloatArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewFloatArray = Marshal.GetDelegateForFunctionPointer (env.NewFloatArray); return _NewFloatArray; } } @@ -4837,7 +4725,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewFloatArray { public JniFunc_JNIEnvPtr_int_jobject NewDoubleArray { get { if (_NewDoubleArray == null) - _NewDoubleArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewDoubleArray = Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray); return _NewDoubleArray; } } @@ -4846,7 +4734,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewDoubleArray { public JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr GetBooleanArrayElements { get { if (_GetBooleanArrayElements == null) - _GetBooleanArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr)); + _GetBooleanArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements); return _GetBooleanArrayElements; } } @@ -4855,7 +4743,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr GetBooleanArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr GetByteArrayElements { get { if (_GetByteArrayElements == null) - _GetByteArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr)); + _GetByteArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements); return _GetByteArrayElements; } } @@ -4864,7 +4752,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr GetByteArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetCharArrayElements { get { if (_GetCharArrayElements == null) - _GetCharArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr)); + _GetCharArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements); return _GetCharArrayElements; } } @@ -4873,7 +4761,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetCharArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr GetShortArrayElements { get { if (_GetShortArrayElements == null) - _GetShortArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr)); + _GetShortArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements); return _GetShortArrayElements; } } @@ -4882,7 +4770,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr GetShortArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr GetIntArrayElements { get { if (_GetIntArrayElements == null) - _GetIntArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr)); + _GetIntArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements); return _GetIntArrayElements; } } @@ -4891,7 +4779,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr GetIntArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr GetLongArrayElements { get { if (_GetLongArrayElements == null) - _GetLongArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr)); + _GetLongArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements); return _GetLongArrayElements; } } @@ -4900,7 +4788,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr GetLongArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr GetFloatArrayElements { get { if (_GetFloatArrayElements == null) - _GetFloatArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr)); + _GetFloatArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements); return _GetFloatArrayElements; } } @@ -4909,7 +4797,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr GetFloatArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr GetDoubleArrayElements { get { if (_GetDoubleArrayElements == null) - _GetDoubleArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr)); + _GetDoubleArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements); return _GetDoubleArrayElements; } } @@ -4918,7 +4806,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr GetDoubleArrayElements { public JniAction_JNIEnvPtr_jobject_boolPtr_int ReleaseBooleanArrayElements { get { if (_ReleaseBooleanArrayElements == null) - _ReleaseBooleanArrayElements = (JniAction_JNIEnvPtr_jobject_boolPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements, typeof (JniAction_JNIEnvPtr_jobject_boolPtr_int)); + _ReleaseBooleanArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements); return _ReleaseBooleanArrayElements; } } @@ -4927,7 +4815,7 @@ public JniAction_JNIEnvPtr_jobject_boolPtr_int ReleaseBooleanArrayElements { public JniAction_JNIEnvPtr_jobject_sbytePtr_int ReleaseByteArrayElements { get { if (_ReleaseByteArrayElements == null) - _ReleaseByteArrayElements = (JniAction_JNIEnvPtr_jobject_sbytePtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements, typeof (JniAction_JNIEnvPtr_jobject_sbytePtr_int)); + _ReleaseByteArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements); return _ReleaseByteArrayElements; } } @@ -4936,7 +4824,7 @@ public JniAction_JNIEnvPtr_jobject_sbytePtr_int ReleaseByteArrayElements { public JniAction_JNIEnvPtr_jobject_charPtr_int ReleaseCharArrayElements { get { if (_ReleaseCharArrayElements == null) - _ReleaseCharArrayElements = (JniAction_JNIEnvPtr_jobject_charPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements, typeof (JniAction_JNIEnvPtr_jobject_charPtr_int)); + _ReleaseCharArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements); return _ReleaseCharArrayElements; } } @@ -4945,7 +4833,7 @@ public JniAction_JNIEnvPtr_jobject_charPtr_int ReleaseCharArrayElements { public JniAction_JNIEnvPtr_jobject_shortPtr_int ReleaseShortArrayElements { get { if (_ReleaseShortArrayElements == null) - _ReleaseShortArrayElements = (JniAction_JNIEnvPtr_jobject_shortPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements, typeof (JniAction_JNIEnvPtr_jobject_shortPtr_int)); + _ReleaseShortArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements); return _ReleaseShortArrayElements; } } @@ -4954,7 +4842,7 @@ public JniAction_JNIEnvPtr_jobject_shortPtr_int ReleaseShortArrayElements { public JniAction_JNIEnvPtr_jobject_intPtr_int ReleaseIntArrayElements { get { if (_ReleaseIntArrayElements == null) - _ReleaseIntArrayElements = (JniAction_JNIEnvPtr_jobject_intPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements, typeof (JniAction_JNIEnvPtr_jobject_intPtr_int)); + _ReleaseIntArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements); return _ReleaseIntArrayElements; } } @@ -4963,7 +4851,7 @@ public JniAction_JNIEnvPtr_jobject_intPtr_int ReleaseIntArrayElements { public JniAction_JNIEnvPtr_jobject_longPtr_int ReleaseLongArrayElements { get { if (_ReleaseLongArrayElements == null) - _ReleaseLongArrayElements = (JniAction_JNIEnvPtr_jobject_longPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements, typeof (JniAction_JNIEnvPtr_jobject_longPtr_int)); + _ReleaseLongArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements); return _ReleaseLongArrayElements; } } @@ -4972,7 +4860,7 @@ public JniAction_JNIEnvPtr_jobject_longPtr_int ReleaseLongArrayElements { public JniAction_JNIEnvPtr_jobject_floatPtr_int ReleaseFloatArrayElements { get { if (_ReleaseFloatArrayElements == null) - _ReleaseFloatArrayElements = (JniAction_JNIEnvPtr_jobject_floatPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements, typeof (JniAction_JNIEnvPtr_jobject_floatPtr_int)); + _ReleaseFloatArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements); return _ReleaseFloatArrayElements; } } @@ -4981,7 +4869,7 @@ public JniAction_JNIEnvPtr_jobject_floatPtr_int ReleaseFloatArrayElements { public JniAction_JNIEnvPtr_jobject_doublePtr_int ReleaseDoubleArrayElements { get { if (_ReleaseDoubleArrayElements == null) - _ReleaseDoubleArrayElements = (JniAction_JNIEnvPtr_jobject_doublePtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements, typeof (JniAction_JNIEnvPtr_jobject_doublePtr_int)); + _ReleaseDoubleArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements); return _ReleaseDoubleArrayElements; } } @@ -4990,7 +4878,7 @@ public JniAction_JNIEnvPtr_jobject_doublePtr_int ReleaseDoubleArrayElements { public JniAction_JNIEnvPtr_jobject_int_int_boolPtr GetBooleanArrayRegion { get { if (_GetBooleanArrayRegion == null) - _GetBooleanArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_boolPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_boolPtr)); + _GetBooleanArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion); return _GetBooleanArrayRegion; } } @@ -4999,7 +4887,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_boolPtr GetBooleanArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr GetByteArrayRegion { get { if (_GetByteArrayRegion == null) - _GetByteArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr)); + _GetByteArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion); return _GetByteArrayRegion; } } @@ -5008,7 +4896,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr GetByteArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetCharArrayRegion { get { if (_GetCharArrayRegion == null) - _GetCharArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_charPtr)); + _GetCharArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion); return _GetCharArrayRegion; } } @@ -5017,7 +4905,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetCharArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_shortPtr GetShortArrayRegion { get { if (_GetShortArrayRegion == null) - _GetShortArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_shortPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_shortPtr)); + _GetShortArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion); return _GetShortArrayRegion; } } @@ -5026,7 +4914,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_shortPtr GetShortArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_intPtr GetIntArrayRegion { get { if (_GetIntArrayRegion == null) - _GetIntArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_intPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_intPtr)); + _GetIntArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion); return _GetIntArrayRegion; } } @@ -5035,7 +4923,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_intPtr GetIntArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_longPtr GetLongArrayRegion { get { if (_GetLongArrayRegion == null) - _GetLongArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_longPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_longPtr)); + _GetLongArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion); return _GetLongArrayRegion; } } @@ -5044,7 +4932,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_longPtr GetLongArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_floatPtr GetFloatArrayRegion { get { if (_GetFloatArrayRegion == null) - _GetFloatArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_floatPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_floatPtr)); + _GetFloatArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion); return _GetFloatArrayRegion; } } @@ -5053,7 +4941,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_floatPtr GetFloatArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_doublePtr GetDoubleArrayRegion { get { if (_GetDoubleArrayRegion == null) - _GetDoubleArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_doublePtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_doublePtr)); + _GetDoubleArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion); return _GetDoubleArrayRegion; } } @@ -5062,7 +4950,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_doublePtr GetDoubleArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_boolPtr SetBooleanArrayRegion { get { if (_SetBooleanArrayRegion == null) - _SetBooleanArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_boolPtr) Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_boolPtr)); + _SetBooleanArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion); return _SetBooleanArrayRegion; } } @@ -5071,7 +4959,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_boolPtr SetBooleanArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr SetByteArrayRegion { get { if (_SetByteArrayRegion == null) - _SetByteArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr) Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr)); + _SetByteArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion); return _SetByteArrayRegion; } } @@ -5080,7 +4968,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr SetByteArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_charPtr SetCharArrayRegion { get { if (_SetCharArrayRegion == null) - _SetCharArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_charPtr) Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_charPtr)); + _SetCharArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion); return _SetCharArrayRegion; } } @@ -5089,7 +4977,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_charPtr SetCharArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_shortPtr SetShortArrayRegion { get { if (_SetShortArrayRegion == null) - _SetShortArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_shortPtr) Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_shortPtr)); + _SetShortArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion); return _SetShortArrayRegion; } } @@ -5098,7 +4986,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_shortPtr SetShortArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_intPtr SetIntArrayRegion { get { if (_SetIntArrayRegion == null) - _SetIntArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_intPtr) Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_intPtr)); + _SetIntArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion); return _SetIntArrayRegion; } } @@ -5107,7 +4995,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_intPtr SetIntArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_longPtr SetLongArrayRegion { get { if (_SetLongArrayRegion == null) - _SetLongArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_longPtr) Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_longPtr)); + _SetLongArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion); return _SetLongArrayRegion; } } @@ -5116,7 +5004,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_longPtr SetLongArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_floatPtr SetFloatArrayRegion { get { if (_SetFloatArrayRegion == null) - _SetFloatArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_floatPtr) Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_floatPtr)); + _SetFloatArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion); return _SetFloatArrayRegion; } } @@ -5125,7 +5013,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_floatPtr SetFloatArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_doublePtr SetDoubleArrayRegion { get { if (_SetDoubleArrayRegion == null) - _SetDoubleArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_doublePtr) Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_doublePtr)); + _SetDoubleArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion); return _SetDoubleArrayRegion; } } @@ -5134,7 +5022,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_doublePtr SetDoubleArrayRegion { public JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int RegisterNatives { get { if (_RegisterNatives == null) - _RegisterNatives = (JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int) Marshal.GetDelegateForFunctionPointer (env.RegisterNatives, typeof (JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int)); + _RegisterNatives = Marshal.GetDelegateForFunctionPointer (env.RegisterNatives); return _RegisterNatives; } } @@ -5143,7 +5031,7 @@ public JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int Regist public JniFunc_JNIEnvPtr_jobject_int UnregisterNatives { get { if (_UnregisterNatives == null) - _UnregisterNatives = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _UnregisterNatives = Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives); return _UnregisterNatives; } } @@ -5152,7 +5040,7 @@ public JniFunc_JNIEnvPtr_jobject_int UnregisterNatives { public JniFunc_JNIEnvPtr_jobject_int MonitorEnter { get { if (_MonitorEnter == null) - _MonitorEnter = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.MonitorEnter, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _MonitorEnter = Marshal.GetDelegateForFunctionPointer (env.MonitorEnter); return _MonitorEnter; } } @@ -5161,7 +5049,7 @@ public JniFunc_JNIEnvPtr_jobject_int MonitorEnter { public JniFunc_JNIEnvPtr_jobject_int MonitorExit { get { if (_MonitorExit == null) - _MonitorExit = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.MonitorExit, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _MonitorExit = Marshal.GetDelegateForFunctionPointer (env.MonitorExit); return _MonitorExit; } } @@ -5170,7 +5058,7 @@ public JniFunc_JNIEnvPtr_jobject_int MonitorExit { public JniFunc_JNIEnvPtr_outIntPtr_int GetJavaVM { get { if (_GetJavaVM == null) - _GetJavaVM = (JniFunc_JNIEnvPtr_outIntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetJavaVM, typeof (JniFunc_JNIEnvPtr_outIntPtr_int)); + _GetJavaVM = Marshal.GetDelegateForFunctionPointer (env.GetJavaVM); return _GetJavaVM; } } @@ -5179,7 +5067,7 @@ public JniFunc_JNIEnvPtr_outIntPtr_int GetJavaVM { public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetStringRegion { get { if (_GetStringRegion == null) - _GetStringRegion = (JniAction_JNIEnvPtr_jobject_int_int_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_charPtr)); + _GetStringRegion = Marshal.GetDelegateForFunctionPointer (env.GetStringRegion); return _GetStringRegion; } } @@ -5188,7 +5076,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetStringRegion { public JniAction_JNIEnvPtr_jobject_int_int_IntPtr GetStringUTFRegion { get { if (_GetStringUTFRegion == null) - _GetStringUTFRegion = (JniAction_JNIEnvPtr_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_IntPtr)); + _GetStringUTFRegion = Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion); return _GetStringUTFRegion; } } @@ -5197,7 +5085,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_IntPtr GetStringUTFRegion { public JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr GetPrimitiveArrayCritical { get { if (_GetPrimitiveArrayCritical == null) - _GetPrimitiveArrayCritical = (JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr)); + _GetPrimitiveArrayCritical = Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical); return _GetPrimitiveArrayCritical; } } @@ -5206,7 +5094,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr GetPrimitiveArrayCritical { public JniAction_JNIEnvPtr_jobject_IntPtr_int ReleasePrimitiveArrayCritical { get { if (_ReleasePrimitiveArrayCritical == null) - _ReleasePrimitiveArrayCritical = (JniAction_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_int)); + _ReleasePrimitiveArrayCritical = Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical); return _ReleasePrimitiveArrayCritical; } } @@ -5215,7 +5103,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_int ReleasePrimitiveArrayCritical { public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringCritical { get { if (_GetStringCritical == null) - _GetStringCritical = (JniFunc_JNIEnvPtr_jobject_boolPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringCritical, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_string)); + _GetStringCritical = Marshal.GetDelegateForFunctionPointer (env.GetStringCritical); return _GetStringCritical; } } @@ -5224,7 +5112,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringCritical { public JniAction_JNIEnvPtr_jobject_string ReleaseStringCritical { get { if (_ReleaseStringCritical == null) - _ReleaseStringCritical = (JniAction_JNIEnvPtr_jobject_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical, typeof (JniAction_JNIEnvPtr_jobject_string)); + _ReleaseStringCritical = Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical); return _ReleaseStringCritical; } } @@ -5233,7 +5121,7 @@ public JniAction_JNIEnvPtr_jobject_string ReleaseStringCritical { public JniFunc_JNIEnvPtr_jobject_jobject NewWeakGlobalRef { get { if (_NewWeakGlobalRef == null) - _NewWeakGlobalRef = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _NewWeakGlobalRef = Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef); return _NewWeakGlobalRef; } } @@ -5242,7 +5130,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject NewWeakGlobalRef { public JniAction_JNIEnvPtr_IntPtr DeleteWeakGlobalRef { get { if (_DeleteWeakGlobalRef == null) - _DeleteWeakGlobalRef = (JniAction_JNIEnvPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef, typeof (JniAction_JNIEnvPtr_IntPtr)); + _DeleteWeakGlobalRef = Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef); return _DeleteWeakGlobalRef; } } @@ -5251,7 +5139,7 @@ public JniAction_JNIEnvPtr_IntPtr DeleteWeakGlobalRef { public JniFunc_JNIEnvPtr_byte ExceptionCheck { get { if (_ExceptionCheck == null) - _ExceptionCheck = (JniFunc_JNIEnvPtr_byte) Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck, typeof (JniFunc_JNIEnvPtr_byte)); + _ExceptionCheck = Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck); return _ExceptionCheck; } } @@ -5260,7 +5148,7 @@ public JniFunc_JNIEnvPtr_byte ExceptionCheck { public JniFunc_JNIEnvPtr_IntPtr_long_jobject NewDirectByteBuffer { get { if (_NewDirectByteBuffer == null) - _NewDirectByteBuffer = (JniFunc_JNIEnvPtr_IntPtr_long_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer, typeof (JniFunc_JNIEnvPtr_IntPtr_long_jobject)); + _NewDirectByteBuffer = Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer); return _NewDirectByteBuffer; } } @@ -5269,7 +5157,7 @@ public JniFunc_JNIEnvPtr_IntPtr_long_jobject NewDirectByteBuffer { public JniFunc_JNIEnvPtr_jobject_IntPtr GetDirectBufferAddress { get { if (_GetDirectBufferAddress == null) - _GetDirectBufferAddress = (JniFunc_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr)); + _GetDirectBufferAddress = Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress); return _GetDirectBufferAddress; } } @@ -5278,7 +5166,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr GetDirectBufferAddress { public JniFunc_JNIEnvPtr_jobject_long GetDirectBufferCapacity { get { if (_GetDirectBufferCapacity == null) - _GetDirectBufferCapacity = (JniFunc_JNIEnvPtr_jobject_long) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity, typeof (JniFunc_JNIEnvPtr_jobject_long)); + _GetDirectBufferCapacity = Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity); return _GetDirectBufferCapacity; } } @@ -5287,7 +5175,7 @@ public JniFunc_JNIEnvPtr_jobject_long GetDirectBufferCapacity { public JniFunc_JNIEnvPtr_jobject_JniObjectReferenceType GetObjectRefType { get { if (_GetObjectRefType == null) - _GetObjectRefType = (JniFunc_JNIEnvPtr_jobject_JniObjectReferenceType) Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType, typeof (JniFunc_JNIEnvPtr_jobject_JniObjectReferenceType)); + _GetObjectRefType = Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType); return _GetObjectRefType; } } @@ -5307,569 +5195,757 @@ static partial class NativeMethods { const string JavaInteropLib = "java-interop"; - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_get_version (IntPtr jnienv); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_get_version (IntPtr jnienv); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_define_class (IntPtr jnienv, out IntPtr thrown, string name, jobject loader, IntPtr buffer, int bufferLength); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_define_class (IntPtr jnienv, out IntPtr thrown, string name, jobject loader, IntPtr buffer, int bufferLength); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_find_class (IntPtr jnienv, out IntPtr thrown, string classname); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_find_class (IntPtr jnienv, out IntPtr thrown, string classname); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_to_reflected_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, byte isStatic); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_to_reflected_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, byte isStatic); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_get_superclass (IntPtr jnienv, jobject type); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_get_superclass (IntPtr jnienv, jobject type); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_is_assignable_from (IntPtr jnienv, jobject class1, jobject class2); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_is_assignable_from (IntPtr jnienv, jobject class1, jobject class2); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_to_reflected_field (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr field, byte isStatic); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_to_reflected_field (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr field, byte isStatic); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_throw (IntPtr jnienv, jobject toThrow); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_throw (IntPtr jnienv, jobject toThrow); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_throw_new (IntPtr jnienv, jobject type, string message); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_throw_new (IntPtr jnienv, jobject type, string message); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_exception_occurred (IntPtr jnienv); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_exception_occurred (IntPtr jnienv); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_exception_describe (IntPtr jnienv); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_exception_describe (IntPtr jnienv); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_exception_clear (IntPtr jnienv); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_exception_clear (IntPtr jnienv); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_fatal_error (IntPtr jnienv, string message); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_fatal_error (IntPtr jnienv, string message); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_push_local_frame (IntPtr jnienv, int capacity); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_push_local_frame (IntPtr jnienv, int capacity); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_pop_local_frame (IntPtr jnienv, jobject result); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_pop_local_frame (IntPtr jnienv, jobject result); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_global_ref (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_global_ref (IntPtr jnienv, jobject instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_delete_global_ref (IntPtr jnienv, IntPtr instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_delete_global_ref (IntPtr jnienv, IntPtr instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_delete_local_ref (IntPtr jnienv, IntPtr instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_delete_local_ref (IntPtr jnienv, IntPtr instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_is_same_object (IntPtr jnienv, jobject object1, jobject object2); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_is_same_object (IntPtr jnienv, jobject object1, jobject object2); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_local_ref (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_local_ref (IntPtr jnienv, jobject instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_ensure_local_capacity (IntPtr jnienv, int capacity); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_ensure_local_capacity (IntPtr jnienv, int capacity); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_alloc_object (IntPtr jnienv, out IntPtr thrown, jobject type); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_alloc_object (IntPtr jnienv, out IntPtr thrown, jobject type); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_object (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_object (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_object_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_object_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_get_object_class (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_get_object_class (IntPtr jnienv, jobject instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_is_instance_of (IntPtr jnienv, jobject instance, jobject type); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_is_instance_of (IntPtr jnienv, jobject instance, jobject type); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe IntPtr java_interop_jnienv_get_method_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial IntPtr java_interop_jnienv_get_method_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_call_object_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_call_object_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_call_object_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_call_object_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_call_boolean_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_call_boolean_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_call_boolean_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_call_boolean_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_call_byte_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_call_byte_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_call_byte_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_call_byte_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_call_char_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_call_char_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_call_char_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_call_char_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_call_short_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_call_short_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_call_short_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_call_short_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_call_int_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_call_int_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_call_int_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_call_int_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_call_long_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_call_long_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_call_long_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_call_long_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_call_float_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_call_float_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_call_float_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_call_float_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_call_double_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_call_double_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_call_double_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_call_double_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_call_void_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_call_void_method (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_call_void_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_call_void_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_call_nonvirtual_object_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_call_nonvirtual_object_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_call_nonvirtual_object_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_call_nonvirtual_object_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_call_nonvirtual_boolean_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_call_nonvirtual_boolean_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_call_nonvirtual_boolean_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_call_nonvirtual_boolean_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_call_nonvirtual_byte_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_call_nonvirtual_byte_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_call_nonvirtual_byte_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_call_nonvirtual_byte_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_call_nonvirtual_char_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_call_nonvirtual_char_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_call_nonvirtual_char_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_call_nonvirtual_char_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_call_nonvirtual_short_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_call_nonvirtual_short_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_call_nonvirtual_short_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_call_nonvirtual_short_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_call_nonvirtual_int_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_call_nonvirtual_int_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_call_nonvirtual_int_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_call_nonvirtual_int_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_call_nonvirtual_long_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_call_nonvirtual_long_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_call_nonvirtual_long_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_call_nonvirtual_long_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_call_nonvirtual_float_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_call_nonvirtual_float_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_call_nonvirtual_float_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_call_nonvirtual_float_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_call_nonvirtual_double_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_call_nonvirtual_double_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_call_nonvirtual_double_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_call_nonvirtual_double_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_call_nonvirtual_void_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_call_nonvirtual_void_method (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_call_nonvirtual_void_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_call_nonvirtual_void_method_a (IntPtr jnienv, out IntPtr thrown, jobject instance, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe IntPtr java_interop_jnienv_get_field_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial IntPtr java_interop_jnienv_get_field_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_get_object_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_get_object_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_get_boolean_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_get_boolean_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_get_byte_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_get_byte_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_get_char_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_get_char_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_get_short_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_get_short_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_get_int_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_get_int_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_get_long_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_get_long_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_get_float_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_get_float_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_get_double_field (IntPtr jnienv, jobject instance, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_get_double_field (IntPtr jnienv, jobject instance, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_object_field (IntPtr jnienv, jobject instance, IntPtr field, jobject value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_object_field (IntPtr jnienv, jobject instance, IntPtr field, jobject value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_boolean_field (IntPtr jnienv, jobject instance, IntPtr field, byte value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_boolean_field (IntPtr jnienv, jobject instance, IntPtr field, byte value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_byte_field (IntPtr jnienv, jobject instance, IntPtr field, sbyte value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_byte_field (IntPtr jnienv, jobject instance, IntPtr field, sbyte value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_char_field (IntPtr jnienv, jobject instance, IntPtr field, char value); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_char_field (IntPtr jnienv, jobject instance, IntPtr field, char value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_short_field (IntPtr jnienv, jobject instance, IntPtr field, short value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_short_field (IntPtr jnienv, jobject instance, IntPtr field, short value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_int_field (IntPtr jnienv, jobject instance, IntPtr field, int value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_int_field (IntPtr jnienv, jobject instance, IntPtr field, int value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_long_field (IntPtr jnienv, jobject instance, IntPtr field, long value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_long_field (IntPtr jnienv, jobject instance, IntPtr field, long value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_float_field (IntPtr jnienv, jobject instance, IntPtr field, float value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_float_field (IntPtr jnienv, jobject instance, IntPtr field, float value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_double_field (IntPtr jnienv, jobject instance, IntPtr field, double value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_double_field (IntPtr jnienv, jobject instance, IntPtr field, double value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe IntPtr java_interop_jnienv_get_static_method_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial IntPtr java_interop_jnienv_get_static_method_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_call_static_object_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_call_static_object_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_call_static_object_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_call_static_object_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_call_static_boolean_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_call_static_boolean_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_call_static_boolean_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_call_static_boolean_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_call_static_byte_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_call_static_byte_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_call_static_byte_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_call_static_byte_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_call_static_char_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_call_static_char_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_call_static_char_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_call_static_char_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_call_static_short_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_call_static_short_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_call_static_short_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_call_static_short_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_call_static_int_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_call_static_int_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_call_static_int_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_call_static_int_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_call_static_long_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_call_static_long_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_call_static_long_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_call_static_long_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_call_static_float_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_call_static_float_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_call_static_float_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_call_static_float_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_call_static_double_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_call_static_double_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_call_static_double_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_call_static_double_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_call_static_void_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_call_static_void_method (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_call_static_void_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_call_static_void_method_a (IntPtr jnienv, out IntPtr thrown, jobject type, IntPtr method, IntPtr args); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe IntPtr java_interop_jnienv_get_static_field_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial IntPtr java_interop_jnienv_get_static_field_id (IntPtr jnienv, out IntPtr thrown, jobject type, string name, string signature); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_get_static_object_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_get_static_object_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_get_static_boolean_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_get_static_boolean_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte java_interop_jnienv_get_static_byte_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte java_interop_jnienv_get_static_byte_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char java_interop_jnienv_get_static_char_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char java_interop_jnienv_get_static_char_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short java_interop_jnienv_get_static_short_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short java_interop_jnienv_get_static_short_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_get_static_int_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_get_static_int_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_get_static_long_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_get_static_long_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float java_interop_jnienv_get_static_float_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float java_interop_jnienv_get_static_float_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double java_interop_jnienv_get_static_double_field (IntPtr jnienv, jobject type, IntPtr field); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double java_interop_jnienv_get_static_double_field (IntPtr jnienv, jobject type, IntPtr field); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_object_field (IntPtr jnienv, jobject type, IntPtr field, jobject value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_object_field (IntPtr jnienv, jobject type, IntPtr field, jobject value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_boolean_field (IntPtr jnienv, jobject type, IntPtr field, byte value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_boolean_field (IntPtr jnienv, jobject type, IntPtr field, byte value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_byte_field (IntPtr jnienv, jobject type, IntPtr field, sbyte value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_byte_field (IntPtr jnienv, jobject type, IntPtr field, sbyte value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_char_field (IntPtr jnienv, jobject type, IntPtr field, char value); + [LibraryImport (JavaInteropLib, StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof (System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_char_field (IntPtr jnienv, jobject type, IntPtr field, char value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_short_field (IntPtr jnienv, jobject type, IntPtr field, short value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_short_field (IntPtr jnienv, jobject type, IntPtr field, short value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_int_field (IntPtr jnienv, jobject type, IntPtr field, int value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_int_field (IntPtr jnienv, jobject type, IntPtr field, int value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_long_field (IntPtr jnienv, jobject type, IntPtr field, long value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_long_field (IntPtr jnienv, jobject type, IntPtr field, long value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_float_field (IntPtr jnienv, jobject type, IntPtr field, float value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_float_field (IntPtr jnienv, jobject type, IntPtr field, float value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_static_double_field (IntPtr jnienv, jobject type, IntPtr field, double value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_static_double_field (IntPtr jnienv, jobject type, IntPtr field, double value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_string (IntPtr jnienv, out IntPtr thrown, char* unicodeChars, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_string (IntPtr jnienv, out IntPtr thrown, char* unicodeChars, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_get_string_length (IntPtr jnienv, jobject stringInstance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_get_string_length (IntPtr jnienv, jobject stringInstance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char* java_interop_jnienv_get_string_chars (IntPtr jnienv, jobject stringInstance, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char* java_interop_jnienv_get_string_chars (IntPtr jnienv, jobject stringInstance, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_string_chars (IntPtr jnienv, jobject stringInstance, char* chars); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_string_chars (IntPtr jnienv, jobject stringInstance, char* chars); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_get_array_length (IntPtr jnienv, jobject array); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_get_array_length (IntPtr jnienv, jobject array); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_object_array (IntPtr jnienv, out IntPtr thrown, int length, jobject elementClass, jobject initialElement); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_object_array (IntPtr jnienv, out IntPtr thrown, int length, jobject elementClass, jobject initialElement); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_get_object_array_element (IntPtr jnienv, out IntPtr thrown, jobject array, int index); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_get_object_array_element (IntPtr jnienv, out IntPtr thrown, jobject array, int index); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_object_array_element (IntPtr jnienv, out IntPtr thrown, jobject array, int index, jobject value); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_object_array_element (IntPtr jnienv, out IntPtr thrown, jobject array, int index, jobject value); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_boolean_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_boolean_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_byte_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_byte_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_char_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_char_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_short_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_short_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_int_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_int_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_long_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_long_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_float_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_float_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_double_array (IntPtr jnienv, int length); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_double_array (IntPtr jnienv, int length); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe bool* java_interop_jnienv_get_boolean_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial bool* java_interop_jnienv_get_boolean_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe sbyte* java_interop_jnienv_get_byte_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial sbyte* java_interop_jnienv_get_byte_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe char* java_interop_jnienv_get_char_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial char* java_interop_jnienv_get_char_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe short* java_interop_jnienv_get_short_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial short* java_interop_jnienv_get_short_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int* java_interop_jnienv_get_int_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int* java_interop_jnienv_get_int_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long* java_interop_jnienv_get_long_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long* java_interop_jnienv_get_long_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe float* java_interop_jnienv_get_float_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial float* java_interop_jnienv_get_float_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe double* java_interop_jnienv_get_double_array_elements (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial double* java_interop_jnienv_get_double_array_elements (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_boolean_array_elements (IntPtr jnienv, jobject array, bool* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_boolean_array_elements (IntPtr jnienv, jobject array, bool* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_byte_array_elements (IntPtr jnienv, jobject array, sbyte* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_byte_array_elements (IntPtr jnienv, jobject array, sbyte* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_char_array_elements (IntPtr jnienv, jobject array, char* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_char_array_elements (IntPtr jnienv, jobject array, char* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_short_array_elements (IntPtr jnienv, jobject array, short* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_short_array_elements (IntPtr jnienv, jobject array, short* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_int_array_elements (IntPtr jnienv, jobject array, int* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_int_array_elements (IntPtr jnienv, jobject array, int* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_long_array_elements (IntPtr jnienv, jobject array, long* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_long_array_elements (IntPtr jnienv, jobject array, long* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_float_array_elements (IntPtr jnienv, jobject array, float* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_float_array_elements (IntPtr jnienv, jobject array, float* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_double_array_elements (IntPtr jnienv, jobject array, double* elements, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_double_array_elements (IntPtr jnienv, jobject array, double* elements, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_boolean_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, bool* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_boolean_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, bool* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_byte_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, sbyte* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_byte_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, sbyte* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_char_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, char* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_char_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, char* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_short_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, short* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_short_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, short* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_int_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, int* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_int_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, int* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_long_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, long* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_long_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, long* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_float_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, float* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_float_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, float* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_get_double_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, double* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_get_double_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, double* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_boolean_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, bool* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_boolean_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, bool* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_byte_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, sbyte* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_byte_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, sbyte* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_char_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, char* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_char_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, char* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_short_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, short* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_short_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, short* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_int_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, int* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_int_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, int* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_long_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, long* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_long_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, long* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_float_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, float* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_float_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, float* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_set_double_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, double* buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_set_double_array_region (IntPtr jnienv, out IntPtr thrown, jobject array, int start, int length, double* buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_register_natives (IntPtr jnienv, out IntPtr thrown, jobject type, JniNativeMethodRegistration [] methods, int numMethods); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_register_natives (IntPtr jnienv, out IntPtr thrown, jobject type, JniNativeMethodRegistration [] methods, int numMethods); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_unregister_natives (IntPtr jnienv, jobject type); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_unregister_natives (IntPtr jnienv, jobject type); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_monitor_enter (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_monitor_enter (IntPtr jnienv, jobject instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_monitor_exit (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_monitor_exit (IntPtr jnienv, jobject instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe int java_interop_jnienv_get_java_vm (IntPtr jnienv, out IntPtr vm); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial int java_interop_jnienv_get_java_vm (IntPtr jnienv, out IntPtr vm); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe IntPtr java_interop_jnienv_get_primitive_array_critical (IntPtr jnienv, jobject array, bool* isCopy); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial IntPtr java_interop_jnienv_get_primitive_array_critical (IntPtr jnienv, jobject array, bool* isCopy); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_release_primitive_array_critical (IntPtr jnienv, jobject array, IntPtr carray, int mode); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_release_primitive_array_critical (IntPtr jnienv, jobject array, IntPtr carray, int mode); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_weak_global_ref (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_weak_global_ref (IntPtr jnienv, jobject instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe void java_interop_jnienv_delete_weak_global_ref (IntPtr jnienv, IntPtr instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial void java_interop_jnienv_delete_weak_global_ref (IntPtr jnienv, IntPtr instance); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe byte java_interop_jnienv_exception_check (IntPtr jnienv); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial byte java_interop_jnienv_exception_check (IntPtr jnienv); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe jobject java_interop_jnienv_new_direct_byte_buffer (IntPtr jnienv, out IntPtr thrown, IntPtr address, long capacity); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial jobject java_interop_jnienv_new_direct_byte_buffer (IntPtr jnienv, out IntPtr thrown, IntPtr address, long capacity); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe IntPtr java_interop_jnienv_get_direct_buffer_address (IntPtr jnienv, jobject buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial IntPtr java_interop_jnienv_get_direct_buffer_address (IntPtr jnienv, jobject buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe long java_interop_jnienv_get_direct_buffer_capacity (IntPtr jnienv, jobject buffer); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial long java_interop_jnienv_get_direct_buffer_capacity (IntPtr jnienv, jobject buffer); - [DllImport (JavaInteropLib, CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] - internal static extern unsafe JniObjectReferenceType java_interop_jnienv_get_object_ref_type (IntPtr jnienv, jobject instance); + [LibraryImport (JavaInteropLib)] + [UnmanagedCallConv (CallConvs = [typeof (System.Runtime.CompilerServices.CallConvCdecl)])] + internal static unsafe partial JniObjectReferenceType java_interop_jnienv_get_object_ref_type (IntPtr jnienv, jobject instance); } partial class JniEnvironment { @@ -6382,10 +6458,9 @@ internal static unsafe int _ThrowNew (JniObjectReference type, string message) { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var tmp = NativeMethods.java_interop_jnienv_throw_new (JniEnvironment.EnvironmentPointer, type.Handle, message); + var tmp = NativeMethods.java_interop_jnienv_throw_new (JniEnvironment.EnvironmentPointer, type.Handle, message); return tmp; } @@ -6407,10 +6482,9 @@ public static unsafe void ExceptionClear () public static unsafe void FatalError (string message) { - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - NativeMethods.java_interop_jnienv_fatal_error (JniEnvironment.EnvironmentPointer, message); + NativeMethods.java_interop_jnienv_fatal_error (JniEnvironment.EnvironmentPointer, message); } public static unsafe bool ExceptionCheck () @@ -6426,12 +6500,10 @@ public static unsafe JniFieldInfo GetFieldID (JniObjectReference type, string na { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - IntPtr thrown; + IntPtr thrown; var tmp = NativeMethods.java_interop_jnienv_get_field_id (JniEnvironment.EnvironmentPointer, out thrown, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (thrown); @@ -6447,9 +6519,8 @@ public static unsafe JniObjectReference GetObjectField (JniObjectReference insta { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6462,9 +6533,8 @@ public static unsafe bool GetBooleanField (JniObjectReference instance, JniField { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6476,9 +6546,8 @@ public static unsafe sbyte GetByteField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6490,9 +6559,8 @@ public static unsafe char GetCharField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6504,9 +6572,8 @@ public static unsafe short GetShortField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6518,9 +6585,8 @@ public static unsafe int GetIntField (JniObjectReference instance, JniFieldInfo { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6532,9 +6598,8 @@ public static unsafe long GetLongField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6546,9 +6611,8 @@ public static unsafe float GetFloatField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6560,9 +6624,8 @@ public static unsafe double GetDoubleField (JniObjectReference instance, JniFiel { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6574,9 +6637,8 @@ public static unsafe void SetObjectField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6587,9 +6649,8 @@ public static unsafe void SetBooleanField (JniObjectReference instance, JniField { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6600,9 +6661,8 @@ public static unsafe void SetByteField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6613,9 +6673,8 @@ public static unsafe void SetCharField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6626,9 +6685,8 @@ public static unsafe void SetShortField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6639,9 +6697,8 @@ public static unsafe void SetIntField (JniObjectReference instance, JniFieldInfo { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6652,9 +6709,8 @@ public static unsafe void SetLongField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6665,9 +6721,8 @@ public static unsafe void SetFloatField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6678,9 +6733,8 @@ public static unsafe void SetDoubleField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -6694,12 +6748,10 @@ public static unsafe JniMethodInfo GetMethodID (JniObjectReference type, string { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - IntPtr thrown; + IntPtr thrown; var tmp = NativeMethods.java_interop_jnienv_get_method_id (JniEnvironment.EnvironmentPointer, out thrown, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (thrown); @@ -6715,9 +6767,8 @@ public static unsafe JniObjectReference CallObjectMethod (JniObjectReference ins { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6736,9 +6787,8 @@ public static unsafe JniObjectReference CallObjectMethod (JniObjectReference ins { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6757,9 +6807,8 @@ public static unsafe bool CallBooleanMethod (JniObjectReference instance, JniMet { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6777,9 +6826,8 @@ public static unsafe bool CallBooleanMethod (JniObjectReference instance, JniMet { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6797,9 +6845,8 @@ public static unsafe sbyte CallByteMethod (JniObjectReference instance, JniMetho { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6817,9 +6864,8 @@ public static unsafe sbyte CallByteMethod (JniObjectReference instance, JniMetho { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6837,9 +6883,8 @@ public static unsafe char CallCharMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6857,9 +6902,8 @@ public static unsafe char CallCharMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6877,9 +6921,8 @@ public static unsafe short CallShortMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6897,9 +6940,8 @@ public static unsafe short CallShortMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6917,9 +6959,8 @@ public static unsafe int CallIntMethod (JniObjectReference instance, JniMethodIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6937,9 +6978,8 @@ public static unsafe int CallIntMethod (JniObjectReference instance, JniMethodIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6957,9 +6997,8 @@ public static unsafe long CallLongMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6977,9 +7016,8 @@ public static unsafe long CallLongMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -6997,9 +7035,8 @@ public static unsafe float CallFloatMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7017,9 +7054,8 @@ public static unsafe float CallFloatMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7037,9 +7073,8 @@ public static unsafe double CallDoubleMethod (JniObjectReference instance, JniMe { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7057,9 +7092,8 @@ public static unsafe double CallDoubleMethod (JniObjectReference instance, JniMe { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7077,9 +7111,8 @@ public static unsafe void CallVoidMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7096,9 +7129,8 @@ public static unsafe void CallVoidMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7117,9 +7149,8 @@ public static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectRef throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7140,9 +7171,8 @@ public static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectRef throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7163,9 +7193,8 @@ public static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference instan throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7185,9 +7214,8 @@ public static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference instan throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7207,9 +7235,8 @@ public static unsafe sbyte CallNonvirtualByteMethod (JniObjectReference instance throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7229,9 +7256,8 @@ public static unsafe sbyte CallNonvirtualByteMethod (JniObjectReference instance throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7251,9 +7277,8 @@ public static unsafe char CallNonvirtualCharMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7273,9 +7298,8 @@ public static unsafe char CallNonvirtualCharMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7295,9 +7319,8 @@ public static unsafe short CallNonvirtualShortMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7317,9 +7340,8 @@ public static unsafe short CallNonvirtualShortMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7339,9 +7361,8 @@ public static unsafe int CallNonvirtualIntMethod (JniObjectReference instance, J throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7361,9 +7382,8 @@ public static unsafe int CallNonvirtualIntMethod (JniObjectReference instance, J throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7383,9 +7403,8 @@ public static unsafe long CallNonvirtualLongMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7405,9 +7424,8 @@ public static unsafe long CallNonvirtualLongMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7427,9 +7445,8 @@ public static unsafe float CallNonvirtualFloatMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7449,9 +7466,8 @@ public static unsafe float CallNonvirtualFloatMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7471,9 +7487,8 @@ public static unsafe double CallNonvirtualDoubleMethod (JniObjectReference insta throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7493,9 +7508,8 @@ public static unsafe double CallNonvirtualDoubleMethod (JniObjectReference insta throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7515,9 +7529,8 @@ public static unsafe void CallNonvirtualVoidMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7536,9 +7549,8 @@ public static unsafe void CallNonvirtualVoidMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7632,9 +7644,8 @@ internal static unsafe JniObjectReference _NewObject (JniObjectReference type, J { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7653,9 +7664,8 @@ internal static unsafe JniObjectReference _NewObject (JniObjectReference type, J { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7747,9 +7757,8 @@ public static unsafe JniObjectReference ToReflectedMethod (JniObjectReference ty { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -7768,9 +7777,8 @@ public static unsafe JniObjectReference ToReflectedField (JniObjectReference typ { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -7792,12 +7800,10 @@ public static unsafe JniFieldInfo GetStaticFieldID (JniObjectReference type, str { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - IntPtr thrown; + IntPtr thrown; var tmp = NativeMethods.java_interop_jnienv_get_static_field_id (JniEnvironment.EnvironmentPointer, out thrown, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (thrown); @@ -7813,9 +7819,8 @@ public static unsafe JniObjectReference GetStaticObjectField (JniObjectReference { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7828,9 +7833,8 @@ public static unsafe bool GetStaticBooleanField (JniObjectReference type, JniFie { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7842,9 +7846,8 @@ public static unsafe sbyte GetStaticByteField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7856,9 +7859,8 @@ public static unsafe char GetStaticCharField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7870,9 +7872,8 @@ public static unsafe short GetStaticShortField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7884,9 +7885,8 @@ public static unsafe int GetStaticIntField (JniObjectReference type, JniFieldInf { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7898,9 +7898,8 @@ public static unsafe long GetStaticLongField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7912,9 +7911,8 @@ public static unsafe float GetStaticFloatField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7926,9 +7924,8 @@ public static unsafe double GetStaticDoubleField (JniObjectReference type, JniFi { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7940,9 +7937,8 @@ public static unsafe void SetStaticObjectField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7953,9 +7949,8 @@ public static unsafe void SetStaticBooleanField (JniObjectReference type, JniFie { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7966,9 +7961,8 @@ public static unsafe void SetStaticByteField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7979,9 +7973,8 @@ public static unsafe void SetStaticCharField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -7992,9 +7985,8 @@ public static unsafe void SetStaticShortField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -8005,9 +7997,8 @@ public static unsafe void SetStaticIntField (JniObjectReference type, JniFieldIn { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -8018,9 +8009,8 @@ public static unsafe void SetStaticLongField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -8031,9 +8021,8 @@ public static unsafe void SetStaticFloatField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -8044,9 +8033,8 @@ public static unsafe void SetStaticDoubleField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -8060,12 +8048,10 @@ public static unsafe JniMethodInfo GetStaticMethodID (JniObjectReference type, s { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - IntPtr thrown; + IntPtr thrown; var tmp = NativeMethods.java_interop_jnienv_get_static_method_id (JniEnvironment.EnvironmentPointer, out thrown, type.Handle, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (thrown); @@ -8081,9 +8067,8 @@ public static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReferen { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8102,9 +8087,8 @@ public static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReferen { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8123,9 +8107,8 @@ public static unsafe bool CallStaticBooleanMethod (JniObjectReference type, JniM { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8143,9 +8126,8 @@ public static unsafe bool CallStaticBooleanMethod (JniObjectReference type, JniM { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8163,9 +8145,8 @@ public static unsafe sbyte CallStaticByteMethod (JniObjectReference type, JniMet { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8183,9 +8164,8 @@ public static unsafe sbyte CallStaticByteMethod (JniObjectReference type, JniMet { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8203,9 +8183,8 @@ public static unsafe char CallStaticCharMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8223,9 +8202,8 @@ public static unsafe char CallStaticCharMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8243,9 +8221,8 @@ public static unsafe short CallStaticShortMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8263,9 +8240,8 @@ public static unsafe short CallStaticShortMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8283,9 +8259,8 @@ public static unsafe int CallStaticIntMethod (JniObjectReference type, JniMethod { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8303,9 +8278,8 @@ public static unsafe int CallStaticIntMethod (JniObjectReference type, JniMethod { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8323,9 +8297,8 @@ public static unsafe long CallStaticLongMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8343,9 +8316,8 @@ public static unsafe long CallStaticLongMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8363,9 +8335,8 @@ public static unsafe float CallStaticFloatMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8383,9 +8354,8 @@ public static unsafe float CallStaticFloatMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8403,9 +8373,8 @@ public static unsafe double CallStaticDoubleMethod (JniObjectReference type, Jni { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8423,9 +8392,8 @@ public static unsafe double CallStaticDoubleMethod (JniObjectReference type, Jni { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8443,9 +8411,8 @@ public static unsafe void CallStaticVoidMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8462,9 +8429,8 @@ public static unsafe void CallStaticVoidMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -8524,9 +8490,8 @@ public static partial class Types { public static unsafe JniObjectReference DefineClass (string name, JniObjectReference loader, IntPtr buffer, int bufferLength) { - if (name == null) - throw new ArgumentNullException ("name"); - if (!loader.IsValid) + ArgumentNullException.ThrowIfNull (name); + if (!loader.IsValid) throw new ArgumentException ("Handle must be valid.", "loader"); if (buffer == IntPtr.Zero) throw new ArgumentException ("'buffer' must not be IntPtr.Zero.", "buffer"); @@ -8544,10 +8509,9 @@ public static unsafe JniObjectReference DefineClass (string name, JniObjectRefer internal static unsafe JniObjectReference _FindClass (string classname) { - if (classname == null) - throw new ArgumentNullException ("classname"); + ArgumentNullException.ThrowIfNull (classname); - IntPtr thrown; + IntPtr thrown; var tmp = NativeMethods.java_interop_jnienv_find_class (JniEnvironment.EnvironmentPointer, out thrown, classname); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (thrown); @@ -9296,10 +9260,9 @@ internal static unsafe int _ThrowNew (IntPtr type, string message) { if (type == IntPtr.Zero) throw new ArgumentException ("`type` must not be IntPtr.Zero.", "type"); - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.ThrowNew (__info.EnvironmentPointer, type, message); return tmp; } @@ -9325,10 +9288,9 @@ public static unsafe void ExceptionClear () public static unsafe void FatalError (string message) { - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; __info.Invoker.FatalError (__info.EnvironmentPointer, message); } @@ -9346,12 +9308,10 @@ public static unsafe IntPtr GetFieldID (IntPtr type, string name, string signatu { if (type == IntPtr.Zero) throw new ArgumentException ("`type` must not be IntPtr.Zero.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetFieldID (__info.EnvironmentPointer, type, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -9576,12 +9536,10 @@ public static unsafe IntPtr GetMethodID (IntPtr type, string name, string signat { if (type == IntPtr.Zero) throw new ArgumentException ("`type` must not be IntPtr.Zero.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetMethodID (__info.EnvironmentPointer, type, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -10555,12 +10513,10 @@ public static unsafe IntPtr GetStaticFieldID (IntPtr type, string name, string s { if (type == IntPtr.Zero) throw new ArgumentException ("`type` must not be IntPtr.Zero.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetStaticFieldID (__info.EnvironmentPointer, type, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -10785,12 +10741,10 @@ public static unsafe IntPtr GetStaticMethodID (IntPtr type, string name, string { if (type == IntPtr.Zero) throw new ArgumentException ("`type` must not be IntPtr.Zero.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.GetStaticMethodID (__info.EnvironmentPointer, type, name, signature); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -11190,9 +11144,8 @@ public static partial class Types { public static unsafe IntPtr DefineClass (string name, IntPtr loader, IntPtr buffer, int bufferLength) { - if (name == null) - throw new ArgumentNullException ("name"); - if (loader == IntPtr.Zero) + ArgumentNullException.ThrowIfNull (name); + if (loader == IntPtr.Zero) throw new ArgumentException ("`loader` must not be IntPtr.Zero.", "loader"); if (buffer == IntPtr.Zero) throw new ArgumentException ("'buffer' must not be IntPtr.Zero.", "buffer"); @@ -11210,10 +11163,9 @@ public static unsafe IntPtr DefineClass (string name, IntPtr loader, IntPtr buff internal static unsafe IntPtr _FindClass (string classname) { - if (classname == null) - throw new ArgumentNullException ("classname"); + ArgumentNullException.ThrowIfNull (classname); - var __info = JniEnvironment.CurrentInfo; + var __info = JniEnvironment.CurrentInfo; var tmp = __info.Invoker.FindClass (__info.EnvironmentPointer, classname); Exception? __e = JniEnvironment.GetExceptionForLastThrowable (); @@ -11328,7 +11280,7 @@ public unsafe JniEnvironmentInvoker (JniNativeInterfaceStruct* p) public JniFunc_JNIEnvPtr_int GetVersion { get { if (_GetVersion == null) - _GetVersion = (JniFunc_JNIEnvPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetVersion, typeof (JniFunc_JNIEnvPtr_int)); + _GetVersion = Marshal.GetDelegateForFunctionPointer (env.GetVersion); return _GetVersion; } } @@ -11337,7 +11289,7 @@ public JniFunc_JNIEnvPtr_int GetVersion { public JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject DefineClass { get { if (_DefineClass == null) - _DefineClass = (JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.DefineClass, typeof (JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject)); + _DefineClass = Marshal.GetDelegateForFunctionPointer (env.DefineClass); return _DefineClass; } } @@ -11346,7 +11298,7 @@ public JniFunc_JNIEnvPtr_string_jobject_IntPtr_int_jobject DefineClass { public JniFunc_JNIEnvPtr_string_jobject FindClass { get { if (_FindClass == null) - _FindClass = (JniFunc_JNIEnvPtr_string_jobject) Marshal.GetDelegateForFunctionPointer (env.FindClass, typeof (JniFunc_JNIEnvPtr_string_jobject)); + _FindClass = Marshal.GetDelegateForFunctionPointer (env.FindClass); return _FindClass; } } @@ -11355,7 +11307,7 @@ public JniFunc_JNIEnvPtr_string_jobject FindClass { public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedMethod { get { if (_FromReflectedMethod == null) - _FromReflectedMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr)); + _FromReflectedMethod = Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod); return _FromReflectedMethod; } } @@ -11364,7 +11316,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedField { get { if (_FromReflectedField == null) - _FromReflectedField = (JniFunc_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.FromReflectedField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr)); + _FromReflectedField = Marshal.GetDelegateForFunctionPointer (env.FromReflectedField); return _FromReflectedField; } } @@ -11373,7 +11325,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr FromReflectedField { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedMethod { get { if (_ToReflectedMethod == null) - _ToReflectedMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject)); + _ToReflectedMethod = Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod); return _ToReflectedMethod; } } @@ -11382,7 +11334,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedMethod { public JniFunc_JNIEnvPtr_jobject_jobject GetSuperclass { get { if (_GetSuperclass == null) - _GetSuperclass = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.GetSuperclass, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _GetSuperclass = Marshal.GetDelegateForFunctionPointer (env.GetSuperclass); return _GetSuperclass; } } @@ -11391,7 +11343,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject GetSuperclass { public JniFunc_JNIEnvPtr_jobject_jobject_byte IsAssignableFrom { get { if (_IsAssignableFrom == null) - _IsAssignableFrom = (JniFunc_JNIEnvPtr_jobject_jobject_byte) Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom, typeof (JniFunc_JNIEnvPtr_jobject_jobject_byte)); + _IsAssignableFrom = Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom); return _IsAssignableFrom; } } @@ -11400,7 +11352,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_byte IsAssignableFrom { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedField { get { if (_ToReflectedField == null) - _ToReflectedField = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject)); + _ToReflectedField = Marshal.GetDelegateForFunctionPointer (env.ToReflectedField); return _ToReflectedField; } } @@ -11409,7 +11361,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte_jobject ToReflectedField { public JniFunc_JNIEnvPtr_jobject_int Throw { get { if (_Throw == null) - _Throw = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.Throw, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _Throw = Marshal.GetDelegateForFunctionPointer (env.Throw); return _Throw; } } @@ -11418,7 +11370,7 @@ public JniFunc_JNIEnvPtr_jobject_int Throw { public JniFunc_JNIEnvPtr_jobject_string_int ThrowNew { get { if (_ThrowNew == null) - _ThrowNew = (JniFunc_JNIEnvPtr_jobject_string_int) Marshal.GetDelegateForFunctionPointer (env.ThrowNew, typeof (JniFunc_JNIEnvPtr_jobject_string_int)); + _ThrowNew = Marshal.GetDelegateForFunctionPointer (env.ThrowNew); return _ThrowNew; } } @@ -11427,7 +11379,7 @@ public JniFunc_JNIEnvPtr_jobject_string_int ThrowNew { public JniFunc_JNIEnvPtr_jobject ExceptionOccurred { get { if (_ExceptionOccurred == null) - _ExceptionOccurred = (JniFunc_JNIEnvPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred, typeof (JniFunc_JNIEnvPtr_jobject)); + _ExceptionOccurred = Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred); return _ExceptionOccurred; } } @@ -11436,7 +11388,7 @@ public JniFunc_JNIEnvPtr_jobject ExceptionOccurred { public JniAction_JNIEnvPtr ExceptionDescribe { get { if (_ExceptionDescribe == null) - _ExceptionDescribe = (JniAction_JNIEnvPtr) Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe, typeof (JniAction_JNIEnvPtr)); + _ExceptionDescribe = Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe); return _ExceptionDescribe; } } @@ -11445,7 +11397,7 @@ public JniAction_JNIEnvPtr ExceptionDescribe { public JniAction_JNIEnvPtr ExceptionClear { get { if (_ExceptionClear == null) - _ExceptionClear = (JniAction_JNIEnvPtr) Marshal.GetDelegateForFunctionPointer (env.ExceptionClear, typeof (JniAction_JNIEnvPtr)); + _ExceptionClear = Marshal.GetDelegateForFunctionPointer (env.ExceptionClear); return _ExceptionClear; } } @@ -11454,7 +11406,7 @@ public JniAction_JNIEnvPtr ExceptionClear { public JniAction_JNIEnvPtr_string FatalError { get { if (_FatalError == null) - _FatalError = (JniAction_JNIEnvPtr_string) Marshal.GetDelegateForFunctionPointer (env.FatalError, typeof (JniAction_JNIEnvPtr_string)); + _FatalError = Marshal.GetDelegateForFunctionPointer (env.FatalError); return _FatalError; } } @@ -11463,7 +11415,7 @@ public JniAction_JNIEnvPtr_string FatalError { public JniFunc_JNIEnvPtr_int_int PushLocalFrame { get { if (_PushLocalFrame == null) - _PushLocalFrame = (JniFunc_JNIEnvPtr_int_int) Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame, typeof (JniFunc_JNIEnvPtr_int_int)); + _PushLocalFrame = Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame); return _PushLocalFrame; } } @@ -11472,7 +11424,7 @@ public JniFunc_JNIEnvPtr_int_int PushLocalFrame { public JniFunc_JNIEnvPtr_jobject_jobject PopLocalFrame { get { if (_PopLocalFrame == null) - _PopLocalFrame = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _PopLocalFrame = Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame); return _PopLocalFrame; } } @@ -11481,7 +11433,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject PopLocalFrame { public JniFunc_JNIEnvPtr_jobject_jobject NewGlobalRef { get { if (_NewGlobalRef == null) - _NewGlobalRef = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _NewGlobalRef = Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef); return _NewGlobalRef; } } @@ -11490,7 +11442,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject NewGlobalRef { public JniAction_JNIEnvPtr_IntPtr DeleteGlobalRef { get { if (_DeleteGlobalRef == null) - _DeleteGlobalRef = (JniAction_JNIEnvPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef, typeof (JniAction_JNIEnvPtr_IntPtr)); + _DeleteGlobalRef = Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef); return _DeleteGlobalRef; } } @@ -11499,7 +11451,7 @@ public JniAction_JNIEnvPtr_IntPtr DeleteGlobalRef { public JniAction_JNIEnvPtr_IntPtr DeleteLocalRef { get { if (_DeleteLocalRef == null) - _DeleteLocalRef = (JniAction_JNIEnvPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef, typeof (JniAction_JNIEnvPtr_IntPtr)); + _DeleteLocalRef = Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef); return _DeleteLocalRef; } } @@ -11508,7 +11460,7 @@ public JniAction_JNIEnvPtr_IntPtr DeleteLocalRef { public JniFunc_JNIEnvPtr_jobject_jobject_byte IsSameObject { get { if (_IsSameObject == null) - _IsSameObject = (JniFunc_JNIEnvPtr_jobject_jobject_byte) Marshal.GetDelegateForFunctionPointer (env.IsSameObject, typeof (JniFunc_JNIEnvPtr_jobject_jobject_byte)); + _IsSameObject = Marshal.GetDelegateForFunctionPointer (env.IsSameObject); return _IsSameObject; } } @@ -11517,7 +11469,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_byte IsSameObject { public JniFunc_JNIEnvPtr_jobject_jobject NewLocalRef { get { if (_NewLocalRef == null) - _NewLocalRef = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLocalRef, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _NewLocalRef = Marshal.GetDelegateForFunctionPointer (env.NewLocalRef); return _NewLocalRef; } } @@ -11526,7 +11478,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject NewLocalRef { public JniFunc_JNIEnvPtr_int_int EnsureLocalCapacity { get { if (_EnsureLocalCapacity == null) - _EnsureLocalCapacity = (JniFunc_JNIEnvPtr_int_int) Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity, typeof (JniFunc_JNIEnvPtr_int_int)); + _EnsureLocalCapacity = Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity); return _EnsureLocalCapacity; } } @@ -11535,7 +11487,7 @@ public JniFunc_JNIEnvPtr_int_int EnsureLocalCapacity { public JniFunc_JNIEnvPtr_jobject_jobject AllocObject { get { if (_AllocObject == null) - _AllocObject = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.AllocObject, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _AllocObject = Marshal.GetDelegateForFunctionPointer (env.AllocObject); return _AllocObject; } } @@ -11544,7 +11496,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject AllocObject { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject NewObject { get { if (_NewObject == null) - _NewObject = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObject, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _NewObject = Marshal.GetDelegateForFunctionPointer (env.NewObject); return _NewObject; } } @@ -11553,7 +11505,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject NewObject { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject NewObjectA { get { if (_NewObjectA == null) - _NewObjectA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _NewObjectA = Marshal.GetDelegateForFunctionPointer (env.NewObjectA); return _NewObjectA; } } @@ -11562,7 +11514,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject NewObjectA { public JniFunc_JNIEnvPtr_jobject_jobject GetObjectClass { get { if (_GetObjectClass == null) - _GetObjectClass = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectClass, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _GetObjectClass = Marshal.GetDelegateForFunctionPointer (env.GetObjectClass); return _GetObjectClass; } } @@ -11571,7 +11523,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject GetObjectClass { public JniFunc_JNIEnvPtr_jobject_jobject_byte IsInstanceOf { get { if (_IsInstanceOf == null) - _IsInstanceOf = (JniFunc_JNIEnvPtr_jobject_jobject_byte) Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf, typeof (JniFunc_JNIEnvPtr_jobject_jobject_byte)); + _IsInstanceOf = Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf); return _IsInstanceOf; } } @@ -11580,7 +11532,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_byte IsInstanceOf { public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetMethodID { get { if (_GetMethodID == null) - _GetMethodID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetMethodID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetMethodID = Marshal.GetDelegateForFunctionPointer (env.GetMethodID); return _GetMethodID; } } @@ -11589,7 +11541,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetMethodID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallObjectMethod { get { if (_CallObjectMethod == null) - _CallObjectMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _CallObjectMethod = Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod); return _CallObjectMethod; } } @@ -11598,7 +11550,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallObjectMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallObjectMethodA { get { if (_CallObjectMethodA == null) - _CallObjectMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _CallObjectMethodA = Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA); return _CallObjectMethodA; } } @@ -11607,7 +11559,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallObjectMe public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallBooleanMethod { get { if (_CallBooleanMethod == null) - _CallBooleanMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _CallBooleanMethod = Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod); return _CallBooleanMethod; } } @@ -11616,7 +11568,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallBooleanMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallBooleanMethodA { get { if (_CallBooleanMethodA == null) - _CallBooleanMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte)); + _CallBooleanMethodA = Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA); return _CallBooleanMethodA; } } @@ -11625,7 +11577,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallBooleanMeth public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallByteMethod { get { if (_CallByteMethod == null) - _CallByteMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallByteMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _CallByteMethod = Marshal.GetDelegateForFunctionPointer (env.CallByteMethod); return _CallByteMethod; } } @@ -11634,7 +11586,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallByteMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallByteMethodA { get { if (_CallByteMethodA == null) - _CallByteMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallByteMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte)); + _CallByteMethodA = Marshal.GetDelegateForFunctionPointer (env.CallByteMethodA); return _CallByteMethodA; } } @@ -11643,7 +11595,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallByteMethod public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallCharMethod { get { if (_CallCharMethod == null) - _CallCharMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _CallCharMethod = Marshal.GetDelegateForFunctionPointer (env.CallCharMethod); return _CallCharMethod; } } @@ -11652,7 +11604,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallCharMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallCharMethodA { get { if (_CallCharMethodA == null) - _CallCharMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char)); + _CallCharMethodA = Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA); return _CallCharMethodA; } } @@ -11661,7 +11613,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallCharMethodA public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallShortMethod { get { if (_CallShortMethod == null) - _CallShortMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _CallShortMethod = Marshal.GetDelegateForFunctionPointer (env.CallShortMethod); return _CallShortMethod; } } @@ -11670,7 +11622,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallShortMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallShortMethodA { get { if (_CallShortMethodA == null) - _CallShortMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short)); + _CallShortMethodA = Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA); return _CallShortMethodA; } } @@ -11679,7 +11631,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallShortMetho public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallIntMethod { get { if (_CallIntMethod == null) - _CallIntMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _CallIntMethod = Marshal.GetDelegateForFunctionPointer (env.CallIntMethod); return _CallIntMethod; } } @@ -11688,7 +11640,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallIntMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallIntMethodA { get { if (_CallIntMethodA == null) - _CallIntMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int)); + _CallIntMethodA = Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA); return _CallIntMethodA; } } @@ -11697,7 +11649,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallIntMethodA { public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallLongMethod { get { if (_CallLongMethod == null) - _CallLongMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _CallLongMethod = Marshal.GetDelegateForFunctionPointer (env.CallLongMethod); return _CallLongMethod; } } @@ -11706,7 +11658,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallLongMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallLongMethodA { get { if (_CallLongMethodA == null) - _CallLongMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long)); + _CallLongMethodA = Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA); return _CallLongMethodA; } } @@ -11715,7 +11667,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallLongMethodA public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallFloatMethod { get { if (_CallFloatMethod == null) - _CallFloatMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _CallFloatMethod = Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod); return _CallFloatMethod; } } @@ -11724,7 +11676,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallFloatMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallFloatMethodA { get { if (_CallFloatMethodA == null) - _CallFloatMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float)); + _CallFloatMethodA = Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA); return _CallFloatMethodA; } } @@ -11733,7 +11685,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallFloatMetho public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallDoubleMethod { get { if (_CallDoubleMethod == null) - _CallDoubleMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _CallDoubleMethod = Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod); return _CallDoubleMethod; } } @@ -11742,7 +11694,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallDoubleMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallDoubleMethodA { get { if (_CallDoubleMethodA == null) - _CallDoubleMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double)); + _CallDoubleMethodA = Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA); return _CallDoubleMethodA; } } @@ -11751,7 +11703,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallDoubleMet public JniAction_JNIEnvPtr_jobject_IntPtr CallVoidMethod { get { if (_CallVoidMethod == null) - _CallVoidMethod = (JniAction_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod, typeof (JniAction_JNIEnvPtr_jobject_IntPtr)); + _CallVoidMethod = Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod); return _CallVoidMethod; } } @@ -11760,7 +11712,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr CallVoidMethod { public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallVoidMethodA { get { if (_CallVoidMethodA == null) - _CallVoidMethodA = (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr)); + _CallVoidMethodA = Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA); return _CallVoidMethodA; } } @@ -11769,7 +11721,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallVoidMethodA { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject CallNonvirtualObjectMethod { get { if (_CallNonvirtualObjectMethod == null) - _CallNonvirtualObjectMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject)); + _CallNonvirtualObjectMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod); return _CallNonvirtualObjectMethod; } } @@ -11778,7 +11730,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_jobject CallNonvirtualObjectMeth public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject CallNonvirtualObjectMethodA { get { if (_CallNonvirtualObjectMethodA == null) - _CallNonvirtualObjectMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _CallNonvirtualObjectMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA); return _CallNonvirtualObjectMethodA; } } @@ -11787,7 +11739,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_jobject Call public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte CallNonvirtualBooleanMethod { get { if (_CallNonvirtualBooleanMethod == null) - _CallNonvirtualBooleanMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte)); + _CallNonvirtualBooleanMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod); return _CallNonvirtualBooleanMethod; } } @@ -11796,7 +11748,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_byte CallNonvirtualBooleanMethod public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte CallNonvirtualBooleanMethodA { get { if (_CallNonvirtualBooleanMethodA == null) - _CallNonvirtualBooleanMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte)); + _CallNonvirtualBooleanMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA); return _CallNonvirtualBooleanMethodA; } } @@ -11805,7 +11757,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_byte CallNon public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte CallNonvirtualByteMethod { get { if (_CallNonvirtualByteMethod == null) - _CallNonvirtualByteMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte)); + _CallNonvirtualByteMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethod); return _CallNonvirtualByteMethod; } } @@ -11814,7 +11766,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_sbyte CallNonvirtualByteMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte CallNonvirtualByteMethodA { get { if (_CallNonvirtualByteMethodA == null) - _CallNonvirtualByteMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte)); + _CallNonvirtualByteMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualByteMethodA); return _CallNonvirtualByteMethodA; } } @@ -11823,7 +11775,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_sbyte CallNo public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char CallNonvirtualCharMethod { get { if (_CallNonvirtualCharMethod == null) - _CallNonvirtualCharMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char)); + _CallNonvirtualCharMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod); return _CallNonvirtualCharMethod; } } @@ -11832,7 +11784,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_char CallNonvirtualCharMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char CallNonvirtualCharMethodA { get { if (_CallNonvirtualCharMethodA == null) - _CallNonvirtualCharMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char)); + _CallNonvirtualCharMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA); return _CallNonvirtualCharMethodA; } } @@ -11841,7 +11793,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_char CallNon public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short CallNonvirtualShortMethod { get { if (_CallNonvirtualShortMethod == null) - _CallNonvirtualShortMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short)); + _CallNonvirtualShortMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod); return _CallNonvirtualShortMethod; } } @@ -11850,7 +11802,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_short CallNonvirtualShortMethod public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short CallNonvirtualShortMethodA { get { if (_CallNonvirtualShortMethodA == null) - _CallNonvirtualShortMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short)); + _CallNonvirtualShortMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA); return _CallNonvirtualShortMethodA; } } @@ -11859,7 +11811,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_short CallNo public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int CallNonvirtualIntMethod { get { if (_CallNonvirtualIntMethod == null) - _CallNonvirtualIntMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int)); + _CallNonvirtualIntMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod); return _CallNonvirtualIntMethod; } } @@ -11868,7 +11820,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_int CallNonvirtualIntMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int CallNonvirtualIntMethodA { get { if (_CallNonvirtualIntMethodA == null) - _CallNonvirtualIntMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int)); + _CallNonvirtualIntMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA); return _CallNonvirtualIntMethodA; } } @@ -11877,7 +11829,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_int CallNonv public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long CallNonvirtualLongMethod { get { if (_CallNonvirtualLongMethod == null) - _CallNonvirtualLongMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long)); + _CallNonvirtualLongMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod); return _CallNonvirtualLongMethod; } } @@ -11886,7 +11838,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_long CallNonvirtualLongMethod { public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long CallNonvirtualLongMethodA { get { if (_CallNonvirtualLongMethodA == null) - _CallNonvirtualLongMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long)); + _CallNonvirtualLongMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA); return _CallNonvirtualLongMethodA; } } @@ -11895,7 +11847,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_long CallNon public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float CallNonvirtualFloatMethod { get { if (_CallNonvirtualFloatMethod == null) - _CallNonvirtualFloatMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float)); + _CallNonvirtualFloatMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod); return _CallNonvirtualFloatMethod; } } @@ -11904,7 +11856,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_float CallNonvirtualFloatMethod public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float CallNonvirtualFloatMethodA { get { if (_CallNonvirtualFloatMethodA == null) - _CallNonvirtualFloatMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float)); + _CallNonvirtualFloatMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA); return _CallNonvirtualFloatMethodA; } } @@ -11913,7 +11865,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_float CallNo public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double CallNonvirtualDoubleMethod { get { if (_CallNonvirtualDoubleMethod == null) - _CallNonvirtualDoubleMethod = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double)); + _CallNonvirtualDoubleMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod); return _CallNonvirtualDoubleMethod; } } @@ -11922,7 +11874,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_double CallNonvirtualDoubleMetho public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double CallNonvirtualDoubleMethodA { get { if (_CallNonvirtualDoubleMethodA == null) - _CallNonvirtualDoubleMethodA = (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA, typeof (JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double)); + _CallNonvirtualDoubleMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA); return _CallNonvirtualDoubleMethodA; } } @@ -11931,7 +11883,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr_double CallN public JniAction_JNIEnvPtr_jobject_jobject_IntPtr CallNonvirtualVoidMethod { get { if (_CallNonvirtualVoidMethod == null) - _CallNonvirtualVoidMethod = (JniAction_JNIEnvPtr_jobject_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod, typeof (JniAction_JNIEnvPtr_jobject_jobject_IntPtr)); + _CallNonvirtualVoidMethod = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod); return _CallNonvirtualVoidMethod; } } @@ -11940,7 +11892,7 @@ public JniAction_JNIEnvPtr_jobject_jobject_IntPtr CallNonvirtualVoidMethod { public JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr CallNonvirtualVoidMethodA { get { if (_CallNonvirtualVoidMethodA == null) - _CallNonvirtualVoidMethodA = (JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA, typeof (JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr)); + _CallNonvirtualVoidMethodA = Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA); return _CallNonvirtualVoidMethodA; } } @@ -11949,7 +11901,7 @@ public JniAction_JNIEnvPtr_jobject_jobject_IntPtr_JniArgumentValuePtr CallNonvir public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetFieldID { get { if (_GetFieldID == null) - _GetFieldID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFieldID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetFieldID = Marshal.GetDelegateForFunctionPointer (env.GetFieldID); return _GetFieldID; } } @@ -11958,7 +11910,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetFieldID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetObjectField { get { if (_GetObjectField == null) - _GetObjectField = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _GetObjectField = Marshal.GetDelegateForFunctionPointer (env.GetObjectField); return _GetObjectField; } } @@ -11967,7 +11919,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetObjectField { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetBooleanField { get { if (_GetBooleanField == null) - _GetBooleanField = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.GetBooleanField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _GetBooleanField = Marshal.GetDelegateForFunctionPointer (env.GetBooleanField); return _GetBooleanField; } } @@ -11976,7 +11928,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetBooleanField { public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetByteField { get { if (_GetByteField == null) - _GetByteField = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetByteField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _GetByteField = Marshal.GetDelegateForFunctionPointer (env.GetByteField); return _GetByteField; } } @@ -11985,7 +11937,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetByteField { public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetCharField { get { if (_GetCharField == null) - _GetCharField = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.GetCharField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _GetCharField = Marshal.GetDelegateForFunctionPointer (env.GetCharField); return _GetCharField; } } @@ -11994,7 +11946,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetCharField { public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetShortField { get { if (_GetShortField == null) - _GetShortField = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.GetShortField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _GetShortField = Marshal.GetDelegateForFunctionPointer (env.GetShortField); return _GetShortField; } } @@ -12003,7 +11955,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetShortField { public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetIntField { get { if (_GetIntField == null) - _GetIntField = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetIntField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _GetIntField = Marshal.GetDelegateForFunctionPointer (env.GetIntField); return _GetIntField; } } @@ -12012,7 +11964,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetIntField { public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetLongField { get { if (_GetLongField == null) - _GetLongField = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.GetLongField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _GetLongField = Marshal.GetDelegateForFunctionPointer (env.GetLongField); return _GetLongField; } } @@ -12021,7 +11973,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetLongField { public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetFloatField { get { if (_GetFloatField == null) - _GetFloatField = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.GetFloatField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _GetFloatField = Marshal.GetDelegateForFunctionPointer (env.GetFloatField); return _GetFloatField; } } @@ -12030,7 +11982,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetFloatField { public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetDoubleField { get { if (_GetDoubleField == null) - _GetDoubleField = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.GetDoubleField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _GetDoubleField = Marshal.GetDelegateForFunctionPointer (env.GetDoubleField); return _GetDoubleField; } } @@ -12039,7 +11991,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetDoubleField { public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetObjectField { get { if (_SetObjectField == null) - _SetObjectField = (JniAction_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.SetObjectField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_jobject)); + _SetObjectField = Marshal.GetDelegateForFunctionPointer (env.SetObjectField); return _SetObjectField; } } @@ -12048,7 +12000,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetObjectField { public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetBooleanField { get { if (_SetBooleanField == null) - _SetBooleanField = (JniAction_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.SetBooleanField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_byte)); + _SetBooleanField = Marshal.GetDelegateForFunctionPointer (env.SetBooleanField); return _SetBooleanField; } } @@ -12057,7 +12009,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetBooleanField { public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetByteField { get { if (_SetByteField == null) - _SetByteField = (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetByteField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte)); + _SetByteField = Marshal.GetDelegateForFunctionPointer (env.SetByteField); return _SetByteField; } } @@ -12066,7 +12018,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetByteField { public JniAction_JNIEnvPtr_jobject_IntPtr_char SetCharField { get { if (_SetCharField == null) - _SetCharField = (JniAction_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.SetCharField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_char)); + _SetCharField = Marshal.GetDelegateForFunctionPointer (env.SetCharField); return _SetCharField; } } @@ -12075,7 +12027,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_char SetCharField { public JniAction_JNIEnvPtr_jobject_IntPtr_short SetShortField { get { if (_SetShortField == null) - _SetShortField = (JniAction_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.SetShortField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_short)); + _SetShortField = Marshal.GetDelegateForFunctionPointer (env.SetShortField); return _SetShortField; } } @@ -12084,7 +12036,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_short SetShortField { public JniAction_JNIEnvPtr_jobject_IntPtr_int SetIntField { get { if (_SetIntField == null) - _SetIntField = (JniAction_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.SetIntField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_int)); + _SetIntField = Marshal.GetDelegateForFunctionPointer (env.SetIntField); return _SetIntField; } } @@ -12093,7 +12045,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_int SetIntField { public JniAction_JNIEnvPtr_jobject_IntPtr_long SetLongField { get { if (_SetLongField == null) - _SetLongField = (JniAction_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.SetLongField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_long)); + _SetLongField = Marshal.GetDelegateForFunctionPointer (env.SetLongField); return _SetLongField; } } @@ -12102,7 +12054,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_long SetLongField { public JniAction_JNIEnvPtr_jobject_IntPtr_float SetFloatField { get { if (_SetFloatField == null) - _SetFloatField = (JniAction_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.SetFloatField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_float)); + _SetFloatField = Marshal.GetDelegateForFunctionPointer (env.SetFloatField); return _SetFloatField; } } @@ -12111,7 +12063,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_float SetFloatField { public JniAction_JNIEnvPtr_jobject_IntPtr_double SetDoubleField { get { if (_SetDoubleField == null) - _SetDoubleField = (JniAction_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.SetDoubleField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_double)); + _SetDoubleField = Marshal.GetDelegateForFunctionPointer (env.SetDoubleField); return _SetDoubleField; } } @@ -12120,7 +12072,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_double SetDoubleField { public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticMethodID { get { if (_GetStaticMethodID == null) - _GetStaticMethodID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetStaticMethodID = Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID); return _GetStaticMethodID; } } @@ -12129,7 +12081,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticMethodID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallStaticObjectMethod { get { if (_CallStaticObjectMethod == null) - _CallStaticObjectMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _CallStaticObjectMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod); return _CallStaticObjectMethod; } } @@ -12138,7 +12090,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject CallStaticObjectMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallStaticObjectMethodA { get { if (_CallStaticObjectMethodA == null) - _CallStaticObjectMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject)); + _CallStaticObjectMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA); return _CallStaticObjectMethodA; } } @@ -12147,7 +12099,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_jobject CallStaticOb public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallStaticBooleanMethod { get { if (_CallStaticBooleanMethod == null) - _CallStaticBooleanMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _CallStaticBooleanMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod); return _CallStaticBooleanMethod; } } @@ -12156,7 +12108,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte CallStaticBooleanMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallStaticBooleanMethodA { get { if (_CallStaticBooleanMethodA == null) - _CallStaticBooleanMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte)); + _CallStaticBooleanMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA); return _CallStaticBooleanMethodA; } } @@ -12165,7 +12117,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_byte CallStaticBoole public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallStaticByteMethod { get { if (_CallStaticByteMethod == null) - _CallStaticByteMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _CallStaticByteMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethod); return _CallStaticByteMethod; } } @@ -12174,7 +12126,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte CallStaticByteMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallStaticByteMethodA { get { if (_CallStaticByteMethodA == null) - _CallStaticByteMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte)); + _CallStaticByteMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticByteMethodA); return _CallStaticByteMethodA; } } @@ -12183,7 +12135,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_sbyte CallStaticByte public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallStaticCharMethod { get { if (_CallStaticCharMethod == null) - _CallStaticCharMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _CallStaticCharMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod); return _CallStaticCharMethod; } } @@ -12192,7 +12144,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char CallStaticCharMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallStaticCharMethodA { get { if (_CallStaticCharMethodA == null) - _CallStaticCharMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char)); + _CallStaticCharMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA); return _CallStaticCharMethodA; } } @@ -12201,7 +12153,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_char CallStaticCharM public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallStaticShortMethod { get { if (_CallStaticShortMethod == null) - _CallStaticShortMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _CallStaticShortMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod); return _CallStaticShortMethod; } } @@ -12210,7 +12162,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short CallStaticShortMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallStaticShortMethodA { get { if (_CallStaticShortMethodA == null) - _CallStaticShortMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short)); + _CallStaticShortMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA); return _CallStaticShortMethodA; } } @@ -12219,7 +12171,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_short CallStaticShor public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallStaticIntMethod { get { if (_CallStaticIntMethod == null) - _CallStaticIntMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _CallStaticIntMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod); return _CallStaticIntMethod; } } @@ -12228,7 +12180,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int CallStaticIntMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallStaticIntMethodA { get { if (_CallStaticIntMethodA == null) - _CallStaticIntMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int)); + _CallStaticIntMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA); return _CallStaticIntMethodA; } } @@ -12237,7 +12189,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_int CallStaticIntMet public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallStaticLongMethod { get { if (_CallStaticLongMethod == null) - _CallStaticLongMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _CallStaticLongMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod); return _CallStaticLongMethod; } } @@ -12246,7 +12198,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long CallStaticLongMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallStaticLongMethodA { get { if (_CallStaticLongMethodA == null) - _CallStaticLongMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long)); + _CallStaticLongMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA); return _CallStaticLongMethodA; } } @@ -12255,7 +12207,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_long CallStaticLongM public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallStaticFloatMethod { get { if (_CallStaticFloatMethod == null) - _CallStaticFloatMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _CallStaticFloatMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod); return _CallStaticFloatMethod; } } @@ -12264,7 +12216,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float CallStaticFloatMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallStaticFloatMethodA { get { if (_CallStaticFloatMethodA == null) - _CallStaticFloatMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float)); + _CallStaticFloatMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA); return _CallStaticFloatMethodA; } } @@ -12273,7 +12225,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_float CallStaticFloa public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallStaticDoubleMethod { get { if (_CallStaticDoubleMethod == null) - _CallStaticDoubleMethod = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _CallStaticDoubleMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod); return _CallStaticDoubleMethod; } } @@ -12282,7 +12234,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double CallStaticDoubleMethod { public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallStaticDoubleMethodA { get { if (_CallStaticDoubleMethodA == null) - _CallStaticDoubleMethodA = (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double)); + _CallStaticDoubleMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA); return _CallStaticDoubleMethodA; } } @@ -12291,7 +12243,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr_double CallStaticDou public JniAction_JNIEnvPtr_jobject_IntPtr CallStaticVoidMethod { get { if (_CallStaticVoidMethod == null) - _CallStaticVoidMethod = (JniAction_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod, typeof (JniAction_JNIEnvPtr_jobject_IntPtr)); + _CallStaticVoidMethod = Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod); return _CallStaticVoidMethod; } } @@ -12300,7 +12252,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr CallStaticVoidMethod { public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallStaticVoidMethodA { get { if (_CallStaticVoidMethodA == null) - _CallStaticVoidMethodA = (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr)); + _CallStaticVoidMethodA = Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA); return _CallStaticVoidMethodA; } } @@ -12309,7 +12261,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_JniArgumentValuePtr CallStaticVoidMeth public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticFieldID { get { if (_GetStaticFieldID == null) - _GetStaticFieldID = (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID, typeof (JniFunc_JNIEnvPtr_jobject_string_string_IntPtr)); + _GetStaticFieldID = Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID); return _GetStaticFieldID; } } @@ -12318,7 +12270,7 @@ public JniFunc_JNIEnvPtr_jobject_string_string_IntPtr GetStaticFieldID { public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetStaticObjectField { get { if (_GetStaticObjectField == null) - _GetStaticObjectField = (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_jobject)); + _GetStaticObjectField = Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField); return _GetStaticObjectField; } } @@ -12327,7 +12279,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_jobject GetStaticObjectField { public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetStaticBooleanField { get { if (_GetStaticBooleanField == null) - _GetStaticBooleanField = (JniFunc_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_byte)); + _GetStaticBooleanField = Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField); return _GetStaticBooleanField; } } @@ -12336,7 +12288,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_byte GetStaticBooleanField { public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetStaticByteField { get { if (_GetStaticByteField == null) - _GetStaticByteField = (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte)); + _GetStaticByteField = Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField); return _GetStaticByteField; } } @@ -12345,7 +12297,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_sbyte GetStaticByteField { public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetStaticCharField { get { if (_GetStaticCharField == null) - _GetStaticCharField = (JniFunc_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_char)); + _GetStaticCharField = Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField); return _GetStaticCharField; } } @@ -12354,7 +12306,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_char GetStaticCharField { public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetStaticShortField { get { if (_GetStaticShortField == null) - _GetStaticShortField = (JniFunc_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_short)); + _GetStaticShortField = Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField); return _GetStaticShortField; } } @@ -12363,7 +12315,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_short GetStaticShortField { public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetStaticIntField { get { if (_GetStaticIntField == null) - _GetStaticIntField = (JniFunc_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_int)); + _GetStaticIntField = Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField); return _GetStaticIntField; } } @@ -12372,7 +12324,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_int GetStaticIntField { public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetStaticLongField { get { if (_GetStaticLongField == null) - _GetStaticLongField = (JniFunc_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_long)); + _GetStaticLongField = Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField); return _GetStaticLongField; } } @@ -12381,7 +12333,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_long GetStaticLongField { public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetStaticFloatField { get { if (_GetStaticFloatField == null) - _GetStaticFloatField = (JniFunc_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_float)); + _GetStaticFloatField = Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField); return _GetStaticFloatField; } } @@ -12390,7 +12342,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_float GetStaticFloatField { public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetStaticDoubleField { get { if (_GetStaticDoubleField == null) - _GetStaticDoubleField = (JniFunc_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr_double)); + _GetStaticDoubleField = Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField); return _GetStaticDoubleField; } } @@ -12399,7 +12351,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr_double GetStaticDoubleField { public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetStaticObjectField { get { if (_SetStaticObjectField == null) - _SetStaticObjectField = (JniAction_JNIEnvPtr_jobject_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_jobject)); + _SetStaticObjectField = Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField); return _SetStaticObjectField; } } @@ -12408,7 +12360,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_jobject SetStaticObjectField { public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetStaticBooleanField { get { if (_SetStaticBooleanField == null) - _SetStaticBooleanField = (JniAction_JNIEnvPtr_jobject_IntPtr_byte) Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_byte)); + _SetStaticBooleanField = Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField); return _SetStaticBooleanField; } } @@ -12417,7 +12369,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_byte SetStaticBooleanField { public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetStaticByteField { get { if (_SetStaticByteField == null) - _SetStaticByteField = (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_sbyte)); + _SetStaticByteField = Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField); return _SetStaticByteField; } } @@ -12426,7 +12378,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_sbyte SetStaticByteField { public JniAction_JNIEnvPtr_jobject_IntPtr_char SetStaticCharField { get { if (_SetStaticCharField == null) - _SetStaticCharField = (JniAction_JNIEnvPtr_jobject_IntPtr_char) Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_char)); + _SetStaticCharField = Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField); return _SetStaticCharField; } } @@ -12435,7 +12387,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_char SetStaticCharField { public JniAction_JNIEnvPtr_jobject_IntPtr_short SetStaticShortField { get { if (_SetStaticShortField == null) - _SetStaticShortField = (JniAction_JNIEnvPtr_jobject_IntPtr_short) Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_short)); + _SetStaticShortField = Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField); return _SetStaticShortField; } } @@ -12444,7 +12396,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_short SetStaticShortField { public JniAction_JNIEnvPtr_jobject_IntPtr_int SetStaticIntField { get { if (_SetStaticIntField == null) - _SetStaticIntField = (JniAction_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_int)); + _SetStaticIntField = Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField); return _SetStaticIntField; } } @@ -12453,7 +12405,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_int SetStaticIntField { public JniAction_JNIEnvPtr_jobject_IntPtr_long SetStaticLongField { get { if (_SetStaticLongField == null) - _SetStaticLongField = (JniAction_JNIEnvPtr_jobject_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_long)); + _SetStaticLongField = Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField); return _SetStaticLongField; } } @@ -12462,7 +12414,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_long SetStaticLongField { public JniAction_JNIEnvPtr_jobject_IntPtr_float SetStaticFloatField { get { if (_SetStaticFloatField == null) - _SetStaticFloatField = (JniAction_JNIEnvPtr_jobject_IntPtr_float) Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_float)); + _SetStaticFloatField = Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField); return _SetStaticFloatField; } } @@ -12471,7 +12423,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_float SetStaticFloatField { public JniAction_JNIEnvPtr_jobject_IntPtr_double SetStaticDoubleField { get { if (_SetStaticDoubleField == null) - _SetStaticDoubleField = (JniAction_JNIEnvPtr_jobject_IntPtr_double) Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_double)); + _SetStaticDoubleField = Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField); return _SetStaticDoubleField; } } @@ -12480,7 +12432,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_double SetStaticDoubleField { public JniFunc_JNIEnvPtr_charPtr_int_jobject NewString { get { if (_NewString == null) - _NewString = (JniFunc_JNIEnvPtr_charPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewString, typeof (JniFunc_JNIEnvPtr_charPtr_int_jobject)); + _NewString = Marshal.GetDelegateForFunctionPointer (env.NewString); return _NewString; } } @@ -12489,7 +12441,7 @@ public JniFunc_JNIEnvPtr_charPtr_int_jobject NewString { public JniFunc_JNIEnvPtr_jobject_int GetStringLength { get { if (_GetStringLength == null) - _GetStringLength = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetStringLength, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _GetStringLength = Marshal.GetDelegateForFunctionPointer (env.GetStringLength); return _GetStringLength; } } @@ -12498,7 +12450,7 @@ public JniFunc_JNIEnvPtr_jobject_int GetStringLength { public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetStringChars { get { if (_GetStringChars == null) - _GetStringChars = (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringChars, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr)); + _GetStringChars = Marshal.GetDelegateForFunctionPointer (env.GetStringChars); return _GetStringChars; } } @@ -12507,7 +12459,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetStringChars { public JniAction_JNIEnvPtr_jobject_charPtr ReleaseStringChars { get { if (_ReleaseStringChars == null) - _ReleaseStringChars = (JniAction_JNIEnvPtr_jobject_charPtr) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars, typeof (JniAction_JNIEnvPtr_jobject_charPtr)); + _ReleaseStringChars = Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars); return _ReleaseStringChars; } } @@ -12516,7 +12468,7 @@ public JniAction_JNIEnvPtr_jobject_charPtr ReleaseStringChars { public JniFunc_JNIEnvPtr_string_jobject NewStringUTF { get { if (_NewStringUTF == null) - _NewStringUTF = (JniFunc_JNIEnvPtr_string_jobject) Marshal.GetDelegateForFunctionPointer (env.NewStringUTF, typeof (JniFunc_JNIEnvPtr_string_jobject)); + _NewStringUTF = Marshal.GetDelegateForFunctionPointer (env.NewStringUTF); return _NewStringUTF; } } @@ -12525,7 +12477,7 @@ public JniFunc_JNIEnvPtr_string_jobject NewStringUTF { public JniFunc_JNIEnvPtr_jobject_int GetStringUTFLength { get { if (_GetStringUTFLength == null) - _GetStringUTFLength = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _GetStringUTFLength = Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength); return _GetStringUTFLength; } } @@ -12534,7 +12486,7 @@ public JniFunc_JNIEnvPtr_jobject_int GetStringUTFLength { public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringUTFChars { get { if (_GetStringUTFChars == null) - _GetStringUTFChars = (JniFunc_JNIEnvPtr_jobject_boolPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_string)); + _GetStringUTFChars = Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars); return _GetStringUTFChars; } } @@ -12543,7 +12495,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringUTFChars { public JniAction_JNIEnvPtr_jobject_string ReleaseStringUTFChars { get { if (_ReleaseStringUTFChars == null) - _ReleaseStringUTFChars = (JniAction_JNIEnvPtr_jobject_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars, typeof (JniAction_JNIEnvPtr_jobject_string)); + _ReleaseStringUTFChars = Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars); return _ReleaseStringUTFChars; } } @@ -12552,7 +12504,7 @@ public JniAction_JNIEnvPtr_jobject_string ReleaseStringUTFChars { public JniFunc_JNIEnvPtr_jobject_int GetArrayLength { get { if (_GetArrayLength == null) - _GetArrayLength = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetArrayLength, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _GetArrayLength = Marshal.GetDelegateForFunctionPointer (env.GetArrayLength); return _GetArrayLength; } } @@ -12561,7 +12513,7 @@ public JniFunc_JNIEnvPtr_jobject_int GetArrayLength { public JniFunc_JNIEnvPtr_int_jobject_jobject_jobject NewObjectArray { get { if (_NewObjectArray == null) - _NewObjectArray = (JniFunc_JNIEnvPtr_int_jobject_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectArray, typeof (JniFunc_JNIEnvPtr_int_jobject_jobject_jobject)); + _NewObjectArray = Marshal.GetDelegateForFunctionPointer (env.NewObjectArray); return _NewObjectArray; } } @@ -12570,7 +12522,7 @@ public JniFunc_JNIEnvPtr_int_jobject_jobject_jobject NewObjectArray { public JniFunc_JNIEnvPtr_jobject_int_jobject GetObjectArrayElement { get { if (_GetObjectArrayElement == null) - _GetObjectArrayElement = (JniFunc_JNIEnvPtr_jobject_int_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement, typeof (JniFunc_JNIEnvPtr_jobject_int_jobject)); + _GetObjectArrayElement = Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement); return _GetObjectArrayElement; } } @@ -12579,7 +12531,7 @@ public JniFunc_JNIEnvPtr_jobject_int_jobject GetObjectArrayElement { public JniAction_JNIEnvPtr_jobject_int_jobject SetObjectArrayElement { get { if (_SetObjectArrayElement == null) - _SetObjectArrayElement = (JniAction_JNIEnvPtr_jobject_int_jobject) Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement, typeof (JniAction_JNIEnvPtr_jobject_int_jobject)); + _SetObjectArrayElement = Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement); return _SetObjectArrayElement; } } @@ -12588,7 +12540,7 @@ public JniAction_JNIEnvPtr_jobject_int_jobject SetObjectArrayElement { public JniFunc_JNIEnvPtr_int_jobject NewBooleanArray { get { if (_NewBooleanArray == null) - _NewBooleanArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewBooleanArray = Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray); return _NewBooleanArray; } } @@ -12597,7 +12549,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewBooleanArray { public JniFunc_JNIEnvPtr_int_jobject NewByteArray { get { if (_NewByteArray == null) - _NewByteArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewByteArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewByteArray = Marshal.GetDelegateForFunctionPointer (env.NewByteArray); return _NewByteArray; } } @@ -12606,7 +12558,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewByteArray { public JniFunc_JNIEnvPtr_int_jobject NewCharArray { get { if (_NewCharArray == null) - _NewCharArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewCharArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewCharArray = Marshal.GetDelegateForFunctionPointer (env.NewCharArray); return _NewCharArray; } } @@ -12615,7 +12567,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewCharArray { public JniFunc_JNIEnvPtr_int_jobject NewShortArray { get { if (_NewShortArray == null) - _NewShortArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewShortArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewShortArray = Marshal.GetDelegateForFunctionPointer (env.NewShortArray); return _NewShortArray; } } @@ -12624,7 +12576,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewShortArray { public JniFunc_JNIEnvPtr_int_jobject NewIntArray { get { if (_NewIntArray == null) - _NewIntArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewIntArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewIntArray = Marshal.GetDelegateForFunctionPointer (env.NewIntArray); return _NewIntArray; } } @@ -12633,7 +12585,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewIntArray { public JniFunc_JNIEnvPtr_int_jobject NewLongArray { get { if (_NewLongArray == null) - _NewLongArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLongArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewLongArray = Marshal.GetDelegateForFunctionPointer (env.NewLongArray); return _NewLongArray; } } @@ -12642,7 +12594,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewLongArray { public JniFunc_JNIEnvPtr_int_jobject NewFloatArray { get { if (_NewFloatArray == null) - _NewFloatArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewFloatArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewFloatArray = Marshal.GetDelegateForFunctionPointer (env.NewFloatArray); return _NewFloatArray; } } @@ -12651,7 +12603,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewFloatArray { public JniFunc_JNIEnvPtr_int_jobject NewDoubleArray { get { if (_NewDoubleArray == null) - _NewDoubleArray = (JniFunc_JNIEnvPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray, typeof (JniFunc_JNIEnvPtr_int_jobject)); + _NewDoubleArray = Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray); return _NewDoubleArray; } } @@ -12660,7 +12612,7 @@ public JniFunc_JNIEnvPtr_int_jobject NewDoubleArray { public JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr GetBooleanArrayElements { get { if (_GetBooleanArrayElements == null) - _GetBooleanArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr)); + _GetBooleanArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements); return _GetBooleanArrayElements; } } @@ -12669,7 +12621,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_boolPtr GetBooleanArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr GetByteArrayElements { get { if (_GetByteArrayElements == null) - _GetByteArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr)); + _GetByteArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements); return _GetByteArrayElements; } } @@ -12678,7 +12630,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_sbytePtr GetByteArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetCharArrayElements { get { if (_GetCharArrayElements == null) - _GetCharArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr)); + _GetCharArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements); return _GetCharArrayElements; } } @@ -12687,7 +12639,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_charPtr GetCharArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr GetShortArrayElements { get { if (_GetShortArrayElements == null) - _GetShortArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr)); + _GetShortArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements); return _GetShortArrayElements; } } @@ -12696,7 +12648,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_shortPtr GetShortArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr GetIntArrayElements { get { if (_GetIntArrayElements == null) - _GetIntArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr)); + _GetIntArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements); return _GetIntArrayElements; } } @@ -12705,7 +12657,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_intPtr GetIntArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr GetLongArrayElements { get { if (_GetLongArrayElements == null) - _GetLongArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr)); + _GetLongArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements); return _GetLongArrayElements; } } @@ -12714,7 +12666,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_longPtr GetLongArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr GetFloatArrayElements { get { if (_GetFloatArrayElements == null) - _GetFloatArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr)); + _GetFloatArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements); return _GetFloatArrayElements; } } @@ -12723,7 +12675,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_floatPtr GetFloatArrayElements { public JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr GetDoubleArrayElements { get { if (_GetDoubleArrayElements == null) - _GetDoubleArrayElements = (JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr)); + _GetDoubleArrayElements = Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements); return _GetDoubleArrayElements; } } @@ -12732,7 +12684,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_doublePtr GetDoubleArrayElements { public JniAction_JNIEnvPtr_jobject_boolPtr_int ReleaseBooleanArrayElements { get { if (_ReleaseBooleanArrayElements == null) - _ReleaseBooleanArrayElements = (JniAction_JNIEnvPtr_jobject_boolPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements, typeof (JniAction_JNIEnvPtr_jobject_boolPtr_int)); + _ReleaseBooleanArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements); return _ReleaseBooleanArrayElements; } } @@ -12741,7 +12693,7 @@ public JniAction_JNIEnvPtr_jobject_boolPtr_int ReleaseBooleanArrayElements { public JniAction_JNIEnvPtr_jobject_sbytePtr_int ReleaseByteArrayElements { get { if (_ReleaseByteArrayElements == null) - _ReleaseByteArrayElements = (JniAction_JNIEnvPtr_jobject_sbytePtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements, typeof (JniAction_JNIEnvPtr_jobject_sbytePtr_int)); + _ReleaseByteArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements); return _ReleaseByteArrayElements; } } @@ -12750,7 +12702,7 @@ public JniAction_JNIEnvPtr_jobject_sbytePtr_int ReleaseByteArrayElements { public JniAction_JNIEnvPtr_jobject_charPtr_int ReleaseCharArrayElements { get { if (_ReleaseCharArrayElements == null) - _ReleaseCharArrayElements = (JniAction_JNIEnvPtr_jobject_charPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements, typeof (JniAction_JNIEnvPtr_jobject_charPtr_int)); + _ReleaseCharArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements); return _ReleaseCharArrayElements; } } @@ -12759,7 +12711,7 @@ public JniAction_JNIEnvPtr_jobject_charPtr_int ReleaseCharArrayElements { public JniAction_JNIEnvPtr_jobject_shortPtr_int ReleaseShortArrayElements { get { if (_ReleaseShortArrayElements == null) - _ReleaseShortArrayElements = (JniAction_JNIEnvPtr_jobject_shortPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements, typeof (JniAction_JNIEnvPtr_jobject_shortPtr_int)); + _ReleaseShortArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements); return _ReleaseShortArrayElements; } } @@ -12768,7 +12720,7 @@ public JniAction_JNIEnvPtr_jobject_shortPtr_int ReleaseShortArrayElements { public JniAction_JNIEnvPtr_jobject_intPtr_int ReleaseIntArrayElements { get { if (_ReleaseIntArrayElements == null) - _ReleaseIntArrayElements = (JniAction_JNIEnvPtr_jobject_intPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements, typeof (JniAction_JNIEnvPtr_jobject_intPtr_int)); + _ReleaseIntArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements); return _ReleaseIntArrayElements; } } @@ -12777,7 +12729,7 @@ public JniAction_JNIEnvPtr_jobject_intPtr_int ReleaseIntArrayElements { public JniAction_JNIEnvPtr_jobject_longPtr_int ReleaseLongArrayElements { get { if (_ReleaseLongArrayElements == null) - _ReleaseLongArrayElements = (JniAction_JNIEnvPtr_jobject_longPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements, typeof (JniAction_JNIEnvPtr_jobject_longPtr_int)); + _ReleaseLongArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements); return _ReleaseLongArrayElements; } } @@ -12786,7 +12738,7 @@ public JniAction_JNIEnvPtr_jobject_longPtr_int ReleaseLongArrayElements { public JniAction_JNIEnvPtr_jobject_floatPtr_int ReleaseFloatArrayElements { get { if (_ReleaseFloatArrayElements == null) - _ReleaseFloatArrayElements = (JniAction_JNIEnvPtr_jobject_floatPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements, typeof (JniAction_JNIEnvPtr_jobject_floatPtr_int)); + _ReleaseFloatArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements); return _ReleaseFloatArrayElements; } } @@ -12795,7 +12747,7 @@ public JniAction_JNIEnvPtr_jobject_floatPtr_int ReleaseFloatArrayElements { public JniAction_JNIEnvPtr_jobject_doublePtr_int ReleaseDoubleArrayElements { get { if (_ReleaseDoubleArrayElements == null) - _ReleaseDoubleArrayElements = (JniAction_JNIEnvPtr_jobject_doublePtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements, typeof (JniAction_JNIEnvPtr_jobject_doublePtr_int)); + _ReleaseDoubleArrayElements = Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements); return _ReleaseDoubleArrayElements; } } @@ -12804,7 +12756,7 @@ public JniAction_JNIEnvPtr_jobject_doublePtr_int ReleaseDoubleArrayElements { public JniAction_JNIEnvPtr_jobject_int_int_boolPtr GetBooleanArrayRegion { get { if (_GetBooleanArrayRegion == null) - _GetBooleanArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_boolPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_boolPtr)); + _GetBooleanArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion); return _GetBooleanArrayRegion; } } @@ -12813,7 +12765,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_boolPtr GetBooleanArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr GetByteArrayRegion { get { if (_GetByteArrayRegion == null) - _GetByteArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr)); + _GetByteArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion); return _GetByteArrayRegion; } } @@ -12822,7 +12774,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr GetByteArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetCharArrayRegion { get { if (_GetCharArrayRegion == null) - _GetCharArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_charPtr)); + _GetCharArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion); return _GetCharArrayRegion; } } @@ -12831,7 +12783,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetCharArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_shortPtr GetShortArrayRegion { get { if (_GetShortArrayRegion == null) - _GetShortArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_shortPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_shortPtr)); + _GetShortArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion); return _GetShortArrayRegion; } } @@ -12840,7 +12792,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_shortPtr GetShortArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_intPtr GetIntArrayRegion { get { if (_GetIntArrayRegion == null) - _GetIntArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_intPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_intPtr)); + _GetIntArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion); return _GetIntArrayRegion; } } @@ -12849,7 +12801,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_intPtr GetIntArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_longPtr GetLongArrayRegion { get { if (_GetLongArrayRegion == null) - _GetLongArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_longPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_longPtr)); + _GetLongArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion); return _GetLongArrayRegion; } } @@ -12858,7 +12810,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_longPtr GetLongArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_floatPtr GetFloatArrayRegion { get { if (_GetFloatArrayRegion == null) - _GetFloatArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_floatPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_floatPtr)); + _GetFloatArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion); return _GetFloatArrayRegion; } } @@ -12867,7 +12819,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_floatPtr GetFloatArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_doublePtr GetDoubleArrayRegion { get { if (_GetDoubleArrayRegion == null) - _GetDoubleArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_doublePtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_doublePtr)); + _GetDoubleArrayRegion = Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion); return _GetDoubleArrayRegion; } } @@ -12876,7 +12828,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_doublePtr GetDoubleArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_boolPtr SetBooleanArrayRegion { get { if (_SetBooleanArrayRegion == null) - _SetBooleanArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_boolPtr) Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_boolPtr)); + _SetBooleanArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion); return _SetBooleanArrayRegion; } } @@ -12885,7 +12837,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_boolPtr SetBooleanArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr SetByteArrayRegion { get { if (_SetByteArrayRegion == null) - _SetByteArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr) Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_sbytePtr)); + _SetByteArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion); return _SetByteArrayRegion; } } @@ -12894,7 +12846,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_sbytePtr SetByteArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_charPtr SetCharArrayRegion { get { if (_SetCharArrayRegion == null) - _SetCharArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_charPtr) Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_charPtr)); + _SetCharArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion); return _SetCharArrayRegion; } } @@ -12903,7 +12855,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_charPtr SetCharArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_shortPtr SetShortArrayRegion { get { if (_SetShortArrayRegion == null) - _SetShortArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_shortPtr) Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_shortPtr)); + _SetShortArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion); return _SetShortArrayRegion; } } @@ -12912,7 +12864,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_shortPtr SetShortArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_intPtr SetIntArrayRegion { get { if (_SetIntArrayRegion == null) - _SetIntArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_intPtr) Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_intPtr)); + _SetIntArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion); return _SetIntArrayRegion; } } @@ -12921,7 +12873,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_intPtr SetIntArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_longPtr SetLongArrayRegion { get { if (_SetLongArrayRegion == null) - _SetLongArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_longPtr) Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_longPtr)); + _SetLongArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion); return _SetLongArrayRegion; } } @@ -12930,7 +12882,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_longPtr SetLongArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_floatPtr SetFloatArrayRegion { get { if (_SetFloatArrayRegion == null) - _SetFloatArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_floatPtr) Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_floatPtr)); + _SetFloatArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion); return _SetFloatArrayRegion; } } @@ -12939,7 +12891,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_floatPtr SetFloatArrayRegion { public JniAction_JNIEnvPtr_jobject_int_int_doublePtr SetDoubleArrayRegion { get { if (_SetDoubleArrayRegion == null) - _SetDoubleArrayRegion = (JniAction_JNIEnvPtr_jobject_int_int_doublePtr) Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_doublePtr)); + _SetDoubleArrayRegion = Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion); return _SetDoubleArrayRegion; } } @@ -12948,7 +12900,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_doublePtr SetDoubleArrayRegion { public JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int RegisterNatives { get { if (_RegisterNatives == null) - _RegisterNatives = (JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int) Marshal.GetDelegateForFunctionPointer (env.RegisterNatives, typeof (JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int)); + _RegisterNatives = Marshal.GetDelegateForFunctionPointer (env.RegisterNatives); return _RegisterNatives; } } @@ -12957,7 +12909,7 @@ public JniFunc_JNIEnvPtr_jobject_JniNativeMethodRegistrationArray_int_int Regist public JniFunc_JNIEnvPtr_jobject_int UnregisterNatives { get { if (_UnregisterNatives == null) - _UnregisterNatives = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _UnregisterNatives = Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives); return _UnregisterNatives; } } @@ -12966,7 +12918,7 @@ public JniFunc_JNIEnvPtr_jobject_int UnregisterNatives { public JniFunc_JNIEnvPtr_jobject_int MonitorEnter { get { if (_MonitorEnter == null) - _MonitorEnter = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.MonitorEnter, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _MonitorEnter = Marshal.GetDelegateForFunctionPointer (env.MonitorEnter); return _MonitorEnter; } } @@ -12975,7 +12927,7 @@ public JniFunc_JNIEnvPtr_jobject_int MonitorEnter { public JniFunc_JNIEnvPtr_jobject_int MonitorExit { get { if (_MonitorExit == null) - _MonitorExit = (JniFunc_JNIEnvPtr_jobject_int) Marshal.GetDelegateForFunctionPointer (env.MonitorExit, typeof (JniFunc_JNIEnvPtr_jobject_int)); + _MonitorExit = Marshal.GetDelegateForFunctionPointer (env.MonitorExit); return _MonitorExit; } } @@ -12984,7 +12936,7 @@ public JniFunc_JNIEnvPtr_jobject_int MonitorExit { public JniFunc_JNIEnvPtr_outIntPtr_int GetJavaVM { get { if (_GetJavaVM == null) - _GetJavaVM = (JniFunc_JNIEnvPtr_outIntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetJavaVM, typeof (JniFunc_JNIEnvPtr_outIntPtr_int)); + _GetJavaVM = Marshal.GetDelegateForFunctionPointer (env.GetJavaVM); return _GetJavaVM; } } @@ -12993,7 +12945,7 @@ public JniFunc_JNIEnvPtr_outIntPtr_int GetJavaVM { public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetStringRegion { get { if (_GetStringRegion == null) - _GetStringRegion = (JniAction_JNIEnvPtr_jobject_int_int_charPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_charPtr)); + _GetStringRegion = Marshal.GetDelegateForFunctionPointer (env.GetStringRegion); return _GetStringRegion; } } @@ -13002,7 +12954,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_charPtr GetStringRegion { public JniAction_JNIEnvPtr_jobject_int_int_IntPtr GetStringUTFRegion { get { if (_GetStringUTFRegion == null) - _GetStringUTFRegion = (JniAction_JNIEnvPtr_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion, typeof (JniAction_JNIEnvPtr_jobject_int_int_IntPtr)); + _GetStringUTFRegion = Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion); return _GetStringUTFRegion; } } @@ -13011,7 +12963,7 @@ public JniAction_JNIEnvPtr_jobject_int_int_IntPtr GetStringUTFRegion { public JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr GetPrimitiveArrayCritical { get { if (_GetPrimitiveArrayCritical == null) - _GetPrimitiveArrayCritical = (JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr)); + _GetPrimitiveArrayCritical = Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical); return _GetPrimitiveArrayCritical; } } @@ -13020,7 +12972,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_IntPtr GetPrimitiveArrayCritical { public JniAction_JNIEnvPtr_jobject_IntPtr_int ReleasePrimitiveArrayCritical { get { if (_ReleasePrimitiveArrayCritical == null) - _ReleasePrimitiveArrayCritical = (JniAction_JNIEnvPtr_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical, typeof (JniAction_JNIEnvPtr_jobject_IntPtr_int)); + _ReleasePrimitiveArrayCritical = Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical); return _ReleasePrimitiveArrayCritical; } } @@ -13029,7 +12981,7 @@ public JniAction_JNIEnvPtr_jobject_IntPtr_int ReleasePrimitiveArrayCritical { public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringCritical { get { if (_GetStringCritical == null) - _GetStringCritical = (JniFunc_JNIEnvPtr_jobject_boolPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringCritical, typeof (JniFunc_JNIEnvPtr_jobject_boolPtr_string)); + _GetStringCritical = Marshal.GetDelegateForFunctionPointer (env.GetStringCritical); return _GetStringCritical; } } @@ -13038,7 +12990,7 @@ public JniFunc_JNIEnvPtr_jobject_boolPtr_string GetStringCritical { public JniAction_JNIEnvPtr_jobject_string ReleaseStringCritical { get { if (_ReleaseStringCritical == null) - _ReleaseStringCritical = (JniAction_JNIEnvPtr_jobject_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical, typeof (JniAction_JNIEnvPtr_jobject_string)); + _ReleaseStringCritical = Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical); return _ReleaseStringCritical; } } @@ -13047,7 +12999,7 @@ public JniAction_JNIEnvPtr_jobject_string ReleaseStringCritical { public JniFunc_JNIEnvPtr_jobject_jobject NewWeakGlobalRef { get { if (_NewWeakGlobalRef == null) - _NewWeakGlobalRef = (JniFunc_JNIEnvPtr_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef, typeof (JniFunc_JNIEnvPtr_jobject_jobject)); + _NewWeakGlobalRef = Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef); return _NewWeakGlobalRef; } } @@ -13056,7 +13008,7 @@ public JniFunc_JNIEnvPtr_jobject_jobject NewWeakGlobalRef { public JniAction_JNIEnvPtr_IntPtr DeleteWeakGlobalRef { get { if (_DeleteWeakGlobalRef == null) - _DeleteWeakGlobalRef = (JniAction_JNIEnvPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef, typeof (JniAction_JNIEnvPtr_IntPtr)); + _DeleteWeakGlobalRef = Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef); return _DeleteWeakGlobalRef; } } @@ -13065,7 +13017,7 @@ public JniAction_JNIEnvPtr_IntPtr DeleteWeakGlobalRef { public JniFunc_JNIEnvPtr_byte ExceptionCheck { get { if (_ExceptionCheck == null) - _ExceptionCheck = (JniFunc_JNIEnvPtr_byte) Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck, typeof (JniFunc_JNIEnvPtr_byte)); + _ExceptionCheck = Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck); return _ExceptionCheck; } } @@ -13074,7 +13026,7 @@ public JniFunc_JNIEnvPtr_byte ExceptionCheck { public JniFunc_JNIEnvPtr_IntPtr_long_jobject NewDirectByteBuffer { get { if (_NewDirectByteBuffer == null) - _NewDirectByteBuffer = (JniFunc_JNIEnvPtr_IntPtr_long_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer, typeof (JniFunc_JNIEnvPtr_IntPtr_long_jobject)); + _NewDirectByteBuffer = Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer); return _NewDirectByteBuffer; } } @@ -13083,7 +13035,7 @@ public JniFunc_JNIEnvPtr_IntPtr_long_jobject NewDirectByteBuffer { public JniFunc_JNIEnvPtr_jobject_IntPtr GetDirectBufferAddress { get { if (_GetDirectBufferAddress == null) - _GetDirectBufferAddress = (JniFunc_JNIEnvPtr_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress, typeof (JniFunc_JNIEnvPtr_jobject_IntPtr)); + _GetDirectBufferAddress = Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress); return _GetDirectBufferAddress; } } @@ -13092,7 +13044,7 @@ public JniFunc_JNIEnvPtr_jobject_IntPtr GetDirectBufferAddress { public JniFunc_JNIEnvPtr_jobject_long GetDirectBufferCapacity { get { if (_GetDirectBufferCapacity == null) - _GetDirectBufferCapacity = (JniFunc_JNIEnvPtr_jobject_long) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity, typeof (JniFunc_JNIEnvPtr_jobject_long)); + _GetDirectBufferCapacity = Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity); return _GetDirectBufferCapacity; } } @@ -13101,7 +13053,7 @@ public JniFunc_JNIEnvPtr_jobject_long GetDirectBufferCapacity { public JniFunc_JNIEnvPtr_jobject_JniObjectReferenceType GetObjectRefType { get { if (_GetObjectRefType == null) - _GetObjectRefType = (JniFunc_JNIEnvPtr_jobject_JniObjectReferenceType) Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType, typeof (JniFunc_JNIEnvPtr_jobject_JniObjectReferenceType)); + _GetObjectRefType = Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType); return _GetObjectRefType; } } @@ -14806,10 +14758,9 @@ internal static unsafe int _ThrowNew (JniObjectReference type, string message) { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var _message_ptr = Marshal.StringToCoTaskMemUTF8 (message); + var _message_ptr = Marshal.StringToCoTaskMemUTF8 (message); IntPtr __env = JniEnvironment.EnvironmentPointer; var tmp = JniNativeMethods.ThrowNew (__env, type.Handle, _message_ptr); @@ -14838,10 +14789,9 @@ public static unsafe void ExceptionClear () public static unsafe void FatalError (string message) { - if (message == null) - throw new ArgumentNullException ("message"); + ArgumentNullException.ThrowIfNull (message); - var _message_ptr = Marshal.StringToCoTaskMemUTF8 (message); + var _message_ptr = Marshal.StringToCoTaskMemUTF8 (message); IntPtr __env = JniEnvironment.EnvironmentPointer; JniNativeMethods.FatalError (__env, _message_ptr); @@ -14862,12 +14812,10 @@ public static unsafe JniFieldInfo GetFieldID (JniObjectReference type, string na { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); + var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); var _signature_ptr = Marshal.StringToCoTaskMemUTF8 (signature); IntPtr __env = JniEnvironment.EnvironmentPointer; @@ -14889,9 +14837,8 @@ public static unsafe JniObjectReference GetObjectField (JniObjectReference insta { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14905,9 +14852,8 @@ public static unsafe bool GetBooleanField (JniObjectReference instance, JniField { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14920,9 +14866,8 @@ public static unsafe sbyte GetByteField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14935,9 +14880,8 @@ public static unsafe char GetCharField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14950,9 +14894,8 @@ public static unsafe short GetShortField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14965,9 +14908,8 @@ public static unsafe int GetIntField (JniObjectReference instance, JniFieldInfo { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14980,9 +14922,8 @@ public static unsafe long GetLongField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -14995,9 +14936,8 @@ public static unsafe float GetFloatField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15010,9 +14950,8 @@ public static unsafe double GetDoubleField (JniObjectReference instance, JniFiel { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15025,9 +14964,8 @@ public static unsafe void SetObjectField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15039,9 +14977,8 @@ public static unsafe void SetBooleanField (JniObjectReference instance, JniField { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15053,9 +14990,8 @@ public static unsafe void SetByteField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15067,9 +15003,8 @@ public static unsafe void SetCharField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15081,9 +15016,8 @@ public static unsafe void SetShortField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15095,9 +15029,8 @@ public static unsafe void SetIntField (JniObjectReference instance, JniFieldInfo { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15109,9 +15042,8 @@ public static unsafe void SetLongField (JniObjectReference instance, JniFieldInf { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15123,9 +15055,8 @@ public static unsafe void SetFloatField (JniObjectReference instance, JniFieldIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15137,9 +15068,8 @@ public static unsafe void SetDoubleField (JniObjectReference instance, JniFieldI { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -15154,12 +15084,10 @@ public static unsafe JniMethodInfo GetMethodID (JniObjectReference type, string { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); + var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); var _signature_ptr = Marshal.StringToCoTaskMemUTF8 (signature); IntPtr __env = JniEnvironment.EnvironmentPointer; @@ -15181,9 +15109,8 @@ public static unsafe JniObjectReference CallObjectMethod (JniObjectReference ins { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15203,9 +15130,8 @@ public static unsafe JniObjectReference CallObjectMethod (JniObjectReference ins { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15225,9 +15151,8 @@ public static unsafe bool CallBooleanMethod (JniObjectReference instance, JniMet { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15246,9 +15171,8 @@ public static unsafe bool CallBooleanMethod (JniObjectReference instance, JniMet { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15267,9 +15191,8 @@ public static unsafe sbyte CallByteMethod (JniObjectReference instance, JniMetho { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15288,9 +15211,8 @@ public static unsafe sbyte CallByteMethod (JniObjectReference instance, JniMetho { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15309,9 +15231,8 @@ public static unsafe char CallCharMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15330,9 +15251,8 @@ public static unsafe char CallCharMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15351,9 +15271,8 @@ public static unsafe short CallShortMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15372,9 +15291,8 @@ public static unsafe short CallShortMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15393,9 +15311,8 @@ public static unsafe int CallIntMethod (JniObjectReference instance, JniMethodIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15414,9 +15331,8 @@ public static unsafe int CallIntMethod (JniObjectReference instance, JniMethodIn { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15435,9 +15351,8 @@ public static unsafe long CallLongMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15456,9 +15371,8 @@ public static unsafe long CallLongMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15477,9 +15391,8 @@ public static unsafe float CallFloatMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15498,9 +15411,8 @@ public static unsafe float CallFloatMethod (JniObjectReference instance, JniMeth { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15519,9 +15431,8 @@ public static unsafe double CallDoubleMethod (JniObjectReference instance, JniMe { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15540,9 +15451,8 @@ public static unsafe double CallDoubleMethod (JniObjectReference instance, JniMe { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15561,9 +15471,8 @@ public static unsafe void CallVoidMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15581,9 +15490,8 @@ public static unsafe void CallVoidMethod (JniObjectReference instance, JniMethod { if (!instance.IsValid) throw new ArgumentException ("Handle must be valid.", "instance"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15603,9 +15511,8 @@ public static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectRef throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15627,9 +15534,8 @@ public static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectRef throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15651,9 +15557,8 @@ public static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference instan throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15674,9 +15579,8 @@ public static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference instan throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15697,9 +15601,8 @@ public static unsafe sbyte CallNonvirtualByteMethod (JniObjectReference instance throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15720,9 +15623,8 @@ public static unsafe sbyte CallNonvirtualByteMethod (JniObjectReference instance throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15743,9 +15645,8 @@ public static unsafe char CallNonvirtualCharMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15766,9 +15667,8 @@ public static unsafe char CallNonvirtualCharMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15789,9 +15689,8 @@ public static unsafe short CallNonvirtualShortMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15812,9 +15711,8 @@ public static unsafe short CallNonvirtualShortMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15835,9 +15733,8 @@ public static unsafe int CallNonvirtualIntMethod (JniObjectReference instance, J throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15858,9 +15755,8 @@ public static unsafe int CallNonvirtualIntMethod (JniObjectReference instance, J throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15881,9 +15777,8 @@ public static unsafe long CallNonvirtualLongMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15904,9 +15799,8 @@ public static unsafe long CallNonvirtualLongMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15927,9 +15821,8 @@ public static unsafe float CallNonvirtualFloatMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15950,9 +15843,8 @@ public static unsafe float CallNonvirtualFloatMethod (JniObjectReference instanc throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15973,9 +15865,8 @@ public static unsafe double CallNonvirtualDoubleMethod (JniObjectReference insta throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -15996,9 +15887,8 @@ public static unsafe double CallNonvirtualDoubleMethod (JniObjectReference insta throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -16019,9 +15909,8 @@ public static unsafe void CallNonvirtualVoidMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -16041,9 +15930,8 @@ public static unsafe void CallNonvirtualVoidMethod (JniObjectReference instance, throw new ArgumentException ("Handle must be valid.", "instance"); if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -16144,9 +16032,8 @@ internal static unsafe JniObjectReference _NewObject (JniObjectReference type, J { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -16166,9 +16053,8 @@ internal static unsafe JniObjectReference _NewObject (JniObjectReference type, J { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -16275,9 +16161,8 @@ public static unsafe JniObjectReference ToReflectedMethod (JniObjectReference ty { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (!method.IsStatic); @@ -16297,9 +16182,8 @@ public static unsafe JniObjectReference ToReflectedField (JniObjectReference typ { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (!field.IsStatic); @@ -16322,12 +16206,10 @@ public static unsafe JniFieldInfo GetStaticFieldID (JniObjectReference type, str { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); + var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); var _signature_ptr = Marshal.StringToCoTaskMemUTF8 (signature); IntPtr __env = JniEnvironment.EnvironmentPointer; @@ -16349,9 +16231,8 @@ public static unsafe JniObjectReference GetStaticObjectField (JniObjectReference { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16365,9 +16246,8 @@ public static unsafe bool GetStaticBooleanField (JniObjectReference type, JniFie { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16380,9 +16260,8 @@ public static unsafe sbyte GetStaticByteField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16395,9 +16274,8 @@ public static unsafe char GetStaticCharField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16410,9 +16288,8 @@ public static unsafe short GetStaticShortField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16425,9 +16302,8 @@ public static unsafe int GetStaticIntField (JniObjectReference type, JniFieldInf { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16440,9 +16316,8 @@ public static unsafe long GetStaticLongField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16455,9 +16330,8 @@ public static unsafe float GetStaticFloatField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16470,9 +16344,8 @@ public static unsafe double GetStaticDoubleField (JniObjectReference type, JniFi { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16485,9 +16358,8 @@ public static unsafe void SetStaticObjectField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16499,9 +16371,8 @@ public static unsafe void SetStaticBooleanField (JniObjectReference type, JniFie { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16513,9 +16384,8 @@ public static unsafe void SetStaticByteField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16527,9 +16397,8 @@ public static unsafe void SetStaticCharField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16541,9 +16410,8 @@ public static unsafe void SetStaticShortField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16555,9 +16423,8 @@ public static unsafe void SetStaticIntField (JniObjectReference type, JniFieldIn { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16569,9 +16436,8 @@ public static unsafe void SetStaticLongField (JniObjectReference type, JniFieldI { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16583,9 +16449,8 @@ public static unsafe void SetStaticFloatField (JniObjectReference type, JniField { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16597,9 +16462,8 @@ public static unsafe void SetStaticDoubleField (JniObjectReference type, JniFiel { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (field == null) - throw new ArgumentNullException ("field"); - if (!field.IsValid) + ArgumentNullException.ThrowIfNull (field); + if (!field.IsValid) throw new ArgumentException ("Handle value is not valid.", "field"); System.Diagnostics.Debug.Assert (field.IsStatic); @@ -16614,12 +16478,10 @@ public static unsafe JniMethodInfo GetStaticMethodID (JniObjectReference type, s { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (name == null) - throw new ArgumentNullException ("name"); - if (signature == null) - throw new ArgumentNullException ("signature"); + ArgumentNullException.ThrowIfNull (name); + ArgumentNullException.ThrowIfNull (signature); - var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); + var _name_ptr = Marshal.StringToCoTaskMemUTF8 (name); var _signature_ptr = Marshal.StringToCoTaskMemUTF8 (signature); IntPtr __env = JniEnvironment.EnvironmentPointer; @@ -16641,9 +16503,8 @@ public static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReferen { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16663,9 +16524,8 @@ public static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReferen { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16685,9 +16545,8 @@ public static unsafe bool CallStaticBooleanMethod (JniObjectReference type, JniM { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16706,9 +16565,8 @@ public static unsafe bool CallStaticBooleanMethod (JniObjectReference type, JniM { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16727,9 +16585,8 @@ public static unsafe sbyte CallStaticByteMethod (JniObjectReference type, JniMet { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16748,9 +16605,8 @@ public static unsafe sbyte CallStaticByteMethod (JniObjectReference type, JniMet { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16769,9 +16625,8 @@ public static unsafe char CallStaticCharMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16790,9 +16645,8 @@ public static unsafe char CallStaticCharMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16811,9 +16665,8 @@ public static unsafe short CallStaticShortMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16832,9 +16685,8 @@ public static unsafe short CallStaticShortMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16853,9 +16705,8 @@ public static unsafe int CallStaticIntMethod (JniObjectReference type, JniMethod { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16874,9 +16725,8 @@ public static unsafe int CallStaticIntMethod (JniObjectReference type, JniMethod { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16895,9 +16745,8 @@ public static unsafe long CallStaticLongMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16916,9 +16765,8 @@ public static unsafe long CallStaticLongMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16937,9 +16785,8 @@ public static unsafe float CallStaticFloatMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16958,9 +16805,8 @@ public static unsafe float CallStaticFloatMethod (JniObjectReference type, JniMe { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -16979,9 +16825,8 @@ public static unsafe double CallStaticDoubleMethod (JniObjectReference type, Jni { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -17000,9 +16845,8 @@ public static unsafe double CallStaticDoubleMethod (JniObjectReference type, Jni { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -17021,9 +16865,8 @@ public static unsafe void CallStaticVoidMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -17041,9 +16884,8 @@ public static unsafe void CallStaticVoidMethod (JniObjectReference type, JniMeth { if (!type.IsValid) throw new ArgumentException ("Handle must be valid.", "type"); - if (method == null) - throw new ArgumentNullException ("method"); - if (!method.IsValid) + ArgumentNullException.ThrowIfNull (method); + if (!method.IsValid) throw new ArgumentException ("Handle value is not valid.", "method"); System.Diagnostics.Debug.Assert (method.IsStatic); @@ -17108,9 +16950,8 @@ public static partial class Types { public static unsafe JniObjectReference DefineClass (string name, JniObjectReference loader, IntPtr buffer, int bufferLength) { - if (name == null) - throw new ArgumentNullException ("name"); - if (!loader.IsValid) + ArgumentNullException.ThrowIfNull (name); + if (!loader.IsValid) throw new ArgumentException ("Handle must be valid.", "loader"); if (buffer == IntPtr.Zero) throw new ArgumentException ("'buffer' must not be IntPtr.Zero.", "buffer"); @@ -17132,10 +16973,9 @@ public static unsafe JniObjectReference DefineClass (string name, JniObjectRefer internal static unsafe JniObjectReference _FindClass (string classname) { - if (classname == null) - throw new ArgumentNullException ("classname"); + ArgumentNullException.ThrowIfNull (classname); - var _classname_ptr = Marshal.StringToCoTaskMemUTF8 (classname); + var _classname_ptr = Marshal.StringToCoTaskMemUTF8 (classname); IntPtr __env = JniEnvironment.EnvironmentPointer; var tmp = JniNativeMethods.FindClass (__env, _classname_ptr); diff --git a/tests/logcat-parse-Tests/GrefsTest.cs b/tests/logcat-parse-Tests/GrefsTest.cs index 9dd065baf..66b527d91 100644 --- a/tests/logcat-parse-Tests/GrefsTest.cs +++ b/tests/logcat-parse-Tests/GrefsTest.cs @@ -10,7 +10,7 @@ namespace Xamarin.Android.Tools.LogcatParse.Tests { [TestFixture] - public class GrefsTest { + internal class GrefsTest { [Test] public void Instances_GrefToWgrefToCollected () diff --git a/tests/logcat-parse-Tests/JniHandleInfoTests.cs b/tests/logcat-parse-Tests/JniHandleInfoTests.cs index ea4da2285..e031aa81d 100644 --- a/tests/logcat-parse-Tests/JniHandleInfoTests.cs +++ b/tests/logcat-parse-Tests/JniHandleInfoTests.cs @@ -10,7 +10,7 @@ namespace Xamarin.Android.Tools.LogcatParse.Tests { [TestFixture] - public class JniHandleInfoTests { + internal class JniHandleInfoTests { [Test] public void ImplicitFromString () diff --git a/tools/class-parse/Program.cs b/tools/class-parse/Program.cs index bf3b2f178..7bd67ffdb 100644 --- a/tools/class-parse/Program.cs +++ b/tools/class-parse/Program.cs @@ -13,7 +13,7 @@ namespace Xamarin.Android.Tools { - class App { + sealed class App { public static void Main (string[] args) { diff --git a/tools/generator/ApiVersionsProvider.cs b/tools/generator/ApiVersionsProvider.cs index 3bd1c8fd7..295c57fda 100644 --- a/tools/generator/ApiVersionsProvider.cs +++ b/tools/generator/ApiVersionsProvider.cs @@ -6,7 +6,7 @@ namespace Xamarin.AndroidTools.AnnotationSupport { - public class ApiVersionsProvider + internal class ApiVersionsProvider { public void Parse (string apiVersionsFilePath) { @@ -57,7 +57,7 @@ void Parse (XmlReader reader) } } - public class Definition + internal class Definition { public string Name; // it is name + JNI signature for methods. public AndroidSdkVersion Since; @@ -97,7 +97,7 @@ void EnsureParsed () } } - public class ClassDefinition : Definition + internal class ClassDefinition : Definition { public IList Fields { get; private set; } = new List (); public IList Methods { get; private set; } = new List (); diff --git a/tools/generator/ApiVersionsSupport.cs b/tools/generator/ApiVersionsSupport.cs index d512a4027..6083b62fe 100644 --- a/tools/generator/ApiVersionsSupport.cs +++ b/tools/generator/ApiVersionsSupport.cs @@ -15,9 +15,9 @@ public static string AdditionalAttributeString (this ApiVersionsSupport.IApiAvai } } - public static class ApiVersionsSupport + internal static class ApiVersionsSupport { - public interface IApiAvailability + internal interface IApiAvailability { AndroidSdkVersion ApiAvailableSince { get; set; } AndroidSdkVersion ApiRemovedSince { get; set; } diff --git a/tools/generator/CodeGenerationOptions.cs b/tools/generator/CodeGenerationOptions.cs index d3c50a254..7ba4ba722 100644 --- a/tools/generator/CodeGenerationOptions.cs +++ b/tools/generator/CodeGenerationOptions.cs @@ -12,7 +12,7 @@ namespace MonoDroid.Generation { - public class CodeGenerationOptions + internal class CodeGenerationOptions { CodeGenerationTarget codeGenerationTarget; public CodeGenerationTarget CodeGenerationTarget { @@ -223,7 +223,7 @@ string GetJniTypeCode (ISymbol symbol) var jni_name = symbol.JniName; - if (jni_name.StartsWith ("L", StringComparison.Ordinal) || jni_name.StartsWith ("[", StringComparison.Ordinal)) + if (jni_name.StartsWith ('L') || jni_name.StartsWith ('[')) return "L"; return symbol.JniName; @@ -268,7 +268,7 @@ public string GetSafeIdentifier (string name) // Sadly that is not true in reality, so we need to exclude non-symbols // when replacing the argument name with a valid identifier. // (ReturnValue.ToNative() takes an argument which could be either an expression or mere symbol.) - if (name [name.Length-1] != ')' && !name.Contains ('.') && !name.StartsWith ("@", StringComparison.Ordinal)) { + if (name [name.Length-1] != ')' && !name.Contains ('.') && !name.StartsWith ('@')) { if (!IdentifierValidator.IsValidIdentifier (name) || Array.BinarySearch (TypeNameUtilities.reserved_keywords, name, StringComparer.Ordinal) >= 0) { name = name + "_"; @@ -297,7 +297,7 @@ public string GetFileName (string fullName) public string GetTransformedNamespace (string value) { - if (!value.HasValue () || !NamespaceTransforms.Any ()) + if (!value.HasValue () || NamespaceTransforms.Count == 0) return value; foreach (var nt in NamespaceTransforms) diff --git a/tools/generator/CodeGenerationTarget.cs b/tools/generator/CodeGenerationTarget.cs index e8624ac11..da6610699 100644 --- a/tools/generator/CodeGenerationTarget.cs +++ b/tools/generator/CodeGenerationTarget.cs @@ -1,6 +1,6 @@ namespace Xamarin.Android.Binder { - public enum CodeGenerationTarget + internal enum CodeGenerationTarget { XAJavaInterop1, JavaInterop1, diff --git a/tools/generator/CodeGenerator.cs b/tools/generator/CodeGenerator.cs index f7dcd14f4..f152f4124 100644 --- a/tools/generator/CodeGenerator.cs +++ b/tools/generator/CodeGenerator.cs @@ -21,7 +21,7 @@ namespace Xamarin.Android.Binder { - public class CodeGenerator + internal class CodeGenerator { public static int Main (string[] args) { @@ -43,8 +43,7 @@ public static int Main (string[] args) public static void Run (CodeGeneratorOptions options) { - if (options == null) - throw new ArgumentNullException ("options"); + ArgumentNullException.ThrowIfNull (options); using (var resolver = new DirectoryAssemblyResolver (Diagnostic.CreateConsoleLogger (), loadDebugSymbols: false)) { Run (options, resolver); diff --git a/tools/generator/CodeGeneratorContext.cs b/tools/generator/CodeGeneratorContext.cs index 4bc80d6e7..c231204de 100644 --- a/tools/generator/CodeGeneratorContext.cs +++ b/tools/generator/CodeGeneratorContext.cs @@ -4,14 +4,14 @@ namespace MonoDroid.Generation { - public class CodeGeneratorContext + internal class CodeGeneratorContext { public Stack ContextTypes { get; } = new Stack (); public List ContextGeneratedMethods { get; set; } = new List (); public Field ContextField { get; set; } public MethodBase ContextMethod { get; set; } - public GenBase ContextType => ContextTypes.Any () ? ContextTypes.Peek () : null; + public GenBase ContextType => ContextTypes.Count != 0 ? ContextTypes.Peek () : null; string ContextFieldString => ContextField != null ? "in field " + ContextField.Name + " " : null; string ContextMethodString => ContextMethod != null ? "in method " + ContextMethod.Name + " " : null; string ContextTypeString => ContextType != null ? "in managed type " + ContextType.FullName : null; diff --git a/tools/generator/CodeGeneratorOptions.cs b/tools/generator/CodeGeneratorOptions.cs index 317f8b93a..b460693dc 100644 --- a/tools/generator/CodeGeneratorOptions.cs +++ b/tools/generator/CodeGeneratorOptions.cs @@ -10,7 +10,7 @@ namespace Xamarin.Android.Binder { - public class CodeGeneratorOptions + internal class CodeGeneratorOptions { public CodeGeneratorOptions () { diff --git a/tools/generator/Extensions/GenBaseExtensions.cs b/tools/generator/Extensions/GenBaseExtensions.cs index cae65c976..c0f155447 100644 --- a/tools/generator/Extensions/GenBaseExtensions.cs +++ b/tools/generator/Extensions/GenBaseExtensions.cs @@ -6,7 +6,7 @@ namespace Xamarin.AndroidTools.AnnotationSupport { - public static class GenBaseExtensions + internal static class GenBaseExtensions { public static IEnumerable FlattenTypes (this GenBase t) { diff --git a/tools/generator/Extensions/JavaApiDllLoaderExtensions.cs b/tools/generator/Extensions/JavaApiDllLoaderExtensions.cs index 58e3b7cbf..50af98a54 100644 --- a/tools/generator/Extensions/JavaApiDllLoaderExtensions.cs +++ b/tools/generator/Extensions/JavaApiDllLoaderExtensions.cs @@ -6,7 +6,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster { - public static class JavaApiDllLoaderExtensions + internal static class JavaApiDllLoaderExtensions { public static void LoadReferences (this JavaApi api, CodeGenerationOptions opt, IEnumerable gens) { diff --git a/tools/generator/Extensions/ManagedExtensions.cs b/tools/generator/Extensions/ManagedExtensions.cs index b5e94c9c3..41afdb21d 100644 --- a/tools/generator/Extensions/ManagedExtensions.cs +++ b/tools/generator/Extensions/ManagedExtensions.cs @@ -1,6 +1,7 @@ using Java.Interop.Tools.Cecil; using Java.Interop.Tools.TypeNameMappings; using Mono.Cecil; +using System; using System.Collections.Generic; using System.Linq; @@ -63,7 +64,7 @@ public static string StripArity (this string type) if (less_than_index == -1) return type; - type = type.Substring (0, tick_index) + type.Substring (less_than_index); + type = string.Concat (type.AsSpan (0, tick_index), type.AsSpan (less_than_index)); } return type; diff --git a/tools/generator/GenerationInfo.cs b/tools/generator/GenerationInfo.cs index a10f3c9f1..4e84d8f1f 100644 --- a/tools/generator/GenerationInfo.cs +++ b/tools/generator/GenerationInfo.cs @@ -10,7 +10,7 @@ namespace MonoDroid.Generation { - public class GenerationInfo { + internal class GenerationInfo { public GenerationInfo (string csdir, string javadir, string assembly) { diff --git a/tools/generator/Java.Interop.Tools.Generator.Importers/CecilApiImporter.cs b/tools/generator/Java.Interop.Tools.Generator.Importers/CecilApiImporter.cs index 7a718448c..57cd817a4 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Importers/CecilApiImporter.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Importers/CecilApiImporter.cs @@ -220,7 +220,7 @@ public static Method CreateMethod (GenBase declaringType, MethodDefinition m, Co // Strip "Formatted" from ICharSequence-based method. var name_base = method.IsReturnCharSequence ? m.Name.Substring (0, m.Name.Length - "Formatted".Length) : m.Name; - method.Name = m.IsGetter ? (m.Name.StartsWith ("get_Is", StringComparison.Ordinal) && m.Name.Length > 6 && char.IsUpper (m.Name [6]) ? string.Empty : "Get") + name_base.Substring (4) : m.IsSetter ? (m.Name.StartsWith ("set_Is", StringComparison.Ordinal) && m.Name.Length > 6 && char.IsUpper (m.Name [6]) ? string.Empty : "Set") + name_base.Substring (4) : name_base; + method.Name = m.IsGetter ? string.Concat (m.Name.StartsWith ("get_Is", StringComparison.Ordinal) && m.Name.Length > 6 && char.IsUpper (m.Name [6]) ? string.Empty : "Get", name_base.AsSpan (4)) : m.IsSetter ? string.Concat (m.Name.StartsWith ("set_Is", StringComparison.Ordinal) && m.Name.Length > 6 && char.IsUpper (m.Name [6]) ? string.Empty : "Set", name_base.AsSpan (4)) : name_base; return method; } @@ -248,7 +248,7 @@ static CustomAttribute GetObsoleteAttribute (Collection attribu attributes.FirstOrDefault (a => a.AttributeType.FullNameCorrected () == "System.ObsoleteAttribute"); static string GetObsoleteComment (CustomAttribute attribute) => - attribute?.ConstructorArguments.Any () == true ? (string) attribute.ConstructorArguments [0].Value : null; + attribute?.ConstructorArguments.Count != 0 == true ? (string) attribute.ConstructorArguments [0].Value : null; static CustomAttribute GetRegisterAttribute (Collection attributes, CodeGenerationOptions opt) => attributes.FirstOrDefault (a => { diff --git a/tools/generator/Java.Interop.Tools.Generator.Importers/XmlApiImporter.cs b/tools/generator/Java.Interop.Tools.Generator.Importers/XmlApiImporter.cs index 5016f66be..dea8a5cd1 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Importers/XmlApiImporter.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Importers/XmlApiImporter.cs @@ -11,9 +11,10 @@ namespace MonoDroid.Generation { - class XmlApiImporter + partial class XmlApiImporter { - static readonly Regex api_level = new Regex (@"api-(\d+).xml"); + static readonly Regex api_level = MyRegex (); + internal static readonly char [] separator = new char [] { ',', ' ', '\n', '\r' }; public static List Parse (XDocument doc, CodeGenerationOptions options) { @@ -92,8 +93,8 @@ public static List ParsePackage (XElement ns, CodeGenerationOptions opt foreach (var name in nested.Keys) { var top_ancestor = name.Substring (0, name.IndexOf ('.')); - if (by_name.ContainsKey (top_ancestor)) - by_name [top_ancestor].AddNestedType (nested [name]); + if (by_name.TryGetValue (top_ancestor, out var value)) + value.AddNestedType (nested [name]); else { Report.LogCodedWarning (0, Report.WarningNestedTypeAncestorNotFound, top_ancestor, nested [name].FullName); nested [name].Invalidate (); @@ -148,7 +149,7 @@ public static ClassGen CreateClass (XElement pkg, XElement elem, CodeGenerationO } if (elem.Attribute ("skipInterfaceMethods")?.Value is string skip) - foreach (var m in skip.Split (new char [] { ',', ' ', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (var m in skip.Split (separator, StringSplitOptions.RemoveEmptyEntries)) klass.SkippedInterfaceMethods.Add (m); return klass; @@ -239,7 +240,7 @@ public static Field CreateField (GenBase declaringType, XElement elem, CodeGener if (elem.Attribute ("managedName") != null) field.Name = elem.XGetAttribute ("managedName"); else { - field.Name = TypeNameUtilities.StudlyCase (char.IsLower (field.JavaName [0]) || field.JavaName.ToLowerInvariant ().ToUpperInvariant () != field.JavaName ? field.JavaName : field.JavaName.ToLowerInvariant ()); + field.Name = TypeNameUtilities.StudlyCase (char.IsLower (field.JavaName [0]) || !field.JavaName.ToLowerInvariant ().Equals (field.JavaName, StringComparison.InvariantCultureIgnoreCase) ? field.JavaName : field.JavaName.ToLowerInvariant ()); field.Name = EnsureValidIdentifer (field.Name); } @@ -267,7 +268,7 @@ public static GenBaseSupport CreateGenBaseSupport (XElement pkg, XElement elem, }; if (elem.Attribute ("skipInvokerMethods")?.Value is string skip) - foreach (var m in skip.Split (new char [] { ',', ' ', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (var m in skip.Split (separator, StringSplitOptions.RemoveEmptyEntries)) support.SkippedInvokerMethods.Add (m); if (support.IsDeprecated) { @@ -571,10 +572,13 @@ static bool ShouldBind (XElement elem) var java_name = elem.XGetAttribute ("name"); // Ignore types that do not have a name (nested classes would end in a period like "Document.") - if (!java_name.HasValue () || java_name.EndsWith (".", StringComparison.Ordinal)) + if (!java_name.HasValue () || java_name.EndsWith ('.')) return false; return true; } + + [GeneratedRegex (@"api-(\d+).xml")] + private static partial Regex MyRegex (); } } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs index a071a5810..415a13f00 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public class ClassGen : GenBase + internal class ClassGen : GenBase { bool fill_explicit_implementation_started; HashSet skipped_interface_methods; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Ctor.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Ctor.cs index 0848e9497..9be981ef0 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Ctor.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Ctor.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class Ctor : MethodBase + internal class Ctor : MethodBase { public Ctor (GenBase declaringType) : base (declaringType) { diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Field.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Field.cs index 1a3f89f5b..ac49fc4fe 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Field.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Field.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class Field : ApiVersionsSupport.IApiAvailability, ISourceLineInfo + internal class Field : ApiVersionsSupport.IApiAvailability, ISourceLineInfo { public string AnnotatedVisibility { get; set; } public string Annotation { get; set; } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs index 4f0ca0b8e..fdca165b5 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBase.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public abstract class GenBase : IGeneratable, ApiVersionsSupport.IApiAvailability, ISourceLineInfo + internal abstract class GenBase : IGeneratable, ApiVersionsSupport.IApiAvailability, ISourceLineInfo { bool enum_updated; bool property_filled; @@ -141,15 +141,14 @@ void AddPropertyAccessors () if (Ancestors ().All (a => !a.prop_hash.ContainsKey (m.PropertyName)) && Ancestors ().Any (a => a.Methods.Any (mm => mm.Name == m.Name && ReturnTypeMatches (m, mm) && ParameterList.Equals (mm.Parameters, m.Parameters)))) unmatched.Add (m); // base setter exists, and it was not a property. - else if (prop_hash.ContainsKey (m.PropertyName)) { + else if (prop_hash.TryGetValue (m.PropertyName, out var setterProp)) { Property baseProp = BaseGen?.Properties.FirstOrDefault (p => p.Name == m.PropertyName); - var prop = prop_hash [m.PropertyName]; - if (prop.Getter.RetVal.FullName == m.Parameters [0].Type && - prop.Getter.IsAbstract == m.IsAbstract && // SearchIterator abstract getIndex() and non-abstract setIndex() - prop.Getter.Visibility == m.Visibility && + if (setterProp.Getter.RetVal.FullName == m.Parameters [0].Type && + setterProp.Getter.IsAbstract == m.IsAbstract && // SearchIterator abstract getIndex() and non-abstract setIndex() + setterProp.Getter.Visibility == m.Visibility && (baseProp == null || baseProp.Setter != null) && - prop.Getter.SourceApiLevel <= m.SourceApiLevel) - prop.Setter = m; + setterProp.Getter.SourceApiLevel <= m.SourceApiLevel) + setterProp.Setter = m; else unmatched.Add (m); } else if (prop_hash.ContainsKey ("Is" + m.PropertyName)) { @@ -166,8 +165,8 @@ void AddPropertyAccessors () unmatched.Add (m); } else unmatched.Add (m); - if (m.GenerateDispatchingSetter && prop_hash.ContainsKey (m.PropertyName)) - prop_hash [m.PropertyName].GenerateDispatchingSetter = true; + if (m.GenerateDispatchingSetter && prop_hash.TryGetValue (m.PropertyName, out var value)) + value.GenerateDispatchingSetter = true; } Methods = unmatched; } @@ -513,7 +512,7 @@ protected void GenerateAnnotationAttribute (CodeGenerationOptions opt, Generatio } if (ShouldGenerateAnnotationAttribute) { var baseName = Namespace.Length > 0 ? FullName.Substring (Namespace.Length + 1) : FullName; - var attrClassNameBase = baseName.Substring (TypeNamePrefix.Length) + "Attribute"; + var attrClassNameBase = string.Concat (baseName.AsSpan (TypeNamePrefix.Length), "Attribute"); var localFullName = Namespace + (Namespace.Length > 0 ? "." : string.Empty) + attrClassNameBase; using (var sw = gen_info.OpenStream (opt.GetFileName (localFullName))) { @@ -660,8 +659,8 @@ public Property GetPropertyByName (string name, bool check_ifaces) => public Property GetPropertyByName (string name, bool check_ifaces, bool check_base_ifaces) { - if (prop_hash.ContainsKey (name)) - return prop_hash [name]; + if (prop_hash.TryGetValue (name, out var value)) + return value; if (check_ifaces) { foreach (ISymbol isym in Interfaces) { diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBaseSupport.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBaseSupport.cs index 027e5cf62..f7085c5ca 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBaseSupport.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenBaseSupport.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class GenBaseSupport + internal class GenBaseSupport { HashSet skipped_invoker_methods; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterDefinition.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterDefinition.cs index 353afedcc..600e45ba5 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterDefinition.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterDefinition.cs @@ -13,7 +13,7 @@ namespace MonoDroid.Generation { // Represents a generic parameter definition in GenBase. - public class GenericParameterDefinition + internal class GenericParameterDefinition { public GenericParameterDefinition (string name, string [] constraints) { @@ -56,7 +56,7 @@ public GenericParameterDefinition Clone () } } - public class GenericParameterDefinitionList : List + internal class GenericParameterDefinitionList : List { public static GenericParameterDefinitionList Merge (GenericParameterDefinitionList l1, GenericParameterDefinitionList l2) { @@ -98,7 +98,7 @@ public static GenericParameterDefinitionList FromXml (XElement tps) public string ToGeneratedAttributeString () { - var typeArgList = this.Select (t => t.Name + (t.ConstraintExpressions.Any () ? " extends " + string.Join (" & ", t.ConstraintExpressions) : null)); + var typeArgList = this.Select (t => t.Name + (t.ConstraintExpressions.Length != 0 ? " extends " + string.Join (" & ", t.ConstraintExpressions) : null)); return "[global::Java.Interop.JavaTypeParameters (new string [] {\"" + string.Join ("\", \"", typeArgList) + "\"})]"; } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterList.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterList.cs index 8d472ba81..33d193172 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterList.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/GenericParameterList.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class GenericParameterList { + internal class GenericParameterList { public static string[] Parse (string type_params) { diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IGeneratable.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IGeneratable.cs index da84394f8..c05c836d7 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IGeneratable.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IGeneratable.cs @@ -2,7 +2,7 @@ namespace MonoDroid.Generation { - public interface IGeneratable : ISymbol { + internal interface IGeneratable : ISymbol { bool IsGeneratable { get; } void Generate (CodeGenerationOptions opt, GenerationInfo gen_info); } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IRequireGenericMarshal.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IRequireGenericMarshal.cs index 453dc0f31..16f905de1 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IRequireGenericMarshal.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/IRequireGenericMarshal.cs @@ -3,7 +3,7 @@ namespace MonoDroid.Generation { - public interface IRequireGenericMarshal + internal interface IRequireGenericMarshal { bool MayHaveManagedGenericArguments { get; } string GetGenericJavaObjectTypeOverride (); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/InterfaceGen.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/InterfaceGen.cs index 7f36d0cff..c571826f5 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/InterfaceGen.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/InterfaceGen.cs @@ -6,7 +6,7 @@ namespace MonoDroid.Generation { - public class InterfaceGen : GenBase, IRequireGenericMarshal + internal class InterfaceGen : GenBase, IRequireGenericMarshal { public InterfaceGen (GenBaseSupport support) : base (support) { @@ -30,11 +30,11 @@ public override void AddNestedType (GenBase gen) if (gen is InterfaceGen) { // ex: my.namespace.IParentChild - gen.FullName = FullName + gen.Name.Substring (1); - gen.Name = Name + gen.Name.Substring (1); + gen.FullName = string.Concat (FullName, gen.Name.AsSpan (1)); + gen.Name = string.Concat (Name, gen.Name.AsSpan (1)); } else { - gen.FullName = FullName.Substring (0, FullName.Length - Name.Length) + Name.Substring (1) + gen.Name; - gen.Name = Name.Substring (1) + gen.Name; + gen.FullName = string.Concat (FullName.AsSpan (0, FullName.Length - Name.Length), Name.AsSpan (1), gen.Name); + gen.Name = string.Concat (Name.AsSpan (1), gen.Name); } } } @@ -132,7 +132,7 @@ internal string GetArgsName (Method m) start = Name.StartsWith ("IOn", StringComparison.Ordinal) ? 3 : 1; trim = 8; // "Listener" } - return nameBase.Substring (start, nameBase.Length - start - trim) + "EventArgs"; + return string.Concat (nameBase.AsSpan (start, nameBase.Length - start - trim), "EventArgs"); } internal string GetEventDelegateName (Method m) @@ -148,7 +148,7 @@ internal string GetEventDelegateName (Method m) return "EventHandler<" + GetArgsName (m) + ">"; } else { string methodSpec = Methods.Count > 1 ? m.AdjustedName : string.Empty; - return Name.Substring (start, Name.Length - start - 8) + methodSpec + "Handler"; + return string.Concat (Name.AsSpan (start, Name.Length - start - 8), methodSpec, "Handler"); } } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/JavadocInfo.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/JavadocInfo.cs index c142a930c..172763f15 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/JavadocInfo.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/JavadocInfo.cs @@ -16,7 +16,7 @@ enum ApiLinkStyle { DeveloperAndroidComReference_2020Nov, } - public sealed class JavadocInfo { + internal sealed class JavadocInfo { public string Javadoc { get; set; } @@ -71,8 +71,8 @@ public static JavadocInfo CreateInfo (XElement element, XmldocStyle style, bool string declaringJniType = isType ? (string) element.Attribute ("jni-signature") : (string) element.Parent.Attribute ("jni-signature"); - if (declaringJniType.StartsWith ("L", StringComparison.Ordinal) && - declaringJniType.EndsWith (";", StringComparison.Ordinal)) { + if (declaringJniType.StartsWith ('L') && + declaringJniType.EndsWith (';')) { declaringJniType = declaringJniType.Substring (1, declaringJniType.Length-2); } @@ -86,7 +86,7 @@ public static JavadocInfo CreateInfo (XElement element, XmldocStyle style, bool string declaringMemberParameterString = null; - if (!isType && (declaringMemberJniSignature?.StartsWith ("(", StringComparison.Ordinal) ?? false)) { + if (!isType && (declaringMemberJniSignature?.StartsWith ('(') ?? false)) { var parameterTypes = element.Elements ("parameter")?.Select (e => e.Attribute ("type")?.Value)?.ToList (); if (parameterTypes?.Any () ?? false) { declaringMemberParameterString = $"({string.Join (", ", parameterTypes)})"; @@ -262,7 +262,7 @@ static XElement CreateAndroidDocLinkUri (string prefix, string declaringJniType, .Replace ("/", "."); var url = new StringBuilder (prefix); - if (!prefix.EndsWith ("/", StringComparison.Ordinal)) { + if (!prefix.EndsWith ('/')) { url.Append ("/"); } url.Append (declaringJniType); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Method.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Method.cs index d818df4c2..5f0e7779e 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Method.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Method.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class Method : MethodBase + internal class Method : MethodBase { bool is_override; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/MethodBase.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/MethodBase.cs index 2a8680faa..7658a1ba6 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/MethodBase.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/MethodBase.cs @@ -6,7 +6,7 @@ namespace MonoDroid.Generation { - public abstract class MethodBase : ApiVersionsSupport.IApiAvailability, ISourceLineInfo + internal abstract class MethodBase : ApiVersionsSupport.IApiAvailability, ISourceLineInfo { protected MethodBase (GenBase declaringType) { diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs index bb27a6087..3a3497719 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/NamespaceMapping.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class NamespaceMapping + internal class NamespaceMapping { Dictionary mappings = new Dictionary (); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs index 7bf81e1c0..330513318 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Parameter.cs @@ -11,7 +11,7 @@ namespace MonoDroid.Generation { - public class Parameter : ISourceLineInfo + internal class Parameter : ISourceLineInfo { bool is_sender; string name; @@ -133,7 +133,7 @@ public string UnsafeNativeName { public string JavaName { get { - if (Name.StartsWith ("@", StringComparison.Ordinal)) + if (Name.StartsWith ('@')) return Name.Substring (1); return Name; } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ParameterList.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ParameterList.cs index 779c1d657..9bc0fadf3 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ParameterList.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ParameterList.cs @@ -9,7 +9,7 @@ namespace MonoDroid.Generation { - public class ParameterList : IEnumerable { + internal class ParameterList : IEnumerable { public static bool Equals (ParameterList l1, ParameterList l2) { diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Property.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Property.cs index a9a51ff74..754b5c4f6 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Property.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Property.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public class Property + internal class Property { private Method setter; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ReturnValue.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ReturnValue.cs index 3f3bb13f4..2fa2cbb84 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ReturnValue.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ReturnValue.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public class ReturnValue { + internal class ReturnValue { ISymbol sym; string java_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 800360f60..5533bc8cb 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ArraySymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ArraySymbol.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public class ArraySymbol : ISymbol { + internal class ArraySymbol : ISymbol { static ISymbol byte_sym = new SimpleSymbol ("0", "byte", "byte", "B"); 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 d474cb421..ea5a35caf 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CharSequenceSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CharSequenceSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class CharSequenceSymbol : ISymbol { + internal class CharSequenceSymbol : ISymbol { public string DefaultValue { get { return "IntPtr.Zero"; } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CollectionSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CollectionSymbol.cs index 227a2f401..21326b6a6 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CollectionSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/CollectionSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class CollectionSymbol : ISymbol, IRequireGenericMarshal { + internal class CollectionSymbol : ISymbol, IRequireGenericMarshal { string java_name; string managed_name; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ColorSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ColorSymbol.cs index 1a4d1d258..95916c0ee 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ColorSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ColorSymbol.cs @@ -6,7 +6,7 @@ namespace MonoDroid.Generation { - public class ColorSymbol : SimpleSymbol, ISymbol { + internal class ColorSymbol : SimpleSymbol, ISymbol { public ColorSymbol () : base ("default (global::Android.Graphics.Color)", diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/EnumSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/EnumSymbol.cs index ad377c13a..403dd2965 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/EnumSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/EnumSymbol.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class EnumSymbol : ISymbol { + internal class EnumSymbol : ISymbol { string type; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/FormatSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/FormatSymbol.cs index abbb5cfe9..8608f04b1 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/FormatSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/FormatSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class FormatSymbol : ISymbol { + internal class FormatSymbol : ISymbol { string default_value; string from_fmt; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GeneratedEnumSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GeneratedEnumSymbol.cs index b2b687eab..95f85e80c 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GeneratedEnumSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GeneratedEnumSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { // This could be array and non-array, depending on metadata fixup. - public class GeneratedEnumSymbol : ISymbol + internal class GeneratedEnumSymbol : ISymbol { string enum_type; bool is_array; diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericSymbol.cs index 49849c913..72f2fe86d 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericSymbol.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class GenericSymbol : ISymbol { + internal class GenericSymbol : ISymbol { bool is_concrete; GenBase gen; @@ -77,8 +77,8 @@ string MapTypeParams (Dictionary mappings) foreach (var tp in type_params) { if (sb.Length > 1) sb.Append (", "); - if (mappings.ContainsKey (tp.FullName)) - sb.Append (mappings[tp.FullName]); + if (mappings.TryGetValue (tp.FullName, out var value)) + sb.Append (value); else sb.Append (tp.FullName); } 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 db11a3dd9..ab098f558 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericTypeParameter.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/GenericTypeParameter.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation { - public class GenericTypeParameter : ISymbol { + internal class GenericTypeParameter : ISymbol { string type; string java_type; @@ -14,8 +14,7 @@ public class GenericTypeParameter : ISymbol { public GenericTypeParameter (GenericParameterDefinition parm) { - if (parm == null) - throw new ArgumentNullException ("parm"); + ArgumentNullException.ThrowIfNull (parm); this.parm = parm; #if false // FIXME: we want to enable generic type constraints to get valid JNI output. So far we "remove" any method that involves generic parameter constraints. type = parm.Constraints != null ? parm.Constraints [0].FullName : "Java.Lang.Object"; @@ -83,13 +82,13 @@ public string FromNative (CodeGenerationOptions opt, string varname, bool owned) public string GetGenericType (Dictionary mappings) { - var mapped = mappings != null && mappings.ContainsKey (parm.Name) ? mappings [parm.Name] : null; + var mapped = mappings != null && mappings.TryGetValue (parm.Name, out var value) ? value : null; return mapped ?? parm.Name; } public string ToNative (CodeGenerationOptions opt, string varname, Dictionary mappings = null) { - var mapped = mappings != null && mappings.ContainsKey (parm.Name) ? mappings [parm.Name] : null; + var mapped = mappings != null && mappings.TryGetValue (parm.Name, out var value) ? value : null; string targetType = opt.GetOutputName (mappings == null ? parm.Name : mapped); if (targetType == "string") return string.Format ("new global::Java.Lang.String ({0})", varname); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ISymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ISymbol.cs index 15ff68daf..759cc1cf8 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ISymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/ISymbol.cs @@ -3,7 +3,7 @@ namespace MonoDroid.Generation { - public interface ISymbol { + internal interface ISymbol { string DefaultValue { get; } string FullName { get; } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SimpleSymbol.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SimpleSymbol.cs index c8d3e9e2b..9d965338a 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SimpleSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SimpleSymbol.cs @@ -2,7 +2,7 @@ namespace MonoDroid.Generation { - public class SimpleSymbol : FormatSymbol { + internal class SimpleSymbol : FormatSymbol { public SimpleSymbol (string default_value, string java_type, string type, string jni_type, string native_type = null, string from_fmt="{0}", string to_fmt="{0}", string returnCast = null) : base (default_value, java_type, jni_type, native_type ?? type, type, from_fmt, to_fmt, returnCast) 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 0e7b5022f..52d38fd41 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StreamSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StreamSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class StreamSymbol : ISymbol { + internal class StreamSymbol : ISymbol { string base_name; string java_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 093ea470e..7ca97e5fc 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StringSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/StringSymbol.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public class StringSymbol : ISymbol { + internal class StringSymbol : ISymbol { public string DefaultValue { get { return "IntPtr.Zero"; } diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SymbolTable.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SymbolTable.cs index 3d9353563..68bdfcec5 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SymbolTable.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SymbolTable.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Generation { - public class SymbolTable { + internal class SymbolTable { // The symbols dictionary may contain shallow types (types that have not populated Ctors/Methods/Fields). // If you make any changes to the SymbolTable class that accesses the symbols you need to keep @@ -327,7 +327,7 @@ public ISymbol Lookup (string java_type) private string AddArity (string key, string typeParams) { - if (string.IsNullOrWhiteSpace (typeParams) || !typeParams.StartsWith ("<", StringComparison.Ordinal) || !typeParams.EndsWith (">", StringComparison.Ordinal)) + if (string.IsNullOrWhiteSpace (typeParams) || !typeParams.StartsWith ('<') || !typeParams.EndsWith ('>')) return key; var nested_count = 0; 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 a2b4e1466..153087e60 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlPullParserSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlPullParserSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class XmlPullParserSymbol : ISymbol { + internal class XmlPullParserSymbol : ISymbol { public string DefaultValue { get { return "IntPtr.Zero"; } 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 63569ae02..6cacf4fd6 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlResourceParserSymbol.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/XmlResourceParserSymbol.cs @@ -4,7 +4,7 @@ namespace MonoDroid.Generation { - public class XmlResourceParserSymbol : ISymbol { + internal class XmlResourceParserSymbol : ISymbol { public string DefaultValue { get { return "IntPtr.Zero"; } diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiTransform.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiTransform.cs index ce9c738e3..63b65eb0c 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiTransform.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiTransform.cs @@ -6,7 +6,7 @@ namespace MonoDroid.Generation { - public class ApiTransform + internal class ApiTransform { public bool PreserveType { get; set; } public string Version { get; set; } diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiXmlAdjuster.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiXmlAdjuster.cs index dff3e8f5a..87647af30 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiXmlAdjuster.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/ApiXmlAdjuster.cs @@ -3,7 +3,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster { - public class Adjuster + internal class Adjuster { public void Process (string inputXmlFile, CodeGenerationOptions opt, GenBase [] gens, string outputXmlFile, int reportVerbosity) { diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/EnumMappings.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/EnumMappings.cs index 425fffb01..f935077ef 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/EnumMappings.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/EnumMappings.cs @@ -19,7 +19,7 @@ namespace MonoDroid.Generation { partial class EnumMappings { - public class EnumDescription { + internal class EnumDescription { public List Members = new List (); public bool BitField; public bool FieldsRemoved; diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/JavaTypeResolutionFixups.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/JavaTypeResolutionFixups.cs index bf8301457..349d792fa 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/JavaTypeResolutionFixups.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/JavaTypeResolutionFixups.cs @@ -8,7 +8,7 @@ namespace generator { - public static class JavaTypeResolutionFixups + internal static class JavaTypeResolutionFixups { [Obsolete ("Use the TypeDefinitionCache overload for better performance.", error: true)] public static void Fixup (string xmlFile, string outputXmlFile, DirectoryAssemblyResolver resolver, string [] references) => throw new NotSupportedException (); diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/JavadocFixups.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/JavadocFixups.cs index c9eca4a24..126425123 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/JavadocFixups.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/JavadocFixups.cs @@ -13,7 +13,7 @@ namespace Java.Interop.Tools.Generator.Transformation { - public static class JavadocFixups + internal static class JavadocFixups { public static void Fixup (List gens, CodeGeneratorOptions options) { diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/KotlinFixups.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/KotlinFixups.cs index 5d068acda..ed4b85913 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/KotlinFixups.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/KotlinFixups.cs @@ -7,7 +7,7 @@ namespace Java.Interop.Tools.Generator.Transformation { - public static class KotlinFixups + internal static class KotlinFixups { public static void Fixup (List gens) { diff --git a/tools/generator/Java.Interop.Tools.Generator.Transformation/SealedProtectedFixups.cs b/tools/generator/Java.Interop.Tools.Generator.Transformation/SealedProtectedFixups.cs index d0454ecc7..c59763b46 100644 --- a/tools/generator/Java.Interop.Tools.Generator.Transformation/SealedProtectedFixups.cs +++ b/tools/generator/Java.Interop.Tools.Generator.Transformation/SealedProtectedFixups.cs @@ -5,7 +5,7 @@ namespace Java.Interop.Tools.Generator.Transformation { - public static class SealedProtectedFixups + internal static class SealedProtectedFixups { public static void Fixup (List gens) { diff --git a/tools/generator/ManagedTypeFinderGeneratorTypeSystem.cs b/tools/generator/ManagedTypeFinderGeneratorTypeSystem.cs index 5a1e5d8d0..3876248ad 100644 --- a/tools/generator/ManagedTypeFinderGeneratorTypeSystem.cs +++ b/tools/generator/ManagedTypeFinderGeneratorTypeSystem.cs @@ -6,7 +6,7 @@ namespace Xamarin.AndroidTools.AnnotationSupport { - public class ManagedTypeFinderGeneratorTypeSystem : ManagedTypeFinderDefault + internal class ManagedTypeFinderGeneratorTypeSystem : ManagedTypeFinderDefault { public ManagedTypeFinderGeneratorTypeSystem (GenBase [] types) { @@ -22,15 +22,15 @@ protected override void OnAnnotationsParsed (IEnumerable itemsToB #region ManagedTypeFinder implementation - public abstract class Wrapper + internal abstract class Wrapper { public T Value { get; set; } } - public class TType : Wrapper, IType { } - public class TDefinition : Wrapper, IDefinition { } - public class TProperty : Wrapper, IProperty { } - public class TMethodBase : Wrapper, IMethodBase { } + internal class TType : Wrapper, IType { } + internal class TDefinition : Wrapper, IDefinition { } + internal class TProperty : Wrapper, IProperty { } + internal class TMethodBase : Wrapper, IMethodBase { } public override string GetManagedName (ManagedTypeFinder.IType t) { diff --git a/tools/generator/SourceWriters/Attributes/CustomAttr.cs b/tools/generator/SourceWriters/Attributes/CustomAttr.cs index 5ef54358f..33d4531a2 100644 --- a/tools/generator/SourceWriters/Attributes/CustomAttr.cs +++ b/tools/generator/SourceWriters/Attributes/CustomAttr.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class CustomAttr : AttributeWriter + internal class CustomAttr : AttributeWriter { public string Value { get; set; } diff --git a/tools/generator/SourceWriters/Attributes/DebuggerBrowsableAttr.cs b/tools/generator/SourceWriters/Attributes/DebuggerBrowsableAttr.cs index ee984b141..2bb3b87e6 100644 --- a/tools/generator/SourceWriters/Attributes/DebuggerBrowsableAttr.cs +++ b/tools/generator/SourceWriters/Attributes/DebuggerBrowsableAttr.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class DebuggerBrowsableAttr : AttributeWriter + internal class DebuggerBrowsableAttr : AttributeWriter { public override void WriteAttribute (CodeWriter writer) { diff --git a/tools/generator/SourceWriters/Attributes/DebuggerDisableUserUnhandledExceptionsAttributeAttr.cs b/tools/generator/SourceWriters/Attributes/DebuggerDisableUserUnhandledExceptionsAttributeAttr.cs index 0f7a6ace1..7e031d151 100644 --- a/tools/generator/SourceWriters/Attributes/DebuggerDisableUserUnhandledExceptionsAttributeAttr.cs +++ b/tools/generator/SourceWriters/Attributes/DebuggerDisableUserUnhandledExceptionsAttributeAttr.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class DebuggerDisableUserUnhandledExceptionsAttributeAttr : AttributeWriter + internal class DebuggerDisableUserUnhandledExceptionsAttributeAttr : AttributeWriter { public override void WriteAttribute (CodeWriter writer) { diff --git a/tools/generator/SourceWriters/Attributes/EditorBrowsableAttr.cs b/tools/generator/SourceWriters/Attributes/EditorBrowsableAttr.cs index a965ac3a7..b99690e6c 100644 --- a/tools/generator/SourceWriters/Attributes/EditorBrowsableAttr.cs +++ b/tools/generator/SourceWriters/Attributes/EditorBrowsableAttr.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class EditorBrowsableAttr : AttributeWriter + internal class EditorBrowsableAttr : AttributeWriter { public override void WriteAttribute (CodeWriter writer) { diff --git a/tools/generator/SourceWriters/Attributes/FlagsAttr.cs b/tools/generator/SourceWriters/Attributes/FlagsAttr.cs index a329ab052..8687b6066 100644 --- a/tools/generator/SourceWriters/Attributes/FlagsAttr.cs +++ b/tools/generator/SourceWriters/Attributes/FlagsAttr.cs @@ -3,7 +3,7 @@ namespace generator.SourceWriters { - public class FlagsAttr : AttributeWriter + internal class FlagsAttr : AttributeWriter { public override void WriteAttribute (CodeWriter writer) { diff --git a/tools/generator/SourceWriters/Attributes/GeneratedEnumAttr.cs b/tools/generator/SourceWriters/Attributes/GeneratedEnumAttr.cs index 154818517..28c3e1277 100644 --- a/tools/generator/SourceWriters/Attributes/GeneratedEnumAttr.cs +++ b/tools/generator/SourceWriters/Attributes/GeneratedEnumAttr.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class GeneratedEnumAttr : AttributeWriter + internal class GeneratedEnumAttr : AttributeWriter { readonly bool is_return; diff --git a/tools/generator/SourceWriters/Attributes/IntDefinitionAttr.cs b/tools/generator/SourceWriters/Attributes/IntDefinitionAttr.cs index 380d2cbaa..ac59eba3b 100644 --- a/tools/generator/SourceWriters/Attributes/IntDefinitionAttr.cs +++ b/tools/generator/SourceWriters/Attributes/IntDefinitionAttr.cs @@ -3,7 +3,7 @@ namespace generator.SourceWriters { - public class IntDefinitionAttr : AttributeWriter + internal class IntDefinitionAttr : AttributeWriter { public string ManagedMember { get; set; } public string JniField { get; set; } diff --git a/tools/generator/SourceWriters/Attributes/ObsoleteAttr.cs b/tools/generator/SourceWriters/Attributes/ObsoleteAttr.cs index b00ef5008..78d79aaf9 100644 --- a/tools/generator/SourceWriters/Attributes/ObsoleteAttr.cs +++ b/tools/generator/SourceWriters/Attributes/ObsoleteAttr.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class ObsoleteAttr : AttributeWriter + internal class ObsoleteAttr : AttributeWriter { public string Message { get; set; } public bool IsError { get; set; } diff --git a/tools/generator/SourceWriters/Attributes/ObsoletedOSPlatformAttr.cs b/tools/generator/SourceWriters/Attributes/ObsoletedOSPlatformAttr.cs index f8e398f4d..610f00a73 100644 --- a/tools/generator/SourceWriters/Attributes/ObsoletedOSPlatformAttr.cs +++ b/tools/generator/SourceWriters/Attributes/ObsoletedOSPlatformAttr.cs @@ -5,7 +5,7 @@ namespace generator.SourceWriters { - public class ObsoletedOSPlatformAttr : AttributeWriter + internal class ObsoletedOSPlatformAttr : AttributeWriter { public string Message { get; set; } public AndroidSdkVersion Version { get; } diff --git a/tools/generator/SourceWriters/Attributes/RegisterAttr.cs b/tools/generator/SourceWriters/Attributes/RegisterAttr.cs index bad28fbc6..8951926a5 100644 --- a/tools/generator/SourceWriters/Attributes/RegisterAttr.cs +++ b/tools/generator/SourceWriters/Attributes/RegisterAttr.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class RegisterAttr : AttributeWriter + internal class RegisterAttr : AttributeWriter { public string Name { get; set; } public string Signature { get; set; } diff --git a/tools/generator/SourceWriters/Attributes/RestrictToAttr.cs b/tools/generator/SourceWriters/Attributes/RestrictToAttr.cs index b634c0f14..d3e681517 100644 --- a/tools/generator/SourceWriters/Attributes/RestrictToAttr.cs +++ b/tools/generator/SourceWriters/Attributes/RestrictToAttr.cs @@ -3,7 +3,7 @@ namespace generator.SourceWriters { - public class RestrictToAttr : AttributeWriter + internal class RestrictToAttr : AttributeWriter { bool is_type; diff --git a/tools/generator/SourceWriters/Attributes/SupportedOSPlatformAttr.cs b/tools/generator/SourceWriters/Attributes/SupportedOSPlatformAttr.cs index 6e79b48c8..1b8d282b5 100644 --- a/tools/generator/SourceWriters/Attributes/SupportedOSPlatformAttr.cs +++ b/tools/generator/SourceWriters/Attributes/SupportedOSPlatformAttr.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { - public class SupportedOSPlatformAttr : AttributeWriter + internal class SupportedOSPlatformAttr : AttributeWriter { public AndroidSdkVersion Version { get; } diff --git a/tools/generator/SourceWriters/Attributes/UnsupportedOSPlatformAttr.cs b/tools/generator/SourceWriters/Attributes/UnsupportedOSPlatformAttr.cs index b15a70cbd..469cc40fd 100644 --- a/tools/generator/SourceWriters/Attributes/UnsupportedOSPlatformAttr.cs +++ b/tools/generator/SourceWriters/Attributes/UnsupportedOSPlatformAttr.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { - public class UnsupportedOSPlatformAttr : AttributeWriter + internal class UnsupportedOSPlatformAttr : AttributeWriter { public AndroidSdkVersion Version { get; } diff --git a/tools/generator/SourceWriters/BoundAbstractProperty.cs b/tools/generator/SourceWriters/BoundAbstractProperty.cs index 7e0985528..2cc9537e2 100644 --- a/tools/generator/SourceWriters/BoundAbstractProperty.cs +++ b/tools/generator/SourceWriters/BoundAbstractProperty.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { - public class BoundAbstractProperty : PropertyWriter + internal class BoundAbstractProperty : PropertyWriter { readonly MethodCallback getter_callback; readonly MethodCallback setter_callback; diff --git a/tools/generator/SourceWriters/BoundClass.cs b/tools/generator/SourceWriters/BoundClass.cs index 725ead6eb..8859546ed 100644 --- a/tools/generator/SourceWriters/BoundClass.cs +++ b/tools/generator/SourceWriters/BoundClass.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class BoundClass : ClassWriter + internal class BoundClass : ClassWriter { readonly CodeGenerationOptions opt; readonly List sibling_types = new List (); diff --git a/tools/generator/SourceWriters/BoundConstructor.cs b/tools/generator/SourceWriters/BoundConstructor.cs index 7f333f17c..b1d371931 100644 --- a/tools/generator/SourceWriters/BoundConstructor.cs +++ b/tools/generator/SourceWriters/BoundConstructor.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class BoundConstructor : ConstructorWriter + internal class BoundConstructor : ConstructorWriter { protected Ctor constructor; protected CodeGenerationOptions opt; @@ -125,7 +125,7 @@ void WriteParamterListCallArgs (CodeWriter writer, ParameterList parameters, boo } } - public class StringOverloadConstructor : BoundConstructor + internal class StringOverloadConstructor : BoundConstructor { public StringOverloadConstructor (ClassGen klass, Ctor constructor, bool useBase, CodeGenerationOptions opt, CodeGeneratorContext context) : base (klass, constructor, useBase, opt, context) diff --git a/tools/generator/SourceWriters/BoundField.cs b/tools/generator/SourceWriters/BoundField.cs index 0b8e28a44..c26d4bb41 100644 --- a/tools/generator/SourceWriters/BoundField.cs +++ b/tools/generator/SourceWriters/BoundField.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class BoundField : FieldWriter + internal class BoundField : FieldWriter { // // Metadata.xml XPath field reference: path="/api/package[@name='android.os']/class[@name='Vibrator']/field[@name='VIBRATION_EFFECT_SUPPORT_UNKNOWN']" // [Register ("VIBRATION_EFFECT_SUPPORT_UNKNOWN", ApiSince = 30)] diff --git a/tools/generator/SourceWriters/BoundFieldAsProperty.cs b/tools/generator/SourceWriters/BoundFieldAsProperty.cs index 4bd7b0f7a..1dfafe9f8 100644 --- a/tools/generator/SourceWriters/BoundFieldAsProperty.cs +++ b/tools/generator/SourceWriters/BoundFieldAsProperty.cs @@ -12,7 +12,7 @@ namespace generator.SourceWriters { // This is a field that is not a constant, and thus we need to generate it as a // property so it can access the Java field. - public class BoundFieldAsProperty : PropertyWriter + internal class BoundFieldAsProperty : PropertyWriter { readonly Field field; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/BoundInterface.cs b/tools/generator/SourceWriters/BoundInterface.cs index 258a6e910..fb0547964 100644 --- a/tools/generator/SourceWriters/BoundInterface.cs +++ b/tools/generator/SourceWriters/BoundInterface.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { - public class BoundInterface : InterfaceWriter + internal class BoundInterface : InterfaceWriter { readonly List pre_sibling_types = new List (); readonly List post_sibling_types = new List (); @@ -107,7 +107,7 @@ void AddAlternativesClass (InterfaceGen iface, CodeGenerationOptions opt, CodeGe var staticMethods = iface.Methods.Where (m => m.IsStatic); if (opt.CodeGenerationTarget != CodeGenerationTarget.JavaInterop1 && - (iface.Fields.Any () || staticMethods.Any ())) { + (iface.Fields.Count != 0 || staticMethods.Any ())) { pre_sibling_types.Add (new InterfaceMemberAlternativeClass (iface, opt, context)); } } diff --git a/tools/generator/SourceWriters/BoundInterfaceMethodDeclaration.cs b/tools/generator/SourceWriters/BoundInterfaceMethodDeclaration.cs index 01f8493de..b3e7f81ad 100644 --- a/tools/generator/SourceWriters/BoundInterfaceMethodDeclaration.cs +++ b/tools/generator/SourceWriters/BoundInterfaceMethodDeclaration.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { - public class BoundInterfaceMethodDeclaration : MethodWriter + internal class BoundInterfaceMethodDeclaration : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/BoundInterfacePropertyDeclaration.cs b/tools/generator/SourceWriters/BoundInterfacePropertyDeclaration.cs index 1031b197a..ba635113a 100644 --- a/tools/generator/SourceWriters/BoundInterfacePropertyDeclaration.cs +++ b/tools/generator/SourceWriters/BoundInterfacePropertyDeclaration.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { - public class BoundInterfacePropertyDeclaration : PropertyWriter + internal class BoundInterfacePropertyDeclaration : PropertyWriter { public BoundInterfacePropertyDeclaration (GenBase gen, Property property, string adapter, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/BoundMethod.cs b/tools/generator/SourceWriters/BoundMethod.cs index 747191bce..6dff0c7c6 100644 --- a/tools/generator/SourceWriters/BoundMethod.cs +++ b/tools/generator/SourceWriters/BoundMethod.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { - public class BoundMethod : MethodWriter + internal class BoundMethod : MethodWriter { readonly MethodCallback callback; diff --git a/tools/generator/SourceWriters/BoundMethodAbstractDeclaration.cs b/tools/generator/SourceWriters/BoundMethodAbstractDeclaration.cs index 95db23991..b8b5461cf 100644 --- a/tools/generator/SourceWriters/BoundMethodAbstractDeclaration.cs +++ b/tools/generator/SourceWriters/BoundMethodAbstractDeclaration.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class BoundMethodAbstractDeclaration : MethodWriter + internal class BoundMethodAbstractDeclaration : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/BoundMethodExtensionStringOverload.cs b/tools/generator/SourceWriters/BoundMethodExtensionStringOverload.cs index 527dfdd2e..1ccbca6b6 100644 --- a/tools/generator/SourceWriters/BoundMethodExtensionStringOverload.cs +++ b/tools/generator/SourceWriters/BoundMethodExtensionStringOverload.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class BoundMethodExtensionStringOverload : MethodWriter + internal class BoundMethodExtensionStringOverload : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/BoundMethodStringOverload.cs b/tools/generator/SourceWriters/BoundMethodStringOverload.cs index a6d73d7fb..fe52a823e 100644 --- a/tools/generator/SourceWriters/BoundMethodStringOverload.cs +++ b/tools/generator/SourceWriters/BoundMethodStringOverload.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class BoundMethodStringOverload : MethodWriter + internal class BoundMethodStringOverload : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/BoundProperty.cs b/tools/generator/SourceWriters/BoundProperty.cs index 41b48d88e..953e7a09f 100644 --- a/tools/generator/SourceWriters/BoundProperty.cs +++ b/tools/generator/SourceWriters/BoundProperty.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { - public class BoundProperty : PropertyWriter + internal class BoundProperty : PropertyWriter { readonly MethodCallback getter_callback; readonly MethodCallback setter_callback; diff --git a/tools/generator/SourceWriters/BoundPropertyStringVariant.cs b/tools/generator/SourceWriters/BoundPropertyStringVariant.cs index 7a20ae516..4434a9832 100644 --- a/tools/generator/SourceWriters/BoundPropertyStringVariant.cs +++ b/tools/generator/SourceWriters/BoundPropertyStringVariant.cs @@ -11,7 +11,7 @@ namespace generator.SourceWriters { // When a property has a type of 'Java.Lang.ICharSequence' we usually generate // an overload with type 'string' as a convenience for the user. - public class BoundPropertyStringVariant : PropertyWriter + internal class BoundPropertyStringVariant : PropertyWriter { public BoundPropertyStringVariant (Property property, CodeGenerationOptions opt, BoundAbstractProperty original) : this (property, opt, original.IsVirtual) diff --git a/tools/generator/SourceWriters/CharSequenceEnumeratorMethod.cs b/tools/generator/SourceWriters/CharSequenceEnumeratorMethod.cs index 79c4b1f6d..7a97e626a 100644 --- a/tools/generator/SourceWriters/CharSequenceEnumeratorMethod.cs +++ b/tools/generator/SourceWriters/CharSequenceEnumeratorMethod.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class CharSequenceEnumeratorMethod : MethodWriter + internal class CharSequenceEnumeratorMethod : MethodWriter { // System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () // { @@ -22,7 +22,7 @@ public CharSequenceEnumeratorMethod () } } - public class CharSequenceGenericEnumeratorMethod : MethodWriter + internal class CharSequenceGenericEnumeratorMethod : MethodWriter { // public System.Collections.Generic.IEnumerator GetEnumerator () // { diff --git a/tools/generator/SourceWriters/ClassInvokerClass.cs b/tools/generator/SourceWriters/ClassInvokerClass.cs index 41e983ea7..a66719b8d 100644 --- a/tools/generator/SourceWriters/ClassInvokerClass.cs +++ b/tools/generator/SourceWriters/ClassInvokerClass.cs @@ -12,7 +12,7 @@ namespace generator.SourceWriters { - public class ClassInvokerClass : ClassWriter + internal class ClassInvokerClass : ClassWriter { public ClassInvokerClass (ClassGen klass, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/ClassInvokers.cs b/tools/generator/SourceWriters/ClassInvokers.cs index ad03036f3..fb8b8df0d 100644 --- a/tools/generator/SourceWriters/ClassInvokers.cs +++ b/tools/generator/SourceWriters/ClassInvokers.cs @@ -7,7 +7,7 @@ namespace generator.SourceWriters { - public class ClassHandleGetter : PropertyWriter + internal class ClassHandleGetter : PropertyWriter { // internal static new IntPtr class_ref { // get { return _members.JniPeerType.PeerReference.Handle; } @@ -26,7 +26,7 @@ public ClassHandleGetter (bool requireNew) } } - public class InterfaceHandleGetter : PropertyWriter + internal class InterfaceHandleGetter : PropertyWriter { // static IntPtr java_class_ref { // get { return _members.JniPeerType.PeerReference.Handle; } @@ -43,7 +43,7 @@ public InterfaceHandleGetter (string members) } } - public class JniPeerMembersGetter : PropertyWriter + internal class JniPeerMembersGetter : PropertyWriter { // [DebuggerBrowsable (DebuggerBrowsableState.Never)] // [EditorBrowsable (EditorBrowsableState.Never)] @@ -66,7 +66,7 @@ public JniPeerMembersGetter (string name = "_members") } } - public class ClassThresholdClassGetter : PropertyWriter + internal class ClassThresholdClassGetter : PropertyWriter { // [DebuggerBrowsable (DebuggerBrowsableState.Never)] // [EditorBrowsable (EditorBrowsableState.Never)] @@ -89,7 +89,7 @@ public ClassThresholdClassGetter () } } - public class InterfaceThresholdClassGetter : PropertyWriter + internal class InterfaceThresholdClassGetter : PropertyWriter { // [DebuggerBrowsable (DebuggerBrowsableState.Never)] // [EditorBrowsable (EditorBrowsableState.Never)] @@ -112,7 +112,7 @@ public InterfaceThresholdClassGetter (string getExpression) } } - public class ThresholdTypeGetter : PropertyWriter + internal class ThresholdTypeGetter : PropertyWriter { // [DebuggerBrowsable (DebuggerBrowsableState.Never)] // [EditorBrowsable (EditorBrowsableState.Never)] diff --git a/tools/generator/SourceWriters/ConstructorPartialMethod.cs b/tools/generator/SourceWriters/ConstructorPartialMethod.cs index af0c4c4b8..f9edd588b 100644 --- a/tools/generator/SourceWriters/ConstructorPartialMethod.cs +++ b/tools/generator/SourceWriters/ConstructorPartialMethod.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { - public class ConstructorPartialMethod : MethodWriter + internal class ConstructorPartialMethod : MethodWriter { public ConstructorPartialMethod (string partialMethodName) { diff --git a/tools/generator/SourceWriters/CreateImplementorMethod.cs b/tools/generator/SourceWriters/CreateImplementorMethod.cs index 4d87793f7..aed4d5b40 100644 --- a/tools/generator/SourceWriters/CreateImplementorMethod.cs +++ b/tools/generator/SourceWriters/CreateImplementorMethod.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class CreateImplementorMethod : MethodWriter + internal class CreateImplementorMethod : MethodWriter { public CreateImplementorMethod (InterfaceGen iface, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/ExplicitInterfaceInvokerMethod.cs b/tools/generator/SourceWriters/ExplicitInterfaceInvokerMethod.cs index d6db5d484..bb107c6df 100644 --- a/tools/generator/SourceWriters/ExplicitInterfaceInvokerMethod.cs +++ b/tools/generator/SourceWriters/ExplicitInterfaceInvokerMethod.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class ExplicitInterfaceInvokerMethod : MethodWriter + internal class ExplicitInterfaceInvokerMethod : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/Extensions/SourceWriterExtensions.cs b/tools/generator/SourceWriters/Extensions/SourceWriterExtensions.cs index 626eb1cb0..9449a192a 100644 --- a/tools/generator/SourceWriters/Extensions/SourceWriterExtensions.cs +++ b/tools/generator/SourceWriters/Extensions/SourceWriterExtensions.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public static class SourceWriterExtensions + internal static class SourceWriterExtensions { const int MINIMUM_API_LEVEL = 21; @@ -97,7 +97,7 @@ public static void AddInterfaceListenerEventsAndProperties (TypeWriter tw, Inter if (method.Name.StartsWith ("Set", StringComparison.Ordinal)) remove = string.Format ("__v => {0} (null)", method.Name); else if (method.Name.StartsWith ("Add", StringComparison.Ordinal) && - (rm = "Remove" + method.Name.Substring ("Add".Length)) != null && + (rm = string.Concat ("Remove", method.Name.AsSpan ("Add".Length))) != null && methods.Where (m => m.Name == rm).Any ()) remove = string.Format ("__v => {0} (__v)", rm); else @@ -143,14 +143,14 @@ public static void AddInterfaceListenerEventOrProperty (TypeWriter tw, Interface return; var nameSpec = iface.Methods.Count > 1 ? method.AdjustedName : string.Empty; - var idx = iface.FullName.LastIndexOf (".", StringComparison.Ordinal); + var idx = iface.FullName.LastIndexOf ('.'); var start = iface.Name.StartsWith ("IOn", StringComparison.Ordinal) ? 3 : 1; - var full_delegate_name = iface.FullName.Substring (0, idx + 1) + iface.Name.Substring (start, iface.Name.Length - start - 8) + nameSpec; + var full_delegate_name = string.Concat (iface.FullName.AsSpan (0, idx + 1), iface.Name.AsSpan (start, iface.Name.Length - start - 8), nameSpec); if (method.IsSimpleEventHandler) full_delegate_name = "EventHandler"; else if (method.RetVal.IsVoid || method.IsEventHandlerWithHandledProperty) - full_delegate_name = "EventHandler<" + iface.FullName.Substring (0, idx + 1) + iface.GetArgsName (method) + ">"; + full_delegate_name = string.Concat ("EventHandler<", iface.FullName.AsSpan (0, idx + 1), iface.GetArgsName (method), ">"); else full_delegate_name += "Handler"; diff --git a/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationMethod.cs b/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationMethod.cs index 869fb5020..b3b96599b 100644 --- a/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationMethod.cs +++ b/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationMethod.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { // This is supposed to generate instantiated generic method output, but I don't think it is done yet. - public class GenericExplicitInterfaceImplementationMethod : MethodWriter + internal class GenericExplicitInterfaceImplementationMethod : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationProperty.cs b/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationProperty.cs index 4a942cc8b..7156e2567 100644 --- a/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationProperty.cs +++ b/tools/generator/SourceWriters/GenericExplicitInterfaceImplementationProperty.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class GenericExplicitInterfaceImplementationProperty : PropertyWriter + internal class GenericExplicitInterfaceImplementationProperty : PropertyWriter { public GenericExplicitInterfaceImplementationProperty (Property property, GenericSymbol gen, string adapter, Dictionary mappings, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/InterfaceConstsClass.cs b/tools/generator/SourceWriters/InterfaceConstsClass.cs index 1689f4e11..833b4b596 100644 --- a/tools/generator/SourceWriters/InterfaceConstsClass.cs +++ b/tools/generator/SourceWriters/InterfaceConstsClass.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceConstsClass : ClassWriter + internal class InterfaceConstsClass : ClassWriter { public InterfaceConstsClass (ClassGen klass, HashSet seen, CodeGenerationOptions opt, CodeGeneratorContext context) { diff --git a/tools/generator/SourceWriters/InterfaceEventArgsClass.cs b/tools/generator/SourceWriters/InterfaceEventArgsClass.cs index 5e0b9dee9..7769a67f2 100644 --- a/tools/generator/SourceWriters/InterfaceEventArgsClass.cs +++ b/tools/generator/SourceWriters/InterfaceEventArgsClass.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceEventArgsClass : ClassWriter + internal class InterfaceEventArgsClass : ClassWriter { public InterfaceEventArgsClass (InterfaceGen iface, Method method) { @@ -84,7 +84,7 @@ void AddProperties (Method method, CodeGenerationOptions opt) } } - public class HandledProperty : PropertyWriter + internal class HandledProperty : PropertyWriter { public HandledProperty () { diff --git a/tools/generator/SourceWriters/InterfaceEventHandlerImplClass.cs b/tools/generator/SourceWriters/InterfaceEventHandlerImplClass.cs index 6fee9ef06..55abae71e 100644 --- a/tools/generator/SourceWriters/InterfaceEventHandlerImplClass.cs +++ b/tools/generator/SourceWriters/InterfaceEventHandlerImplClass.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceEventHandlerImplClass : ClassWriter + internal class InterfaceEventHandlerImplClass : ClassWriter { public InterfaceEventHandlerImplClass (InterfaceGen iface, CodeGenerationOptions opt, CodeGeneratorContext context) { @@ -84,7 +84,7 @@ void AddMethods (InterfaceGen iface, CodeGenerationOptions opt) } } - public class InterfaceEventHandlerImplMethod : MethodWriter + internal class InterfaceEventHandlerImplMethod : MethodWriter { readonly InterfaceGen iface; readonly Method method; diff --git a/tools/generator/SourceWriters/InterfaceExtensionsClass.cs b/tools/generator/SourceWriters/InterfaceExtensionsClass.cs index 378c7323a..dd5571553 100644 --- a/tools/generator/SourceWriters/InterfaceExtensionsClass.cs +++ b/tools/generator/SourceWriters/InterfaceExtensionsClass.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceExtensionsClass : ClassWriter + internal class InterfaceExtensionsClass : ClassWriter { public InterfaceExtensionsClass (InterfaceGen iface, string declaringTypeName, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/InterfaceInvokerClass.cs b/tools/generator/SourceWriters/InterfaceInvokerClass.cs index 1ae292f1f..9ad4209ba 100644 --- a/tools/generator/SourceWriters/InterfaceInvokerClass.cs +++ b/tools/generator/SourceWriters/InterfaceInvokerClass.cs @@ -12,7 +12,7 @@ namespace generator.SourceWriters { - public class InterfaceInvokerClass : ClassWriter + internal class InterfaceInvokerClass : ClassWriter { public InterfaceInvokerClass (InterfaceGen iface, CodeGenerationOptions opt, CodeGeneratorContext context) { @@ -132,7 +132,7 @@ void AddMethodInvokers (InterfaceGen iface, IEnumerable methods, HashSet } } - public class GetObjectMethod : MethodWriter + internal class GetObjectMethod : MethodWriter { // public static IInterface? GetObject (IntPtr handle, JniHandleOwnership transfer) // { @@ -154,7 +154,7 @@ public GetObjectMethod (InterfaceGen iface, CodeGenerationOptions opt) } } - public class ValidateMethod : MethodWriter + internal class ValidateMethod : MethodWriter { // static IntPtr Validate (IntPtr handle) // { @@ -179,7 +179,7 @@ public ValidateMethod (InterfaceGen iface) } } - public class DisposeMethod : MethodWriter + internal class DisposeMethod : MethodWriter { // protected override void Dispose (bool disposing) // { @@ -205,7 +205,7 @@ public DisposeMethod () } } - public class InterfaceInvokerConstructor : ConstructorWriter + internal class InterfaceInvokerConstructor : ConstructorWriter { // public IfaceInvoker (IntPtr handle, JniHandleOwnership transfer) : base (Validate (handle), transfer) // { diff --git a/tools/generator/SourceWriters/InterfaceInvokerMethod.cs b/tools/generator/SourceWriters/InterfaceInvokerMethod.cs index 2345961d6..49a8228e5 100644 --- a/tools/generator/SourceWriters/InterfaceInvokerMethod.cs +++ b/tools/generator/SourceWriters/InterfaceInvokerMethod.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class InterfaceInvokerMethod : MethodWriter + internal class InterfaceInvokerMethod : MethodWriter { readonly MethodCallback method_callback; readonly Method method; diff --git a/tools/generator/SourceWriters/InterfaceInvokerProperty.cs b/tools/generator/SourceWriters/InterfaceInvokerProperty.cs index 8742bdecb..a9acee4d6 100644 --- a/tools/generator/SourceWriters/InterfaceInvokerProperty.cs +++ b/tools/generator/SourceWriters/InterfaceInvokerProperty.cs @@ -10,7 +10,7 @@ namespace generator.SourceWriters { - public class InterfaceInvokerProperty : PropertyWriter + internal class InterfaceInvokerProperty : PropertyWriter { readonly MethodCallback getter_callback; readonly MethodCallback setter_callback; diff --git a/tools/generator/SourceWriters/InterfaceListenerEvent.cs b/tools/generator/SourceWriters/InterfaceListenerEvent.cs index fb7a2cc4b..07b38bde3 100644 --- a/tools/generator/SourceWriters/InterfaceListenerEvent.cs +++ b/tools/generator/SourceWriters/InterfaceListenerEvent.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceListenerEvent : EventWriter + internal class InterfaceListenerEvent : EventWriter { readonly InterfaceListenerEventHandlerHelper helper_method; @@ -49,7 +49,7 @@ public override void Write (CodeWriter writer) } } - public class InterfaceListenerEventHandlerHelper : MethodWriter + internal class InterfaceListenerEventHandlerHelper : MethodWriter { public InterfaceListenerEventHandlerHelper (InterfaceGen iface, Method method, string add, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/InterfaceListenerProperty.cs b/tools/generator/SourceWriters/InterfaceListenerProperty.cs index 985328602..a09f08866 100644 --- a/tools/generator/SourceWriters/InterfaceListenerProperty.cs +++ b/tools/generator/SourceWriters/InterfaceListenerProperty.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceListenerProperty : PropertyWriter + internal class InterfaceListenerProperty : PropertyWriter { public InterfaceListenerProperty (InterfaceGen iface, string name, string nameSpec, string methodName, string fullDelegateName, CodeGenerationOptions opt) { diff --git a/tools/generator/SourceWriters/InterfaceListenerPropertyImplementor.cs b/tools/generator/SourceWriters/InterfaceListenerPropertyImplementor.cs index b74e87f77..fe6c3f466 100644 --- a/tools/generator/SourceWriters/InterfaceListenerPropertyImplementor.cs +++ b/tools/generator/SourceWriters/InterfaceListenerPropertyImplementor.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class InterfaceListenerPropertyImplementor : PropertyWriter + internal class InterfaceListenerPropertyImplementor : PropertyWriter { readonly string name; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs b/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs index c247fceb7..91b904cab 100644 --- a/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs +++ b/tools/generator/SourceWriters/InterfaceMemberAlternativeClass.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { - public class InterfaceMemberAlternativeClass : ClassWriter + internal class InterfaceMemberAlternativeClass : ClassWriter { readonly List sibling_classes = new List (); @@ -27,7 +27,7 @@ public InterfaceMemberAlternativeClass (InterfaceGen iface, CodeGenerationOption var should_obsolete = opt.SupportInterfaceConstants && opt.SupportDefaultInterfaceMethods; Name = iface.HasManagedName - ? iface.Name.Substring (1) + "Consts" + ? string.Concat (iface.Name.AsSpan (1), "Consts") : iface.Name.Substring (1); Inherits = "Java.Lang.Object"; @@ -170,11 +170,11 @@ public void WriteSiblingClasses (CodeWriter writer) } } - public class InterfaceConstsForwardClass : ClassWriter + internal class InterfaceConstsForwardClass : ClassWriter { public InterfaceConstsForwardClass (InterfaceGen iface, CodeGenerationOptions opt) { - Name = iface.Name.Substring (1) + "Consts"; + Name = string.Concat (iface.Name.AsSpan (1), "Consts"); Inherits = iface.Name.Substring (1); IsPublic = true; diff --git a/tools/generator/SourceWriters/JavaLangObjectConstructor.cs b/tools/generator/SourceWriters/JavaLangObjectConstructor.cs index 7c6381e14..911b39a41 100644 --- a/tools/generator/SourceWriters/JavaLangObjectConstructor.cs +++ b/tools/generator/SourceWriters/JavaLangObjectConstructor.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { - public class JavaLangObjectConstructor : ConstructorWriter + internal class JavaLangObjectConstructor : ConstructorWriter { public JavaLangObjectConstructor (ClassGen klass, CodeGenerationOptions opt, string callPartialMethod) { diff --git a/tools/generator/SourceWriters/MethodAsyncWrapper.cs b/tools/generator/SourceWriters/MethodAsyncWrapper.cs index 838fc368d..67bc9cd8c 100644 --- a/tools/generator/SourceWriters/MethodAsyncWrapper.cs +++ b/tools/generator/SourceWriters/MethodAsyncWrapper.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class MethodAsyncWrapper : MethodWriter + internal class MethodAsyncWrapper : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/MethodCallback.cs b/tools/generator/SourceWriters/MethodCallback.cs index 21efefc70..4ed6bbd23 100644 --- a/tools/generator/SourceWriters/MethodCallback.cs +++ b/tools/generator/SourceWriters/MethodCallback.cs @@ -9,7 +9,7 @@ namespace generator.SourceWriters { - public class MethodCallback : MethodWriter + internal class MethodCallback : MethodWriter { readonly GenBase type; readonly Method method; @@ -126,7 +126,7 @@ public override void Write (CodeWriter writer) } } - public class MethodCallbackDelegateField : FieldWriter + internal class MethodCallbackDelegateField : FieldWriter { // static Delegate cb_byteValueExact; public MethodCallbackDelegateField (Method method, CodeGenerationOptions options) @@ -142,7 +142,7 @@ public MethodCallbackDelegateField (Method method, CodeGenerationOptions options } } - public class GetDelegateHandlerMethod : MethodWriter + internal class GetDelegateHandlerMethod : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/MethodExplicitInterfaceImplementation.cs b/tools/generator/SourceWriters/MethodExplicitInterfaceImplementation.cs index 7b8fe53b0..89ed5d6f4 100644 --- a/tools/generator/SourceWriters/MethodExplicitInterfaceImplementation.cs +++ b/tools/generator/SourceWriters/MethodExplicitInterfaceImplementation.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class MethodExplicitInterfaceImplementation : MethodWriter + internal class MethodExplicitInterfaceImplementation : MethodWriter { readonly Method method; readonly CodeGenerationOptions opt; diff --git a/tools/generator/SourceWriters/MethodExtensionAsyncWrapper.cs b/tools/generator/SourceWriters/MethodExtensionAsyncWrapper.cs index f7d0cd551..d6ad76a3b 100644 --- a/tools/generator/SourceWriters/MethodExtensionAsyncWrapper.cs +++ b/tools/generator/SourceWriters/MethodExtensionAsyncWrapper.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class MethodExtensionAsyncWrapper : MethodWriter + internal class MethodExtensionAsyncWrapper : MethodWriter { public MethodExtensionAsyncWrapper (Method method, CodeGenerationOptions opt, string selfType) { diff --git a/tools/generator/SourceWriters/PeerMembersField.cs b/tools/generator/SourceWriters/PeerMembersField.cs index 9b6e877b8..c7e152ec0 100644 --- a/tools/generator/SourceWriters/PeerMembersField.cs +++ b/tools/generator/SourceWriters/PeerMembersField.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class PeerMembersField : FieldWriter + internal class PeerMembersField : FieldWriter { // static readonly JniPeerMembers _members = new XAPeerMembers ("android/provider/ContactsContract$AggregationExceptions", typeof (AggregationExceptions)); public PeerMembersField (CodeGenerationOptions opt, string rawJniType, string declaringType, bool isInterface, string name = "_members") diff --git a/tools/generator/SourceWriters/WeakImplementorField.cs b/tools/generator/SourceWriters/WeakImplementorField.cs index e46e00c10..49a6c5aa7 100644 --- a/tools/generator/SourceWriters/WeakImplementorField.cs +++ b/tools/generator/SourceWriters/WeakImplementorField.cs @@ -8,7 +8,7 @@ namespace generator.SourceWriters { - public class WeakImplementorField : FieldWriter + internal class WeakImplementorField : FieldWriter { public WeakImplementorField (string name, CodeGenerationOptions opt) { diff --git a/tools/generator/Utilities/AncestorDescendantCache.cs b/tools/generator/Utilities/AncestorDescendantCache.cs index 756f4bc46..618a1de79 100644 --- a/tools/generator/Utilities/AncestorDescendantCache.cs +++ b/tools/generator/Utilities/AncestorDescendantCache.cs @@ -5,7 +5,7 @@ namespace MonoDroid.Generation.Utilities { // Finding all descendants of a type is expensive, so we cache the results here - public class AncestorDescendantCache + internal class AncestorDescendantCache { readonly List gens; readonly Dictionary> cache = new Dictionary> (); diff --git a/tools/generator/Utilities/CsvParser.cs b/tools/generator/Utilities/CsvParser.cs index 15e7b2648..c1bf6691a 100644 --- a/tools/generator/Utilities/CsvParser.cs +++ b/tools/generator/Utilities/CsvParser.cs @@ -6,7 +6,7 @@ namespace MonoDroid.Generation { - public class CsvParser + internal class CsvParser { readonly string [] fields; diff --git a/tools/generator/Utilities/ParsedType.cs b/tools/generator/Utilities/ParsedType.cs index a7c1026ea..c95c85b01 100644 --- a/tools/generator/Utilities/ParsedType.cs +++ b/tools/generator/Utilities/ParsedType.cs @@ -14,7 +14,7 @@ namespace MonoDroid.Generation // - Type: string // A placeholder "{0}" is added because the type may extend past the generics: // ex: "List.Enumerator[]" becomes "List<{0}>.Enumerator[]" - public class ParsedType + internal class ParsedType { public string Type { get; set; } public List GenericArguments { get; } = new List (); @@ -32,7 +32,7 @@ public static ParsedType Parse (string type) var greater_than = type.LastIndexOf ('>'); var type_args = type.Substring (less_than + 1, greater_than - less_than - 1); - var type_string = type.Substring (0, less_than) + "<{0}>" + (greater_than + 1 < type.Length ? type.Substring (greater_than + 1) : string.Empty); + var type_string = string.Concat (type.AsSpan (0, less_than), "<{0}>", greater_than + 1 < type.Length ? type.Substring (greater_than + 1) : string.Empty); var parsed_args = ParseTypeList (type_args); diff --git a/tools/generator/Utilities/ProcessRocks.cs b/tools/generator/Utilities/ProcessRocks.cs index 04f0d45e6..6ef76f611 100644 --- a/tools/generator/Utilities/ProcessRocks.cs +++ b/tools/generator/Utilities/ProcessRocks.cs @@ -8,7 +8,7 @@ namespace MonoDroid.Utils { - public static class ProcessRocks { + internal static class ProcessRocks { public static IEnumerable ReadStandardOutput (IEnumerable commandLine, bool printCommandLine) { @@ -111,7 +111,7 @@ private static List FindFileInDirectory (string directory, string filena // Recurse foreach (var dir in Directory.GetDirectories (directory)) { // Don't go into obj or bin directories - if (Path.GetFileName (dir).ToLowerInvariant () == "obj" || Path.GetFileName (dir).ToLowerInvariant () == "bin") + if (Path.GetFileName (dir).Equals ("obj", StringComparison.InvariantCultureIgnoreCase) || Path.GetFileName (dir).Equals ("bin", StringComparison.InvariantCultureIgnoreCase)) continue; results.AddRange (FindFileInDirectory (dir, filename)); @@ -119,7 +119,7 @@ private static List FindFileInDirectory (string directory, string filena // Check this directory for the file foreach (var file in Directory.GetFiles (directory)) { - if (Path.GetFileName (file).ToLowerInvariant () == filename.ToLowerInvariant ()) + if (Path.GetFileName (file).Equals (filename, StringComparison.InvariantCultureIgnoreCase)) results.Add (file); } @@ -127,7 +127,7 @@ private static List FindFileInDirectory (string directory, string filena } } - class CommandFailedException : InvalidOperationException + partial class CommandFailedException : InvalidOperationException { public string FileName { get; private set; } public string Arguments { get; private set; } @@ -161,7 +161,7 @@ public string VSFormattedErrorLog { private string FormatForVS (string text) { - Regex regex = new Regex (@"(?.+):(?\d+): error: Error: (?.+)"); + Regex regex = MyRegex (); if (!regex.IsMatch (text)) return text; @@ -182,6 +182,9 @@ private string FormatForVS (string text) return string.Format ("{0}({1}): error 1: {2}", MessageUtils.MapGeneratedToProjectFile (filename), line_no, error); } + + [GeneratedRegex (@"(?.+):(?\d+): error: Error: (?.+)")] + private static partial Regex MyRegex (); } } diff --git a/tools/generator/Utilities/TypeNameUtilities.cs b/tools/generator/Utilities/TypeNameUtilities.cs index 9e9656d2f..9ea64de98 100644 --- a/tools/generator/Utilities/TypeNameUtilities.cs +++ b/tools/generator/Utilities/TypeNameUtilities.cs @@ -7,7 +7,7 @@ namespace MonoDroid.Generation { - public static class TypeNameUtilities + internal static class TypeNameUtilities { // These must be sorted for BinarySearch to work // Missing "this" because it's handled elsewhere as "this_" @@ -71,8 +71,8 @@ public static string GetGenericJavaObjectTypeOverride (string managed_name, stri public static string GetNativeName (string name) { - if (name.StartsWith ("@", StringComparison.Ordinal)) - return "native__" + name.Substring (1); + if (name.StartsWith ('@')) + return string.Concat ("native__", name.AsSpan (1)); return "native_" + name; } diff --git a/tools/jcw-gen/App.cs b/tools/jcw-gen/App.cs index 0eb606902..f65f27c45 100644 --- a/tools/jcw-gen/App.cs +++ b/tools/jcw-gen/App.cs @@ -13,7 +13,7 @@ namespace Java.Interop.Tools { - class App + sealed class App { public static int Main (string [] args) { diff --git a/tools/logcat-parse/GrefParseOptions.cs b/tools/logcat-parse/GrefParseOptions.cs index 7720a8d1f..7970fdeba 100644 --- a/tools/logcat-parse/GrefParseOptions.cs +++ b/tools/logcat-parse/GrefParseOptions.cs @@ -3,7 +3,7 @@ namespace Xamarin.Android.Tools.LogcatParse { [Flags] - public enum GrefParseOptions { + internal enum GrefParseOptions { None, LogWarningOnMismatch = 1 << 0, diff --git a/tools/logcat-parse/Grefs.cs b/tools/logcat-parse/Grefs.cs index dcce7e2c4..7e5f2514d 100644 --- a/tools/logcat-parse/Grefs.cs +++ b/tools/logcat-parse/Grefs.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Tools.LogcatParse { - public class Grefs { + internal class Grefs { const string FilePrefix = @"\[monodroid-gref\] "; const string AndroidPrefix = @"(\d\d-\d\d \d\d:\d\d:[^:]+: )?I/monodroid-gref\(\s*(?{0})\): "; diff --git a/tools/logcat-parse/PeerInfo.cs b/tools/logcat-parse/PeerInfo.cs index 63370e27c..a9ee71088 100644 --- a/tools/logcat-parse/PeerInfo.cs +++ b/tools/logcat-parse/PeerInfo.cs @@ -6,14 +6,14 @@ namespace Xamarin.Android.Tools.LogcatParse { - public enum JniHandleType { + internal enum JniHandleType { None, Local, Global, WeakGlobal, } - public struct JniHandleInfo : IEquatable { + internal struct JniHandleInfo : IEquatable { public readonly string Handle; public readonly JniHandleType Type; @@ -132,7 +132,7 @@ enum PeerInfoState { Finalized = 1 << 2, } - public class PeerInfo { + internal class PeerInfo { PeerInfoState state; diff --git a/tools/logcat-parse/Program.cs b/tools/logcat-parse/Program.cs index d338702b0..a4e9613d0 100644 --- a/tools/logcat-parse/Program.cs +++ b/tools/logcat-parse/Program.cs @@ -5,7 +5,7 @@ namespace Xamarin.Android.Tools.LogcatParse { - public class Program { + internal class Program { public static int Main (string[] args) { diff --git a/tools/logcat-parse/repl.cs b/tools/logcat-parse/repl.cs index 4a342e7ff..9abde0f61 100644 --- a/tools/logcat-parse/repl.cs +++ b/tools/logcat-parse/repl.cs @@ -32,7 +32,7 @@ namespace Mono { - public class InteractiveBaseShell : InteractiveBase { + internal class InteractiveBaseShell : InteractiveBase { static bool tab_at_start_completes; static InteractiveBaseShell () @@ -62,7 +62,7 @@ public static bool TabAtStartCompletes { } } - public class CSharpShell { + internal class CSharpShell { static bool isatty = true, is_unix = false; protected string [] startup_files; diff --git a/tools/param-name-importer/DroidDocImporter.cs b/tools/param-name-importer/DroidDocImporter.cs index dabc30399..7033415a8 100644 --- a/tools/param-name-importer/DroidDocImporter.cs +++ b/tools/param-name-importer/DroidDocImporter.cs @@ -9,7 +9,7 @@ namespace Xamarin.Android.ApiTools.DroidDocImporter { - public class DroidDocScrapingImporter + internal sealed class DroidDocScrapingImporter { static bool ClassContains (XElement e, string cls) { diff --git a/tools/param-name-importer/HtmlLoader.cs b/tools/param-name-importer/HtmlLoader.cs index 095ed9020..b51673dd5 100644 --- a/tools/param-name-importer/HtmlLoader.cs +++ b/tools/param-name-importer/HtmlLoader.cs @@ -9,22 +9,21 @@ namespace Xamarin.Android.ApiTools.DroidDocImporter { - class HtmlLoader + sealed class HtmlLoader { // okay, SgmlReader itself has something similar, but I need something that makes sure to resolve only embedded resources. - class EmbeddedResourceEntityResolver : Sgml.IEntityResolver + sealed class EmbeddedResourceEntityResolver : Sgml.IEntityResolver { public IEntityContent GetContent (Uri uri) { return new EmbeddedResourceEntityContent (uri.LocalPath); } - class EmbeddedResourceEntityContent : Sgml.IEntityContent + sealed class EmbeddedResourceEntityContent : Sgml.IEntityContent { public EmbeddedResourceEntityContent (string name) { - if (name == null) - throw new ArgumentNullException (nameof (name)); + ArgumentNullException.ThrowIfNull (name); this.name = Path.GetFileName (name); } diff --git a/tools/param-name-importer/ImporterOptions.cs b/tools/param-name-importer/ImporterOptions.cs index 3cdc44090..9de66b7ff 100644 --- a/tools/param-name-importer/ImporterOptions.cs +++ b/tools/param-name-importer/ImporterOptions.cs @@ -3,7 +3,7 @@ namespace Xamarin.Android.ApiTools { - public class ImporterOptions + internal sealed class ImporterOptions { public string InputZipArchive { get; set; } public string DocumentDirectory { get; set; } diff --git a/tools/param-name-importer/JavaApiParameterNamesExporter.cs b/tools/param-name-importer/JavaApiParameterNamesExporter.cs index 2dd5947e9..4ce74302d 100644 --- a/tools/param-name-importer/JavaApiParameterNamesExporter.cs +++ b/tools/param-name-importer/JavaApiParameterNamesExporter.cs @@ -6,7 +6,7 @@ namespace Xamarin.Android.Tools.ApiXmlAdjuster { - public static class JavaApiParameterNamesExporter + internal static class JavaApiParameterNamesExporter { public static void WriteParameterNamesXml (this JavaApi api, string file) { diff --git a/tools/param-name-importer/JavaStubSourceImporter.cs b/tools/param-name-importer/JavaStubSourceImporter.cs index 0a8b84b12..580d466c8 100644 --- a/tools/param-name-importer/JavaStubSourceImporter.cs +++ b/tools/param-name-importer/JavaStubSourceImporter.cs @@ -12,7 +12,7 @@ namespace Xamarin.Android.ApiTools.JavaStubImporter { - public class JavaStubSourceImporter + internal sealed class JavaStubSourceImporter { public void Import (ImporterOptions options) { diff --git a/tools/param-name-importer/Program.cs b/tools/param-name-importer/Program.cs index ac74ea23f..6bff7e616 100644 --- a/tools/param-name-importer/Program.cs +++ b/tools/param-name-importer/Program.cs @@ -11,7 +11,7 @@ namespace Xamarin.Android.ApiTools { - public class Driver + internal sealed class Driver { public static void Main (string [] args) {