Program: 32358
Project: 32358
Buggy source:
public void run(){
  int length;
  byte[] msgBytes;
  ProtocolMessage pm;
  OnStreamRPC notification;
  android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
  try {
    int iCorrID=0;
    PutFile msg=(PutFile)_request;
    sFileName=msg.getSdlFileName();
    long iOffsetCounter=msg.getOffset();
    int priorityCoefficient=1;
    if (lFileSize != 0) {
      Long iFileSize=(long)lFileSize;
      msg.setLength(iFileSize);
    }
    Long iFileLength=msg.getLength();
    notificationList.clear();
    long iSkipBytes=is.skip(iOffsetCounter);
    if (iOffsetCounter != iSkipBytes) {
      handleStreamException(null,null,"String_Node_Str" + sFileName);
    }
    if (callBack != null) {
      callBack.onStart(_request.getCorrelationID(),lFileSize);
    }
    while (!Thread.interrupted()) {
synchronized (mPauseLock) {
        while (mPaused) {
          try {
            mPauseLock.wait();
          }
 catch (          InterruptedException e) {
          }
        }
      }
      length=is.read(buffer,0,BUFF_READ_SIZE);
      if (length == -1)       stop();
      if (length >= 0) {
        if (msg.getOffset() != 0)         msg.setLength((Long)null);
        msgBytes=JsonRPCMarshaller.marshall(msg,_wiproVersion);
        pm=new ProtocolMessage();
        pm.setData(msgBytes);
        pm.setSessionID(_rpcSessionID);
        pm.setMessageType(MessageType.RPC);
        pm.setSessionType(_serviceType);
        pm.setFunctionID(FunctionID.getFunctionId(msg.getFunctionName()));
        if (buffer.length != length)         pm.setBulkData(buffer,length);
 else         pm.setBulkDataNoCopy(buffer);
        pm.setCorrID(msg.getCorrelationID());
        pm.setPayloadProtected(isRPCProtected);
        priorityCoefficient++;
        pm.setPriorityCoefficient(priorityCoefficient);
        notification=new OnStreamRPC();
        notification.setFileName(msg.getSdlFileName());
        notification.setFileSize(iFileLength);
        iOffsetCounter=iOffsetCounter + length;
        notification.setBytesComplete(iOffsetCounter);
        notificationList.put(msg.getCorrelationID(),notification);
        msg.setOffset(iOffsetCounter);
        iCorrID=msg.getCorrelationID() + 1;
        msg.setCorrelationID(iCorrID);
        _streamListener.sendStreamPacket(pm);
      }
    }
  }
 catch (  Exception e) {
    handleStreamException(null,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void run(){
  int length;
  byte[] msgBytes;
  ProtocolMessage pm;
  OnStreamRPC notification;
  android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
  try {
    int iCorrID=0;
    PutFile msg=(PutFile)_request;
    sFileName=msg.getSdlFileName();
    long iOffsetCounter=msg.getOffset();
    int priorityCoefficient=1;
    if (lFileSize != 0) {
      Long iFileSize=(long)lFileSize;
      msg.setLength(iFileSize);
    }
    Long iFileLength=msg.getLength();
    notificationList.clear();
    long iSkipBytes=is.skip(iOffsetCounter);
    if (iOffsetCounter != iSkipBytes) {
      handleStreamException(null,null,"String_Node_Str" + sFileName);
    }
    if (callBack != null) {
      callBack.onStart(_request.getCorrelationID(),lFileSize);
    }
    while (!Thread.interrupted()) {
synchronized (mPauseLock) {
        while (mPaused) {
          try {
            mPauseLock.wait();
          }
 catch (          InterruptedException e) {
          }
        }
      }
      length=is.read(buffer,0,bufferSize);
      if (length == -1)       stop();
      if (length >= 0) {
        if (msg.getOffset() != 0)         msg.setLength((Long)null);
        msgBytes=JsonRPCMarshaller.marshall(msg,_wiproVersion);
        pm=new ProtocolMessage();
        pm.setData(msgBytes);
        pm.setSessionID(_rpcSessionID);
        pm.setMessageType(MessageType.RPC);
        pm.setSessionType(_serviceType);
        pm.setFunctionID(FunctionID.getFunctionId(msg.getFunctionName()));
        if (buffer.length != length)         pm.setBulkData(buffer,length);
 else         pm.setBulkDataNoCopy(buffer);
        pm.setCorrID(msg.getCorrelationID());
        pm.setPayloadProtected(isRPCProtected);
        priorityCoefficient++;
        pm.setPriorityCoefficient(priorityCoefficient);
        notification=new OnStreamRPC();
        notification.setFileName(msg.getSdlFileName());
        notification.setFileSize(iFileLength);
        iOffsetCounter=iOffsetCounter + length;
        notification.setBytesComplete(iOffsetCounter);
        notificationList.put(msg.getCorrelationID(),notification);
        msg.setOffset(iOffsetCounter);
        iCorrID=msg.getCorrelationID() + 1;
        msg.setCorrelationID(iCorrID);
        _streamListener.sendStreamPacket(pm);
      }
    }
  }
 catch (  Exception e) {
    handleStreamException(null,e,"String_Node_Str");
  }
}