RFR: implementation for JEP 334: JVM Constants API

jbvernee jbvernee at xs4all.nl
Wed May 23 19:10:46 UTC 2018


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.

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`?
   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`?
   Using full names seems more proper + abbreviations can be ambiguous.

Cheers,
Jorn Vernee

[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