Buggy code:
public class MainActivity extends Activity { private static final int REQUEST_CODE = 1234 ; private ListView wordsList ; EditText search ; EditText locationText ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( main ) ; ActionBar ab = getActionBar ( ) ; ab . hide ( ) ; search = ( ( EditText ) ( findViewById ( R . id . search ) ) ) ; locationText = ( ( EditText ) ( findViewById ( location ) ) ) ; Button btnSpeak = ( ( Button ) ( findViewById ( btnSpeak ) ) ) ; Button location = ( ( Button ) ( findViewById ( btnLocation ) ) ) ; PackageManager pm = getPackageManager ( ) ; List < ResolveInfo > activities = pm . queryIntentActivities ( new Intent ( RecognizerIntent . ACTION_RECOGNIZE_SPEECH ) , 0 ) ; if ( ( activities . size ( ) ) == 0 ) { btnSpeak . setEnabled ( false ) ; btnSpeak . setText ( "Recognizer<seq2seq4repair_space>not<seq2seq4repair_space>present" ) ; } btnSpeak . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( RecognizerIntent . ACTION_RECOGNIZE_SPEECH ) ; intent . putExtra ( EXTRA_LANGUAGE_MODEL , LANGUAGE_MODEL_FREE_FORM ) ; startActivityForResult ( intent , MainActivity . REQUEST_CODE ) ; } } ) ; location . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { boolean is_gps_available = false ; LocationManager locationManager = ( ( LocationManager ) ( getSystemService ( LOCATION_SERVICE ) ) ) ; Location lastKnownLocation = locationManager . getLastKnownLocation ( locationManager . NETWORK_PROVIDER ) ; if ( locationManager == null ) { locationManager = ( ( LocationManager ) ( getApplicationContext ( ) . getSystemService ( LOCATION_SERVICE ) ) ) ; } try { is_gps_available = locationManager . isProviderEnabled ( GPS_PROVIDER ) ; } catch ( Exception ex ) { } try { is_gps_available = locationManager . isProviderEnabled ( NETWORK_PROVIDER ) ; } catch ( Exception ex ) { } if ( is_gps_available == true ) { Geocoder userLocation = new Geocoder ( getApplicationContext ( ) , Locale . getDefault ( ) ) ; List < Address > addresses = null ; try { addresses = userLocation . getFromLocation ( lastKnownLocation . getLatitude ( ) , lastKnownLocation . getLongitude ( ) , 1 ) ; } catch ( IOException e ) { Log . e ( "MainActivity" , "IO<seq2seq4repair_space>Error" ) ; } if ( ( addresses . size ( ) ) > 0 ) { Address address = addresses . get ( 0 ) ; <START_BUG> String addressText = String . format ( "%s,<seq2seq4repair_space>%s,<seq2seq4repair_space>%s,<seq2seq4repair_space>$s" , ( ( address . getMaxAddressLineIndex ( ) ) > 0 ? address . getAddressLine ( 0 ) : "" ) , address . getLocality ( ) , address . getCountryName ( ) , address . getPostalCode ( ) ) ; <END_BUG> locationText . setText ( addressText ) ; } try { Double lat = ( ( Double ) ( lastKnownLocation . getLatitude ( ) ) ) ; Double lon = ( ( Double ) ( lastKnownLocation . getLongitude ( ) ) ) ; } catch ( NullPointerException e ) { locationText . setText ( e . toString ( ) ) ; } } else { Intent gpsOptionsIntent = new Intent ( Settings . ACTION_LOCATION_SOURCE_SETTINGS ) ; startActivity ( gpsOptionsIntent ) ; } } } ) ; } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } }

Fix:
String addressText = String . format ( "%s,<seq2seq4repair_space>%s,<seq2seq4repair_space>%s,<seq2seq4repair_space>%s" , ( ( address . getMaxAddressLineIndex ( ) ) > 0 ? address . getAddressLine ( 0 ) : "" ) , address . getLocality ( ) , address . getCountryName ( ) , address . getPostalCode ( ) ) ;