[java-intentions] IDEA-299075 More scenarios for parameter fixes

1. Surround with array initialization
2. Apply .toArray() conversion
3. Limited vararg support
4. Limited qualifier propagation

GitOrigin-RevId: f81f593502df317b555e816af20cdec2d04488fc
This commit is contained in:
Tagir Valeev
2022-08-03 14:28:35 +02:00
committed by intellij-monorepo-bot
parent 7f3050849a
commit c99da54bb4
10 changed files with 124 additions and 24 deletions

View File

@@ -0,0 +1,8 @@
// "Convert argument to 'long'" "true-preview"
import java.util.stream.Stream;
public class Demo {
void test() {
Stream<Long> stream = Stream.of(123L).limit(10);
}
}

View File

@@ -0,0 +1,8 @@
// "Apply conversion '.toArray(new java.lang.String[0])'" "true-preview"
import java.util.*;
public class Demo {
void test2(Collection<String> collection) {
Set<String[]> integers = Collections.singleton(collection.toArray(new String[0]));
}
}

View File

@@ -0,0 +1,8 @@
// "Convert argument to 'long'" "true-preview"
import java.util.*;
public class Demo {
void test() {
List<Long> integers = Arrays.asList(1L);
}
}

View File

@@ -0,0 +1,8 @@
// "Surround with array initialization" "true-preview"
import java.util.*;
public class Demo {
void test() {
Set<int[]> integers = Collections.singleton(new int[]{1});
}
}

View File

@@ -0,0 +1,8 @@
// "Convert argument to 'long'" "true-preview"
import java.util.stream.Stream;
public class Demo {
void test() {
Stream<Long> stream = Stream.of(123)<caret>.limit(10);
}
}

View File

@@ -0,0 +1,8 @@
// "Apply conversion '.toArray(new java.lang.String[0])'" "true-preview"
import java.util.*;
public class Demo {
void test2(Collection<String> collection) {
Set<String[]> integers = Collections.<caret>singleton(collection);
}
}

View File

@@ -0,0 +1,8 @@
// "Convert argument to 'long'" "true-preview"
import java.util.*;
public class Demo {
void test() {
List<Long> integers = Arrays.<caret>asList(1);
}
}

View File

@@ -0,0 +1,8 @@
// "Surround with array initialization" "true-preview"
import java.util.*;
public class Demo {
void test() {
Set<int[]> integers = Collections.<caret>singleton(1);
}
}