jeudi 10 septembre 2015

Using reflection, can I determine if a Java static final field will be in-lined?

Is there any way, using reflection, to determine whether a static final field has an '=' value (so that the value will be in-lined when it is accessed) or whether its value is assigned by the static initializer? If the field does have a value, is there any way to retrieve that value without using the Field.get method (and therefore causing the static initializer to be executed)?





Aucun commentaire:

Enregistrer un commentaire