Community
Participate
Working Groups
If I copy some code that contains within it some folded code, only the unfolded code makes it to the clipboard. So if I have a couple of methods that I want to copy, but the JavaDocs before the method are folded, then when I paste the code somewhere else, the entire method ends up as a comment since the only part of the folded comment that was showing didn't include the comment end characters (*/).
My little research against 3.0RC2: Using the following code: public class FoldCopyBugs { private void foo() { Runnable r = new Runnable() { public void run() { System.out.println("foo"); } }; } } When "Runnable r ..." is "folded", i.e. shows as public class FoldCopyBugs { private void foo() { Runnable r = new Runnable() {[...] } } If you select the line "Runnable r..." and press - Ctrl-Insert (i.e. Copy on Windows) only "Runnable r = new Runnable() { " gets copied to the clipboard. - Ctrl-C the whole Runnable-block gets copied - Shift-Delete (Cut on Windows) the block gets expande, but only the "Runnable .."-line is copied - Ctrl-X the complete block gets copied.
Thanks Nico. That jives with how I normally do cut/copy/paste: I've always had a tendency to use the Shift-Delete/Ctrl-Insert/Shift-Insert method. Glad there's a workaround.
*** This bug has been marked as a duplicate of 65955 ***