Community
Participate
Working Groups
RC1: Test Case: package p; import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; public class Dummy extends TestCase { private String fValue = "Eclipse"; public void testOne() throws Exception { List l = new ArrayList(); } } - select new ArrayList() - extract constant You get: package p; import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; public class Dummy extends TestCase { private static final ArrayList EEE = new ArrayList(); private String fValue = "Eclipse"; public void testOne() throws Exception { List l = EEE; } } Expected result is to have a blank line between the constant and the field. That's how my formatter is configured. Problem seems to be that extract constant isn't using AST rewriter.
Also the JavaDoc is not generated for the new constant. I would expect that the "Fields" JavaDoc template would be employed for the new constant.
Fixed in HEAD. - Added javadoc generation if the option is enabled in the "Code Templates" settings. - Rewrote code to use ASTRewrite. Bug 85839 deals with remaining formatting problems of the inserted field declaration. *** This bug has been marked as a duplicate of 85839 ***