Program: 184903
Project: 184903
Buggy source:
/** 
 * Updates the main block of caller info on the CallCard (ie. the stuff in the mainCallCard block) based on the specified Call.
 */
private void displayMainCallStatus(Phone phone,Call call){
  if (DBG)   log("String_Node_Str" + phone + "String_Node_Str"+ call+ "String_Node_Str");
  if (call == null) {
    mMainCallCard.setVisibility(View.GONE);
    return;
  }
  mMainCallCard.setVisibility(View.VISIBLE);
  Call.State state=call.getState();
  if (DBG)   log("String_Node_Str" + call.getState());
  int callCardBackgroundResid=0;
  boolean landscapeMode=InCallScreen.ConfigurationHelper.isLandscape();
  final boolean bluetoothActive=PhoneApp.getInstance().showBluetoothIndication();
switch (state) {
case ACTIVE:
    showCallConnected();
  if (bluetoothActive) {
    callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land : R.drawable.incall_frame_bluetooth_tall_port;
  }
 else {
    callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_connected_tall_land : R.drawable.incall_frame_connected_tall_port;
  }
if (DBG) log("String_Node_Str");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
showCallOnhold();
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_hold_tall_land : R.drawable.incall_frame_hold_tall_port;
mCallTime.cancelTimer();
break;
case DISCONNECTED:
reset();
showCallEnded();
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_ended_tall_land : R.drawable.incall_frame_ended_tall_port;
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
showCallConnecting();
if (bluetoothActive) {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land : R.drawable.incall_frame_bluetooth_tall_port;
}
 else {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_normal_tall_land : R.drawable.incall_frame_normal_tall_port;
}
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
showCallIncoming();
if (bluetoothActive) {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land : R.drawable.incall_frame_bluetooth_tall_port;
}
 else {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_normal_tall_land : R.drawable.incall_frame_normal_tall_port;
}
mCallTime.cancelTimer();
break;
case IDLE:
Log.w(LOG_TAG,"String_Node_Str");
break;
default :
Log.w(LOG_TAG,"String_Node_Str" + state);
break;
}
updateCardTitleWidgets(phone,call);
if (PhoneUtils.isConferenceCall(call)) {
updateDisplayForConference();
}
 else {
Connection conn=call.getEarliestConnection();
int presentation=conn.getNumberPresentation();
if (conn == null) {
if (DBG) log("String_Node_Str");
CallerInfo info=PhoneUtils.getCallerInfo(getContext(),conn);
updateDisplayForPerson(info,presentation,false,call);
}
 else {
if (DBG) log("String_Node_Str" + conn + "String_Node_Str"+ conn.getState());
boolean runQuery=true;
Object o=conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery=mPhotoTracker.isDifferentImageRequest(((PhoneUtils.CallerInfoToken)o).currentInfo);
}
 else {
runQuery=mPhotoTracker.isDifferentImageRequest(conn);
}
if (runQuery) {
if (DBG) log("String_Node_Str");
PhoneUtils.CallerInfoToken info=PhoneUtils.startGetCallerInfo(getContext(),conn,this,call);
updateDisplayForPerson(info.currentInfo,presentation,!info.isFinal,call);
}
 else {
if (DBG) log("String_Node_Str");
if (o instanceof CallerInfo) {
CallerInfo ci=(CallerInfo)o;
if (DBG) log("String_Node_Str" + ci);
updateDisplayForPerson(ci,presentation,false,call);
}
 else if (o instanceof PhoneUtils.CallerInfoToken) {
CallerInfo ci=((PhoneUtils.CallerInfoToken)o).currentInfo;
if (DBG) log("String_Node_Str" + ci);
updateDisplayForPerson(ci,presentation,true,call);
}
 else {
Log.w(LOG_TAG,"String_Node_Str" + "String_Node_Str" + o);
}
}
}
}
updatePhotoForCallState(call);
setMainCallCardBackgroundResource(callCardBackgroundResid);
}

Fixed version (ground truth):
/** 
 * Updates the main block of caller info on the CallCard (ie. the stuff in the mainCallCard block) based on the specified Call.
 */
private void displayMainCallStatus(Phone phone,Call call){
  if (DBG)   log("String_Node_Str" + phone + "String_Node_Str"+ call+ "String_Node_Str");
  if (call == null) {
    mMainCallCard.setVisibility(View.GONE);
    return;
  }
  mMainCallCard.setVisibility(View.VISIBLE);
  Call.State state=call.getState();
  if (DBG)   log("String_Node_Str" + call.getState());
  int callCardBackgroundResid=0;
  boolean landscapeMode=InCallScreen.ConfigurationHelper.isLandscape();
  final boolean bluetoothActive=PhoneApp.getInstance().showBluetoothIndication();
switch (state) {
case ACTIVE:
    showCallConnected();
  if (bluetoothActive) {
    callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land : R.drawable.incall_frame_bluetooth_tall_port;
  }
 else {
    callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_connected_tall_land : R.drawable.incall_frame_connected_tall_port;
  }
if (DBG) log("String_Node_Str");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
showCallOnhold();
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_hold_tall_land : R.drawable.incall_frame_hold_tall_port;
mCallTime.cancelTimer();
break;
case DISCONNECTED:
reset();
showCallEnded();
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_ended_tall_land : R.drawable.incall_frame_ended_tall_port;
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
showCallConnecting();
if (bluetoothActive) {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land : R.drawable.incall_frame_bluetooth_tall_port;
}
 else {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_normal_tall_land : R.drawable.incall_frame_normal_tall_port;
}
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
showCallIncoming();
if (bluetoothActive) {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land : R.drawable.incall_frame_bluetooth_tall_port;
}
 else {
callCardBackgroundResid=landscapeMode ? R.drawable.incall_frame_normal_tall_land : R.drawable.incall_frame_normal_tall_port;
}
mCallTime.cancelTimer();
break;
case IDLE:
Log.w(LOG_TAG,"String_Node_Str");
break;
default :
Log.w(LOG_TAG,"String_Node_Str" + state);
break;
}
updateCardTitleWidgets(phone,call);
if (PhoneUtils.isConferenceCall(call)) {
updateDisplayForConference();
}
 else {
Connection conn=call.getEarliestConnection();
if (conn == null) {
if (DBG) log("String_Node_Str");
CallerInfo info=PhoneUtils.getCallerInfo(getContext(),null);
updateDisplayForPerson(info,Connection.PRESENTATION_ALLOWED,false,call);
}
 else {
if (DBG) log("String_Node_Str" + conn + "String_Node_Str"+ conn.getState());
int presentation=conn.getNumberPresentation();
boolean runQuery=true;
Object o=conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery=mPhotoTracker.isDifferentImageRequest(((PhoneUtils.CallerInfoToken)o).currentInfo);
}
 else {
runQuery=mPhotoTracker.isDifferentImageRequest(conn);
}
if (runQuery) {
if (DBG) log("String_Node_Str");
PhoneUtils.CallerInfoToken info=PhoneUtils.startGetCallerInfo(getContext(),conn,this,call);
updateDisplayForPerson(info.currentInfo,presentation,!info.isFinal,call);
}
 else {
if (DBG) log("String_Node_Str");
if (o instanceof CallerInfo) {
CallerInfo ci=(CallerInfo)o;
if (DBG) log("String_Node_Str" + ci);
updateDisplayForPerson(ci,presentation,false,call);
}
 else if (o instanceof PhoneUtils.CallerInfoToken) {
CallerInfo ci=((PhoneUtils.CallerInfoToken)o).currentInfo;
if (DBG) log("String_Node_Str" + ci);
updateDisplayForPerson(ci,presentation,true,call);
}
 else {
Log.w(LOG_TAG,"String_Node_Str" + "String_Node_Str" + o);
}
}
}
}
updatePhotoForCallState(call);
setMainCallCardBackgroundResource(callCardBackgroundResid);
}