method ref: create method from usages accept method ref in argument

This commit is contained in:
anna
2012-09-25 19:47:00 +02:00
parent da860a5f6d
commit d2af36382c
3 changed files with 26 additions and 1 deletions
@@ -254,7 +254,9 @@ public class CreateFromUsageUtils {
names = new String[]{"p" + i};
}
if (argType == null || PsiType.NULL.equals(argType) || argType instanceof PsiLambdaExpressionType) {
if (argType == null || PsiType.NULL.equals(argType) ||
argType instanceof PsiLambdaExpressionType ||
argType instanceof PsiMethodReferenceType) {
argType = PsiType.getJavaLangObject(psiManager, resolveScope);
}
PsiParameter parameter;
@@ -0,0 +1,14 @@
// "Create Method 'f'" "true"
class A {
{
f(A::foo);
}
private void f(Object foo) {
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
static int foo() {
return 42;
}
}
@@ -0,0 +1,9 @@
// "Create Method 'f'" "true"
class A {
{
f<caret>(A::foo);
}
static int foo() {
return 42;
}
}