allow navigating from `ClassInfo` to its member classes
Ladicek opened this issue · comments
For a class, the InnerClasses
bytecode attribute contains (among others) names of all its member classes. They can be recognized by outer_class_info_index
being != 0
. If that outer_class_info_index
points to the "current" class, we know it is "our" member class. The name of the member class can be found using inner_name_index
.
Names (as in, DotName
s) of all member classes could be stored in the ClassInfo
and serialized. That would allow, in addition to current navigation from a class to its enclosing class, also navigating from a class to its member classes.
Open questions:
-
If I have a bunch of classes like this
class A { class B { class C { } } }
What should
A
's set of member classes contain? OnlyB
, orB
andC
? I'd say justB
. If you wantC
, you should navigate to it fromB
. -
Member class names in bytecode are stored in a simple form. So if I have a class
com.example.A
which has a member classB
, we know its name isB
. Do we want to return a full name ofcom.example.A$B
? I'd say yes, it's actually pretty simple to create a componentized name of this form. -
What about local classes and anonymous classes? I'd say we can just ignore them, at least for now.
Done in #185.