Modify

Ticket #37 (closed defect: fixed)

Opened 11 years ago

static final variables

Reported by: Bernhard Haumacher (haui at haumacher dot de) Owned by:
Priority: normal Milestone: 1.06a
Component: JP trafo Version:
Severity: normal Keywords:
Cc:

Description

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.

Evaluation

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.

Solution

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.

See also

ticket:118

fixed since 1.06a.

Attachments

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.