Program: 43304
Project: 43304
Buggy source:
public int startUsingNetworkFeature(int networkType,String feature,IBinder binder){
  if (DBG) {
    Log.d(TAG,"String_Node_Str" + networkType + "String_Node_Str"+ feature);
  }
  enforceChangePermission();
  if (!ConnectivityManager.isNetworkTypeValid(networkType)) {
    return Phone.APN_REQUEST_FAILED;
  }
synchronized (mFeatureUsers) {
    mFeatureUsers.add(new FeatureUser(networkType,feature,binder));
  }
  int usedNetworkType=networkType;
  if (networkType == ConnectivityManager.TYPE_MOBILE) {
    if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_MMS)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_MMS;
    }
 else     if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_SUPL)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_SUPL;
    }
 else     if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_DUN)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_DUN;
    }
 else     if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_HIPRI)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_HIPRI;
    }
  }
  NetworkStateTracker network=mNetTrackers[usedNetworkType];
  if (network != null) {
    if (usedNetworkType != networkType) {
      Integer currentPid=new Integer(getCallingPid());
      NetworkStateTracker radio=mNetTrackers[networkType];
      NetworkInfo ni=network.getNetworkInfo();
      if (ni.isAvailable() == false) {
        if (DBG)         Log.d(TAG,"String_Node_Str");
        return Phone.APN_TYPE_NOT_AVAILABLE;
      }
      if (!mNetRequestersPids[usedNetworkType].contains(currentPid)) {
        mNetRequestersPids[usedNetworkType].add(currentPid);
      }
      if (ni.isConnectedOrConnecting() == true) {
        if (ni.isConnected() == true) {
          handleDnsConfigurationChange();
          if (DBG)           Log.d(TAG,"String_Node_Str");
          return Phone.APN_ALREADY_ACTIVE;
        }
        if (DBG)         Log.d(TAG,"String_Node_Str");
        return Phone.APN_REQUEST_STARTED;
      }
      if (mHandler.hasMessages(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK,radio) || radio.getNetworkInfo().isConnectedOrConnecting()) {
        mHandler.removeMessages(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK,radio);
        mHandler.sendMessageDelayed(mHandler.obtainMessage(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK,radio),getRestoreDefaultNetworkDelay());
      }
      if (DBG)       Log.d(TAG,"String_Node_Str");
      network.reconnect();
      return Phone.APN_REQUEST_STARTED;
    }
 else {
      return network.startUsingNetworkFeature(feature,getCallingPid(),getCallingUid());
    }
  }
  return Phone.APN_TYPE_NOT_AVAILABLE;
}

Fixed version (ground truth):
public int startUsingNetworkFeature(int networkType,String feature,IBinder binder){
  if (DBG) {
    Log.d(TAG,"String_Node_Str" + networkType + "String_Node_Str"+ feature);
  }
  enforceChangePermission();
  if (!ConnectivityManager.isNetworkTypeValid(networkType)) {
    return Phone.APN_REQUEST_FAILED;
  }
synchronized (mFeatureUsers) {
    mFeatureUsers.add(new FeatureUser(networkType,feature,binder));
  }
  int usedNetworkType=networkType;
  if (networkType == ConnectivityManager.TYPE_MOBILE) {
    if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_MMS)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_MMS;
    }
 else     if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_SUPL)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_SUPL;
    }
 else     if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_DUN)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_DUN;
    }
 else     if (TextUtils.equals(feature,Phone.FEATURE_ENABLE_HIPRI)) {
      usedNetworkType=ConnectivityManager.TYPE_MOBILE_HIPRI;
    }
  }
  NetworkStateTracker network=mNetTrackers[usedNetworkType];
  if (network != null) {
    if (usedNetworkType != networkType) {
      Integer currentPid=new Integer(getCallingPid());
      NetworkStateTracker radio=mNetTrackers[networkType];
      NetworkInfo ni=network.getNetworkInfo();
      if (ni.isAvailable() == false) {
        if (DBG)         Log.d(TAG,"String_Node_Str");
        return Phone.APN_TYPE_NOT_AVAILABLE;
      }
      if (!mNetRequestersPids[usedNetworkType].contains(currentPid)) {
        mNetRequestersPids[usedNetworkType].add(currentPid);
      }
      if ((ni.isConnectedOrConnecting() == true) && !network.isTeardownRequested()) {
        if (ni.isConnected() == true) {
          handleDnsConfigurationChange();
          if (DBG)           Log.d(TAG,"String_Node_Str");
          return Phone.APN_ALREADY_ACTIVE;
        }
        if (DBG)         Log.d(TAG,"String_Node_Str");
        return Phone.APN_REQUEST_STARTED;
      }
      if (mHandler.hasMessages(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK,radio) || radio.getNetworkInfo().isConnectedOrConnecting()) {
        mHandler.removeMessages(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK,radio);
        mHandler.sendMessageDelayed(mHandler.obtainMessage(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK,radio),getRestoreDefaultNetworkDelay());
      }
      if (DBG)       Log.d(TAG,"String_Node_Str");
      network.reconnect();
      return Phone.APN_REQUEST_STARTED;
    }
 else {
      return network.startUsingNetworkFeature(feature,getCallingPid(),getCallingUid());
    }
  }
  return Phone.APN_TYPE_NOT_AVAILABLE;
}