-
Notifications
You must be signed in to change notification settings - Fork 111
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
[T2A2][T16-A1] Alwinson Au-yong #307
base: master
Are you sure you want to change the base?
Conversation
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 in general. albeit came in a little late.
@@ -54,7 +54,7 @@ | |||
/** | |||
* A platform independent line separator. | |||
*/ | |||
private static final String LS = System.lineSeparator() + LINE_PREFIX; | |||
private static final String LINE_SEPARATOR = System.lineSeparator() + LINE_PREFIX; |
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 catch!
final String[] commandTypeAndParams = splitCommandWordAndArgs(userInputString); | ||
final String commandType = commandTypeAndParams[0]; | ||
final String commandArgs = commandTypeAndParams[1]; | ||
final String commandType = commandTypeAndParams[COMMAND_TYPE_INDEX]; |
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 to see you have removed the magic numbers here!
final boolean changed = ALL_PERSONS.remove(exactPerson); | ||
if (changed) { | ||
final boolean ischanged = ALL_PERSONS.remove(exactPerson); | ||
if (ischanged) { |
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.
the idea here is correct, naming the boolean by prefixing is
however, you need to follow camel casing. appropriate would be isChanged
&& !splitArgs[0].isEmpty() // non-empty arguments | ||
&& !splitArgs[1].isEmpty() | ||
&& !splitArgs[2].isEmpty(); | ||
return splitArgs.length == PERSON_DATA_COUNT // 3 arguments |
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.
👍 eliminating magic numbers.
*/ | ||
private static String removePrefixSign(String s, String sign) { | ||
return s.replace(sign, ""); | ||
private static String removePrefix(String fullString, String prefix) { |
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.
the solution to this one is incorrect.
this one is pretty much the same as earlier. you need to change the code so that only prefix is removed.
in the current version all occurrences of prefix
in fullString
are removed.
@alwinsonauyong sorry for the delay! |
Ready to Review