Community
Participate
Working Groups
3.2 RC7 - use Sun's coding conventions - have the CU below (. == space, --> == tab) ------------ Format.java -------- package a; class Format { ..../** .... * Type comment .... */ ....class Inner { ------->/** -------> * Member comment -------> */ ------->int field; ....} } ----------------------------------- - format it > expected: type comment indented with 4 spaces, member comment with 1 tab (unchanged from above). < actual: ------------ Format.java -------- package a; class Format { ..../** ........ * Type comment ........ */ ....class Inner { ------->/** ........ * Member comment ........ */ ------->int field; ....} } ----------------------------------- Part of the problem is in JDT-text land, but org.eclipse.jdt.internal.formatter.comment.CommentRegion also needs an update. I will attach a patch.
Created attachment 43592 [details] org.eclipse.jdt.core.diff Corrects computeIndentation. The ctor change takes into account that the visual tab size is stored in the INDENTATION_SIZE preference when the indent char is SPACE. I also removed an unused parameter and removed some duplicate code - feel free to ignore.
Created attachment 43963 [details] org.eclipse.jdt.core.diff Correction of the previous patch - when indenting with spaces, the created indent must of course not use tabs...
Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.formatter.comment.MultiLineTestCase.testMultiLineCommentFor145544
Released for 3.3 M1
Verified for 3.3 M1 using build I20060807-2000.
*** Bug 165337 has been marked as a duplicate of this bug. ***