Open Paulifyer opened 1 week ago
Thank you for raising this issue. Upon review, the bug occurs due to the add-water command not adequately handling cases where the user inputs invalid or non-numeric values for the water amount, resulting in a NumberFormatException. We acknowledge this is a functionality bug, and its severity is medium as it interrupts the user experience but does not crash the application entirely.
The issue arises because there is no validation to check whether the input string for the water amount is numeric before attempting to parse it using Integer.parseInt. If the input is invalid, a NumberFormatException is thrown.
We will address this issue by implementing input validation to ensure the amount is a positive integer before parsing it. If the input is invalid, a descriptive error message will be shown to the user without terminating the program.
[The team marked this bug as a duplicate of the following bug]
add-water NumberFormatException not handled
[original: nus-cs2113-AY2425S1/pe-interim#572] [original labels: severity.Medium type.FunctionalityBug]
[This is the team's response to the above 'original' bug]
Thank you for bringing this issue to our attention. We understand that the add-water command currently does not handle NumberFormatException properly when non-numeric input is provided.
We acknowledge this as a valid concern, but after evaluating the current scope of our project, we have decided that this issue is not within the scope of the current release cycle. We will keep it in mind for future updates to ensure better input validation.
Additionally, we have lowered the severity to low because the average user does not have an intake of 10000000000000 ml of water daily.
We appreciate your understanding and feedback.
Items for the Tester to Verify
:question: Issue duplicate status
Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)
Reason for disagreement: [replace this with your explanation]