Bug 283

Summary: Search for Tuen Mun station return null
Product: Group 9: Route Planning Reporter: CherineLee <shiyingli7-c>
Component: NetworkAssignee: qiyuliang2-c
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: Highest    
Version: 1.0   
Hardware: PC   
OS: Mac OS   

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 ***