Priority
Critical
Type
Bug 
State
Fixed 
Assignee
Eugene Zhuravlev 
Subsystem
Debugger 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7744
Fixed in build
8256
Severity
0
  • Submitted by   dennis haupt
    23 months ago (07 Mar 2008 14:28)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:58)
  • Jira: IDEA-43070
    (history, comments)

IDEA-43070

debugger breaks code logic

0
the "automatic method call and show result"-feature (the one having the watch glasses icon in the variables view) calls next() on iterators which messes up the logic. it should only evaluate the result of simple getters

Issue was resolved
Comments (2)
 
History (1)
 
Links
 
Eugene Zhuravlev
  Eugene Zhuravlev
21 Mar 2008 18:29
(22 months ago)
#permalink
Used the following code to reproduce, but was not able to:

public class TestIteratorRendering {
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
list.add("one");
list.add("two");
list.add("three");
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) { // breakpoint here
String str = iterator.next();
System.out.println(str);
}
}
}


Could you give an example in which the "iterator.next()" expression is auto-created?
Eugene Zhuravlev
  Eugene Zhuravlev
28 Mar 2008 17:50
(22 months ago)
#permalink
Nevermind, reproduced.
This is true for expressions like this: "Data data = iterator.next().getData()"
As a workaround please use ExtractVariable refactoring:

MyObject obj = iterator.next();
Data data = obj.getData();