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

Add method hasChildren to DetailAST #7487

Closed
pbludov opened this issue Jan 16, 2020 · 5 comments
Closed

Add method hasChildren to DetailAST #7487

pbludov opened this issue Jan 16, 2020 · 5 comments
Assignees
Milestone

Comments

@pbludov
Copy link
Member

pbludov commented Jan 16, 2020

From sevntu-checkstyle/sevntu.checkstyle#794 (comment)

The most common usage of the method getChildCount is to compare the count to zero. For example. This is not efficient nor readable. Both issues can be fixed by adding a new method to the DetailAST interface:

default boolean hasChildren() {
    return getFirstChild() != null;
}
@romani
Copy link
Member

romani commented Jan 16, 2020

I am ok to add this methood.
@rnveach , please review and put label.

@rnveach
Copy link
Member

rnveach commented Jan 16, 2020

@romani I was ok with it until I saw the default method in the interface. I personally would just prefer to see the implementation in the class. I am old school.

@romani
Copy link
Member

romani commented Jan 16, 2020

ok, lets make method in interface as declaration.

@pbludov pbludov self-assigned this Jan 16, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 17, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 20, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 20, 2020
@pbludov
Copy link
Member Author

pbludov commented Jan 20, 2020

Started hcoles/pitest#725 for the Pitest issue.

pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 25, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 25, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 25, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 25, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Jan 25, 2020
@romani romani added this to the 8.29 milestone Jan 26, 2020
@romani
Copy link
Member

romani commented Jan 26, 2020

Fix is merged

@romani romani closed this as completed Jan 26, 2020
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

3 participants