http://www.jindent.com |
|
Next: Deleting |
Format block comments |
/* ... */
and contain muliple comment lines.
/* unformatted block comment */ |
/* * unformatted * block * comment */ |
See also: | Blank lines before block comments , Blank lines after block comments , Delete block comments |
Format single-line comments |
/* ... */
and only contain one comment line.
/*unformatted comment*/ |
/* unformatted comment */ |
See also: | Blank lines before single-line comments , Blank lines after single-line comments , Delete single-line comments |
Format end-of-line comments |
// ...
and do not appear as trailing comments.
int a = 0; //unformatted end of line comment callMethod(a); |
int a = 0; // unformatted end of line comment callMethod(a); |
See also: | Blank lines before end-of-line comments , Blank lines after end-of-line Comments , Delete end-of-line comments |
Format trailing comments |
int a = 0; //unformatted trailing comment callMethod(a); /*another unformatted trailing comment*/ |
int a = 0; // unformatted trailing comment callMethod(a); /* another unformatted trailing comment */ |
See also: | Delete trailing comments |
Do NOT format comments containing keys |
/* * modification history * -------------------- * 2010-03-01 added new exception handling * 2010-01-21 fixed bug 23412 * 2009-12-10 fixed bug 13459 * ... */ class MyClass { /* some other block comments here */ ... } |
/* modification history -------------------- 2010-03-01 added new exception handling 2010-01-21 fixed bug 23412 2009-12-10 fixed bug 13459 ... */ |
modification history
and the new output looks like:
/* modification history -------------------- 2010-03-01 added new exception handling 2010-01-21 fixed bug 23412 2009-12-10 fixed bug 13459 ... */ class MyClass { /* some other block comments here */ ... } |
Never indent and format comments beginning in first column |
class MyClass { void method() { /* long i = 0; while (i < n) { result *= i; i++; } */ doSomethingElse(); } } |
class MyClass { void method() { /* * long i = 0; * while (i < n) { * result *= i; * i++; * } */ doSomethingElse(); } } |
Indent comment out source code in first column comments |
class MyClass { void calc() { long result = 0; // long i = 0; // while (i < n) { // result *= i; // i++; // } result = doSomethingElse(); ... } } |
calc()
.
class MyClass { void calc() { long result = 0; // long i = 0; // while (i < n) { // result *= i; // i++; // } result = doSomethingElse(); ... } } |