Buggy code:
public class Main extends FragmentActivity implements TabHost . OnTabChangeListener , DevicesListFragment . DevicesListFragmentCallback , ExtrasFragment . ExtrasFragmentCallback , HistoryFragment . HistoryFragmentCallback , HomeFragment . HomeFragmentCallback , NewMeasurementFragment . NewMeasurementFragmentCallback , SettingsFragment . SettingsFragmentCallback { public static final boolean ENABLE_DEBUG = false ; private static final int RERUN_DISCOVER_BLUETOOTH_DEVICES = 0 ; private static final int RERUN_ON_SYNC_CLICK = 1 ; private static final int RERUN_CONNECT_TO_DEFAULT_DEVICE = 2 ; private static final int RERUN_ON_SET_DEFAULT_DEVICE_CLICK = 3 ; private static final int RERUN_ON_EXTRA_LUNGS_CLICK = 4 ; private static final String LOG_TAG = "MainActivity" ; private static Context context = null ; private BluetoothAdapter mBluetoothAdapter ; private BluetoothService mBluetoothService ; private int mBluetoothServiceState = BluetoothService . STATE_NONE ; private SyncWithDeviceThread mSyncWithDeviceThread ; private CaptureBreathingThread mCaptureBreathingThread ; private String [ ] mCurrentTabsGroup ; private FragmentTabHost mTabHost ; private HashMap < String , Main . TabInfo > mMapTabInfo = new HashMap < String , Main . TabInfo > ( ) ; private Main . TabInfo mCurrentTabInfo ; private String mConnectedDeviceName ; private CustomDatabaseAdapter mDBAdapter ; private Stack < Integer > mRerunMethodStack ; private final Handler mHandler = new Handler ( ) { @ Override public void handleMessage ( Message msg ) { } } ; private final BroadcastReceiver mReceiver = new BroadcastReceiver ( ) { public void onReceive ( Context context , Intent intent ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onSaveInstanceState ( Bundle outState ) { } @ Override protected void onPause ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onPostResume ( ) { } @ Override public void onBackPressed ( ) { } private boolean traverseBackStackRecursively ( FragmentManager fm ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ SuppressWarnings ( "UnnecessaryBoxing" ) private void registerForRerun ( int index ) { } private void rerunMethod ( ) { } private void initializeTabHost ( Bundle savedInstanceState ) { } private void setTabsByGroup ( String [ ] tabsGroup , Bundle args ) { } private static void addTab ( Main activity , FragmentTabHost tabHost , TabHost . TabSpec tabSpec , Main . TabInfo tabInfo ) { } private void addTabSpecificListeners ( ) { } @ Override public void onTabChanged ( String tag ) { } private void refreshTabBackgrounds ( ) { } public void sendMessage ( String message ) { } private void setupBluetoothService ( ) { } private void ensureDiscoverable ( ) { } public void discoverBluetoothDevices ( ) { } private void connectToDefaultDevice ( ) { } private void cancelBluetoothActivities ( ) { } @ Override public void onNewMeasurementClick ( ) { } @ Override public void onSyncClick ( ) { } @ Override public void startNewMeasurement ( ) { } public void deviceSelected ( final BluetoothDevice device ) { } public Set < BluetoothDevice > getPairedDevices ( ) { } @ Override public CustomDatabaseAdapter getHistoryDatabaseAdapter ( ) { } @ Override public void onExtraLungsClick ( ) { if ( mRerunMethodStack . contains ( Integer . valueOf ( Main . RERUN_ON_EXTRA_LUNGS_CLICK ) ) ) { return ; } if ( ( ( mCaptureBreathingThread ) != null ) && ( mCaptureBreathingThread . isAlive ( ) ) ) { mCaptureBreathingThread . done ( ) ; return ; } if ( ( ( ( mSyncWithDeviceThread ) != null ) && ( mSyncWithDeviceThread . isAlive ( ) ) ) || ( mRerunMethodStack . contains ( Integer . valueOf ( Main . RERUN_ON_SYNC_CLICK ) ) ) ) { Toast . makeText ( this , "Can't<seq2seq4repair_space>start<seq2seq4repair_space>breathing<seq2seq4repair_space>session<seq2seq4repair_space>while<seq2seq4repair_space>syncing" , LENGTH_LONG ) . show ( ) ; return ; } if ( ( mBluetoothService ) == null ) { setupBluetoothService ( ) ; } if ( ( mBluetoothService . getState ( ) ) != ( BluetoothService . STATE_CONNECTED ) ) { registerForRerun ( Main . RERUN_ON_EXTRA_LUNGS_CLICK ) ; connectToDefaultDevice ( ) ; } else { <START_BUG> String dateTime = new SimpleDateFormat ( "dd-MM-yyyy_HH-mm" , Locale . getDefault ( ) ) . format ( new Date ( ) ) ; <END_BUG> String motherName = getSharedPreferences ( PREFERENCE_FILE , MODE_PRIVATE ) . getString ( "preference_mother_name" , "noname" ) ; String fileName = ( ( motherName + "_" ) + dateTime ) + ".csv" ; mCaptureBreathingThread = new CaptureBreathingThread ( this , mBluetoothService , mHandler , fileName ) ; mCaptureBreathingThread . start ( ) ; } } @ Override public void onPersonalDataClick ( ) { } @ Override public void onSetDefaultDeviceClick ( ) { } @ Override public void onHistoryClearClick ( ) { } private Fragment getFragment ( Class fragmentClass ) { } private class TabInfo { private String mTag ; private Class mClass ; private int mIconId ; @ SuppressWarnings ( "UnusedDeclaration" ) private Bundle mArgs ; private FragmentContainer mFragmentContainer ; TabInfo ( String tag ) { } } class TabFactory implements TabHost . TabContentFactory { private final Context mContext ; public TabFactory ( Context context ) { } public View createTabContent ( String tag ) { } } public static void debugToast ( String message , boolean increaseDuration ) { } }

Fix:
String dateTime = new SimpleDateFormat ( "dd-MM-yyyy_HH-mm-ss" , Locale . getDefault ( ) ) . format ( new Date ( ) ) ;