Program: 143804
Project: 143804
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == R.id.action_call) {
    Intent call=new Intent(Intent.ACTION_CALL);
    SMSFragment frag=(SMSFragment)pages.get(PAGE_SMS);
    call.setData(Uri.parse("String_Node_Str" + frag.phoneContact));
    startActivity(call);
    return true;
  }
 else   if (id == R.id.action_voir_contact) {
    if (contactsList.contains(Global.conversationsList.get(currentConversation))) {
      Uri contactUri=ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,Global.conversationsList.get(currentConversation).getId());
      Intent look=new Intent(Intent.ACTION_VIEW,contactUri);
      look.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      startActivity(look);
    }
 else {
      LheidoContact c=Global.conversationsList.get(currentConversation);
      Intent intent=new Intent(Intent.ACTION_INSERT);
      intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
      intent.putExtra(ContactsContract.Intents.Insert.PHONE,c.getPhone());
      startActivityForResult(intent,PICK_CONTACT);
    }
    return true;
  }
 else   if (id == R.id.action_new_conversation) {
    final Context context=this;
    LheidoUtils.LheidoDialog dialog=new LheidoUtils.LheidoDialog(this,R.layout.new_conversation,"String_Node_Str"){
      LheidoContact contact=null;
      @Override public void customInit(){
        final AutoCompleteTextView entry=(AutoCompleteTextView)findViewById(R.id.new_conversation_phone);
        if (entry != null) {
          entry.setAdapter(new AutoCompleteAdapter(context,R.layout.auto_complete,contactsList));
        }
        entry.setThreshold(1);
        entry.setOnItemClickListener(new AdapterView.OnItemClickListener(){
          @Override public void onItemClick(          AdapterView<?> adapterView,          View view,          int position,          long l){
            contact=contactsList.get(position);
            entry.setText(contact.getName());
          }
        }
);
      }
      @Override public void customCancel(){
      }
      @Override public void cancel(){
        super.cancel();
        contact=null;
      }
      @Override public void customOk(){
        AutoCompleteTextView nConversationPhone=(AutoCompleteTextView)findViewById(R.id.new_conversation_phone);
        String str=nConversationPhone.getText().toString();
        if (!PhoneNumberUtils.isGlobalPhoneNumber(str)) {
          if (contact == null) {
            for (            LheidoContact tmp : contactsList) {
              if (tmp.getName().equals(str))               contact=tmp;
            }
          }
          if (contact != null) {
            int position=-1;
            for (            LheidoContact c : Global.conversationsList) {
              if (c.getName().equals(contact.getName()))               position=Global.conversationsList.indexOf(c);
            }
            if (position != -1) {
              onNavigationDrawerItemSelected(position,Global.conversationsList.get(position));
            }
 else {
              createNewConversation(contact,str);
            }
          }
 else {
            Toast.makeText(context,R.string.error_contact_name,Toast.LENGTH_SHORT).show();
          }
        }
 else {
          int position=-1;
          for (          LheidoContact c : Global.conversationsList) {
            if (c.getName().equals(str))             position=Global.conversationsList.indexOf(c);
          }
          if (position != -1) {
            onNavigationDrawerItemSelected(position,Global.conversationsList.get(position));
          }
 else {
            createNewConversation(new LheidoContact(str,str,0L,null),str);
          }
        }
        contact=null;
      }
    }
;
    dialog.show();
    return true;
  }
 else   if (id == R.id.action_settings) {
    Intent intent;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      intent=new Intent(this,LheidoSMSPreference.class);
    }
 else {
      intent=new Intent(this,LheidoSMSPreferenceOldApi.class);
    }
    if (intent.resolveActivity(getPackageManager()) != null) {
      startActivity(intent);
    }
    return true;
  }
 else   if (id == R.id.action_delete_old) {
    if (userPref.old_message) {
      Intent i=new Intent(getApplicationContext(),DeleteOldSMSService.class);
      startService(i);
    }
 else {
      Toast.makeText(this,R.string.old_message_false,Toast.LENGTH_SHORT).show();
    }
  }
  return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == R.id.action_call) {
    Intent call=new Intent(Intent.ACTION_CALL);
    SMSFragment frag=(SMSFragment)pages.get(PAGE_SMS);
    call.setData(Uri.parse("String_Node_Str" + frag.phoneContact));
    startActivity(call);
    return true;
  }
 else   if (id == R.id.action_voir_contact) {
    if (!PhoneNumberUtils.isGlobalPhoneNumber(Global.conversationsList.get(currentConversation).getName())) {
      Uri contactUri=ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,Global.conversationsList.get(currentConversation).getId());
      Intent look=new Intent(Intent.ACTION_VIEW,contactUri);
      look.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      startActivity(look);
    }
 else {
      LheidoContact c=Global.conversationsList.get(currentConversation);
      Intent intent=new Intent(Intent.ACTION_INSERT);
      intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
      intent.putExtra(ContactsContract.Intents.Insert.PHONE,c.getPhone());
      startActivityForResult(intent,PICK_CONTACT);
    }
    return true;
  }
 else   if (id == R.id.action_new_conversation) {
    final Context context=this;
    LheidoUtils.LheidoDialog dialog=new LheidoUtils.LheidoDialog(this,R.layout.new_conversation,"String_Node_Str"){
      LheidoContact contact=null;
      @Override public void customInit(){
        final AutoCompleteTextView entry=(AutoCompleteTextView)findViewById(R.id.new_conversation_phone);
        if (entry != null) {
          entry.setAdapter(new AutoCompleteAdapter(context,R.layout.auto_complete,contactsList));
        }
        entry.setThreshold(1);
        entry.setOnItemClickListener(new AdapterView.OnItemClickListener(){
          @Override public void onItemClick(          AdapterView<?> adapterView,          View view,          int position,          long l){
            contact=contactsList.get(position);
            entry.setText(contact.getName());
          }
        }
);
      }
      @Override public void customCancel(){
      }
      @Override public void cancel(){
        super.cancel();
        contact=null;
      }
      @Override public void customOk(){
        AutoCompleteTextView nConversationPhone=(AutoCompleteTextView)findViewById(R.id.new_conversation_phone);
        String str=nConversationPhone.getText().toString();
        if (!PhoneNumberUtils.isGlobalPhoneNumber(str)) {
          if (contact == null) {
            for (            LheidoContact tmp : contactsList) {
              if (tmp.getName().equals(str))               contact=tmp;
            }
          }
          if (contact != null) {
            int position=-1;
            for (            LheidoContact c : Global.conversationsList) {
              if (c.getName().equals(contact.getName()))               position=Global.conversationsList.indexOf(c);
            }
            if (position != -1) {
              onNavigationDrawerItemSelected(position,Global.conversationsList.get(position));
            }
 else {
              createNewConversation(contact,str);
            }
          }
 else {
            Toast.makeText(context,R.string.error_contact_name,Toast.LENGTH_SHORT).show();
          }
        }
 else {
          int position=-1;
          for (          LheidoContact c : Global.conversationsList) {
            if (c.getName().equals(str))             position=Global.conversationsList.indexOf(c);
          }
          if (position != -1) {
            onNavigationDrawerItemSelected(position,Global.conversationsList.get(position));
          }
 else {
            createNewConversation(new LheidoContact(str,str,0L,null),str);
          }
        }
        contact=null;
      }
    }
;
    dialog.show();
    return true;
  }
 else   if (id == R.id.action_settings) {
    Intent intent;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      intent=new Intent(this,LheidoSMSPreference.class);
    }
 else {
      intent=new Intent(this,LheidoSMSPreferenceOldApi.class);
    }
    if (intent.resolveActivity(getPackageManager()) != null) {
      startActivity(intent);
    }
    return true;
  }
 else   if (id == R.id.action_delete_old) {
    if (userPref.old_message) {
      Intent i=new Intent(getApplicationContext(),DeleteOldSMSService.class);
      startService(i);
    }
 else {
      Toast.makeText(this,R.string.old_message_false,Toast.LENGTH_SHORT).show();
    }
  }
  return super.onOptionsItemSelected(item);
}