Community
Participate
Working Groups
Broken in M3, HEAD, and in HEAD with patch from bug 330556 comment 8 OK up to at least 3.7 M1. Auto-indentation is broken when copying lines with Ctrl+Alt+ArrowDown. Example (using default code formatter): package p; import java.util.List; class A { void x() { List<? extends Number> nums = getNums(); for (Number n : nums) { Number n2 = (Number) n; // copy with Ctrl+Alt+ArrowDown System.out.println(n); } } private List getNums() { return null; } } => Copied line indented too much: for (Number n : nums) { Number n2 = (Number) n; Number n2 = (Number) n;
The copying is not necessary to reproduce. Ctrl+I also indents wrongly: for (Number n : nums) { Number n2 = (Number) n; Number n2 = (Number) n; System.out.println(n); }
I've reverted all recently made indent fixes.
Verified for 3.7M4 with I20101206-1800.
The problem also affects for-loops with a single statement instead of a block: for (Integer id : ids) process(id); int nextLine; Using 3.7RC2 here (20110526-1053). (Does that mean reopen, since it's supposed to be fixed in M4?)
(In reply to comment #4) > The problem also affects for-loops with a single statement instead of a block: > > for (Integer id : ids) > process(id); > int nextLine; > > Using 3.7RC2 here (20110526-1053). > > (Does that mean reopen, since it's supposed to be fixed in M4?) Please file a new bug.