Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #124284 +++ This bug is known from eclipse 3.2, but we use more an more MDA tools and especially code generators ( MTL, ...) to develop java applications (anong other langages). There is a major problem with imports. The problem is to keep a comment block inside the import block. Example : import java.util.ArrayList; // Start of user code for imports import java.util.List; // End of user code When trying to do CTRL+SHIFT+O or CTRL+SHIFT+M, it will remove the first comment. But these comments are used by the generator tool to keep user code ( that is not generated ) and it will end up with a bad generated file... it is possible to keep all these comments and the imports between them ?
Organize imports by definition reorders, adds, replaces, and removes imports. I guess it would not help you if it just retained the comments but moved them to an arbitrary location, e.g: import java.util.ArrayList; import java.util.List; // Start of user code for imports // End of user code I guess what you really want is a way to mark a section in the import container which should be touched by Organize Imports. That would be an enhancement request. Moving to JDT/Core.
*** This bug has been marked as a duplicate of bug 24804 ***
Verified for 3.8M2 using build I20110912-0800