nus-cs2113-AY2122S1 / pe-dev-response

0 stars 0 forks source link

Error not suitable for delete command #2961

Open nus-se-bot opened 2 years ago

nus-se-bot commented 2 years ago

image.png

When the user types 'delete -11111' , the user would get the error message that an instrument does not exist at that index when in reality the index itself is invalid. Needs a more appropriate error message.


[original: nus-cs2113-AY2122S1/pe-interim#2953] [original labels: severity.Medium type.FunctionalityBug]

KVignesh122 commented 2 years ago

Team's Response

We agree that in Java all index numbers of ArrayLists and Arrays must be non-negative. Since we had used an ArrayList to store the added instruments in the program, -1111 should be an invalid index instead of being treated as a legitimate index with no element at that index, like it is portrayed in the error message. So, the reported bug is accepted.

However, the severity is downgraded to Low since the bug only has to do with phrasing of the error message but the feature works as expected.

Duplicate status (if any):

--