Program: 23573
Project: 23573
Buggy source:
public void onReceive(Context context,Intent intent){
synchronized (this) {
    if (intent.getAction().equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
      Phone.DataState state=getMobileDataState(intent);
      String reason=intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
      String apnName=intent.getStringExtra(Phone.DATA_APN_KEY);
      String apnTypeList=intent.getStringExtra(Phone.DATA_APN_TYPES_KEY);
      boolean unavailable=intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
      mNetworkInfo.setIsAvailable(!unavailable);
      if (isApnTypeIncluded(apnTypeList)) {
        if (mEnabled == false) {
          if (state == Phone.DataState.CONNECTED) {
            if (DBG)             Log.d(TAG,"String_Node_Str" + mInterfaceName + "String_Node_Str"+ intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY)+ "String_Node_Str"+ mApnType);
            mInterfaceName=intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
          }
          return;
        }
      }
 else {
        return;
      }
      if (DBG)       Log.d(TAG,mApnType + "String_Node_Str" + state+ "String_Node_Str"+ mMobileDataState+ "String_Node_Str"+ (reason == null ? "String_Node_Str" : reason)+ "String_Node_Str"+ apnTypeList);
      if (mMobileDataState != state) {
        mMobileDataState=state;
switch (state) {
case DISCONNECTED:
          if (isTeardownRequested()) {
            mEnabled=false;
            setTeardownRequested(false);
          }
        setDetailedState(DetailedState.DISCONNECTED,reason,apnName);
      if (mInterfaceName != null) {
        NetworkUtils.resetConnections(mInterfaceName);
      }
    break;
case CONNECTING:
  setDetailedState(DetailedState.CONNECTING,reason,apnName);
break;
case SUSPENDED:
setDetailedState(DetailedState.SUSPENDED,reason,apnName);
break;
case CONNECTED:
mInterfaceName=intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
if (mInterfaceName == null) {
Log.d(TAG,"String_Node_Str");
}
setDetailedState(DetailedState.CONNECTED,reason,apnName);
break;
}
}
}
 else if (intent.getAction().equals(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED)) {
mEnabled=false;
String reason=intent.getStringExtra(Phone.FAILURE_REASON_KEY);
String apnName=intent.getStringExtra(Phone.DATA_APN_KEY);
if (DBG) Log.d(TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ reason == null ? "String_Node_Str" : "String_Node_Str" + reason + "String_Node_Str");
setDetailedState(DetailedState.FAILED,reason,apnName);
}
TelephonyManager tm=TelephonyManager.getDefault();
setRoamingStatus(tm.isNetworkRoaming());
setSubtype(tm.getNetworkType(),tm.getNetworkTypeName());
}
}

Fixed version (ground truth):
public void onReceive(Context context,Intent intent){
synchronized (this) {
    if (intent.getAction().equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
      Phone.DataState state=getMobileDataState(intent);
      String reason=intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
      String apnName=intent.getStringExtra(Phone.DATA_APN_KEY);
      String apnTypeList=intent.getStringExtra(Phone.DATA_APN_TYPES_KEY);
      mApnName=apnName;
      boolean unavailable=intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
      mNetworkInfo.setIsAvailable(!unavailable);
      if (isApnTypeIncluded(apnTypeList)) {
        if (mEnabled == false) {
          if (state == Phone.DataState.CONNECTED) {
            if (DBG)             Log.d(TAG,"String_Node_Str" + mInterfaceName + "String_Node_Str"+ intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY)+ "String_Node_Str"+ mApnType);
            mInterfaceName=intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
          }
          return;
        }
      }
 else {
        return;
      }
      if (DBG)       Log.d(TAG,mApnType + "String_Node_Str" + state+ "String_Node_Str"+ mMobileDataState+ "String_Node_Str"+ (reason == null ? "String_Node_Str" : reason)+ "String_Node_Str"+ apnTypeList);
      if (mMobileDataState != state) {
        mMobileDataState=state;
switch (state) {
case DISCONNECTED:
          if (isTeardownRequested()) {
            mEnabled=false;
            setTeardownRequested(false);
          }
        setDetailedState(DetailedState.DISCONNECTED,reason,apnName);
      if (mInterfaceName != null) {
        NetworkUtils.resetConnections(mInterfaceName);
      }
    break;
case CONNECTING:
  setDetailedState(DetailedState.CONNECTING,reason,apnName);
break;
case SUSPENDED:
setDetailedState(DetailedState.SUSPENDED,reason,apnName);
break;
case CONNECTED:
mInterfaceName=intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
if (mInterfaceName == null) {
Log.d(TAG,"String_Node_Str");
}
setDetailedState(DetailedState.CONNECTED,reason,apnName);
break;
}
}
}
 else if (intent.getAction().equals(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED)) {
mEnabled=false;
String reason=intent.getStringExtra(Phone.FAILURE_REASON_KEY);
String apnName=intent.getStringExtra(Phone.DATA_APN_KEY);
if (DBG) Log.d(TAG,"String_Node_Str" + intent.getAction() + "String_Node_Str"+ reason == null ? "String_Node_Str" : "String_Node_Str" + reason + "String_Node_Str");
setDetailedState(DetailedState.FAILED,reason,apnName);
}
TelephonyManager tm=TelephonyManager.getDefault();
setRoamingStatus(tm.isNetworkRoaming());
setSubtype(tm.getNetworkType(),tm.getNetworkTypeName());
}
}