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

Review: to fix issue #1979 #1980

Merged
merged 5 commits into from
May 3, 2018
Merged

Review: to fix issue #1979 #1980

merged 5 commits into from
May 3, 2018

Conversation

msramalho
Copy link
Contributor

Implements an iterator for any CtElement that can be used as follows:

CtIterator iterator = new CtIterator(/** some CtElement*/); 
while (iterator.hasNext()) { 
    CtElement next = (CtElement) iterator.next(); 
    System.out.println(next.toString()); 
}

@msramalho
Copy link
Contributor Author

msramalho commented Apr 30, 2018

Need some help on:

  • using checkstyle in intellij, already installed
  • creating the tests

this refers to issue #1979

@msramalho msramalho changed the title fixes #1979 - need help on test case creation WIP: to fix issue #1979 - need help collaborator help Apr 30, 2018
@monperrus
Copy link
Collaborator

Thanks a lot for this PR!

creating the tests

Here is a suggestion. One can visit of a small tree, put the elements in a list, a verify the order of the list in an assertion.

@msramalho msramalho changed the title WIP: to fix issue #1979 - need help collaborator help WIP: to fix issue #1979 - need help collaborator May 1, 2018
@msramalho msramalho changed the title WIP: to fix issue #1979 - need help collaborator WIP: to fix issue #1979 May 1, 2018
Can be extended to use AbstractProcessor for many inputResources, but I am not familiar with this.
@msramalho
Copy link
Contributor Author

I think this is ready for merge, if you want someone who knows how to improve the tests by using an AbstractProcessor wants to do so, they are welcome 😄

@monperrus
Copy link
Collaborator

Looks like the PR for #1077. Correct?

@msramalho
Copy link
Contributor Author

msramalho commented May 2, 2018

Actually the PR for #1979

A friend of mine may actually suggested that this CtIterator can be used to fix #1077 as well, just by wrapping it and providing a class that implements Iterable. He might have something to say @AndreFCruz

@monperrus
Copy link
Collaborator

I'm OK to merge this one: good feature, good test, good documentation.

@monperrus monperrus changed the title WIP: to fix issue #1979 Review: to fix issue #1979 May 3, 2018
@monperrus
Copy link
Collaborator

We'll discuss about #1077 after that. @tdurieux suggests a simple iterator method in CtElement.

@monperrus monperrus merged commit fc55d9a into INRIA:master May 3, 2018
@monperrus
Copy link
Collaborator

Thanks a lot for this first contribution, looking forward to the one for #1077 @AndreFCruz

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