| Summary: | A misguiding error message in input handling part | ||
|---|---|---|---|
| Product: | Group 9: Route Planning | Reporter: | CherineLee <shiyingli7-c> |
| Component: | Interface | Assignee: | zhanjiang2-c |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | 728970038zjh, zhanjiang2-c, zixuan.huang |
| Priority: | Normal | ||
| Version: | 1.0 | ||
| Hardware: | PC | ||
| OS: | Mac OS | ||
Fixed! |
Steps to reproduce: 1. Set up by running: Stations stations = Stations.getInstance(); Lines lines = Lines.getInstance(); Notice that this will not initialize the stations and lines since both initialization() methods are not called. The list of stations and lines are therefore empty. 2. Set the start and end station by running: Station start = stations.searchStationByName("Kowloon Tong"); Station end = stations.searchStationByName("Wong Tai Sin"); Notice that both "Kowloon Tong" and "Wong Tai Sin" are valid input since they are actual station names. 3. Initialize and run the least time service by running: SvcLeastTimeRoute leastTimeRoute = new SvcLesttimeRoute(); leastTimeRoute.searchByTime(stations, lines, start, end); Expected output error: NullPointerException Actual output error: "Invalid Input!" This problem may misguide the tester or developer into thinking that the input string is wrong and ignoring other potential causes. Possible problem: The catch block that deals with the exception will print out "Invalid Input!" regardless the type of the exception.