diff --git a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaTypeScanner.cs b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaTypeScanner.cs index 97f2222ea..8a00814fe 100644 --- a/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaTypeScanner.cs +++ b/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaTypeScanner.cs @@ -18,17 +18,15 @@ public class JavaTypeScanner readonly IMetadataResolver cache; - [Obsolete ("Use the TypeDefinitionCache overload for better performance.")] - public JavaTypeScanner (Action logger) - : this (logger, resolver: null) - { } + [Obsolete ("Use the TypeDefinitionCache overload for better performance.", error: true)] + public JavaTypeScanner (Action logger) => throw new NotSupportedException (); - public JavaTypeScanner (Action logger, TypeDefinitionCache? cache) - : this (logger, (IMetadataResolver?) cache) + public JavaTypeScanner (Action logger, TypeDefinitionCache cache) + : this (logger, (IMetadataResolver) cache) { } - public JavaTypeScanner (Action logger, IMetadataResolver? resolver) + public JavaTypeScanner (Action logger, IMetadataResolver resolver) { if (logger == null) throw new ArgumentNullException (nameof (logger)); @@ -96,15 +94,14 @@ public static bool ShouldSkipJavaCallableWrapperGeneration (TypeDefinition type, return false; } - [Obsolete ("Use the TypeDefinitionCache overload for better performance.")] - public static List GetJavaTypes (IEnumerable assemblies, IAssemblyResolver resolver, Action log) => - GetJavaTypes (assemblies, resolver, log, metadataResolver: null); + [Obsolete ("Use the TypeDefinitionCache overload for better performance.", error: true)] + public static List GetJavaTypes (IEnumerable assemblies, IAssemblyResolver resolver, Action log) => throw new NotSupportedException (); // Returns all types for which we need to generate Java delegate types. - public static List GetJavaTypes (IEnumerable assemblies, IAssemblyResolver resolver, Action log, TypeDefinitionCache? cache) => - GetJavaTypes (assemblies, resolver, log, (IMetadataResolver?) cache); + public static List GetJavaTypes (IEnumerable assemblies, IAssemblyResolver resolver, Action log, TypeDefinitionCache cache) => + GetJavaTypes (assemblies, resolver, log, (IMetadataResolver) cache); - public static List GetJavaTypes (IEnumerable assemblies, IAssemblyResolver resolver, Action log, IMetadataResolver? metadataResolver) + public static List GetJavaTypes (IEnumerable assemblies, IAssemblyResolver resolver, Action log, IMetadataResolver metadataResolver) { Action l = (level, value) => log ("{0}", new string [] { value }); return new JavaTypeScanner (l, metadataResolver).GetJavaTypes (assemblies, resolver);