mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
Java inspection: Preserve comments from replaced and removed statements in EqualsReplaceableByObjectsCallInspection (IDEA-161076)
This commit is contained in:
+3
-3
@@ -5,13 +5,13 @@ class T {
|
||||
for (int i=0; i<a.length; i++) {
|
||||
if (n < a[i]) n = a[i];
|
||||
if (n > 100) {
|
||||
return n; // at the end 1
|
||||
return /* return 1 */ n /* return 2 */;// at the end 1
|
||||
}
|
||||
if (n < 0) {
|
||||
return 0; // at the end 2
|
||||
return /* return 1 */ 0 /* return 2 */;// at the end 2
|
||||
/* inline */
|
||||
}
|
||||
}
|
||||
return n;
|
||||
return /* return 1 */ n /* return 2 */;
|
||||
}
|
||||
}
|
||||
+5
-2
@@ -3,13 +3,16 @@ class T {
|
||||
String f(String a) {
|
||||
String s = a;
|
||||
if (s == null) {
|
||||
return ""; /* return comment */ // end of line
|
||||
return ""; // return comment
|
||||
// end of line
|
||||
}
|
||||
else if (s.startsWith("@")) {
|
||||
return s.substring(1); // return comment
|
||||
/* inline 1 *//* inline 2 */
|
||||
}
|
||||
else if (s.startsWith("#")) {
|
||||
return "#"; /* return comment */ /* inline */
|
||||
return "#"; // return comment
|
||||
/* inline */
|
||||
}
|
||||
return s; // return comment
|
||||
}
|
||||
|
||||
+10
-10
@@ -3,15 +3,15 @@ class T {
|
||||
int f(int[][] a) {
|
||||
int n = -1;
|
||||
myLabel:
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
if (a[i].length == 0) {
|
||||
return -i - 1;
|
||||
}
|
||||
for(int j = 0; j < a[i].length; j++) {
|
||||
n = j;
|
||||
if (a[i][j] == 0) return n;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
if (a[i].length == 0) {
|
||||
return -i - 1;
|
||||
}
|
||||
for(int j = 0; j < a[i].length; j++) {
|
||||
n = j;
|
||||
if (a[i][j] == 0) return n;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@ class T {
|
||||
break; /* inline */
|
||||
}
|
||||
}
|
||||
ret<caret>urn n;
|
||||
ret<caret>urn /* return 1 */ n /* return 2 */;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ class T {
|
||||
s = ""; // end of line
|
||||
}
|
||||
else if (s.startsWith("@")) {
|
||||
s = s.substring(1);
|
||||
s = /* inline 1 */ s.substring(1); /* inline 2 */
|
||||
}
|
||||
else if (s.startsWith("#")) {
|
||||
s = "#"; /* inline */
|
||||
|
||||
+11
-11
@@ -3,16 +3,16 @@ class T {
|
||||
int f(int[][] a) {
|
||||
int n = -1;
|
||||
myLabel:
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
if (a[i].length == 0) {
|
||||
n = -i - 1;
|
||||
break myLabel;
|
||||
}
|
||||
for(int j = 0; j < a[i].length; j++) {
|
||||
n = j;
|
||||
if (a[i][j] == 0) break myLabel;
|
||||
}
|
||||
}
|
||||
re<caret>turn n;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
if (a[i].length == 0) {
|
||||
n = -i - 1;
|
||||
break myLabel;
|
||||
}
|
||||
for(int j = 0; j < a[i].length; j++) {
|
||||
n = j;
|
||||
if (a[i][j] == 0) break myLabel;
|
||||
}
|
||||
}
|
||||
re<caret>turn n;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user