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

Duplicate entry points #177

Open
khatchad opened this issue Feb 6, 2018 · 5 comments
Open

Duplicate entry points #177

khatchad opened this issue Feb 6, 2018 · 5 comments

Comments

@khatchad
Copy link
Member

khatchad commented Feb 6, 2018

From the logs, it looks like our tool has no problem using duplicate entry points, i.e., entry points represented by the same method. This can throw off our entry point count in the situation where we use both implicit and explicit entry points, or if duplicate entry points exist in the file (related to #172).

@khatchad
Copy link
Member Author

My guess is that the entry point class we are using in WALA doesn't or improperly overrides the Object.equals() method such that two entry points with the same method signature are not considered equal. The problem is probably in the WALA code.

@khatchad
Copy link
Member Author

First step should be to reproduce the problem by making a JUnit test case using a entry_points.txt file that has lines consisting of the same method signature.

@khatchad
Copy link
Member Author

In the results.csv file, you'll see the entry point count.

@yiming-tang-cs
Copy link
Contributor

yiming-tang-cs commented Feb 16, 2018

First step should be to reproduce the problem by making a JUnit test case using a entry_points.txt file that has lines consisting of the same method signature.

I cannot reproduce it.

My test case is:

package p;

import java.util.HashSet;

import edu.cuny.hunter.streamrefactoring.annotations.*;

class A {
	void m() {
		HashSet h1 = new HashSet();
		h1.stream().count();
	}
}

My file content is:

p.A.m()V
p.A.m()V

, but I only got 1 entry points in the result.csv.

I guess the hashset already made the distinct entry points.

This is not a bug. I suggest to close it.

@khatchad
Copy link
Member Author

I am still seeing it. To reproduce, annotate a method with @EntryPoint (don't use entry_points.txt) that would also be picked up by the implicit flags (e.g., annotate the main() method and turn on implicit entry points). In this situation, you'll have the same method explicitly marked as an entry point as well as implicitly.

@khatchad khatchad reopened this Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants