Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of Refactoring-Aware Diff #5

Open
wants to merge 8 commits into
base: examples
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
LANGUAGE: Java
REV_BEFORE: ${{ github.event.pull_request.base.sha }}
REV_AFTER: ${{ github.event.pull_request.head.sha }}
uses: rodrigo-brito/refactoring-aware-review@action
uses: rodrigo-brito/refactoring-aware-diff@action
2 changes: 1 addition & 1 deletion src/p1/A.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package p1;

public class A {
public class A implements IA {
public void m1() {
System.out.println("m1");
}
Expand Down
7 changes: 7 additions & 0 deletions src/p1/IA.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package p1;

public interface IA {
void m1();

void m2();
}
6 changes: 5 additions & 1 deletion src/p2/A.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package p2;

public class A {
public boolean isEven(int v) {
return v % 2 == 0;
}

public void m1(int v) {
if (v % 2 == 0) {
if (this.isEven(v)) {
System.out.println("even");
} else {
System.out.println("odd");
Expand Down
6 changes: 1 addition & 5 deletions src/p3/A.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package p3;

public class A {
public void m1() {
System.out.println("m1");
}

public class A extends B {
public void m2() {
System.out.println("m2");
}
Expand Down
7 changes: 7 additions & 0 deletions src/p3/B.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package p3;

public class B {
public void m1() {
System.out.println("m1");
}
}
5 changes: 0 additions & 5 deletions src/p4/A.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package p4;

public class A {
public void m5() {
int number = 5;
System.out.println("m" + number);
}

public void m2() {
System.out.println("m2");
}
Expand Down
5 changes: 5 additions & 0 deletions src/p4/B.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package p4;

public class B {
public void m5() {
int number = 5;
System.out.println("m" + number);
}

public void m3() {
System.out.println("m3");
}
Expand Down
10 changes: 0 additions & 10 deletions src/p5/C.java
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
package p5;

public class C {
public void m3() {
System.out.println("m3");
}

public void m4() {
System.out.println("m4");
}
}
11 changes: 11 additions & 0 deletions src/p6/C.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package p6;

public class C {
public void m3() {
System.out.println("m3");
}

public void m4() {
System.out.println("m4");
}
}
4 changes: 4 additions & 0 deletions src/p7/A.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ public class A {
public void m1() {
System.out.println("m1");
}

public void m2() {
System.out.println("m2");
}
}
4 changes: 0 additions & 4 deletions src/p7/B.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package p7;

public class B extends A {
public void m2() {
System.out.println("m2");
}

public void m3() {
System.out.println("m3");
}
Expand Down
4 changes: 0 additions & 4 deletions src/p8/A.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ public class A {
public void m1() {
System.out.println("m1");
}

public void m2() {
System.out.println("m2");
}
}
4 changes: 4 additions & 0 deletions src/p8/B.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package p8;

public class B extends A {
public void m2() {
System.out.println("m2");
}

public void m3() {
System.out.println("m3");
}
Expand Down
2 changes: 1 addition & 1 deletion src/p9/A.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package p9;

public class A {
public void m5() {
public void m6() {
int value = 5;
System.out.println("m" + value);
}
Expand Down