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
[#9493] Convert FieldValidator to a utility class #9498
Conversation
Hi @VinodkumarWagh, these parts of your pull request do not appear to follow our contributing guidelines:
|
@VinodkumarWagh please look take care of the following.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that your code compiles before you push changes to your PR.
The changes that you've made here are not sufficient and do not resolve the issue.
As mentioned in the issue description, there are 3 steps needed for FieldValidator
:
- all methods are static
- the class is
final
- and the constructor is
private
You will also need to fix other places that break once you make these changes.
@RonakLakhotia @amrut-prabhu @wangsha Can anybody help me to solve that lint error? How do I resolve it? I'm only getting that one error, except that error all things are going fine. |
Hi @VinodkumarWagh, to fix the lint error you should refer to your TRAVIS report. This is the output:
In future, make sure to run |
Just a nifty trick that may be useful in the future, you can run |
@amrut-prabhu I've tried each and every combination for the given error still not getting it, what could be wrong in it? |
@VinodkumarWagh This may help. See the order mentioned under
|
@amrut-prabhu I've tried that too and also tried it again by implementing it according to the file that you had suggested to me(TimeHelper.java). |
Are you sure about that? The link says to place constructors after class variables |
@amrut-prabhu got it, I apologize, btw thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amrut-prabhu Changes have made successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good attempt at the updates!
But, try not to make unintended changes (like unnecessarily removing whitespace or pasting something by accident as mentioned in the first couple of review comments)
@@ -142,7 +144,6 @@ | |||
public static final String TEAM_NAME_IS_VALID_EMAIL_ERROR_MESSAGE = | |||
"The field " + TEAM_NAME_FIELD_NAME + " is not acceptable to TEAMMATES as the suggested value for " | |||
+ TEAM_NAME_FIELD_NAME + " can be mis-interpreted as an email."; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too, and the rest of them as well
@Test | ||
public void testGetValidityInfoForNonHtmlField_cleanInput_returnEmptyString() { | ||
String clean = "Valid clean input with no special HTML characters"; | ||
String testFieldName = "Inconsequential test field name"; | ||
String actual = validator.getValidityInfoForNonHtmlField(testFieldName, clean); | ||
String actual = getValidityInfoForNonHtmlField(testFieldName, clean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above.
addNonEmptyError(validator.getValidityInfoForNonNullField( | ||
FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, feedbackSessionName), errors); | ||
addNonEmptyError(FieldValidator.getValidityInfoForNonNullField( | ||
FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, feedbackSessionName), errors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the extra indent?
|
||
addNonEmptyError(validator.getValidityInfoForNonNullField(FieldValidator.COURSE_ID_FIELD_NAME, courseId), errors); | ||
addNonEmptyError(FieldValidator.getValidityInfoForNonNullField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to just move FieldValidator.getValidityInfoForNonNullField(
to the next line as well
|
||
addNonEmptyError(validator.getValidityInfoForNonNullField("instructions to students", instructions), errors); | ||
addNonEmptyError(FieldValidator.getValidityInfoForNonNullField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -175,25 +175,23 @@ public boolean isEnrollInfoSameAs(StudentAttributes otherStudent) { | |||
// id is allowed to be null when the student is not registered | |||
Assumption.assertNotNull(team); | |||
Assumption.assertNotNull(comments); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amrut-prabhu Thanks for the review, I will surely correct them all.
@amrut-prabhu Why Travis-CI is not showing the report? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to review.
@VinodkumarWagh Until Travis CI gives green, it is not ready for review (unless you requested for partial review, which seems not to be the case). There are merge conflicts that you need to resolve. |
@wkurniawan07 But it's been hours now for Travis CI to give the green light, is there any problem with it? Because I had push that changes hours ago. |
@VinodkumarWagh if there are merge conflicts, no CI would be able to run. |
@wkurniawan07 I am creating a new pull request for this issue. |
Fixes #9493 Covert FieldValidator to a utility class Also modified all files which are related to FieldValidator class.