This JEP introduces an API to standardize the description and loading of class constants.
Every Java class has a constant pool. It either stores simple values such as strings and integers or values to represent classes or methods. Class constant pool values are used as operand values for the ldc (load constant) bytecode instruction. These constants can also be used by the invokedynamic bytecode instruction—in the static argument list of a bootstrap method.
When either an ldc or invokedynamic instruction executes, it represents the constant value as a Java data type value, a class, an integer, or a string. Until now, the responsibility of modeling bytecode instructions and loading constants was on the class that wanted to manipulate class files. This usually takes the focus of these classes off their business logic, moving it to the specifics of how...