Merge remote-tracking branch 'origin/master'

This commit is contained in:
Stanislav Dombrovsky
2017-04-18 15:28:33 +03:00
2 changed files with 9 additions and 2 deletions
@@ -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;
}
@@ -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) {}
}