-
-
Notifications
You must be signed in to change notification settings - Fork 951
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 mentoring notes for java/reverse-string #1006
Conversation
Already discussed in PR exercism#991
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.
Thanks. I've approved it as it is, but left a few suggestions for whitespace formatting.
I'm sorry for letting this wait; I wasn't automatically notified because of the new PR.
String reverse(String inputString) { | ||
String output = ""; | ||
for (int i = inputString.length() - 1; i >= 0; i--) { | ||
output += inputString.charAt(i); |
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.
output += inputString.charAt(i); | |
output += inputString.charAt(i); |
Indentation by 4 spaces.
class ReverseString { | ||
String reverse(String inputString) { | ||
final int length = inputString.length(); | ||
return IntStream.iterate(length-1, i-> i-1).limit(length) |
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.
return IntStream.iterate(length-1, i-> i-1).limit(length) | |
return IntStream.iterate(length - 1, i -> i - 1) | |
.limit(length) |
Whitespace in lambda, align all chained methods.
final int length = inputString.length(); | ||
return IntStream.iterate(length-1, i-> i-1).limit(length) | ||
.mapToObj(inputString::charAt) | ||
.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString(); |
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.
.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString(); | |
.collect(StringBuilder::new, StringBuilder::append, StringBuilder::append) | |
.toString(); |
Align all chained methods.
Not exactly sure how to do this, but I wanted to mention that this PR Fixes #1101 |
@michael-berger-FR: Hello. :-) It seems that I cannot push to your feature branch. Would you like to address my suggested changes? |
@jmrunkle: I think it's okay to not have a corresponding issue for each PR if the discussion is already documented here. |
I've committed the mentor notes sans whitespace formatting on the premise that they can be fixed later. |
Already discussed in PR #991