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

UniquePropertiesCheck.getLineNumber should be private #4694

Closed
romani opened this issue Jul 10, 2017 · 2 comments
Closed

UniquePropertiesCheck.getLineNumber should be private #4694

romani opened this issue Jul 10, 2017 · 2 comments

Comments

@romani
Copy link
Member

romani commented Jul 10, 2017

Checks are not designed for extension in general, so protected usage is discouraged
especially static protected
protected static int getLineNumber(FileText fileText, String keyName) {
https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheck.java#L104

should become private protected. UTs should be updated to use Check public methods to test functionality.

@djydewang
Copy link
Contributor

Is it OK to test functionality by using reflection?

@rnveach
Copy link
Member

rnveach commented Jul 12, 2017

@djydewang Yes, if there is no other way we are fine with reflection.

djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 12, 2017
djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 12, 2017
djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 12, 2017
djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 12, 2017
djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 13, 2017
djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 13, 2017
djydewang added a commit to djydewang/checkstyle that referenced this issue Jul 13, 2017
@romani romani added this to the 8.1 milestone Jul 13, 2017
@romani romani closed this as completed Jul 13, 2017
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