mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
IDEA-164144 Intention offers change to comparingInt for long fields
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort(Comparator.comparingInt(d -> d.b));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort(Comparator.comparingInt(d -> d.b));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort(Comparator.comparingInt(d -> d.c));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
Short s;
|
||||
Byte b;
|
||||
Character c;
|
||||
Integer i;
|
||||
Long l;
|
||||
Double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort(Comparator.comparingInt(d -> d.c));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingDouble" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort(Comparator.comparingDouble(d -> d.d));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingLong" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort(Comparator.comparingLong(d -> d.l));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort((d1, d2) -> Byte.comp<caret>are(d1.b, d2.b));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort((d1, d2) -> d1.b - d2.<caret>b);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort((d1, d2) -> d1.c - d2.<caret>c);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingInt" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
Short s;
|
||||
Byte b;
|
||||
Character c;
|
||||
Integer i;
|
||||
Long l;
|
||||
Double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort((d1, d2) -> d1.<caret>c - d2.c);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingDouble" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort((d1, d2) -> d1.d - d2.<caret>d);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with Comparator.comparingLong" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
static class Data {
|
||||
short s;
|
||||
byte b;
|
||||
char c;
|
||||
int i;
|
||||
long l;
|
||||
double d;
|
||||
}
|
||||
|
||||
void sort(List<Data> data) {
|
||||
data.sort((d1, d2) -> d1.l - d2.<caret>l);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user