Bug 262 - A misguiding error message in input handling part
Summary: A misguiding error message in input handling part
Status: RESOLVED FIXED
Alias: None
Product: Group 9: Route Planning
Classification: Unclassified
Component: Interface (show other bugs)
Version: 1.0
Hardware: PC Mac OS
: Normal major
Assignee: zhanjiang2-c
URL:
Depends on:
Blocks:
 
Reported: 2018-11-28 17:41 HKT by CherineLee
Modified: 2018-12-09 13:30 HKT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CherineLee 2018-11-28 17:41:09 HKT
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.
Comment 1 Henry 2018-12-08 18:02:48 HKT
Fixed!