mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method ref -> lambda: on arrays: resolve naming conflicts
(cherry picked from commit 91a8d6b875756fa2ca8a97afa9bf0cf7dec1a02c)
This commit is contained in:
+1
-1
@@ -122,7 +122,7 @@ public class ReplaceMethodRefWithLambdaIntention extends Intention {
|
||||
int dim = type.getArrayDimensions();
|
||||
buf.append(type.getDeepComponentType().getCanonicalText());
|
||||
buf.append("[");
|
||||
buf.append(parameters[0].getName());
|
||||
buf.append(map.get(parameters[0]));
|
||||
buf.append("]");
|
||||
while (--dim > 0) {
|
||||
buf.append("[]");
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
public class Foo {
|
||||
public void test() {
|
||||
Object i = null;
|
||||
long[][] avg = collect(long[][]:<caret>:new);
|
||||
}
|
||||
|
||||
interface P<T> {
|
||||
T _(int i);
|
||||
}
|
||||
|
||||
<T> T collect(P<T> h) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
public class Foo {
|
||||
public void test() {
|
||||
Object i = null;
|
||||
long[][] avg = collect((i1) -> new long[i1][]);
|
||||
}
|
||||
|
||||
interface P<T> {
|
||||
T _(int i);
|
||||
}
|
||||
|
||||
<T> T collect(P<T> h) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+4
@@ -101,4 +101,8 @@ public class ReplaceMethodReferenceWithLambdaIntentionTest extends IPPTestCase {
|
||||
public void testArrayMethodRef() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testArrayConstructorRefUniqueParamName() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user