Uh oh!
There was an error while loading. Please reload this page.
[TrimmableTypeMap][Core B] Foundation and AssemblyIndex - #10817
[TrimmableTypeMap][Core B] Foundation and AssemblyIndex#10817simonrozsival wants to merge 3 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| if (attrName == "RegisterAttribute") { | ||
| registerInfo = ParseRegisterAttribute (ca, customAttributeTypeProvider); | ||
| } else if (attrName == "ExportAttribute") { | ||
| // [Export] methods are detected per-method in CollectMarshalMethods |
There was a problem hiding this comment.
| // [Export] methods are detected per-method in CollectMarshalMethods | |
| // [Export] methods are not handled yet and supporting them wil be implemented later |
Uh oh!
There was an error while loading. Please reload this page.
| if (typeDef.IsNested) { | ||
| var declaringType = reader.GetTypeDefinition (typeDef.GetDeclaringType ()); | ||
| var parentName = GetFullName (declaringType, reader); | ||
| return parentName + "+" + name; |
There was a problem hiding this comment.
| returnparentName+"+"+name; | |
| return$"{parentName}+{name}"; |
| return name; | ||
| } | ||
| return ns + "." + name; |
There was a problem hiding this comment.
| returnns+"."+name; | |
| return$"{ns}.{name}"; |
Uh oh!
There was an error while loading. Please reload this page.
| /// <summary> | ||
| /// Type has [Activity], [Service], [BroadcastReceiver], [ContentProvider], | ||
| /// [Application], or [Instrumentation]. | ||
| /// </summary> | ||
| public bool HasComponentAttribute { get; set; } |
There was a problem hiding this comment.
I don't really know if this information would be useful later, but it would be useful in tests I think: let's remember the exact type of the attribute please. I think it might be best to make this class abstract and add a sealed subclass for each of the component classes. The ApplicationBackupAgent and ApplicationManageSpaceActivity fields should be just on the ApplicationAttributeInfo class (without the redundant Application prefix).
| bool ImplementsIJniNameProviderAttribute (TypeDefinition typeDef) | ||
| { | ||
| foreach (var implHandle in typeDef.GetInterfaceImplementations ()) { |
There was a problem hiding this comment.
Does typeDef.GetInterfaceImplementations () return only the interfaces implemented on this type level, or also the inherited interfaces? I would expect this API not to recursively explore the interfaces implemented on the base class and the base interfaces of the implemented interfaces. I think we should either not do this yet (we would only support the predefined set of attributes such as [Register], [Application], [Activity], ..., or do it properly and recursively explore the structure. This could be very expensive, so we'd need to carefuly cache if a given type (class or interface) implements IJniNameProviderAttribute. The more I'm thinking about it, the more I think we should not even look for this interface. We can add this logic once we run into a scenario that actually requires it.
| var (registerInfo, attrInfo) = ParseAttributes (typeDef); | ||
| if (attrInfo != null) { |
There was a problem hiding this comment.
| if(attrInfo!=null){ | |
| if(attrInfois notnull){ |
Uh oh!
There was an error while loading. Please reload this page.
simonrozsival
commented
Feb 14, 2026
Addressed all review feedback in this and downstream stacked PRs: applied null patterns ( |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove IJniNameProviderAttribute discovery and ReclassifyAttributes; only support hardcoded known component attributes for now - Remove JniNameProviderAttributeInfo (unused without dynamic discovery) - Convert RegisterInfo and ExportInfo to records with required init - Use .IsNullOrEmpty() extension method instead of string.IsNullOrEmpty() - Add NullableExtensions.cs for netstandard2.0 nullable-aware string checks - Throw on unknown component attribute name instead of silently creating a JniNameProviderAttributeInfo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4730fdf to
a2ac436Compare
Sliced from #10805
Depends on #10816
Scope
project, model/providers)AssemblyIndexmetadata indexing and lookup logicNotes