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

Java Varargs syntax not supported #6

Open
rafaelmotaalves opened this issue May 11, 2020 · 0 comments
Open

Java Varargs syntax not supported #6

rafaelmotaalves opened this issue May 11, 2020 · 0 comments

Comments

@rafaelmotaalves
Copy link

rafaelmotaalves commented May 11, 2020

Hello,
Code that has Overloaded Methods and two of the method have same parameters, but one has varargs is causing inconsistencies on diffj's output, here is an example:

When running this class against itself on diffj:

class Test {
	public void test(String message) {
		System.out.println(message);
	}

	public void test(String ...message) {
		for (int i = 0; i < message.length; i++) {
			System.out.println(message[i]);
		}
	}
}

the following output is returned:

Test.java <=> Test.java
3c7,8 code changed in test(String)
< 		System.out.println(message);
---
> 		for (int i = 0; i < message.length; i++) {
> 			System.out.println(message[i]);

4a9 code added in test(String)
< 	}
---
> 		}

7d3 code removed in test(String)
< 		for (int i = 0; i < message.length; i++) {
---
> 		System.out.println(message);

8d3 code removed in test(String)
< 			System.out.println(message[i]);
---
> 		System.out.println(message);

9d4 code removed in test(String)
< 		}
---
> 	}

I think this is happening because diffj is considering those two methods are same, and it is comparing them with each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant