Buggy code:
public class PointManagerTest extends AndroidTestCase { public void testLoadFromJSON ( ) throws JSONException { <START_BUG> PointManager pm = new PointManager ( ) ; <END_BUG> String testData = "{<seq2seq4repair_space>POIList:[<seq2seq4repair_space>" + ( ( ( ( "{<seq2seq4repair_space>\"name\":\"Mairie<seq2seq4repair_space>de<seq2seq4repair_space>Villeurbanne\",<seq2seq4repair_space>\"altitude\":100,<seq2seq4repair_space>\"latitude\":45.766592,<seq2seq4repair_space>\"longitude\":4.879600,<seq2seq4repair_space>\"type\":\"BUILDING\",<seq2seq4repair_space>\"areas\"<seq2seq4repair_space>:<seq2seq4repair_space>[\"Rhône\",<seq2seq4repair_space>\"France\"]<seq2seq4repair_space>}," + "{<seq2seq4repair_space>\"name\":\"Tour<seq2seq4repair_space>Part<seq2seq4repair_space>Dieu\",<seq2seq4repair_space>\"altitude\":100,<seq2seq4repair_space>\"latitude\":45.761063,<seq2seq4repair_space>\"longitude\":4.853752,<seq2seq4repair_space>\"type\":\"BUILDING\",<seq2seq4repair_space>\"areas\"<seq2seq4repair_space>:<seq2seq4repair_space>[\"Rhône\",<seq2seq4repair_space>\"France\"]<seq2seq4repair_space>}," ) + "{<seq2seq4repair_space>\"name\":\"Basilique<seq2seq4repair_space>de<seq2seq4repair_space>fourvière\",<seq2seq4repair_space>\"altitude\":100,<seq2seq4repair_space>\"latitude\":45.762262,<seq2seq4repair_space>\"longitude\":4.822910,<seq2seq4repair_space>\"type\":\"BUILDING\",<seq2seq4repair_space>\"areas\":<seq2seq4repair_space>[<seq2seq4repair_space>\"Rhône\",<seq2seq4repair_space>\"France\"<seq2seq4repair_space>]<seq2seq4repair_space>}," ) + "{<seq2seq4repair_space>\"name\":\"Mont<seq2seq4repair_space>Blanc\",<seq2seq4repair_space>\"altitude\":100,<seq2seq4repair_space>\"latitude\":45.833679,<seq2seq4repair_space>\"longitude\":6.864564,<seq2seq4repair_space>\"type\":\"SUMMIT\",<seq2seq4repair_space>\"areas\"<seq2seq4repair_space>:<seq2seq4repair_space>[\"Rhône\",<seq2seq4repair_space>\"France\"]<seq2seq4repair_space>}" ) + "]}" ) ; pm . loadFromJson ( testData ) ; Vector < PointOfInterest > listOfPoi = pm . getPointList ( ) ; assertEquals ( 4 , listOfPoi . size ( ) ) ; assertEquals ( "Mairie<seq2seq4repair_space>de<seq2seq4repair_space>Villeurbanne" , listOfPoi . get ( 0 ) . getLabel ( ) ) ; assertEquals ( listOfPoi . get ( 0 ) . getLocation ( ) . getLongitude ( ) , 4.8796 , 1.0E-4 ) ; assertEquals ( listOfPoi . get ( 0 ) . getLocation ( ) . getLatitude ( ) , 45.766592 , 1.0E-4 ) ; assertEquals ( listOfPoi . get ( 0 ) . getLocation ( ) . getAltitude ( ) , 100 , 0.001 ) ; assertEquals ( BUILDING , listOfPoi . get ( 0 ) . getType ( ) ) ; assertEquals ( "Basilique<seq2seq4repair_space>de<seq2seq4repair_space>fourvière" , listOfPoi . get ( 2 ) . getLabel ( ) ) ; assertEquals ( "Mont<seq2seq4repair_space>Blanc" , listOfPoi . get ( 3 ) . getLabel ( ) ) ; assertEquals ( SUMMIT , listOfPoi . get ( 3 ) . getType ( ) ) ; assertEquals ( listOfPoi . get ( 3 ) . getLocation ( ) . getLatitude ( ) , 45.833679 , 1.0E-4 ) ; assertEquals ( listOfPoi . get ( 3 ) . getLocation ( ) . getLongitude ( ) , 6.864564 , 1.0E-4 ) ; boolean exceptionHappened = false ; try { pm . loadFromJson ( "{invalid}" ) ; } catch ( JSONException e ) { exceptionHappened = true ; } assertTrue ( exceptionHappened ) ; } }

Fix:
PointManager pm = new PointManager ( getContext ( ) ) ;