[code-reflection] RFR: Conflicting code reflection fields for method overrides [v4]

Adam Sotona asotona at openjdk.org
Fri Jun 28 17:14:42 UTC 2024


On Fri, 28 Jun 2024 16:42:30 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Yes, it was more in the spirit of a quicker fix with less mangling code.
>
>> > Could we encode an instance of `MethodRef` in the field name...
>> 
>> Maybe I don't know all the javac tricks, but I understand the `MethodRef` instance is composed a bit later in the process. Here we try to reconstruct the composition of it (or at least the method parameters).
> 
> I think @PaulSandoz is referring to the code model's `MethodRef` class. You can easily build one in `ReflectMethods` by calling this: `symbolToErasedMethodRef(sym)` where `sym` is the symbol of the reflectable method.
> 
> I believe the "bet" is that the `toString` representation of code model's `MethodRef` is good enough to disambiguate and, at the same time, provides an easy way for the reflective code to reconstruct and pick that back up.

Implemented as suggested, thank you.

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/162#discussion_r1659070286


More information about the babylon-dev mailing list