Buggy code:
public class GreedyImpl { private Timestamp driverTimeStamp ; private TreeMap < Integer , Double > mBlockDistanceSortedMap ; private boolean isParkingSpaceAvailable ( final int block ) { } public TrialData computeGravityRoadNetwork ( final Location userLoc , final int congestionLevel ) { Iterator < Integer > it = sInMemoryEdges . getKeySet ( ) . iterator ( ) ; mBlockDistanceSortedMap = new TreeMap < Integer , Double > ( ) ; while ( it . hasNext ( ) ) { RoadNetworkEdge edge = sInMemoryEdges . getEdge ( it . next ( ) ) ; double userToBlockDistance = 0 ; userToBlockDistance = DistanceUtils . distance ( userLoc . getLatitude ( ) , userLoc . getLongitude ( ) , edge . latitude1 , edge . longitude1 , 'M' ) ; int blockId = edge . blockId ; int totalAvailableParkingLots = GeneralUtils . getAvailableParkingLots ( blockId , driverTimeStamp , congestionLevel ) ; System . out . println ( ( "****<seq2seq4repair_space>totalAvailableParkingLots:<seq2seq4repair_space>" + totalAvailableParkingLots ) ) ; System . out . println ( ( "***<seq2seq4repair_space>Num<seq2seq4repair_space>Operational:<seq2seq4repair_space>" + ( edge . numOperational ) ) ) ; double resultantValue ; if ( ( edge . numOperational ) == 0 ) { resultantValue = 0 ; } else { resultantValue = ( totalAvailableParkingLots // ( edge . numOperational ) ) // userToBlockDistance ; } if ( ( ( edge . numOperational ) > 0 ) && ( totalAvailableParkingLots > 0 ) ) { mBlockDistanceSortedMap . put ( edge . blockId , resultantValue ) ; } } TreeMap < Integer , Double > sortedDistanceMap = ( ( TreeMap < Integer , Double > ) ( GeneralUtils . sortByValues ( mBlockDistanceSortedMap ) ) ) ; Iterator testIt = sortedDistanceMap . keySet ( ) . iterator ( ) ; for ( Map . Entry < Integer , Double > entry : sortedDistanceMap . entrySet ( ) ) { System . out . print ( ( ( ( ( entry . getKey ( ) ) + "//" ) + ( entry . getValue ( ) ) ) + "...." ) ) ; Location loc = GeneralUtils . getBlockLocation ( entry . getKey ( ) ) . get ( "start" ) ; System . out . println ( ( "Distance<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( DistanceUtils . distance ( userLoc . getLatitude ( ) , userLoc . getLongitude ( ) , loc . getLatitude ( ) , loc . getLongitude ( ) , 'M' ) ) ) ) ; } int parkingBlock = GeneralUtils . getNearestParkingBlock ( sortedDistanceMap ) ; System . out . println ( ( "***<seq2seq4repair_space>Parking<seq2seq4repair_space>Block<seq2seq4repair_space>got<seq2seq4repair_space>:<seq2seq4repair_space>" + parkingBlock ) ) ; HashMap < String , Location > blockLoc = GeneralUtils . getBlockLocation ( parkingBlock ) ; Location blockStartLoc = blockLoc . get ( "start" ) ; double userToBestParkingDistance = DistanceUtils . distance ( userLoc . getLatitude ( ) , userLoc . getLongitude ( ) , blockStartLoc . getLatitude ( ) , blockStartLoc . getLongitude ( ) , 'M' ) ; System . out . println ( ( ( ( ( "The<seq2seq4repair_space>Parking<seq2seq4repair_space>Block:<seq2seq4repair_space>" + parkingBlock ) + "<seq2seq4repair_space>allocated<seq2seq4repair_space>is<seq2seq4repair_space>located<seq2seq4repair_space>at<seq2seq4repair_space>a<seq2seq4repair_space>distance<seq2seq4repair_space>of:<seq2seq4repair_space>" ) + userToBestParkingDistance ) + "<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>user<seq2seq4repair_space>location" ) ) ; int totalTime = DistanceUtils . totalTime ( userLoc . getLatitude ( ) , userLoc . getLongitude ( ) , blockStartLoc . getLatitude ( ) , blockStartLoc . getLongitude ( ) , 'M' ) ; while ( userToBestParkingDistance > 0 ) { userToBestParkingDistance = userToBestParkingDistance - 0.0310686 ; driverTimeStamp . setMinutes ( ( ( driverTimeStamp . getMinutes ( ) ) + 1 ) ) ; if ( isParkingSpaceAvailable ( parkingBlock ) ) { continue ; } else { System . out . println ( ( "Parking<seq2seq4repair_space>Lot<seq2seq4repair_space>not<seq2seq4repair_space>available<seq2seq4repair_space>at<seq2seq4repair_space>:<seq2seq4repair_space>" + ( driverTimeStamp ) ) ) ; } } System . out . println ( ( "Total<seq2seq4repair_space>Minutes<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>parking<seq2seq4repair_space>lot<seq2seq4repair_space>in<seq2seq4repair_space>seconds:<seq2seq4repair_space>" + totalTime ) ) ; <START_BUG> TrialData returnTrialData = new TrialData ( totalTime , parkingBlock , userLoc , blockStartLoc ) ; <END_BUG> return returnTrialData ; } public void initializeDriverTime ( ) { } }

Fix:
TrialData returnTrialData = new TrialData ( parkingBlock , totalTime , userLoc , blockStartLoc ) ;