Buggy code:
public class GPSDatabase { private Context context ; private GPSDatabase . DbHelper dbHelper ; public final String DBNAME = "gpsdb" ; public final int DBVERSION = 1 ; public final String CREATERDB = ( ( ( ( ( ( ( ( ( ( ( ( ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>" + ( TABLENAME ) ) + "(" ) + ( FIELD_ID ) ) + "<seq2seq4repair_space>INTEGER<seq2seq4repair_space>PRIMARY<seq2seq4repair_space>KEY,<seq2seq4repair_space>" ) + ( FIELD_LAT ) ) + "<seq2seq4repair_space>VARCHAR<seq2seq4repair_space>NOT<seq2seq4repair_space>NULL,<seq2seq4repair_space>" ) + ( FIELD_LNG ) ) + "<seq2seq4repair_space>VARCHAR<seq2seq4repair_space>NOT<seq2seq4repair_space>NULL,<seq2seq4repair_space>" ) + ( FIELD_ALT ) ) + "<seq2seq4repair_space>VARCHAR,<seq2seq4repair_space>" ) + ( FIELD_TIME ) ) + "<seq2seq4repair_space>INTEGER,<seq2seq4repair_space>" ) + ( FIELD_DIST ) ) + "<seq2seq4repair_space>REAL);" ; public GPSDatabase ( Context context ) { } public class DbHelper extends SQLiteOpenHelper { public DbHelper ( Context context ) { } @ Override public void onCreate ( SQLiteDatabase db ) { } @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } } public long insertRow ( double lat , double lng , double alt , float dist ) { } private Cursor getAllRows ( ) { } public void deleteTable ( ) { } private JSONArray getTableInJSON ( ) { } public ArrayList < LatLng > getAllLocations ( ) { } public float getTotalLength ( ) { } public long getTotalDuration ( ) { } private String getTableInGPX ( String email , String name , String description ) { ArrayList < LatLng > waypoints = getWayPoints ( ) ; String gpxString = "" ; gpxString += "<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"ISO-8859-1\"<seq2seq4repair_space>standalone=\"no\"?>\n" + ( ( ( ( "<gpx\n" + "<seq2seq4repair_space>xmlns=\"http:////www.topografix.com//GPX//1//0\"\n" ) + "<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>creator=\"MoBike<seq2seq4repair_space>Mobile<seq2seq4repair_space>App\"\n" ) + "<seq2seq4repair_space>xmlns:xsi=\"http:////www.w3.org//2001//XMLSchema-instance\"\n" ) + "<seq2seq4repair_space>xsi:schemaLocation=\"http:////www.topografix.com//GPX//1//0<seq2seq4repair_space>http:////www.topografix.com//GPX//1//0//gpx.xsd\">\n" ) ; <START_BUG> gpxString += ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<metadata>\n" + "<name>" ) + name ) + "<//name>\n" ) + "<desc>" ) + description ) + "<//desc>\n" ) + "<author>\n" ) + "<name>" ) + ( email . substring ( 0 , email . indexOf ( "@" ) ) ) ) + "<//name>\n" ) + "<email<seq2seq4repair_space>" ) + "id=\"" ) + ( email . substring ( 0 , email . indexOf ( "@" ) ) ) ) + "\"" ) + "domain=\"" ) + ( email . substring ( ( ( email . indexOf ( "@" ) ) + 1 ) ) ) ) + "\"\n" ) + "<//author>\n" ) + "<//metadata>\n" ; <END_BUG> double startLat = waypoints . get ( 0 ) . latitude ; double endLat = waypoints . get ( ( ( waypoints . size ( ) ) - 1 ) ) . latitude ; double startLng = waypoints . get ( 0 ) . longitude ; double endLng = waypoints . get ( ( ( waypoints . size ( ) ) - 1 ) ) . longitude ; gpxString += ( ( ( ( "<wpt<seq2seq4repair_space>lat=\"" + startLat ) + "\"<seq2seq4repair_space>lon=\"" ) + startLng ) + "\">" ) + "<name>Start<//name><//wpt>\n" ; double wlat ; double wlng ; for ( int j = 1 ; j < ( ( waypoints . size ( ) ) - 1 ) ; j ++ ) { wlat = waypoints . get ( j ) . latitude ; wlng = waypoints . get ( j ) . longitude ; gpxString += ( ( ( "<wpt<seq2seq4repair_space>lat=\"" + wlat ) + "\"<seq2seq4repair_space>lon=\"" ) + wlng ) + "\">\n" ; } gpxString += ( ( ( ( "<wpt<seq2seq4repair_space>lat=\"" + endLat ) + "\"<seq2seq4repair_space>lon=\"" ) + endLng ) + "\">" ) + "<name>End<//name><//wpt>\n" ; gpxString += ( ( ( ( ( "\n<trk><name>" + name ) + "<//name>\n" ) + "<desc>" ) + description ) + "<//desc>\n" ) + "<trkseg>\n" ; JSONArray array = getTableInJSON ( ) ; String lat ; String lng ; String alt ; long time ; for ( int i = 0 ; i < ( array . length ( ) ) ; i ++ ) { try { JSONObject row = array . getJSONObject ( i ) ; lat = row . getString ( FIELD_LAT ) ; lng = row . getString ( FIELD_LNG ) ; alt = row . getString ( FIELD_ALT ) ; time = row . getLong ( FIELD_TIME ) ; gpxString += ( ( ( ( ( ( ( "<trkpt<seq2seq4repair_space>lat=\"" + lat ) + "\"<seq2seq4repair_space>lon=\"" ) + lng ) + "\"><ele>" ) + alt ) + "<//ele><time>" ) + ( GPSDatabase . millisTimeToStr ( time ) ) ) + "<//time><//trkpt>\n" ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } gpxString += "<//trkseg>\n" + ( "<//trk>\n" + "<//gpx>" ) ; return gpxString ; } public ArrayList < LatLng > getWayPoints ( ) { } public ArrayList < LatLng > gpxToMapPoints ( String gpxString ) throws IOException { } public JSONObject exportRouteInJson ( String email , String name , String description ) { } private static String millisTimeToStr ( long millis ) { } public void open ( ) throws SQLException { } public void close ( ) { } No newline ; at end ; of file ; }

Fix:
gpxString += ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<metadata>\n" + "<name>" ) + name ) + "<//name>\n" ) + "<desc>" ) + description ) + "<//desc>\n" ) + "<author>\n" ) + "<name>" ) + ( email . substring ( 0 , email . indexOf ( "@" ) ) ) ) + "<//name>\n" ) + "<email<seq2seq4repair_space>" ) + "id=\"" ) + ( email . substring ( 0 , email . indexOf ( "@" ) ) ) ) + "\"" ) + "<seq2seq4repair_space>domain=\"" ) + ( email . substring ( ( ( email . indexOf ( "@" ) ) + 1 ) ) ) ) + "\"//>\n" ) + "<//author>\n" ) + "<//metadata>\n" ;