mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't duplicate @Delegated methods (IDEA-78066)
This commit is contained in:
+1
@@ -57,6 +57,7 @@ public class DelegatedMethodsContributor extends AstTransformContributor {
|
||||
for (PsiMethod method : methods) {
|
||||
if (method.isConstructor()) continue;
|
||||
if (!deprecated && PsiImplUtil.getAnnotation(method, "java.lang.Deprecated") != null) continue;
|
||||
if (clazz.findCodeMethodsBySignature(method, false).length > 0) continue;
|
||||
collector.add(generateDelegateMethod(method, clazz, resolveResult.getSubstitutor()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ class DelegateBarImpl {
|
||||
private @Delegate(interfaces=false) Runnable zoo;
|
||||
private @Delegate Doo doo;
|
||||
}
|
||||
class Del2 implements DelegateFoo {
|
||||
@Delegate DelegateFoo foo;
|
||||
def foo() {}
|
||||
}
|
||||
-----
|
||||
public interface DelegateFoo {
|
||||
public java.lang.Object foo() ;
|
||||
@@ -79,4 +83,40 @@ private DelegateFoo foo = null;
|
||||
private java.lang.Runnable zoo = null;
|
||||
private Doo doo = null;
|
||||
}
|
||||
---
|
||||
public class Del2 extends groovy.lang.GroovyObjectSupport implements DelegateFoo, groovy.lang.GroovyObject {
|
||||
public java.lang.Object foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public DelegateFoo getFoo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setFoo(DelegateFoo foo) {
|
||||
return ;
|
||||
}
|
||||
|
||||
public java.lang.Object getProperty(java.lang.String property) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setProperty(java.lang.String property, java.lang.Object newValue) {
|
||||
return ;
|
||||
}
|
||||
|
||||
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public groovy.lang.MetaClass getMetaClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setMetaClass(groovy.lang.MetaClass metaClass) {
|
||||
return ;
|
||||
}
|
||||
|
||||
private DelegateFoo foo = null;
|
||||
}
|
||||
---
|
||||
Reference in New Issue
Block a user