RFR: implementation for JEP 334: JVM Constants API

Vicente Romero vicente.romero at oracle.com
Wed May 23 19:37:11 UTC 2018



On 05/23/2018 03:10 PM, jbvernee wrote:
> Hello,
>
> (I hope this email comes out alright, since I'm using raw text 
> formatting)
>
> There seems to be an error in the generated javadoc.
> If you go to the javadoc of, for instance, `ConstantClassDesc` [1]
> you'll see that it lists `Constable<Class<?>>` as one of the 
> implemented interfaces.
> Looking at the source code, this seems to be pulled down from the 
> `ClassDesc` interface [2],
> which does extend `Constable`. The problem is, it does not extends 
> `Constable<Class<?>>`,
> but `Constable<ConstantDesc<Class<?>>>`, so this `Constable<Class<?>>` 
> super interface of
> `ConstantClassDesc` seems to be an error and it should list 
> `Constable<ConstantDesc<Class<?>>` instead.

I will check this, thanks!

>
> A similar problem exists with the javadoc for this 
> `ConstantMethodHandleDesc` and `ConstantMethodTypeDesc` classes.
> (Reading this for the first time confused me for quite a while, actually)
>
> Some other nitty remarks/questions are:
> - Why is the package name `java.lang.invoke.constant` and not 
> `java.lang.constant`?

package java.lang.invoke is the space used for the classes that define 
the interaction between the JDK and the JVM and the new constants are a 
JVM thing

>   The constants API is not just an extension/sub-component of the 
> `invoke` API, is it?
> - Shouldn't the abbreviation `Desc`, by changed to the full name 
> `Descriptor`?

yep, could be, I guess it's a matter of choosing between very 
descriptive names and shorter ones, mostly a matter of style

>   Using full names seems more proper + abbreviations can be ambiguous.
>
> Cheers,
> Jorn Vernee

Thanks,
Vicente
>
> [1] 
> http://cr.openjdk.java.net/~vromero/constant.api/javadoc.07/java/lang/invoke/constant/ConstantClassDesc.html
> [2] 
> http://cr.openjdk.java.net/~vromero/constant.api/javadoc.07/java/lang/invoke/constant/ClassDesc.html



More information about the amber-dev mailing list