mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not create throws list without exceptions (IDEA-65790 )
This commit is contained in:
@@ -402,7 +402,10 @@ public class PsiElementFactoryImpl extends PsiJavaParserFacadeImpl implements Ps
|
||||
public PsiReferenceList createReferenceList(@NotNull final PsiJavaCodeReferenceElement[] references) throws IncorrectOperationException {
|
||||
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
|
||||
try {
|
||||
builder.append("void method() throws ");
|
||||
builder.append("void method()");
|
||||
if (references.length > 0){
|
||||
builder.append(" throws ");
|
||||
}
|
||||
for (int i = 0; i < references.length; i++) {
|
||||
if (i > 0) builder.append(", ");
|
||||
builder.append(references[i].getCanonicalText());
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
void fo<caret>o() throws RuntimeException {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
}
|
||||
}
|
||||
@@ -288,6 +288,10 @@ public class ChangeSignatureTest extends LightCodeInsightTestCase {
|
||||
doTest(null, null, "Exception", new SimpleParameterGen(), new SimpleExceptionsGen(), false);
|
||||
}
|
||||
|
||||
public void testRemoveExceptions() throws Exception {
|
||||
doTest(null, null, "void", new SimpleParameterGen(), new SimpleExceptionsGen(), false);
|
||||
}
|
||||
|
||||
private void doTest(String newReturnType, ParameterInfoImpl[] parameterInfos, final boolean generateDelegate) throws Exception {
|
||||
doTest(null, null, newReturnType, parameterInfos, new ThrownExceptionInfo[0], generateDelegate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user