mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
diamonds: copy throws list to static constructors to ensure correct unhandled exceptions, etc
This commit is contained in:
@@ -398,6 +398,7 @@ public class PsiDiamondTypeImpl extends PsiDiamondType {
|
||||
return psiParameter.getType().getCanonicalText() + " p" + myIdx++;
|
||||
}
|
||||
}, ",")).append(")");
|
||||
buf.append(constructor.getThrowsList().getText());
|
||||
}
|
||||
buf.append("{}");
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import java.io.IOException;
|
||||
|
||||
class MyTest<T> {
|
||||
public MyTest() throws IOException {}
|
||||
|
||||
void m() {
|
||||
MyTest<String> test = <error descr="Unhandled exception: java.io.IOException">new MyTest<>()</error>;
|
||||
}
|
||||
|
||||
{
|
||||
MyTest<String> test = new MyTest<>();
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,10 @@ public class Diamond8HighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExceptionsThrownFromConstructorShouldBePreserved() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondInsideOverloadedThisReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user