Closed adityap27 closed 11 months ago
Hello @stleary and @johnjaylward,
Can this be reviewed and merged please?
Thanks for starting the review process @stleary.
I would like to ask if there is any possibility of merging this before the 26 Nov day end? Actually, this is a part of my university course assignment, where I would be getting a few bonus points if this gets merged on time. Sorry, if this gentle request sounds casual. I really understand and respect your time.
I am happy to modify the changes as per your feedback.
@adityap27 Out of sync, please merge master to your branch.
@stleary - done, now in sync.
What problem does this code solve? Refactoring to improve code readability
Does the code still compile with Java6? Yes
Risks Low
Changes to the API? No
Will this require a new release? No
Should the documentation be updated? No
Does it break the unit tests? No
Was any code refactored in this commit? Yes, see first prompt
Review status APPROVED
Starting 3-day comment window
Hello @stleary,
I have made 3 refactorings.
1. Renamed Variable boolean b in toString() method of CookieList Class. boolean
isEndOfPair
is more meaningful as compared to just booleanb
.2. Introduced indentationSuffix variable in toString() method of XML Class. There are multiple long expressions which are using
(indentFactor > 0) ? "\n" : ""
sub-expression.indentationSuffix
is introduced to replace this sub-expression to improve readability and reduce duplication.3. Added method isNumericChar(...) in NumberConversionUtil Class. There are some digit-related conditions which may look complex to some developers due to multiple conditional operators. Eg:
if ((initial >= '0' && initial <= '9') || initial == '-' )
andif(at1 == '0' && at2 >= '0' && at2 <= '9')
The sub-condition
c >= '0' && c <= '9'
is moved to a methodisNumericChar(...)
to reduce the complexity of these conditions and better readability.Notes: All the unit tests are passing successfully.
This code is compatible with Java 6.