mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] More diagnostics for EA-1036056 - AIO: PsiElementFactoryImpl.createParameter
GitOrigin-RevId: 8a94c9bc2dbd657f152be94a7274483ef0d30032
This commit is contained in:
committed by
intellij-monorepo-bot
parent
384c07c2e4
commit
70d515e41f
@@ -277,8 +277,12 @@ public final class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl impleme
|
||||
|
||||
@Override
|
||||
public PsiParameter createParameter(@NotNull String name, @NotNull PsiType type, PsiElement context) throws IncorrectOperationException {
|
||||
PsiMethod psiMethod = createMethodFromText("void f(" + type.getCanonicalText(true) + " " + name + ") {}", context);
|
||||
String text = "void f(" + type.getCanonicalText(true) + " " + name + ") {}";
|
||||
PsiMethod psiMethod = createMethodFromText(text, context);
|
||||
PsiParameter[] parameters = psiMethod.getParameterList().getParameters();
|
||||
if (parameters.length != 1) {
|
||||
throw new IncorrectOperationException("Incorrect method was created: " + psiMethod.getText());
|
||||
}
|
||||
return parameters[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user