Bug 283 - Search for Tuen Mun station return null
Summary: Search for Tuen Mun station return null
Status: RESOLVED DUPLICATE of bug 282
Alias: None
Product: Group 9: Route Planning
Classification: Unclassified
Component: Network (show other bugs)
Version: 1.0
Hardware: PC Mac OS
: Highest blocker
Assignee: qiyuliang2-c
URL:
Depends on:
Blocks:
 
Reported: 2018-12-09 13:11 HKT by CherineLee
Modified: 2018-12-09 13:18 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CherineLee 2018-12-09 13:11:50 HKT
Step to reproduce:
1. To set up, run
 	network = Network.getInstance();
	network.initializationStations();
	network.initializationLines();
2. To get the Tuen Mun station, run:
        Station tuenmun = network.searchStationByName("Tuen Mun");
3. To get the name of the searched station, run:
        String result = tuenmun.getName();

Expected result: Tuen Mun
Actual result: NullPointerException

From the NullPointerException, I made a safe assumption that the search returned null. I have made some experiments to search other station names and yet none of them seemed to have this problem.

Please check what is causing this problem.
Comment 1 qiyuliang2-c 2018-12-09 13:18:45 HKT
This is also caused by the index in the data file.

The problem is already fixed.

I will mark this as a duplicate to bug 282.

*** This bug has been marked as a duplicate of bug 282 ***