Skip to content
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

[W3][T12-2] #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[W3][T12-2] #3

wants to merge 1 commit into from

Conversation

sergiovieri
Copy link

@sergiovieri sergiovieri commented Jan 27, 2019

Method savePersonsToFile writes to storageFilePath instead of the passed parameter filePath, which could cause incorrect behaviour in future uses. @bqnguyen94

@@ -763,7 +763,7 @@ private static void createFileIfMissing(String filePath) {
private static void savePersonsToFile(ArrayList<String[]> persons, String filePath) {
final ArrayList<String> linesToWrite = encodePersonsToStrings(persons);
try {
Files.write(Paths.get(storageFilePath), linesToWrite);
Files.write(Paths.get(filePath), linesToWrite);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job catching this 👍 another fix could be omitting filePath parameter entirely from the method signature since it is not used in the method anyway

Copy link

@bqnguyen94 bqnguyen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍

@nus-se-pr-bot
Copy link

Hi @sergiovieri, your pull request title is invalid.

For PR sent to satisfy a learning outcome, the PR name should be in the format of [Learning Outcome ID][Team ID] Your Name, where [Learning Outcome ID] has no dashes or spaces (e.g. [W3.1a]) and [Team ID] has one dash only and no spaces (e.g. [W14-2] means Wednesday 2pm (14 hrs), Team 2).
E.g. If you are in tutorial W09 (i.e. Wednesday 9am), team 1, and is submitting a PR for LO W2.2b, the PR title would be [W2.2b][W09-1] James Yong. Note that your tutorial IDs are different from those shown in CORS/IVLE.

For team PR, the PR name should be in the format of [Team ID] Product Name (e.g. [T09-2] Contact List Pro).

Please follow the above format strictly and edit your title for reprocessing.

Note: this comment is posted by a bot. If you believe this is done in error, please create an issue at nus-se-pr-bot and add a link to this PR.

@sergiovieri sergiovieri changed the title Fix file path in saving persons [W3][T12-2] Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants