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 [haveOnlyPrivateConstructors] #204

Merged
merged 2 commits into from
Jul 29, 2019
Merged

add [haveOnlyPrivateConstructors] #204

merged 2 commits into from
Jul 29, 2019

Conversation

sullis
Copy link
Contributor

@sullis sullis commented Jul 22, 2019

No description provided.

@sullis
Copy link
Contributor Author

sullis commented Jul 23, 2019

please review @codecholeric

@codecholeric
Copy link
Collaborator

Thanks for adding this 😃
I've made some review adjustments, in particular unified the two conditions asserting that all of certain objects (fields, constructors, ...) have a certain modifier.
Can you check if that looks good to you? The semantics shouldn't have changed, only the reporting of the details, but I think it's better if it's consistent.
If you give me your thumbs up I'll merge it.

Copy link
Contributor Author

@sullis sullis left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work!

sullis and others added 2 commits July 29, 2019 03:12
…lFieldsCondition, since in the end it is always some condition on some attributes of a JavaClass having modifiers. Also added GET_MEMBERS, GET_FIELDS, ... to JavaClass.Functions since they were missing.

Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
@codecholeric codecholeric merged commit 72704a3 into TNG:master Jul 29, 2019
@sullis sullis deleted the add-HaveOnlyPrivateConstructorsCondition branch July 29, 2019 01:50
* @return A syntax element that can either be used as working rule, or to continue specifying a more complex rule
*/
@PublicAPI(usage = ACCESS)
ClassesShouldConjunction haveOnlyPrivateConstructors();
Copy link

Choose a reason for hiding this comment

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

It would have been much better to expose haveOnlyConstructorsWithModifiers as well

Copy link
Collaborator

Choose a reason for hiding this comment

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

We're open for PR's 😉
Should be easy to pipe this method to a new haveOnlyConstructorsWithModifiers(..) method.
Other than that you can of course already test this with the current state, just directly use the predicates / conditions and adjust them...

codecholeric added a commit that referenced this pull request Feb 21, 2021
…ndition

add [haveOnlyPrivateConstructors]
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.

4 participants