mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
EA-39209 - IOE: PsiJavaParserFacadeImpl.createParameterFromText
This commit is contained in:
+5
-1
@@ -36,7 +36,6 @@ import com.intellij.openapi.editor.ScrollType;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtil;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
@@ -257,8 +256,13 @@ public class CreateFromUsageUtils {
|
||||
|
||||
if (argType == null || PsiType.NULL.equals(argType) ||
|
||||
argType instanceof PsiLambdaExpressionType ||
|
||||
argType instanceof PsiLambdaParameterType ||
|
||||
argType instanceof PsiMethodReferenceType) {
|
||||
argType = PsiType.getJavaLangObject(psiManager, resolveScope);
|
||||
} else if (argType instanceof PsiDisjunctionType) {
|
||||
argType = ((PsiDisjunctionType)argType).getLeastUpperBound();
|
||||
} else if (argType instanceof PsiWildcardType) {
|
||||
argType = ((PsiWildcardType)argType).isBounded() ? ((PsiWildcardType)argType).getBound() : PsiType.getJavaLangObject(psiManager, resolveScope);
|
||||
}
|
||||
PsiParameter parameter;
|
||||
if (parameterList.getParametersCount() <= i) {
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// "Create Constructor" "true"
|
||||
class Test {
|
||||
void foo() throws Ex1 {}
|
||||
void bar() throws Ex2 {}
|
||||
public void t() {
|
||||
try {
|
||||
foo();
|
||||
bar();
|
||||
}
|
||||
catch (Ex1 | Ex2 e) {
|
||||
new A(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
public A(Exception e) {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
class Ex1 extends Exception {}
|
||||
class Ex2 extends Exception {}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// "Create Constructor" "true"
|
||||
class Test {
|
||||
void foo() throws Ex1 {}
|
||||
void bar() throws Ex2 {}
|
||||
public void t() {
|
||||
try {
|
||||
foo();
|
||||
bar();
|
||||
}
|
||||
catch (Ex1 | Ex2 e) {
|
||||
new A(<caret>e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
}
|
||||
class Ex1 extends Exception {}
|
||||
class Ex2 extends Exception {}
|
||||
Reference in New Issue
Block a user