RFR(13): JDK-8217047: Provide a way to inject missing parameter names
Jan Lahoda
jan.lahoda at oracle.com
Wed Feb 13 14:24:00 UTC 2019
Hi,
Based on feedback, I've updated the javadoc. Also, when
ParameterNameProvider.getParameterName returns null, the javac's default
name will be returned from VariableElement.getSimpleName(), so I've made
this explicit in the javadoc and added a test for that.
Updated webrev: http://cr.openjdk.java.net/~jlahoda/8217047/webrev.02/
Updated specdiff:
http://cr.openjdk.java.net/~jlahoda/8217047/specdiff.02/overview-summary.html
How does this look?
Thanks,
Jan
On 21.1.2019 13:32, Jan Lahoda wrote:
> Hi,
>
> When a type is load from a classfile, and some or all of its methods
> have neither the MethodParameters or LocalVariableTable attributes, then
> the parameters of the methods have an artificial synthesized name, which
> is visible through VariableElement.getSimpleName().
>
> The proposal here is to allow to plug in an external provider that could
> provide more user-friendly names lazily/on demand. These could originate
> e.g. in adjacent sources.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8217437
> Webrev: http://cr.openjdk.java.net/~jlahoda/8217047/webrev.01/
> Specdiff:
> http://cr.openjdk.java.net/~jlahoda/8217047/specdiff.01/overview-summary.html
>
>
> CSR: https://bugs.openjdk.java.net/browse/JDK-8217437
>
> What do you think?
>
> Thanks,
> Jan
More information about the compiler-dev
mailing list