diff --git a/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Adapters/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Android.Graphics.Color/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Arrays/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Constructors/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NestedTypes/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NonStaticFields/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NormalMethods/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/NormalProperties/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/ParameterXPath/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/StaticFields/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/StaticMethods/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/StaticProperties/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/Streams/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/TestInterface/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/java.lang.Enum/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/java.lang.Object/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected.ji/java.util.List/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected/EnumerationFixup/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected/InterfaceMethodsConflict/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs b/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs index 871d20de2..d71a25b64 100644 --- a/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs +++ b/tests/generator-Tests/expected/java.lang.Object/Java.Interop.__TypeRegistrations.cs @@ -23,6 +23,9 @@ public static void RegisterPackages () #endif // def MONODROID_TIMING } +#if NET5_0_OR_GREATER + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage ("Trimming", "IL2057")] +#endif static Type Lookup (string[] mappings, string javaType) { var managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType); diff --git a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs index 7ddd494f6..0506acd69 100644 --- a/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs +++ b/tools/generator/Java.Interop.Tools.Generator.ObjectModel/ClassGen.cs @@ -208,6 +208,9 @@ public static void GenerateTypeRegistrations (CodeGenerationOptions opt, Generat sw.WriteLine ("#endif // def MONODROID_TIMING"); sw.WriteLine ("\t\t}"); sw.WriteLine (); + sw.WriteLine ("#if NET5_0_OR_GREATER"); + sw.WriteLine("\t\t[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage (\"Trimming\", \"IL2057\")]"); + sw.WriteLine ("#endif"); sw.WriteLine ("\t\tstatic Type{0} Lookup (string[] mappings, string javaType)", opt.NullableOperator); sw.WriteLine ("\t\t{"); sw.WriteLine ("\t\t\tvar managedType = Java.Interop.TypeManager.LookupTypeMapping (mappings, javaType);");