0

I've come across what seems to be a bug in Eclipse Kepler while debugging. One of my variables is incrementing itself randomly with every step of the debugger, even through steps that do not change the variable at all. Screenshots included below:

enter image description here

The method advanceLine() increments progress by one

enter image description here

The very next step, progress increments twice, before it even reaches the increment

There is another thread that accesses progress, but it does not modify it. These random changes don't seem to affect my program at all, just the debug view. Also, for some reason, the shortcut to Step-Into (F5) doesn't work despite being already bound. Does anybody know what's going on?

4

2 回答 2

1

变量进度是一个类变量,如果它的更新不明确,则可能是另一个线程正在修改您的变量。请使您的变量本地化。除非您明确右键单击变量并更改其值,否则 Eclipse 不会干扰您的编码逻辑。

于 2013-09-30T12:03:09.550 回答
1

嗯..我想通了。我从 Expressions 视图中删除了变量 watch 并将其添加回来。瞧,它显示正常,我的代码根本没有改变。我认为这只是行为不稳定的视图,因为就像@Vineet 所说,除非您告诉它,否则 Eclipse 不会修改代码中的值。

于 2013-10-01T08:20:07.090 回答