nus-yam/ex-repair huggingface dataset:
Program: 89418
Project: 89418
Buggy source:
public Attribute findAttribute(String name){
  for (  Attribute attr : _attributes) {
    if (attr.columnName.equals(GenericDao.REMOVED) && attr.isUpdatable()) {
      return null;
    }
    if (attr.columnName.equals(name)) {
      return attr;
    }
  }
  return null;
}

Fixed version (ground truth):
public Attribute findAttribute(String name){
  for (  Attribute attr : _attributes) {
    if (attr.columnName.equalsIgnoreCase(name)) {
      if (attr.columnName.equalsIgnoreCase(GenericDao.REMOVED) && attr.isUpdatable()) {
        return null;
      }
      return attr;
    }
  }
  return null;
}
Program: 89419
Project: 89419
Buggy source:
public Attribute findAttribute(String name){
  for (  Attribute attr : _attributes) {
    if (attr.columnName.equals(GenericDao.REMOVED) && attr.isUpdatable()) {
      return null;
    }
    if (attr.columnName.equals(name)) {
      return attr;
    }
  }
  return null;
}

Fixed version (ground truth):
public Attribute findAttribute(String name){
  for (  Attribute attr : _attributes) {
    if (attr.columnName.equalsIgnoreCase(name)) {
      if (attr.columnName.equalsIgnoreCase(GenericDao.REMOVED) && attr.isUpdatable()) {
        return null;
      }
      return attr;
    }
  }
  return null;
}
Program: 89420
Project: 89420
Buggy source:
public Attribute findAttribute(String name){
  for (  Attribute attr : _attributes) {
    if (attr.columnName.equals(GenericDao.REMOVED) && attr.isUpdatable()) {
      return null;
    }
    if (attr.columnName.equals(name)) {
      return attr;
    }
  }
  return null;
}

Fixed version (ground truth):
public Attribute findAttribute(String name){
  for (  Attribute attr : _attributes) {
    if (attr.columnName.equalsIgnoreCase(name)) {
      if (attr.columnName.equalsIgnoreCase(GenericDao.REMOVED) && attr.isUpdatable()) {
        return null;
      }
      return attr;
    }
  }
  return null;
}
Program: 89421
Project: 89421
Buggy source:
public static ByteBuffer doDecompress(ByteBuffer buffer){
  byte[] byteArrayIn=new byte[1024];
  ByteArrayInputStream byteIn;
  if (buffer.hasArray()) {
    byteIn=new ByteArrayInputStream(buffer.array(),buffer.position() + buffer.arrayOffset(),buffer.remaining());
  }
 else {
    byte[] array=new byte[buffer.limit() - buffer.position()];
    buffer.get(array);
    byteIn=new ByteArrayInputStream(array);
  }
  ByteBuffer retBuff=ByteBuffer.allocate(65535);
  int len=0;
  try {
    GZIPInputStream in=new GZIPInputStream(byteIn);
    while ((len=in.read(byteArrayIn)) > 0) {
      retBuff.put(byteArrayIn,0,len);
    }
    in.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  retBuff.flip();
  return retBuff;
}

Fixed version (ground truth):
public static ByteBuffer doDecompress(ByteBuffer buffer,int length){
  byte[] byteArrayIn=new byte[1024];
  ByteArrayInputStream byteIn;
  if (buffer.hasArray()) {
    byteIn=new ByteArrayInputStream(buffer.array(),buffer.position() + buffer.arrayOffset(),buffer.remaining());
  }
 else {
    byte[] array=new byte[buffer.limit() - buffer.position()];
    buffer.get(array);
    byteIn=new ByteArrayInputStream(array);
  }
  ByteBuffer retBuff=ByteBuffer.allocate(length);
  int len=0;
  try {
    GZIPInputStream in=new GZIPInputStream(byteIn);
    while ((len=in.read(byteArrayIn)) > 0) {
      retBuff.put(byteArrayIn,0,len);
    }
    in.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  retBuff.flip();
  return retBuff;
}
Program: 89422
Project: 89422
Buggy source:
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  if (tmp.capacity() >= 8192) {
    tmp=doCompress(tmp);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}

Fixed version (ground truth):
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  int capacity=tmp.capacity();
  if (capacity >= 8192) {
    tmp=doCompress(tmp,capacity);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(capacity);
  return buffers;
}
Program: 89423
Project: 89423
Buggy source:
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}

Fixed version (ground truth):
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff,size);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}
Program: 89424
Project: 89424
Buggy source:
public static ByteBuffer doCompress(ByteBuffer buffer){
  ByteArrayOutputStream byteOut=new ByteArrayOutputStream(65535);
  byte[] array=new byte[buffer.capacity()];
  buffer.get(array);
  try {
    GZIPOutputStream out=new GZIPOutputStream(byteOut,65535);
    out.write(array);
    out.finish();
    out.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  return ByteBuffer.wrap(byteOut.toByteArray());
}

Fixed version (ground truth):
public static ByteBuffer doCompress(ByteBuffer buffer,int length){
  ByteArrayOutputStream byteOut=new ByteArrayOutputStream(length);
  byte[] array;
  if (buffer.hasArray()) {
    array=buffer.array();
  }
 else {
    array=new byte[buffer.capacity()];
    buffer.get(array);
  }
  try {
    GZIPOutputStream out=new GZIPOutputStream(byteOut,length);
    out.write(array);
    out.finish();
    out.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  return ByteBuffer.wrap(byteOut.toByteArray());
}
Program: 89427
Project: 89427
Buggy source:
public static ByteBuffer doDecompress(ByteBuffer buffer){
  byte[] byteArrayIn=new byte[1024];
  ByteArrayInputStream byteIn;
  if (buffer.hasArray()) {
    byteIn=new ByteArrayInputStream(buffer.array(),buffer.position() + buffer.arrayOffset(),buffer.remaining());
  }
 else {
    byte[] array=new byte[buffer.limit() - buffer.position()];
    buffer.get(array);
    byteIn=new ByteArrayInputStream(array);
  }
  ByteBuffer retBuff=ByteBuffer.allocate(65535);
  int len=0;
  try {
    GZIPInputStream in=new GZIPInputStream(byteIn);
    while ((len=in.read(byteArrayIn)) > 0) {
      retBuff.put(byteArrayIn,0,len);
    }
    in.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  retBuff.flip();
  return retBuff;
}

Fixed version (ground truth):
public static ByteBuffer doDecompress(ByteBuffer buffer,int length){
  byte[] byteArrayIn=new byte[1024];
  ByteArrayInputStream byteIn;
  if (buffer.hasArray()) {
    byteIn=new ByteArrayInputStream(buffer.array(),buffer.position() + buffer.arrayOffset(),buffer.remaining());
  }
 else {
    byte[] array=new byte[buffer.limit() - buffer.position()];
    buffer.get(array);
    byteIn=new ByteArrayInputStream(array);
  }
  ByteBuffer retBuff=ByteBuffer.allocate(length);
  int len=0;
  try {
    GZIPInputStream in=new GZIPInputStream(byteIn);
    while ((len=in.read(byteArrayIn)) > 0) {
      retBuff.put(byteArrayIn,0,len);
    }
    in.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  retBuff.flip();
  return retBuff;
}
Program: 89428
Project: 89428
Buggy source:
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  if (tmp.capacity() >= 8192) {
    tmp=doCompress(tmp);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}

Fixed version (ground truth):
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  int capacity=tmp.capacity();
  if (capacity >= 8192) {
    tmp=doCompress(tmp,capacity);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(capacity);
  return buffers;
}
Program: 89429
Project: 89429
Buggy source:
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}

Fixed version (ground truth):
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff,size);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}
Program: 89430
Project: 89430
Buggy source:
public static ByteBuffer doCompress(ByteBuffer buffer){
  ByteArrayOutputStream byteOut=new ByteArrayOutputStream(65535);
  byte[] array=new byte[buffer.capacity()];
  buffer.get(array);
  try {
    GZIPOutputStream out=new GZIPOutputStream(byteOut,65535);
    out.write(array);
    out.finish();
    out.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  return ByteBuffer.wrap(byteOut.toByteArray());
}

Fixed version (ground truth):
public static ByteBuffer doCompress(ByteBuffer buffer,int length){
  ByteArrayOutputStream byteOut=new ByteArrayOutputStream(length);
  byte[] array;
  if (buffer.hasArray()) {
    array=buffer.array();
  }
 else {
    array=new byte[buffer.capacity()];
    buffer.get(array);
  }
  try {
    GZIPOutputStream out=new GZIPOutputStream(byteOut,length);
    out.write(array);
    out.finish();
    out.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  return ByteBuffer.wrap(byteOut.toByteArray());
}
Program: 89432
Project: 89432
Buggy source:
@Override public DomainResponse createDomainResponse(Domain domain){
  DomainResponse domainResponse=new DomainResponse();
  domainResponse.setDomainName(domain.getName());
  domainResponse.setId(domain.getId());
  domainResponse.setLevel(domain.getLevel());
  domainResponse.setParentDomainId(domain.getParent());
  if (domain.getParent() != null) {
    domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());
  }
  if (domain.getChildCount() > 0) {
    domainResponse.setHasChild(true);
  }
  domainResponse.setObjectName("String_Node_Str");
  return domainResponse;
}

Fixed version (ground truth):
@Override public DomainResponse createDomainResponse(Domain domain){
  DomainResponse domainResponse=new DomainResponse();
  domainResponse.setDomainName(domain.getName());
  domainResponse.setId(domain.getId());
  domainResponse.setLevel(domain.getLevel());
  domainResponse.setNetworkDomain(domain.getNetworkDomain());
  domainResponse.setParentDomainId(domain.getParent());
  if (domain.getParent() != null) {
    domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());
  }
  if (domain.getChildCount() > 0) {
    domainResponse.setHasChild(true);
  }
  domainResponse.setObjectName("String_Node_Str");
  return domainResponse;
}
Program: 89433
Project: 89433
Buggy source:
/** 
 * Creates a new zone
 * @param userId
 * @param zoneName
 * @param dns1
 * @param dns2
 * @param internalDns1
 * @param internalDns2
 * @param vnetRange
 * @param guestCidr
 * @param zoneType
 * @param allocationState
 * @return
 * @throws 
     * @throws 
 */
DataCenterVO createZone(long userId,String zoneName,String dns1,String dns2,String internalDns1,String internalDns2,String vnetRange,String guestCidr,String domain,Long domainId,NetworkType zoneType,boolean isSecurityGroupEnabled,String allocationState);

Fixed version (ground truth):
/** 
 * Creates a new zone
 * @param userId
 * @param zoneName
 * @param dns1
 * @param dns2
 * @param internalDns1
 * @param internalDns2
 * @param vnetRange
 * @param guestCidr
 * @param zoneType
 * @param allocationState
 * @param networkDomain TODO
 * @return
 * @throws 
     * @throws 
 */
DataCenterVO createZone(long userId,String zoneName,String dns1,String dns2,String internalDns1,String internalDns2,String vnetRange,String guestCidr,String domain,Long domainId,NetworkType zoneType,boolean isSecurityGroupEnabled,String allocationState,String networkDomain);
Program: 89437
Project: 89437
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _name=name;
  ComponentLocator locator=ComponentLocator.getCurrentLocator();
  ConfigurationDao configDao=locator.getDao(ConfigurationDao.class);
  if (configDao == null) {
    throw new ConfigurationException("String_Node_Str");
  }
  Map<String,String> configs=configDao.getConfiguration();
  String value=configs.get("String_Node_Str");
  _maxSessionCount=NumbersUtil.parseInt(value,ConsoleProxyManager.DEFAULT_PROXY_CAPACITY);
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _name=name;
  ComponentLocator locator=ComponentLocator.getCurrentLocator();
  ConfigurationDao configDao=locator.getDao(ConfigurationDao.class);
  if (configDao == null) {
    throw new ConfigurationException("String_Node_Str");
  }
  Map<String,String> configs=configDao.getConfiguration();
  return true;
}
Program: 89438
Project: 89438
Buggy source:
public static ByteBuffer doDecompress(ByteBuffer buffer){
  byte[] byteArrayIn=new byte[1024];
  ByteArrayInputStream byteIn;
  if (buffer.hasArray()) {
    byteIn=new ByteArrayInputStream(buffer.array(),buffer.position() + buffer.arrayOffset(),buffer.remaining());
  }
 else {
    byte[] array=new byte[buffer.limit() - buffer.position()];
    buffer.get(array);
    byteIn=new ByteArrayInputStream(array);
  }
  ByteBuffer retBuff=ByteBuffer.allocate(65535);
  int len=0;
  try {
    GZIPInputStream in=new GZIPInputStream(byteIn);
    while ((len=in.read(byteArrayIn)) > 0) {
      retBuff.put(byteArrayIn,0,len);
    }
    in.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  retBuff.flip();
  return retBuff;
}

Fixed version (ground truth):
public static ByteBuffer doDecompress(ByteBuffer buffer,int length){
  byte[] byteArrayIn=new byte[1024];
  ByteArrayInputStream byteIn;
  if (buffer.hasArray()) {
    byteIn=new ByteArrayInputStream(buffer.array(),buffer.position() + buffer.arrayOffset(),buffer.remaining());
  }
 else {
    byte[] array=new byte[buffer.limit() - buffer.position()];
    buffer.get(array);
    byteIn=new ByteArrayInputStream(array);
  }
  ByteBuffer retBuff=ByteBuffer.allocate(length);
  int len=0;
  try {
    GZIPInputStream in=new GZIPInputStream(byteIn);
    while ((len=in.read(byteArrayIn)) > 0) {
      retBuff.put(byteArrayIn,0,len);
    }
    in.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  retBuff.flip();
  return retBuff;
}
Program: 89439
Project: 89439
Buggy source:
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  if (tmp.capacity() >= 8192) {
    tmp=doCompress(tmp);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}

Fixed version (ground truth):
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  int capacity=tmp.capacity();
  if (capacity >= 8192) {
    tmp=doCompress(tmp,capacity);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(capacity);
  return buffers;
}
Program: 89440
Project: 89440
Buggy source:
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}

Fixed version (ground truth):
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff,size);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}
Program: 89441
Project: 89441
Buggy source:
public static ByteBuffer doCompress(ByteBuffer buffer){
  ByteArrayOutputStream byteOut=new ByteArrayOutputStream(65535);
  byte[] array=new byte[buffer.capacity()];
  buffer.get(array);
  try {
    GZIPOutputStream out=new GZIPOutputStream(byteOut,65535);
    out.write(array);
    out.finish();
    out.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  return ByteBuffer.wrap(byteOut.toByteArray());
}

Fixed version (ground truth):
public static ByteBuffer doCompress(ByteBuffer buffer,int length){
  ByteArrayOutputStream byteOut=new ByteArrayOutputStream(length);
  byte[] array;
  if (buffer.hasArray()) {
    array=buffer.array();
  }
 else {
    array=new byte[buffer.capacity()];
    buffer.get(array);
  }
  try {
    GZIPOutputStream out=new GZIPOutputStream(byteOut,length);
    out.write(array);
    out.finish();
    out.close();
  }
 catch (  IOException e) {
    s_logger.error("String_Node_Str",e);
  }
  return ByteBuffer.wrap(byteOut.toByteArray());
}
Program: 89442
Project: 89442
Buggy source:
@Override public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates,Map<Long,Integer> loadInfo,long dataCenterId){
  if (candidates != null) {
    List<ConsoleProxyVO> allocationList=new ArrayList<ConsoleProxyVO>();
    for (    ConsoleProxyVO proxy : candidates) {
      Integer load=loadInfo.get(proxy.getId());
      if (load == null || load < _maxSessionCount) {
        allocationList.add(proxy);
      }
    }
    if (allocationList.size() > 0)     return allocationList.get(_rand.nextInt(allocationList.size()));
  }
  return null;
}

Fixed version (ground truth):
@Override public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates,final Map<Long,Integer> loadInfo,long dataCenterId){
  if (candidates != null) {
    List<ConsoleProxyVO> allocationList=new ArrayList<ConsoleProxyVO>();
    for (    ConsoleProxyVO proxy : candidates) {
      allocationList.add(proxy);
    }
    Collections.sort(candidates,new Comparator<ConsoleProxyVO>(){
      @Override public int compare(      ConsoleProxyVO x,      ConsoleProxyVO y){
        Integer loadOfX=loadInfo.get(x.getId());
        Integer loadOfY=loadInfo.get(y.getId());
        if (loadOfX != null && loadOfY != null) {
          if (loadOfX < loadOfY)           return -1;
 else           if (loadOfX > loadOfY)           return 1;
          return 0;
        }
 else         if (loadOfX == null && loadOfY == null) {
          return 0;
        }
 else {
          if (loadOfX == null)           return -1;
          return 1;
        }
      }
    }
);
    if (allocationList.size() > 0)     return allocationList.get(0);
  }
  return null;
}
Program: 89443
Project: 89443
Buggy source:
@Override public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates,Map<Long,Integer> loadInfo,long dataCenterId){
  if (candidates != null) {
    List<ConsoleProxyVO> allocationList=new ArrayList<ConsoleProxyVO>();
    for (    ConsoleProxyVO proxy : candidates) {
      Integer load=loadInfo.get(proxy.getId());
      if (load == null || load < _maxSessionCount) {
        allocationList.add(proxy);
      }
    }
    if (allocationList.size() > 0)     return allocationList.get(_rand.nextInt(allocationList.size()));
  }
  return null;
}

Fixed version (ground truth):
@Override public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates,final Map<Long,Integer> loadInfo,long dataCenterId){
  if (candidates != null) {
    List<ConsoleProxyVO> allocationList=new ArrayList<ConsoleProxyVO>();
    for (    ConsoleProxyVO proxy : candidates) {
      allocationList.add(proxy);
    }
    Collections.sort(candidates,new Comparator<ConsoleProxyVO>(){
      @Override public int compare(      ConsoleProxyVO x,      ConsoleProxyVO y){
        Integer loadOfX=loadInfo.get(x.getId());
        Integer loadOfY=loadInfo.get(y.getId());
        if (loadOfX != null && loadOfY != null) {
          if (loadOfX < loadOfY)           return -1;
 else           if (loadOfX > loadOfY)           return 1;
          return 0;
        }
 else         if (loadOfX == null && loadOfY == null) {
          return 0;
        }
 else {
          if (loadOfX == null)           return -1;
          return 1;
        }
      }
    }
);
    if (allocationList.size() > 0)     return allocationList.get(0);
  }
  return null;
}
Program: 89444
Project: 89444
Buggy source:
@Override public void performDataMigration(Connection conn){
}

Fixed version (ground truth):
@Override public void performDataMigration(Connection conn){
  dropKeysIfExist(conn);
}
Program: 89445
Project: 89445
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _name=name;
  ComponentLocator locator=ComponentLocator.getCurrentLocator();
  ConfigurationDao configDao=locator.getDao(ConfigurationDao.class);
  if (configDao == null) {
    throw new ConfigurationException("String_Node_Str");
  }
  Map<String,String> configs=configDao.getConfiguration();
  String value=configs.get("String_Node_Str");
  _maxSessionCount=NumbersUtil.parseInt(value,ConsoleProxyManager.DEFAULT_PROXY_CAPACITY);
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _name=name;
  ComponentLocator locator=ComponentLocator.getCurrentLocator();
  ConfigurationDao configDao=locator.getDao(ConfigurationDao.class);
  if (configDao == null) {
    throw new ConfigurationException("String_Node_Str");
  }
  Map<String,String> configs=configDao.getConfiguration();
  return true;
}
Program: 89446
Project: 89446
Buggy source:
@Override public void performDataMigration(Connection conn){
}

Fixed version (ground truth):
@Override public void performDataMigration(Connection conn){
  dropKeysIfExist(conn);
}
Program: 89447
Project: 89447
Buggy source:
@DB protected VolumeVO createVolumeFromSnapshot(VolumeVO volume,long snapshotId){
  VolumeVO createdVolume=null;
  SnapshotVO snapshot=_snapshotDao.findById(snapshotId);
  Pair<VolumeVO,String> volumeDetails=createVolumeFromSnapshot(volume,snapshot);
  createdVolume=volumeDetails.first();
  Transaction txn=Transaction.currentTxn();
  txn.start();
  Long diskOfferingId=volume.getDiskOfferingId();
  if (createdVolume.getPath() != null) {
    Long offeringId=null;
    if (diskOfferingId != null) {
      DiskOfferingVO offering=_diskOfferingDao.findById(diskOfferingId);
      if (offering != null && (offering.getType() == DiskOfferingVO.Type.Disk)) {
        offeringId=offering.getId();
      }
    }
    UsageEventVO usageEvent=new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE,volume.getAccountId(),volume.getDataCenterId(),volume.getId(),volume.getName(),offeringId,null,createdVolume.getSize());
    _usageEventDao.persist(usageEvent);
  }
  txn.commit();
  return createdVolume;
}

Fixed version (ground truth):
protected VolumeVO createVolumeFromSnapshot(VolumeVO volume,long snapshotId){
  VolumeVO createdVolume=null;
  SnapshotVO snapshot=_snapshotDao.findById(snapshotId);
  Pair<VolumeVO,String> volumeDetails=createVolumeFromSnapshot(volume,snapshot);
  createdVolume=volumeDetails.first();
  return createdVolume;
}
Program: 89448
Project: 89448
Buggy source:
@Override public void cleanupForServer(long msId){
  s_logger.info("String_Node_Str" + msId);
  PreparedStatement pstmt=null;
  try {
    pstmt=_conn.prepareStatement(CLEANUP_MGMT_LOCKS_SQL);
    pstmt.setLong(1,_msId);
    int rows=pstmt.executeUpdate();
    s_logger.info("String_Node_Str" + rows + "String_Node_Str"+ msId);
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
 finally {
    try {
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void cleanupForServer(long msId){
  s_logger.info("String_Node_Str" + msId);
  PreparedStatement pstmt=null;
  try {
    pstmt=_conn.prepareStatement(CLEANUP_MGMT_LOCKS_SQL);
    pstmt.setLong(1,msId);
    int rows=pstmt.executeUpdate();
    s_logger.info("String_Node_Str" + rows + "String_Node_Str"+ msId);
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
 finally {
    try {
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
}
Program: 89449
Project: 89449
Buggy source:
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  buffers[1]=ByteBuffer.wrap(_content.getBytes());
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}

Fixed version (ground truth):
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  if (tmp.capacity() >= 8192) {
    tmp=doCompress(tmp);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}
Program: 89450
Project: 89450
Buggy source:
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  final ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}

Fixed version (ground truth):
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}
Program: 89451
Project: 89451
Buggy source:
@DB protected VolumeVO createVolumeFromSnapshot(VolumeVO volume,long snapshotId){
  VolumeVO createdVolume=null;
  SnapshotVO snapshot=_snapshotDao.findById(snapshotId);
  Transaction txn=Transaction.currentTxn();
  txn.start();
  Pair<VolumeVO,String> volumeDetails=createVolumeFromSnapshot(volume,snapshot);
  createdVolume=volumeDetails.first();
  Long diskOfferingId=volume.getDiskOfferingId();
  if (createdVolume.getPath() != null) {
    Long offeringId=null;
    if (diskOfferingId != null) {
      DiskOfferingVO offering=_diskOfferingDao.findById(diskOfferingId);
      if (offering != null && (offering.getType() == DiskOfferingVO.Type.Disk)) {
        offeringId=offering.getId();
      }
    }
    UsageEventVO usageEvent=new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE,volume.getAccountId(),volume.getDataCenterId(),volume.getId(),volume.getName(),offeringId,null,createdVolume.getSize());
    _usageEventDao.persist(usageEvent);
  }
  txn.commit();
  return createdVolume;
}

Fixed version (ground truth):
protected VolumeVO createVolumeFromSnapshot(VolumeVO volume,long snapshotId){
  VolumeVO createdVolume=null;
  SnapshotVO snapshot=_snapshotDao.findById(snapshotId);
  Transaction txn=Transaction.currentTxn();
  txn.start();
  Pair<VolumeVO,String> volumeDetails=createVolumeFromSnapshot(volume,snapshot);
  createdVolume=volumeDetails.first();
  return createdVolume;
}
Program: 89452
Project: 89452
Buggy source:
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  buffers[1]=ByteBuffer.wrap(_content.getBytes());
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}

Fixed version (ground truth):
public ByteBuffer[] toBytes(){
  final ByteBuffer[] buffers=new ByteBuffer[2];
  ByteBuffer tmp;
  if (_content == null) {
    _content=s_gson.toJson(_cmds,_cmds.getClass());
  }
  tmp=ByteBuffer.wrap(_content.getBytes());
  if (tmp.capacity() >= 8192) {
    tmp=doCompress(tmp);
    _flags|=FLAG_COMPRESSED;
  }
  buffers[1]=tmp;
  buffers[0]=serializeHeader(buffers[1].capacity());
  return buffers;
}
Program: 89453
Project: 89453
Buggy source:
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  final ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}

Fixed version (ground truth):
/** 
 */
public static Request parse(final byte[] bytes) throws ClassNotFoundException, UnsupportedVersionException {
  ByteBuffer buff=ByteBuffer.wrap(bytes);
  final byte ver=buff.get();
  final Version version=Version.get(ver);
  if (version.ordinal() != Version.v1.ordinal() && version.ordinal() != Version.v3.ordinal()) {
    throw new UnsupportedVersionException("String_Node_Str" + version.toString(),UnsupportedVersionException.IncompatibleVersion);
  }
  final byte reserved=buff.get();
  final short flags=buff.getShort();
  final boolean isRequest=(flags & FLAG_REQUEST) > 0;
  final long seq=buff.getLong();
  final int size=buff.getInt();
  final long mgmtId=buff.getLong();
  final long agentId=buff.getLong();
  long via;
  if (version.ordinal() == Version.v1.ordinal()) {
    via=buff.getLong();
  }
 else {
    via=agentId;
  }
  if ((flags & FLAG_COMPRESSED) != 0) {
    buff=doDecompress(buff);
  }
  byte[] command=null;
  int offset=0;
  if (buff.hasArray()) {
    command=buff.array();
    offset=buff.arrayOffset() + buff.position();
  }
 else {
    command=new byte[buff.remaining()];
    buff.get(command);
    offset=0;
  }
  final String content=new String(command,offset,command.length - offset);
  if (isRequest) {
    return new Request(version,seq,agentId,mgmtId,via,flags,content);
  }
 else {
    return new Response(Version.get(ver),seq,agentId,mgmtId,via,flags,content);
  }
}
Program: 89454
Project: 89454
Buggy source:
@Override public void cleanupForServer(long msId){
  PreparedStatement pstmt=null;
  try {
    pstmt=_concierge.conn().prepareStatement(CLEANUP_MGMT_LOCKS_SQL);
    pstmt.setLong(1,_msId);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
 finally {
    try {
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void cleanupForServer(long msId){
  s_logger.info("String_Node_Str" + msId);
  PreparedStatement pstmt=null;
  try {
    pstmt=_concierge.conn().prepareStatement(CLEANUP_MGMT_LOCKS_SQL);
    pstmt.setLong(1,msId);
    int rows=pstmt.executeUpdate();
    s_logger.info("String_Node_Str" + rows + "String_Node_Str"+ msId);
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
 finally {
    try {
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
}
Program: 89455
Project: 89455
Buggy source:
protected void accept(SelectionKey key) throws IOException {
  ServerSocketChannel serverSocketChannel=(ServerSocketChannel)key.channel();
  SocketChannel socketChannel=serverSocketChannel.accept();
  Socket socket=socketChannel.socket();
  socket.setKeepAlive(true);
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str" + socket);
  }
  socketChannel.configureBlocking(true);
  SSLEngine sslEngine=null;
  try {
    SSLContext sslContext=Link.initSSLContext(false);
    sslEngine=sslContext.createSSLEngine();
    sslEngine.setUseClientMode(false);
    sslEngine.setNeedClientAuth(false);
    Link.doHandshake(socketChannel,sslEngine,false);
  }
 catch (  Exception e) {
    logDebug(e,key,0);
    terminate(key);
    return;
  }
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str");
  }
  socketChannel.configureBlocking(false);
  InetSocketAddress saddr=(InetSocketAddress)socket.getRemoteSocketAddress();
  Link link=new Link(saddr,this);
  link.setSSLEngine(sslEngine);
  link.setKey(socketChannel.register(key.selector(),SelectionKey.OP_READ,link));
  Task task=_factory.create(Task.Type.CONNECT,link,null);
  registerLink(saddr,link);
  _executor.execute(task);
}

Fixed version (ground truth):
protected void accept(SelectionKey key) throws IOException {
  ServerSocketChannel serverSocketChannel=(ServerSocketChannel)key.channel();
  SocketChannel socketChannel=serverSocketChannel.accept();
  Socket socket=socketChannel.socket();
  socket.setKeepAlive(true);
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str" + socket);
  }
  socketChannel.configureBlocking(true);
  SSLEngine sslEngine=null;
  try {
    SSLContext sslContext=Link.initSSLContext(false);
    sslEngine=sslContext.createSSLEngine();
    sslEngine.setUseClientMode(false);
    sslEngine.setNeedClientAuth(false);
    Link.doHandshake(socketChannel,sslEngine,false);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str" + socket + "String_Node_Str"+ e.getMessage());
    terminate(key);
    return;
  }
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str");
  }
  socketChannel.configureBlocking(false);
  InetSocketAddress saddr=(InetSocketAddress)socket.getRemoteSocketAddress();
  Link link=new Link(saddr,this);
  link.setSSLEngine(sslEngine);
  link.setKey(socketChannel.register(key.selector(),SelectionKey.OP_READ,link));
  Task task=_factory.create(Task.Type.CONNECT,link,null);
  registerLink(saddr,link);
  _executor.execute(task);
}
Program: 89456
Project: 89456
Buggy source:
@Override public Long checkAccessAndSpecifyAuthority(Account caller,Long zoneId){
  if (isResourceDomainAdmin(caller.getType())) {
    if (zoneId == null)     return getZoneIdForAccount(caller);
 else     if (getZoneIdForAccount(caller) != zoneId)     throw new PermissionDeniedException("String_Node_Str" + caller + "String_Node_Str"+ zoneId);
 else     return zoneId;
  }
 else   return zoneId;
}

Fixed version (ground truth):
@Override public Long checkAccessAndSpecifyAuthority(Account caller,Long zoneId){
  if (isResourceDomainAdmin(caller.getType())) {
    if (zoneId == null)     return getZoneIdForAccount(caller);
 else     if (zoneId.compareTo(getZoneIdForAccount(caller)) != 0)     throw new PermissionDeniedException("String_Node_Str" + caller + "String_Node_Str"+ zoneId);
 else     return zoneId;
  }
 else   return zoneId;
}
Program: 89464
Project: 89464
Buggy source:
@Override public DomainResponse createDomainResponse(Domain domain){
  DomainResponse domainResponse=new DomainResponse();
  domainResponse.setDomainName(domain.getName());
  domainResponse.setId(domain.getId());
  domainResponse.setLevel(domain.getLevel());
  domainResponse.setParentDomainId(domain.getParent());
  if (domain.getParent() != null) {
    domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());
  }
  if (domain.getChildCount() > 0) {
    domainResponse.setHasChild(true);
  }
  domainResponse.setObjectName("String_Node_Str");
  return domainResponse;
}

Fixed version (ground truth):
@Override public DomainResponse createDomainResponse(Domain domain){
  DomainResponse domainResponse=new DomainResponse();
  domainResponse.setDomainName(domain.getName());
  domainResponse.setId(domain.getId());
  domainResponse.setLevel(domain.getLevel());
  domainResponse.setNetworkDomain(domain.getNetworkDomain());
  domainResponse.setParentDomainId(domain.getParent());
  if (domain.getParent() != null) {
    domainResponse.setParentDomainName(ApiDBUtils.findDomainById(domain.getParent()).getName());
  }
  if (domain.getChildCount() > 0) {
    domainResponse.setHasChild(true);
  }
  domainResponse.setObjectName("String_Node_Str");
  return domainResponse;
}
Program: 89465
Project: 89465
Buggy source:
/** 
 * Creates a new zone
 * @param userId
 * @param zoneName
 * @param dns1
 * @param dns2
 * @param internalDns1
 * @param internalDns2
 * @param vnetRange
 * @param guestCidr
 * @param zoneType
 * @param allocationState
 * @return
 * @throws 
     * @throws 
 */
DataCenterVO createZone(long userId,String zoneName,String dns1,String dns2,String internalDns1,String internalDns2,String vnetRange,String guestCidr,String domain,Long domainId,NetworkType zoneType,boolean isSecurityGroupEnabled,String allocationState);

Fixed version (ground truth):
/** 
 * Creates a new zone
 * @param userId
 * @param zoneName
 * @param dns1
 * @param dns2
 * @param internalDns1
 * @param internalDns2
 * @param vnetRange
 * @param guestCidr
 * @param zoneType
 * @param allocationState
 * @param networkDomain TODO
 * @return
 * @throws 
     * @throws 
 */
DataCenterVO createZone(long userId,String zoneName,String dns1,String dns2,String internalDns1,String internalDns2,String vnetRange,String guestCidr,String domain,Long domainId,NetworkType zoneType,boolean isSecurityGroupEnabled,String allocationState,String networkDomain);
Program: 89470
Project: 89470
Buggy source:
private void initPeerScan(Connection conn){
  Date cutTime=DateUtil.currentGMTTime();
  List<ManagementServerHostVO> inactiveList=_mshostDao.getInactiveList(conn,new Date(cutTime.getTime() - heartbeatThreshold));
  if (inactiveList.size() > 0) {
    this.queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved,inactiveList));
  }
}

Fixed version (ground truth):
private void initPeerScan(){
  Date cutTime=DateUtil.currentGMTTime();
  List<ManagementServerHostVO> inactiveList=_mshostDao.getInactiveList(new Date(cutTime.getTime() - heartbeatThreshold));
  if (inactiveList.size() > 0) {
    this.queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved,inactiveList));
  }
}