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

Get the number of methods #195

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yiming-tang-cs
Copy link
Contributor

Get the number of methods whose return type is Stream or the parameter type is Stream.

The result is shown in the stream_statics.

The example of content:

subject number of methods for stream return type number of method for stream parameter
Test 3 2

I will run the projects tonight.

@yiming-tang-cs
Copy link
Contributor Author

My test case:

class A {
	
	@EntryPoint
	Stream m()  {
		Collection collection1 = new HashSet<>();
		return collection1.stream();
	}
	
	@EntryPoint
	void mm(Stream stream)  {
		stream.count();
	}
	
	@EntryPoint
	void m1(Stream stream)  {
		stream.count();
	}
	
	@EntryPoint
	Stream n()  {
		Collection collection1 = new HashSet<>();
		return collection1.stream();
	}
	
	Stream nn()  {
		Collection collection1 = new HashSet<>();
		return collection1.stream();
	}

}

@yiming-tang-cs
Copy link
Contributor Author

It failed because the visitor only visits the method declarations and ignores the method invocation.

@ponder-lab ponder-lab deleted a comment from yiming-tang-cs Jul 12, 2018
Copy link
Member

@khatchad khatchad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would seem to me that these statistics can go right into results.csv.

@yiming-tang-cs
Copy link
Contributor Author

yiming-tang-cs commented Jul 16, 2018

Test case:

class A {
	
	Stream s;
	Collection collection1 = new HashSet<>();
	Stream s1 = collection1.stream();
	
	void m(){
		
	}

}

The number of fields which stores streams is 2.

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

Successfully merging this pull request may close these issues.

2 participants