mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
mirror throws clauses in groovy stubs
This commit is contained in:
+14
@@ -594,6 +594,20 @@ public class GroovyToJavaGenerator {
|
||||
|
||||
writeParameterList(text, parameters);
|
||||
|
||||
final PsiReferenceList throwsList = method.getThrowsList();
|
||||
final PsiClassType[] exceptions = throwsList.getReferencedTypes();
|
||||
if (exceptions.length > 0) {
|
||||
text.append("throws ");
|
||||
for (int i = 0; i < exceptions.length; i++) {
|
||||
PsiClassType exception = exceptions[i];
|
||||
if (i != 0) {
|
||||
text.append(",");
|
||||
}
|
||||
text.append(getTypeText(exception, method, false));
|
||||
text.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAbstract) {
|
||||
/************* body **********/
|
||||
text.append("{\n");
|
||||
|
||||
@@ -55,6 +55,7 @@ public void testArrayType1() throws Throwable { doTest(); }
|
||||
public void testInaccessibleConstructor() throws Throwable { doTest(); }
|
||||
public void testSynchronizedProperty() throws Throwable { doTest(); }
|
||||
public void testVarargs() throws Throwable { doTest(); }
|
||||
public void testThrowsCheckedException() throws Throwable { doTest(); }
|
||||
|
||||
public void testCheckedExceptionInConstructorDelegate() throws Throwable {
|
||||
myFixture.addClass("package foo;" +
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
class Foo {
|
||||
def foo() throws IOException {}
|
||||
}
|
||||
-----
|
||||
public class Foo implements groovy.lang.GroovyObject {
|
||||
public java.lang.Object foo() throws java.io.IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public groovy.lang.MetaClass getMetaClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setMetaClass(groovy.lang.MetaClass mc) {
|
||||
return ;
|
||||
}
|
||||
|
||||
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public java.lang.Object getProperty(java.lang.String propertyName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setProperty(java.lang.String propertyName, java.lang.Object newValue) {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
---
|
||||
Reference in New Issue
Block a user