Program: 8044
Project: 8044
Buggy source:
private void write(OperationContext context,MetaDataEntry expected,MetaDataEntry entry,boolean isUpdate,boolean resolve) throws OperationException {
  if (entry == null)   throw new IllegalArgumentException("String_Node_Str");
  byte[] rowkey=makeRowKey(entry);
  byte[] column=makeColumnKey(entry);
  byte[] bytes;
  try {
    bytes=getSerializer().serialize(entry);
  }
 catch (  MetaDataException e) {
    throw new OperationException(StatusCode.INTERNAL_ERROR,e.getMessage(),e.getCause());
  }
  OperationResult<Map<byte[],byte[]>> result;
  try {
    Read read=new Read(tableName,rowkey,column);
    result=opex.execute(context,read);
  }
 catch (  OperationException e) {
    String message=String.format("String_Node_Str",e.getMessage());
    Log.error(message,e);
    throw new OperationException(e.getStatus(),message,e);
  }
  byte[] bytesRead=null;
  if (!result.isEmpty())   bytesRead=result.getValue().get(column);
  if (!isUpdate && bytesRead != null) {
    if (resolve && Arrays.equals(bytes,bytesRead)) {
      return;
    }
    String message=String.format("String_Node_Str",entry);
    Log.debug(message);
    throw new OperationException(StatusCode.WRITE_CONFLICT,message);
  }
  if (isUpdate) {
    if (bytesRead == null) {
      String message=String.format("String_Node_Str",entry);
      Log.debug(message);
      throw new OperationException(StatusCode.ENTRY_NOT_FOUND,message);
    }
    if (expected != null) {
      byte[] expectedBytes;
      try {
        expectedBytes=getSerializer().serialize(expected);
      }
 catch (      MetaDataException e) {
        throw new OperationException(StatusCode.INTERNAL_ERROR,e.getMessage(),e);
      }
      if (!Arrays.equals(bytesRead,expectedBytes)) {
        if (resolve && Arrays.equals(bytesRead,bytes)) {
          return;
        }
        String message=String.format("String_Node_Str" + "String_Node_Str",entry);
        Log.trace(message);
        throw new OperationException(StatusCode.WRITE_CONFLICT,message);
      }
    }
  }
  try {
    if (isUpdate && expected == null) {
      Write write=new Write(tableName,rowkey,column,bytes);
      opex.commit(context,write);
    }
 else {
      CompareAndSwap compareAndSwap=new CompareAndSwap(tableName,rowkey,column,bytesRead,bytes);
      opex.commit(context,compareAndSwap);
    }
  }
 catch (  OperationException e) {
    if (resolve && e.getStatus() == StatusCode.WRITE_CONFLICT) {
      try {
        Read read=new Read(tableName,rowkey,column);
        result=opex.execute(context,read);
        if (!result.isEmpty() && Arrays.equals(bytes,result.getValue().get(column)))         return;
      }
 catch (      OperationException e1) {
        String message=String.format("String_Node_Str",e1.getMessage());
        Log.error(message,e1);
        throw new OperationException(e.getStatus(),message,e1);
      }
    }
    String message=String.format("String_Node_Str",e.getMessage());
    if (e.getStatus() != StatusCode.WRITE_CONFLICT)     Log.error(message,e);
    throw new OperationException(e.getStatus(),message,e);
  }
}

Fixed version (ground truth):
private void write(OperationContext context,MetaDataEntry expected,MetaDataEntry entry,boolean isUpdate,boolean resolve) throws OperationException {
  if (entry == null)   throw new IllegalArgumentException("String_Node_Str");
  byte[] rowkey=makeRowKey(entry);
  byte[] column=makeColumnKey(entry);
  byte[] bytes;
  try {
    bytes=getSerializer().serialize(entry);
  }
 catch (  MetaDataException e) {
    throw new OperationException(StatusCode.INTERNAL_ERROR,e.getMessage(),e.getCause());
  }
  OperationResult<Map<byte[],byte[]>> result;
  try {
    Read read=new Read(tableName,rowkey,column);
    result=opex.execute(context,read);
  }
 catch (  OperationException e) {
    String message=String.format("String_Node_Str",e.getMessage());
    Log.error(message,e);
    throw new OperationException(e.getStatus(),message,e);
  }
  byte[] bytesRead=null;
  if (!result.isEmpty())   bytesRead=result.getValue().get(column);
  if (!isUpdate && bytesRead != null) {
    if (resolve && Arrays.equals(bytes,bytesRead)) {
      return;
    }
    String message=String.format("String_Node_Str",entry);
    Log.debug(message);
    throw new OperationException(StatusCode.ENTRY_EXISTS,message);
  }
  if (isUpdate) {
    if (bytesRead == null) {
      String message=String.format("String_Node_Str",entry);
      Log.debug(message);
      throw new OperationException(StatusCode.ENTRY_NOT_FOUND,message);
    }
    if (expected != null) {
      byte[] expectedBytes;
      try {
        expectedBytes=getSerializer().serialize(expected);
      }
 catch (      MetaDataException e) {
        throw new OperationException(StatusCode.INTERNAL_ERROR,e.getMessage(),e);
      }
      if (!Arrays.equals(bytesRead,expectedBytes)) {
        if (resolve && Arrays.equals(bytesRead,bytes)) {
          return;
        }
        String message=String.format("String_Node_Str" + "String_Node_Str",entry);
        Log.trace(message);
        throw new OperationException(StatusCode.WRITE_CONFLICT,message);
      }
    }
  }
  try {
    if (isUpdate && expected == null) {
      Write write=new Write(tableName,rowkey,column,bytes);
      opex.commit(context,write);
    }
 else {
      CompareAndSwap compareAndSwap=new CompareAndSwap(tableName,rowkey,column,bytesRead,bytes);
      opex.commit(context,compareAndSwap);
    }
  }
 catch (  OperationException e) {
    if (resolve && e.getStatus() == StatusCode.WRITE_CONFLICT) {
      try {
        Read read=new Read(tableName,rowkey,column);
        result=opex.execute(context,read);
        if (!result.isEmpty() && Arrays.equals(bytes,result.getValue().get(column)))         return;
      }
 catch (      OperationException e1) {
        String message=String.format("String_Node_Str",e1.getMessage());
        Log.error(message,e1);
        throw new OperationException(e.getStatus(),message,e1);
      }
    }
    String message=String.format("String_Node_Str",e.getMessage());
    if (e.getStatus() != StatusCode.WRITE_CONFLICT)     Log.error(message,e);
    throw new OperationException(e.getStatus(),message,e);
  }
}