Buggy code:
public class MainActivity extends ActionBarActivity implements Handler . Callback , GoogleApiClient . ConnectionCallbacks , GoogleApiClient . OnConnectionFailedListener , MessageApi . MessageListener , Observer , AddContactFragment . OnFragmentInteractionListener , ContactManagementFragment . OnFragmentInteractionListener , ContactSendFragment . OnFragmentInteractionListener , ConversationFragment . OnFragmentInteractionListener , DrawingFragment . OnFragmentInteractionListener , InConversationFragment . OnFragmentInteractionListener , NavigationDrawerFragment . NavigationDrawerCallbacks , SendFragment . OnFragmentInteractionListener { private final String FILENAME = "user" ; private final String MESSAGE = "message" ; private final String TAG = "Sketchagram" ; private Fragment sendFragment ; private Fragment contactSendFragment ; private ConversationFragment conversationFragment ; private InConversationFragment inConversationFragment ; private Fragment contactManagementFragment ; private DrawingFragment drawingFragment ; private FragmentManager fragmentManager ; private Handler mHandler ; private DataMap dataMap ; private IUserManager userManager ; private DrawerLayout mDrawerLayout ; private NavigationDrawerFragment mNavigationDrawerFragment ; private GoogleApiClient mGoogleApiClient ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void startDrawingFragment ( View v ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void showContactSendFragment ( ) { } public void newMessage ( View view ) { } @ Override public void onFragmentInteraction ( Uri uri ) { } @ Override public void onFragmentInteraction ( int conversationId ) { } private void displayFragment ( Fragment fragment ) { } @ Override public void onNavigationDrawerItemSelected ( int position ) { } public void changePassword ( ) { } public void addContact ( View view ) { final Dialog dialog = new Dialog ( this ) ; dialog . setContentView ( add_contact_dialog ) ; dialog . setTitle ( "Add<seq2seq4repair_space>new<seq2seq4repair_space>contact" ) ; ( ( android . widget . Button ) ( dialog . findViewById ( R . id . add_contact_dialog_button ) ) ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { dialog . dismiss ( ) ; String user = ( ( android . widget . EditText ) ( dialog . findViewById ( R . id . user_name_dialog ) ) ) . getText ( ) . toString ( ) ; <START_BUG> if ( MyApplication . getInstance ( ) . getUser ( ) . addContact ( user ) ) { <END_BUG> Toast . makeText ( getApplicationContext ( ) , ( user + "<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>contacts." ) , LENGTH_LONG ) . show ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , ( user + "<seq2seq4repair_space>couldn't<seq2seq4repair_space>be<seq2seq4repair_space>added." ) , LENGTH_LONG ) . show ( ) ; } } } ) ; ( ( android . widget . Button ) ( dialog . findViewById ( R . id . cancel_dialog_button ) ) ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { dialog . dismiss ( ) ; } } ) ; dialog . show ( ) ; } private void tellWatchConnectedState ( final String state ) { } private List < Node > getNodes ( ) { } private ResultCallback < Status > resultCallback ; @ Override public void onMessageReceived ( MessageEvent messageEvent ) { } @ Override public void onConnected ( Bundle bundle ) { } @ Override public void onConnectionSuspended ( int i ) { } @ Override public void onConnectionFailed ( ConnectionResult connectionResult ) { } @ Override public boolean handleMessage ( Message msg ) { } private void sendToWatch ( String msg , final byte [ ] data ) { } @ Override public void onBackPressed ( ) { } @ Override public void update ( Observable observable , Object data ) { } @ Override public void onFragmentInteraction ( String id ) { } No newline ; at end ; of file ; }

Fix:
if ( userManager . addContact ( user ) ) {