WrapWithAdapterMethodCallFix: correctly handle disjunction type

Fixes EA-116570 Cannot create expression for type class com.intellij.psi.PsiDisjunctionType
This commit is contained in:
Tagir Valeev
2018-02-18 07:54:47 +07:00
parent 59c39f06fa
commit 413aca292b
3 changed files with 31 additions and 0 deletions
@@ -0,0 +1,14 @@
// "Wrap using 'Collections.singletonList()'" "true"
import java.util.*;
class Test {
List<Throwable> test() {
try {
System.out.println();
}
catch (Exception | Error ex) {
return Collections.singletonList(ex);
}
return null;
}
}
@@ -0,0 +1,14 @@
// "Wrap using 'Collections.singletonList()'" "true"
import java.util.*;
class Test {
List<Throwable> test() {
try {
System.out.println();
}
catch (Exception | Error ex) {
return e<caret>x;
}
return null;
}
}