[java-intentions] More preview tests; minor fixes

GitOrigin-RevId: 22a46c15d8900d8a31514846755a013f6a67ad42
This commit is contained in:
Tagir Valeev
2022-07-28 14:07:20 +02:00
committed by intellij-monorepo-bot
parent e74564a52c
commit 7e1064ea3c
2540 changed files with 2706 additions and 2696 deletions

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
public static void main(String[] args) {
System.out.println();

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'append()' call" "true"
// "Remove redundant 'append()' call" "true-preview"
class Foo {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
public static void main(String[] args) {
StringBuilder s = new StringBuilder();

View File

@@ -1,4 +1,4 @@
// "Replace with empty string" "true"
// "Replace with empty string" "true-preview"
class Foo {
public static void main(String[] args) {
String s = "";

View File

@@ -1,4 +1,4 @@
// "Replace with argument" "true"
// "Replace with argument" "true-preview"
class Foo {
public static void main(String[] args) {
String s = "foo";

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
int test(String foo) {
return foo.indexOf("bar");

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'intern()' call" "true"
// "Remove redundant 'intern()' call" "true-preview"
class Foo {
private static final String x = ("Hello "+"World"+'!');
}

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
int test(String foo) {
return foo.lastIndexOf("bar");

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
int test(String foo) {
return foo.lastIndexOf("bar");

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
boolean test(String foo) {
return foo.startsWith("bar");

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'toString()' call" "true"
// "Remove redundant 'toString()' call" "true-preview"
class Foo {
public static void main(String[] args) {
/*valuable comment!!!*/

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'substring()' call" "true"
// "Remove redundant 'substring()' call" "true-preview"
class Foo {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'toLowerCase()' call" "true"
// "Remove redundant 'toLowerCase()' call" "true-preview"
class X {
void test(String string) {
if (string.isEmpty()) {

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
public static void main(String[] args) {
System.out.println("<caret>");

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'append()' call" "true"
// "Remove redundant 'append()' call" "true-preview"
class Foo {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
public static void main(String[] args) {
StringBuilder s = new StringBuilder(("<caret>"));

View File

@@ -1,4 +1,4 @@
// "Replace with empty string" "true"
// "Replace with empty string" "true-preview"
class Foo {
public static void main(String[] args) {
String s = new Stri<caret>ng();

View File

@@ -1,4 +1,4 @@
// "Replace with argument" "true"
// "Replace with argument" "true-preview"
class Foo {
public static void main(String[] args) {
String s = new Stri<caret>ng("foo");

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
int test(String foo) {
return foo.indexOf("bar", <caret>0);

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'intern()' call" "true"
// "Remove redundant 'intern()' call" "true-preview"
class Foo {
private static final String x = ("Hello "+"World"+'!').inte<caret>rn();
}

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
int test(String foo) {
return foo.lastIndexOf("bar", <caret>foo.length());

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
int test(String foo) {
return foo.lastIndexOf("bar", <caret>((foo.length())-1));

View File

@@ -1,4 +1,4 @@
// "Remove argument" "true"
// "Remove argument" "true-preview"
class Foo {
boolean test(String foo) {
return foo.startsWith("bar", (<caret>0));

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'toString()' call" "true"
// "Remove redundant 'toString()' call" "true-preview"
class Foo {
public static void main(String[] args) {
String s = args[0].toString<caret>(/*valuable comment!!!*/);

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'substring()' call" "true"
// "Remove redundant 'substring()' call" "true-preview"
class Foo {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();

View File

@@ -1,4 +1,4 @@
// "Remove redundant 'toLowerCase()' call" "true"
// "Remove redundant 'toLowerCase()' call" "true-preview"
class X {
void test(String string) {
if (string.to<caret>LowerCase().isEmpty()) {