mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 23:39:39 +07:00
IDEA-231280 Quick fix for compare() method can be used to compare numbers generates broken code
Also declaration is joined automatically GitOrigin-RevId: f94ddf5ae3e94edffdb44cd56ad6bf8b3a9054b4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e512fa3c6a
commit
619bfa9963
@@ -1,9 +1,8 @@
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public void test(String s1, String s2) {
|
||||
int res;
|
||||
res = Integer.compare(s2.length(), s1.length())
|
||||
System.out.println(res);
|
||||
int res = Integer.compare(s2.length(), s1.length());
|
||||
System.out.println(res);
|
||||
}
|
||||
|
||||
public void testMissingElse(String s1, String s2) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public static int _compare(int mask1, int mask2) {
|
||||
int compareResult = Integer.compare(mask1, mask2);
|
||||
return compareResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Fix all ''compare()' method can be used to compare numbers' problems in file" "true"
|
||||
class Test {
|
||||
public static int _compare(int mask1, int mask2) {
|
||||
int compareResult;
|
||||
i<caret>f (mask1 > mask2) {
|
||||
compareResult = 1;
|
||||
} else if (mask1 == mask2) {
|
||||
compareResult = 0;
|
||||
} else {
|
||||
compareResult = -1;
|
||||
}
|
||||
return compareResult;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user