Community
Participate
Working Groups
Created attachment 117640 [details] Sample project scenario. Build ID: I20080617-2000 EMF: 2.4.0.v200806091234 Steps To Reproduce: 1. Set "Coder Formatter" = true within genmodel 2. Set "Format Header" = true within java code style comments page 3. Generate More information: The comment style within all files will be generated as block instead of javadoc style with the consequence that overriding the @generate annotoation will be ignored. So Far I'v seen is the problem located with the double interpretation of the comment_format_header flag within the JDT code formatter (org.eclipse.jdt.internal.formatter.Scribe.includesJavadocComments()). (org.eclipse.jdt.internal.formatter.Scribe.printComment(int): line 1873). But the error happens only while code formatting during code gen from EMF not applied as JDT editor / package explorer action.
Looking at the behavior I finally figured that changing to specify F_INCLUDE_COMMENTS seemed to help, but this seems to cause formatting of comments even if all the preferences say not to do that ((CodeFormatter)codeFormatter).format(CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, doc.get(), 0, doc.get().length(), 0, null); I think it's actually a more fundamental problem in the formatter itself. Here's what I noticed. Go to the Comments tab of the formatter preferences and uncheck all the "General settings" boxes. Then check "Enable header formatting". Note that not only does the header format (a good thing), but the Javadoc comment on "interface Example" turns into a block comment; this is exactly the same symptom as being reported for this bug. If you also check "Enable block comment formatting" all the Javadoc comments are converted to block comments. So I'm assuming that if the bad behavior on the preferences page is fixed that the bad behavior manifested by EMF's uses of the formatter will also be fixed. This problem occurs in the 3.4.x stream and the 3.5 stream.
Created attachment 122118 [details] Proposed patch Note that this patch also includes fixes for bug 239607 and bug 260276 which were faced while running tests...
Released for 3.5M5.
Verified for 3.5M5 using I20090125-2000 build
*** Bug 265898 has been marked as a duplicate of this bug. ***
*** Bug 268974 has been marked as a duplicate of this bug. ***