Community
Participate
Working Groups
Because the increment operator has what amounts to a side effect, the using extract local variable in a method with muiltiple getXX(i++) type lines of code gives an incorrect result. For example this code: Object o1 = myList.get(index++); Object o3 = myList.get(index++); Object o4 = myList.get(index++); Object o5 = myList.get(index++); After extracting the first "myList.get(index++)", yields: Object object = myList.get(index++); Object o1 = object; Object o3 = object; Object o4 = object; Object o5 = object; which is clearly not what one wants. -Andrew
*** This bug has been marked as a duplicate of 27740 ***