[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] Difficulty undoing refactorings
|
I've been having occasional problems undoing refactorings in CDT. The
following function seems to demonstrate this behaviour consistently.
int f () {
int x = 1;
int y = 2;
return x+y;
}
Select x, then invoke the "Rename" refactoring to change it to xx.
Then select y and refactor it to yy. If you then attempt to undo the
refactorings then the renaming of y is undone successfully, but for x
you get an error box saying
'Rename local variable 'x'' cannot be undone.
Reason: The content of '<file>' has changed.
Sometimes it's possible to carry on and successfully undo the renaming
of x, but at other times it becomes impossible to go back any further
in the editing history (I don't think the latter happens with this
example, but I have seen it with larger files). I've (sporadically)
experienced similar behaviour with refactorings I've implemented
myself, so this seems to be a problem with the refactoring framework
in general. I'm using Neon on Linux, but I've experienced the same
behaviour with earlier Eclipse/CDT versions as well (and with both
Java 7 and Java 8).
Kenneth MacKenzie
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.