IDEA-126310 Unnecessary toString() call fix breaks code

This commit is contained in:
Tagir Valeev
2018-02-04 18:10:11 +07:00
parent 4be91bbc65
commit e21d6c984e
8 changed files with 95 additions and 53 deletions
@@ -0,0 +1,10 @@
// "Fix all 'Unnecessary call to 'toString()'' problems in file" "true"
public class MyFile {
interface UUID {}
interface InetAddress {}
void test(UUID uuid, InetAddress address) {
// IDEA-126310
String nodeString = uuid.toString() + address;
}
}
@@ -0,0 +1,6 @@
// "Fix all 'Unnecessary call to 'toString()'' problems in file" "true"
class X {
void test(Object x) {
System.out.println(x);
}
}
@@ -0,0 +1,6 @@
// "Replace with 'this'" "true"
class X {
void test(Object x) {
System.out.println(this);
}
}
@@ -0,0 +1,10 @@
// "Fix all 'Unnecessary call to 'toString()'' problems in file" "true"
public class MyFile {
interface UUID {}
interface InetAddress {}
void test(UUID uuid, InetAddress address) {
// IDEA-126310
String nodeString = uuid.toStr<caret>ing() + address.toString();
}
}
@@ -0,0 +1,6 @@
// "Fix all 'Unnecessary call to 'toString()'' problems in file" "true"
class X {
void test(Object x) {
System.out.println(x.toStri<caret>ng());
}
}
@@ -0,0 +1,6 @@
// "Replace with 'this'" "true"
class X {
void test(Object x) {
System.out.println(toStri<caret>ng());
}
}