Program: 183347
Project: 183347
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);
      if (DBG)       Log.d(TAG,mApnType + "String_Node_Str" + intent.getAction()+ "String_Node_Str"+ state+ "String_Node_Str"+ unavailable+ "String_Node_Str"+ (reason == null ? "String_Node_Str" : reason));
      if (isApnTypeIncluded(apnTypeList)) {
        if (mEnabled == false) {
          if (mInterfaceName == null && state == Phone.DataState.CONNECTED) {
            mInterfaceName=intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
          }
 else           if (state == Phone.DataState.DISCONNECTED) {
            mInterfaceName=null;
          }
          if (DBG)           Log.d(TAG,"String_Node_Str");
          return;
        }
      }
 else {
        if (DBG)         Log.d(TAG,"String_Node_Str");
        return;
      }
      mNetworkInfo.setIsAvailable(!unavailable);
      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);
      }
    mInterfaceName=null;
  mDefaultGatewayAddr=0;
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);
      boolean unavailable=intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,false);
      if (DBG)       Log.d(TAG,mApnType + "String_Node_Str" + intent.getAction()+ "String_Node_Str"+ state+ "String_Node_Str"+ mMobileDataState+ "String_Node_Str"+ unavailable+ "String_Node_Str"+ (reason == null ? "String_Node_Str" : reason));
      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);
          }
          if (DBG)           Log.d(TAG,"String_Node_Str");
          return;
        }
      }
 else {
        if (DBG)         Log.d(TAG,"String_Node_Str");
        return;
      }
      mNetworkInfo.setIsAvailable(!unavailable);
      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);
      }
    if (DBG)     Log.d(TAG,"String_Node_Str" + mApnType + "String_Node_Str");
  mInterfaceName=null;
mDefaultGatewayAddr=0;
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());
}
}