mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IG: don't check super methods when method is static (thanks to Daniil Ovchinnikov)
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -78,7 +78,7 @@ public class LambdaUnfriendlyMethodOverloadInspectionBase extends BaseInspection
|
||||
return;
|
||||
}
|
||||
final String name = method.getName();
|
||||
for (PsiMethod sameNameMethod : containingClass.findMethodsByName(name, true)) {
|
||||
for (PsiMethod sameNameMethod : containingClass.findMethodsByName(name, !method.hasModifierProperty(PsiModifier.STATIC))) {
|
||||
if (method.equals(sameNameMethod) || PsiSuperMethodUtil.isSuperMethod(method, sameNameMethod)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+7
@@ -55,4 +55,11 @@ class Generics<M, K> {
|
||||
void <warning descr="Lambda unfriendly overload of method 'm()'">m</warning>(IntFunction r, M l) {}
|
||||
void <warning descr="Lambda unfriendly overload of method 'm()'">m</warning>(Function f, K l) {}
|
||||
|
||||
}
|
||||
class A {
|
||||
static void foo(Function f) {}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
static void foo(IntFunction f) {}
|
||||
}
|
||||
Reference in New Issue
Block a user