[code-reflection] RFR: Conflicting code reflection fields for method overrides
    Paul Sandoz 
    psandoz at openjdk.org
       
    Fri Jun 28 15:58:34 UTC 2024
    
    
  
On Fri, 28 Jun 2024 13:20:12 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> This patch constructs code reflection fields from method name and $-escaped method parameters.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ReflectMethods.java line 374:
> 
>> 372:             }
>> 373:         };
>> 374:         for (var p : method.params) {
> 
> I'd suggest to call the signature generator on the type obtained from `method.sym.externalType(types)`, as that will take into account any extra synthetic parameter that might be added later by javac (which will end up in the bytecode) - e.g. for inner class constructors.
Could we encode an instance of `MethodRef` in the field name like we do with the invoke operation's descriptor? (I believe there are less restrictions in the names of synthetic fields than ones that can be denoted in source.) That might be easier to manage on the compile time and run time sides.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/162#discussion_r1658951252
    
    
More information about the babylon-dev
mailing list