Program: 199274
Project: 199274
Buggy source:
private void handleConnect(NetworkInfo info){
  final int newNetType=info.getType();
  boolean isFailover=info.isFailover();
  final NetworkStateTracker thisNet=mNetTrackers[newNetType];
  final String thisIface=thisNet.getLinkProperties().getInterfaceName();
  if (VDBG) {
    log("String_Node_Str" + newNetType + "String_Node_Str"+ thisIface+ "String_Node_Str"+ isFailover);
  }
  if (mNetConfigs[newNetType].isDefault()) {
    if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != newNetType) {
      if (isNewNetTypePreferredOverCurrentNetType(newNetType)) {
        String teardownPolicy=SystemProperties.get("String_Node_Str");
        if (TextUtils.equals(teardownPolicy,"String_Node_Str") == false) {
          NetworkStateTracker otherNet=mNetTrackers[mActiveDefaultNetwork];
          if (DBG) {
            log("String_Node_Str" + otherNet.getNetworkInfo().getTypeName() + "String_Node_Str");
          }
          if (!teardown(otherNet)) {
            loge("String_Node_Str");
            teardown(thisNet);
            return;
          }
        }
 else {
          loge("String_Node_Str");
        }
      }
 else {
        if (VDBG) {
          log("String_Node_Str" + "String_Node_Str" + info.getTypeName());
        }
        teardown(thisNet);
        return;
      }
    }
    int thisNetId=nextNetId();
    thisNet.setNetId(thisNetId);
    try {
    }
 catch (    Exception e) {
      loge("String_Node_Str" + e);
      teardown(thisNet);
      return;
    }
    setupDataActivityTracking(newNetType);
synchronized (ConnectivityService.this) {
      if (mNetTransitionWakeLock.isHeld()) {
        mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_CLEAR_NET_TRANSITION_WAKELOCK,mNetTransitionWakeLockSerialNumber,0),1000);
      }
    }
    mActiveDefaultNetwork=newNetType;
    try {
      mNetd.setDefaultNetId(thisNetId);
    }
 catch (    Exception e) {
      loge("String_Node_Str" + e);
    }
    mDefaultInetConditionPublished=0;
    mDefaultConnectionSequence++;
    mInetConditionChangeInFlight=false;
    updateNetworkSettings(thisNet);
  }
 else {
    int thisNetId=nextNetId();
    thisNet.setNetId(thisNetId);
    try {
    }
 catch (    Exception e) {
      loge("String_Node_Str" + e);
      teardown(thisNet);
      return;
    }
  }
  thisNet.setTeardownRequested(false);
  updateMtuSizeSettings(thisNet);
  handleConnectivityChange(newNetType,false);
  sendConnectedBroadcastDelayed(info,getConnectivityChangeDelay());
  if (thisIface != null) {
    try {
      BatteryStatsService.getService().noteNetworkInterfaceType(thisIface,newNetType);
    }
 catch (    RemoteException e) {
    }
  }
}

Fixed version (ground truth):
private void handleConnect(NetworkInfo info){
  final int newNetType=info.getType();
  boolean isFailover=info.isFailover();
  final NetworkStateTracker thisNet=mNetTrackers[newNetType];
  final String thisIface=thisNet.getLinkProperties().getInterfaceName();
  if (VDBG) {
    log("String_Node_Str" + newNetType + "String_Node_Str"+ thisIface+ "String_Node_Str"+ isFailover);
  }
  if (mNetConfigs[newNetType].isDefault()) {
    if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != newNetType) {
      if (isNewNetTypePreferredOverCurrentNetType(newNetType)) {
        String teardownPolicy=SystemProperties.get("String_Node_Str");
        if (TextUtils.equals(teardownPolicy,"String_Node_Str") == false) {
          NetworkStateTracker otherNet=mNetTrackers[mActiveDefaultNetwork];
          if (DBG) {
            log("String_Node_Str" + otherNet.getNetworkInfo().getTypeName() + "String_Node_Str");
          }
          if (!teardown(otherNet)) {
            loge("String_Node_Str");
            teardown(thisNet);
            return;
          }
        }
 else {
          loge("String_Node_Str");
        }
      }
 else {
        if (VDBG) {
          log("String_Node_Str" + "String_Node_Str" + info.getTypeName());
        }
        teardown(thisNet);
        return;
      }
    }
    int thisNetId=nextNetId();
    thisNet.setNetId(thisNetId);
    try {
    }
 catch (    Exception e) {
      loge("String_Node_Str" + e);
      teardown(thisNet);
      return;
    }
synchronized (ConnectivityService.this) {
      if (mNetTransitionWakeLock.isHeld()) {
        mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_CLEAR_NET_TRANSITION_WAKELOCK,mNetTransitionWakeLockSerialNumber,0),1000);
      }
    }
    mActiveDefaultNetwork=newNetType;
    try {
      mNetd.setDefaultNetId(thisNetId);
    }
 catch (    Exception e) {
      loge("String_Node_Str" + e);
    }
    mDefaultInetConditionPublished=0;
    mDefaultConnectionSequence++;
    mInetConditionChangeInFlight=false;
    updateNetworkSettings(thisNet);
  }
 else {
    int thisNetId=nextNetId();
    thisNet.setNetId(thisNetId);
    try {
    }
 catch (    Exception e) {
      loge("String_Node_Str" + e);
      teardown(thisNet);
      return;
    }
  }
  thisNet.setTeardownRequested(false);
  sendConnectedBroadcastDelayed(info,getConnectivityChangeDelay());
  if (thisIface != null) {
    try {
      BatteryStatsService.getService().noteNetworkInterfaceType(thisIface,newNetType);
    }
 catch (    RemoteException e) {
    }
  }
}