mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-108052 Groovy: "@DelegatesTo inspection" could report unused @DelegatesTo.Target if a closure parameter delegates to a different target
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ public class DelegatesToInspection extends BaseInspection {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (delegatesTo.findDeclaredAttributeValue("target") == null) {
|
||||
if (delegatesTo.findDeclaredAttributeValue("target") == null && delegatesTo.findDeclaredAttributeValue("value") == null) {
|
||||
return; // target is used
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -253,6 +253,12 @@ def with5(@<warning descr="@Target is unused">DelegatesTo.Target</warning>() Obj
|
||||
arg.delegate = target
|
||||
arg()
|
||||
}
|
||||
|
||||
def with6(@<warning descr="@Target is unused">DelegatesTo.Target</warning>() Object target, @DelegatesTo(String) Closure arg) {
|
||||
arg.delegate = target
|
||||
arg()
|
||||
}
|
||||
|
||||
''', DelegatesToInspection)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user