Record and annotation values
forax at univ-mlv.fr
Sun Apr 8 20:16:54 UTC 2018
Currently annotation values are limited to what is encodable as a constant in the constant pool.
With Condy, we can expand the number of values that can be encodable as a constant in the constant pool to the infinity by allowing a reference to any non-mutable class to be encoded as an annotation values.
For that we need to have a 'protocol' that
- encode an instance of a user defined non-mutable class as a condy by the compiler.
- decode an instance of a user defined non-mutable class by the JDK runtime.
Records with their constructors do not provide enough meta-information for that, the parameter names of the constructors may not be available at runtime.
So i think the constructors parameter names of a Record should be always recorded (as with --parameters was specified for the constructors) to enable non-mutable records to be annotation values.
More information about the amber-spec-experts