mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 15:41:26 +07:00
IDEA-133322 Add an intention to convert compareTo(x)==0 to equals
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
|
||||
class X {
|
||||
void m() {
|
||||
|
||||
Integer i1 = new Integer(0);
|
||||
Integer i2 = new Integer(2);
|
||||
|
||||
boolean b = i1.compareT<caret>o(i2) == 0;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
|
||||
class X {
|
||||
void m() {
|
||||
|
||||
Integer i1 = new Integer(0);
|
||||
Integer i2 = new Integer(2);
|
||||
|
||||
boolean b = i1.equals(i2);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.lang.String;
|
||||
|
||||
class X {
|
||||
void m() {
|
||||
|
||||
boolean b = "asd".substring(1).compareTo("qwe".substring(2)) !<caret>= 0;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.lang.String;
|
||||
|
||||
class X {
|
||||
void m() {
|
||||
|
||||
boolean b = !"asd".substring(1).equals("qwe".substring(2));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.lang.String;
|
||||
|
||||
class X {
|
||||
void m() {
|
||||
|
||||
boolean b = "asd".compareTo("qwe") == 1;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user