-
Notifications
You must be signed in to change notification settings - Fork 570
Stop generating dead Java.Interop.__TypeRegistrations #11664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Copilot
wants to merge
10
commits into
main
from
copilot/stop-generating-dead-type-registrations-class
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9ead101
Initial plan
Copilot 928af63
Stop generating type registrations
Copilot fbfbe73
Update Java.Interop type registrations generator
Copilot 84b1643
Preserve RegisterPackage validation
Copilot bb16088
Plan review feedback fix
Copilot f1021e4
Throw for unsupported package registration APIs
Copilot 8b83c95
Restore submodule pointers
Copilot f4bb1ce
Push restored submodule pointers
Copilot 9e02795
Restore submodule pointers
Copilot 21a2d53
Clean unsupported package registration method
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule Java.Interop
updated
from b881d2 to cc8a0a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -453,47 +453,24 @@ public static void RegisterType (string java_class, Type t) | |
| } | ||
| } | ||
|
|
||
| static Dictionary<string, List<Converter<string, Type?>>>? packageLookup; | ||
|
|
||
| [MemberNotNull (nameof (packageLookup))] | ||
| static void LazyInitPackageLookup () | ||
| { | ||
| if (packageLookup == null) | ||
| packageLookup = new Dictionary<string, List<Converter<string, Type?>>> (StringComparer.Ordinal); | ||
| } | ||
|
|
||
| public static void RegisterPackage (string package, Converter<string, Type> lookup) | ||
| { | ||
| LazyInitPackageLookup (); | ||
|
|
||
| lock (packageLookup!) { | ||
| if (!packageLookup.TryGetValue (package, out var lookups)) | ||
| packageLookup.Add (package, lookups = new List<Converter<string, Type?>> ()); | ||
| lookups.Add (lookup); | ||
| } | ||
| if (package == null) | ||
| throw new ArgumentNullException ("package"); | ||
| if (lookup == null) | ||
| throw new ArgumentNullException ("lookup"); | ||
| throw new NotSupportedException (); | ||
| } | ||
|
|
||
| public static void RegisterPackages (string[] packages, Converter<string, Type?>[] lookups) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this method should throw |
||
| { | ||
| LazyInitPackageLookup (); | ||
|
|
||
| if (packages == null) | ||
| throw new ArgumentNullException ("packages"); | ||
| if (lookups == null) | ||
| throw new ArgumentNullException ("lookups"); | ||
| if (packages.Length != lookups.Length) | ||
| throw new ArgumentException ("`packages` and `lookups` arrays must have same number of elements."); | ||
|
|
||
| lock (packageLookup!) { | ||
| for (int i = 0; i < packages.Length; ++i) { | ||
| string package = packages [i]; | ||
| var lookup = lookups [i]; | ||
|
|
||
| if (!packageLookup.TryGetValue (package, out var _lookups)) | ||
| packageLookup.Add (package, _lookups = new List<Converter<string, Type?>> ()); | ||
| _lookups.Add (lookup); | ||
| } | ||
| } | ||
| throw new NotSupportedException (); | ||
| } | ||
|
|
||
| [Register ("mono/android/TypeManager", DoNotGenerateAcw = true)] | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method should throw
NotSupportedException