Java: Simplify handling the comments by using CommentTracker (IDEA-182669)

This commit is contained in:
Pavel Dolgov
2017-11-29 12:49:40 +03:00
parent c43223355a
commit bb9fb0fbe6
3 changed files with 11 additions and 46 deletions
@@ -5,10 +5,12 @@ class T {
for (int i=0; i<a.length; i++) {
if (n < a[i]) n = a[i];
if (n > 100) {
return /* return 1 */ n /* return 2 */;// at the end 1
// at the end 1
return /* return 1 */ n /* return 2 */;
}
if (n < 0) {
return /* return 1 */ 0 /* return 2 */;// at the end 2
// at the end 2
return /* return 1 */ 0 /* return 2 */;
/* inline */
}
}
@@ -3,16 +3,17 @@ class T {
String f(String a) {
String s = a;
if (s == null) {
return ""; // return comment
// end of line
return ""; // return comment
}
else if (s.startsWith("@")) {
/* inline 1 */
/* inline 2 */
return s.substring(1); // return comment
/* inline 1 *//* inline 2 */
}
else if (s.startsWith("#")) {
return "#"; // return comment
/* inline */
return "#"; // return comment
}
return s; // return comment
}