Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Ignore types without names (#837)
Fixes: #835 Context: https://github.com/firebase/firebase-android-sdk/blob/1fba4a70395c20dcc858b22ee8247acbed7cf8d3/firebase-firestore/src/main/java/com/google/firebase/firestore/model/Document.java Context: https://maven.google.com/web/index.html?q=firestore#com.google.firebase:firebase-firestore:22.1.2 Somehow Google has compiled `firebase-firestore.aar` to contain a `Document$.class` with a "non-sensical" *empty* inner class 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" /> The presence of a `//class[@name='Document.']` element causes an `IndexOutOfRangeException` for `generator` when it tries to parse `Document.` into a parent class name and nested class name. System.IndexOutOfRangeException: Index was outside the bounds of the array. at MonoDroid.Generation.XmlApiImporter.CreateGenBaseSupport (System.Xml.Linq.XElement pkg, System.Xml.Linq.XElement elem, System.Boolean isInterface) 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) at MonoDroid.Generation.Parser.ParsePackage (System.Xml.Linq.XElement ns) 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) at Xamarin.Android.Binder.CodeGenerator.Main (System.String[] args) We cannot reproduce *how* to get a `Document$.class` file, 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.
- Loading branch information