-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
split Guard class into two #3497
Comments
Hi, I would like to tackle this issue as my first contribution to the checkstyle project as this seems relatively simple to begin with. As I see it, there should be at least two different classes: a If there is any other information I would need to implement this, please let me know. |
Thanks for desire to help, you always welcome. Do not hesitate to ask questions.
Please propose better names. "Guard" is not good. It is better to less in common, overlap in one field is not enough to make an abstract class for them.
Yes
Please do PR , and we will see what to change. You can skip uts for first review |
What do you think of the names
Ok, but unless we create an abstract class or an interface we cannot operate on the general concept of a 'Guard' anymore from the Right now all Guard objects are stored in a single I think storing them in separate fields is better, we have to make two separate methods for adding them anyway. |
I have started working on this.
I'm gonna do what I think is best for now. I will make a PR once references to |
…from AbstractImportRule
fix is mered. |
https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/Guard.java
it serves two differend modes that are managed by null values in fields.
Task: create two classes from one to avoid checking for null. Names should be different "Guard" and named close to what they represent from XML.
The text was updated successfully, but these errors were encountered: