JDK 20 |
---|
20 b04Fixed |
CSR :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
Modifiers in core reflection and currently modeling using bit positions in an integer by java.lang.reflect.Modifier. This simple model does not fully capture existing nuances of modifiers. For example, there are collisions between the modifier bit positions for concepts used for fields, method, and types. These uses need to be disambiguated in for textual representations (JDK-6354476) and elsewhere. With the possibility of a bit position being reused in the same kind of construct for different purposes on different class file versions (JDK-8266524), a more capable model of core reflection modifiers will be needed. As a straw man proposal: - core reflection classes get a new "modifiers" method which returns an enum set of modifiers - the modifiers enum has a constant for each modifier. A modifier can include information such as its bit position, what kinds of constructs it is applicable to (classes, fields, methods, etc.), string representation, etc. This would allow bit positions with collisions, such as var-args and transient, to be modeled appropriately. Such a class would be analogous to javax.lang.model.element.Modifier.
|