Skip to content

Commit

Permalink
Add new tests to MoveInstanceMethodTests
Browse files Browse the repository at this point in the history
- verifies #1303 is fixed
  • Loading branch information
jjohnstn committed Jun 5, 2024
1 parent b4f5b25 commit 43e1b39
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package p1;

public class A {

B b;

protected class InnerInterface {
void innerMethod() {

}
}

public void m() {
InnerInterface inner = new InnerInterface();
inner.innerMethod();
}
}

class B {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package p1;

public class A {

B b;

protected class InnerInterface {
void innerMethod() {

}
}
}

class B {

public void m(A a) {
A.InnerInterface inner = a.new InnerInterface();
inner.innerMethod();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package p1;

public class A {

B b;

protected class InnerInterface {
void innerMethod() {

}
}

public void m() {
InnerInterface inner = new InnerInterface();
inner.innerMethod();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package p1;

class B {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package p1;

public class A {

B b;

protected class InnerInterface {
void innerMethod() {

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package p1;

import p1.A.InnerInterface;

class B {

public void m(A a) {
InnerInterface inner = a.new InnerInterface();
inner.innerMethod();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,18 @@ public void test74() throws Exception {
helper1(new String[] { "p1.A", "p1.B" }, "p1.A", 13, 17, 13, 18, FIELD, "b", true, true);
}

// Issue 1303
@Test
public void test75() throws Exception {
helper1(new String[] { "p1.A" }, "p1.A", 13, 17, 13, 18, FIELD, "b", true, true);
}

// Issue 1303
@Test
public void test76() throws Exception {
helper1(new String[] { "p1.A", "p1.B" }, "p1.A", 13, 17, 13, 18, FIELD, "b", true, true);
}

// Move mA1 to field fB, do not inline delegator
@Test
public void test3() throws Exception {
Expand Down

0 comments on commit 43e1b39

Please sign in to comment.