Ticket #37 (closed defect: fixed)
Opened 11 years ago
static final variables
|Reported by:||Bernhard Haumacher (haui at haumacher dot de)||Owned by:|
In the actual transformation public static final variables are moved to the object handle class. If the initializer has side effects or the variable is initialized in a static block of the class, this transformation leads to wrong results (if the initializer is executed more than once) or is illegal (because the final variable is not initialized but accessed for writing from the class implementation object where the static initializer is executed.
Normally a public static variable is used as a constant initialized directly from a constant without side effects. Because such constants are accessed very frequently, it is not possible to move such variables to the class implementation object (where they originally belong to). Each access would require a remote method invocation to the class object.
A public static final variable is a special form of replicated data. A public static final variable should be transformed like a replicated static variable without the ability of an update.
fixed since 1.06a.