Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-ui-dev] SEF Refactoring

> <- compound assignments>
> are now handled in the following way:
>
> field += expr;  =>  setField(getField() + expr);

some other things to consider - just from the top of my head:

1. field ^= expr  (and others operators (in compound assignement and
elsewhere)
 like %, /, !,  >>, <<, >>>, &, |, *, ~)

2. remember about operator prorities:
field *= 0 + 1 must be transformed to sth like:
set(get() * (1 + 2))

3. what about stuff like:

if ((field = expr1) == expr2){
}

i think, simply using a setter will not work here.
same as:

field += (field = 2);

or

field += (field *= 2);

or sth else of that sort

4. similar case for boolean:

if (booleanField = false){  //<< assignment!
}


if i come up with something more i'll let you know
a.



Back to the top