method refs: fix testdata according to new javac strategy

This commit is contained in:
anna
2013-02-26 16:30:12 +01:00
parent a41b5c6f85
commit 456a49ce9f
13 changed files with 21 additions and 96 deletions
@@ -1,13 +0,0 @@
// "Replace lambda with method reference" "true"
class NonStaticInner {
class Inner {
Inner() {}
}
interface I1 {
Inner m(NonStaticInner rec);
}
static {
I1 i1 = Inner::new;
}
}
@@ -1,33 +0,0 @@
// "Replace lambda with method reference" "true"
class NonStaticInner3 {
class Foo {
Foo(Integer i) {}
Foo() {}
}
interface I1<X> {
X m(int i);
}
interface I2<X> {
X m();
}
interface I3<X> {
X m(NonStaticInner3 rec, int i);
}
interface I4<X> {
X m(NonStaticInner3 rec);
}
{
I1<Foo> b1 = (i) -> new Foo(i);
I2<Foo> b2 = () -> new Foo();
}
{
I3<Foo> b1 = Foo::new;
I4<Foo> b2 = (rec) -> rec.new Foo();
}
}
@@ -1,33 +0,0 @@
// "Replace lambda with method reference" "true"
class NonStaticInner3 {
class Foo {
Foo(Integer i) {}
Foo() {}
}
interface I1<X> {
X m(int i);
}
interface I2<X> {
X m();
}
interface I3<X> {
X m(NonStaticInner3 rec, int i);
}
interface I4<X> {
X m(NonStaticInner3 rec);
}
{
I1<Foo> b1 = (i) -> new Foo(i);
I2<Foo> b2 = () -> new Foo();
}
{
I3<Foo> b1 = (rec, i) -> rec.new Foo(i);
I4<Foo> b2 = Foo::new;
}
}
@@ -1,4 +1,4 @@
// "Replace lambda with method reference" "true"
// "Replace lambda with method reference" "false"
class NonStaticInner {
class Inner {
Inner() {}
@@ -1,4 +1,4 @@
// "Replace lambda with method reference" "true"
// "Replace lambda with method reference" "false"
class NonStaticInner3 {
class Foo {
Foo(Integer i) {}
@@ -1,4 +1,4 @@
// "Replace lambda with method reference" "true"
// "Replace lambda with method reference" "false"
class NonStaticInner3 {
class Foo {
Foo(Integer i) {}
@@ -10,7 +10,7 @@ public class MyTest {
void m(Integer x);
}
static void call(int i, I1 s) {}
static void call(Integer i, I1 s) {}
static void call(int i, I2 s) {}
public static void main(String[] args) {
@@ -10,10 +10,10 @@ public class MyTest {
void m(Integer x);
}
static void call(int i, I1 s) {}
static void call(Integer i, I1 s) {}
static void call(int i, I2 s) {}
public static void main(String[] args) {
call(1, (I2) (x) -> MyTest.m(x));
call(1, (x) -> MyTest.m(x));
}
}
@@ -1,10 +1,12 @@
class Test1 {
class Inner {}
static class Inner {
}
void test() {
BlahBlah6 blahBlah62 = Inner:<caret>:new;
}
}
interface BlahBlah6 {
Test1.Inner foo6(Test1 p);
Test1.Inner foo6();
}
@@ -1,10 +1,12 @@
class Test1 {
class Inner {}
static class Inner {
}
void test() {
BlahBlah6 blahBlah62 = (p) -> p.new Inner();
BlahBlah6 blahBlah62 = () -> new Inner();
}
}
interface BlahBlah6 {
Test1.Inner foo6(Test1 p);
Test1.Inner foo6();
}
@@ -1,6 +1,6 @@
class MyTest {
class Inner {
Inner() {};
static class Inner {
Inner(MyTest mt) {};
}
interface I {
@@ -1,6 +1,6 @@
class MyTest {
class Inner {
Inner() {};
static class Inner {
Inner(MyTest mt) {};
}
interface I {
@@ -8,6 +8,6 @@ class MyTest {
}
static {
I i1 = (receiver) -> receiver.new Inner();
I i1 = (receiver) -> new Inner(receiver);
}
}
@@ -4,6 +4,6 @@ class Test<T> {
class Bar {
void test() {
Runnable runnable = Test<String>:<caret>:foo;
Runnable runnable = Test:<caret>:foo;
}
}