Community
Participate
Working Groups
This "bug" is a result of two opposing behaviors with "//" comments. When a single line comment is added to the end of a line containing some code like: int myVariable = SOME_LONG_CONSTANT; // this is for something or other. if this line is longer than the column constrain (80 chars) then when the formatter is run the comment is properly wrapped and aligned to the next line like so: int myVariable = SOME_LONG_CONSTANT; // this is for // something or // other. But, if the formatter is run again, the wrapped lines of the comment are pulled back to default indentation and a new line is added: int myVariable = SOME_LONG_CONSTANT; // this is for // something or // other. The comment is now segmented and its message is somewhat lost. I suggest that when the formatter needs to wrap a inline comment that the "//" commenting be replaced with a /* * */ and that as a general behavior with the non-javadoc, multi-line comment that the formatter always align the '*' characters based on the position of the first '*' and that either the opening "/*" is placed one space behind an expression it shares a line with or if there is no expression then the "/*" should be set at default indentation. Example: int myVariable = SOME_LONG_CONSTANT; // this is for something or other. Would result in: int myVariable = SOME_LONG_CONSTANT; /* * this is for * something or * other. */ But the "/*" would only be placed as follows normally: /* * Some comment. */ Thanks, - Justin
Move to JDT/Text
This bug contains another suggestion in how to solve bug 47620. *** This bug has been marked as a duplicate of 47620 ***