mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
CommentTracker#replaceAndRestoreComments: try to keep comments after the statement (not move them to the front)
This commit is contained in:
+1
-2
@@ -5,10 +5,9 @@ class X {
|
||||
//comment4
|
||||
//comment6
|
||||
//comment7
|
||||
//comment8
|
||||
if ("case1".equals(value)) {//comment2
|
||||
//comment3
|
||||
} else if ("case2".equals(value)) {//comment5
|
||||
}
|
||||
}//comment8
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -5,12 +5,10 @@ class T {
|
||||
for (int i=0; i<a.length; i++) {
|
||||
if (n < a[i]) n = a[i];
|
||||
if (n > 100) {
|
||||
// at the end 1
|
||||
return /* return 1 */ n /* return 2 */;
|
||||
return /* return 1 */ n /* return 2 */; // at the end 1
|
||||
}
|
||||
if (n < 0) {
|
||||
// at the end 2
|
||||
return /* return 1 */ 0 /* return 2 */;
|
||||
return /* return 1 */ 0 /* return 2 */; // at the end 2
|
||||
/* inline */
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -3,17 +3,17 @@ class T {
|
||||
String f(String a) {
|
||||
String s = a;
|
||||
if (s == null) {
|
||||
// end of line
|
||||
return ""; // return comment
|
||||
// end of line
|
||||
}
|
||||
else if (s.startsWith("@")) {
|
||||
/* inline 1 */
|
||||
/* inline 2 */
|
||||
return s.substring(1); // return comment
|
||||
/* inline 2 */
|
||||
}
|
||||
else if (s.startsWith("#")) {
|
||||
/* inline */
|
||||
return "#"; // return comment
|
||||
/* inline */
|
||||
}
|
||||
return (s); // return comment
|
||||
}
|
||||
|
||||
+1
-2
@@ -5,10 +5,9 @@ import java.util.Collection;
|
||||
|
||||
public class Test {
|
||||
void test(int[] arr) {
|
||||
// comment
|
||||
Arrays.stream(arr).forEach(x -> {
|
||||
int y = x * 2;
|
||||
if (x > y) return;
|
||||
if (x > y) return; // comment
|
||||
System.out.println(x);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user