Skip to content
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

[generator] Ignore types without names. #837

Merged
merged 1 commit into from
May 12, 2021
Merged

[generator] Ignore types without names. #837

merged 1 commit into from
May 12, 2021

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented May 12, 2021

Fixes: #835

Somehow Google has compiled firebase-firestore.aar to contain a class with a dollar sign in its name:

    <class
      abstract="false"
      deprecated="not deprecated"
      jni-extends="Ljava/lang/Object;"
      extends="java.lang.Object"
      extends-generic-aware="java.lang.Object"
      final="false"
      name="Document."
      jni-signature="Lcom/google/firebase/firestore/model/Document$;"
      source-file-name="Document.java"
      static="false"
      visibility="public" />

This causes an IndexOutOfRangeException for generator when it tries to parse Document. into a parent class name and nested class name.

  Unhandled Exception: (TaskId:666)
  System.IndexOutOfRangeException: Index was outside the bounds of the array. (TaskId:666)

    at MonoDroid.Generation.XmlApiImporter.CreateGenBaseSupport (System.Xml.Linq.XElement pkg, System.Xml.Linq.XElement elem, System.Boolean isInterface) [0x0021c] in <fc31e3500e9a44b181504040e11d2f7d>:0  (TaskId:666)
    at MonoDroid.Generation.XmlApiImporter.CreateClass (System.Xml.Linq.XElement pkg, System.Xml.Linq.XElement elem, 
    at MonoDroid.Generation.Parser.ParsePackage (System.Xml.Linq.XElement ns, System.Predicate`1[T] p) [0x00087] in 
    at MonoDroid.Generation.Parser.ParsePackage (System.Xml.Linq.XElement ns) [0x00000] in 
    at MonoDroid.Generation.Parser.Parse (System.Xml.Linq.XDocument doc, System.Collections.Generic.IEnumerable`1[T] fixups, 
    at MonoDroid.Generation.Parser.Parse (System.String filename, System.Collections.Generic.IEnumerable`1[T] fixups, 
    at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options, 
    at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options) [0x0001b] in 
    at Xamarin.Android.Binder.CodeGenerator.Main (System.String[] args) [0x0000c] in <fc31e3500e9a44b181504040e11d2f7d>:0  

We cannot reproduce how to do this, so we're currently assuming this is some sort of bytecode manipulation. As such, we are going to have generator ignore types with an empty name and types that end in a period, which would indicate a nested type with an empty name.

@jpobst jpobst marked this pull request as ready for review May 12, 2021 21:24
@jonpryor jonpryor merged commit 9b89e90 into main May 12, 2021
@jonpryor jonpryor deleted the unnamed-types branch May 12, 2021 22:35
@jpobst jpobst added this to the 11.4 (16.11 / 8.11) milestone Jun 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IOORE importing type with name ending in a period
2 participants