nus-yam/ex-repair huggingface dataset:
Program: 120293
Project: 120293
Buggy source:
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    File tempFile=itemPath.toFile();
    if (!tempFile.exists()) {
      return;
    }
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}

Fixed version (ground truth):
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    Set<IPath> paths=manager.getPaths();
    if (!paths.contains(itemPath)) {
      return;
    }
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}
Program: 120294
Project: 120294
Buggy source:
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    File tempFile=itemPath.toFile();
    if (!tempFile.exists()) {
      return;
    }
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}

Fixed version (ground truth):
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    Set<IPath> paths=manager.getPaths();
    if (!paths.contains(itemPath)) {
      return;
    }
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}
Program: 120295
Project: 120295
Buggy source:
public boolean isTableViewMoveable(Zone zone,boolean moveUp){
  if (zone == Zone.INPUTS) {
    if (currentSelectedInputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getInputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedInputTableView);
    if (moveUp) {
      if (indexCurrentTable > 1) {
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1 && indexCurrentTable > 0) {
        return true;
      }
      return false;
    }
  }
 else   if (zone == Zone.OUTPUTS) {
    if (currentSelectedOutputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getOutputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedOutputTableView);
    if (moveUp) {
      if (indexCurrentTable > 0) {
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1) {
        return true;
      }
      return false;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean isTableViewMoveable(Zone zone,boolean moveUp){
  if (zone == Zone.INPUTS) {
    if (currentSelectedInputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getInputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedInputTableView);
    if (moveUp) {
      if (indexCurrentTable > 1) {
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1 && indexCurrentTable > 0) {
        return true;
      }
      return false;
    }
  }
 else   if (zone == Zone.OUTPUTS) {
    if (currentSelectedOutputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getOutputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedOutputTableView);
    if (moveUp) {
      if (indexCurrentTable > 0) {
        OutputDataMapTableView previousOutTable=(OutputDataMapTableView)tablesView.get(indexCurrentTable - 1);
        String joinTableName=currentSelectedOutputTableView.getOutputTable().getIsJoinTableOf();
        if (joinTableName != null && joinTableName.equals(previousOutTable.getOutputTable().getName())) {
          return false;
        }
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1) {
        OutputDataMapTableView nextOutTable=(OutputDataMapTableView)tablesView.get(indexCurrentTable + 1);
        String joinTableName=nextOutTable.getOutputTable().getIsJoinTableOf();
        if (joinTableName != null && joinTableName.equals(currentSelectedOutputTableView.getOutputTable().getName())) {
          return false;
        }
        return true;
      }
      return false;
    }
  }
  return false;
}
Program: 120296
Project: 120296
Buggy source:
public boolean isTableViewMoveable(Zone zone,boolean moveUp){
  if (zone == Zone.INPUTS) {
    if (currentSelectedInputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getInputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedInputTableView);
    if (moveUp) {
      if (indexCurrentTable > 1) {
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1 && indexCurrentTable > 0) {
        return true;
      }
      return false;
    }
  }
 else   if (zone == Zone.OUTPUTS) {
    if (currentSelectedOutputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getOutputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedOutputTableView);
    if (moveUp) {
      if (indexCurrentTable > 0) {
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1) {
        return true;
      }
      return false;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean isTableViewMoveable(Zone zone,boolean moveUp){
  if (zone == Zone.INPUTS) {
    if (currentSelectedInputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getInputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedInputTableView);
    if (moveUp) {
      if (indexCurrentTable > 1) {
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1 && indexCurrentTable > 0) {
        return true;
      }
      return false;
    }
  }
 else   if (zone == Zone.OUTPUTS) {
    if (currentSelectedOutputTableView == null) {
      return false;
    }
    List<DataMapTableView> tablesView=mapperManager.getUiManager().getOutputsTablesView();
    int indexCurrentTable=tablesView.indexOf(currentSelectedOutputTableView);
    if (moveUp) {
      if (indexCurrentTable > 0) {
        OutputDataMapTableView previousOutTable=(OutputDataMapTableView)tablesView.get(indexCurrentTable - 1);
        String joinTableName=currentSelectedOutputTableView.getOutputTable().getIsJoinTableOf();
        if (joinTableName != null && joinTableName.equals(previousOutTable.getOutputTable().getName())) {
          return false;
        }
        return true;
      }
      return false;
    }
 else {
      if (indexCurrentTable < tablesView.size() - 1) {
        OutputDataMapTableView nextOutTable=(OutputDataMapTableView)tablesView.get(indexCurrentTable + 1);
        String joinTableName=nextOutTable.getOutputTable().getIsJoinTableOf();
        if (joinTableName != null && joinTableName.equals(currentSelectedOutputTableView.getOutputTable().getName())) {
          return false;
        }
        return true;
      }
      return false;
    }
  }
  return false;
}
Program: 120297
Project: 120297
Buggy source:
public void run(){
  if (connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0 || connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (connection.getTarget().getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0 || connection.getTarget().getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  ChangeConnectionStatusCommand cmd=new ChangeConnectionStatusCommand(connection);
  execute(cmd);
}

Fixed version (ground truth):
@Override public void run(){
  if (connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0 || connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (checkConnectionStatus(connection.getTarget())) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  ChangeConnectionStatusCommand cmd=new ChangeConnectionStatusCommand(connection);
  execute(cmd);
}
Program: 120298
Project: 120298
Buggy source:
public void run(){
  if (connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0 || connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (connection.getTarget().getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0 || connection.getTarget().getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  ChangeConnectionStatusCommand cmd=new ChangeConnectionStatusCommand(connection);
  execute(cmd);
}

Fixed version (ground truth):
public void run(){
  if (connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_OK).size() != 0 || connection.getSource().getDesignSubjobStartNode().getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR).size() != 0) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (checkConnectionStatus(connection.getTarget())) {
    MessageDialog.openError(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  ChangeConnectionStatusCommand cmd=new ChangeConnectionStatusCommand(connection);
  execute(cmd);
}
Program: 120299
Project: 120299
Buggy source:
public String receive(){
  try {
    checkOpen();
    Message msg=msmqHandle.receive(2000);
    return msg.getBodyAsString();
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public String receive() throws MessageQueueException, UnsupportedEncodingException {
  try {
    checkOpen();
    Message msg=msmqHandle.receive(2000);
    return msg.getBodyAsString();
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
catch (  UnsupportedEncodingException e) {
    throw e;
  }
}
Program: 120300
Project: 120300
Buggy source:
public MsmqUtil(){
  try {
    java.net.InetAddress thisIp=java.net.InetAddress.getLocalHost();
    ipAddr=thisIp.getHostAddress();
  }
 catch (  Exception ex1) {
    ex1.printStackTrace();
  }
}

Fixed version (ground truth):
public MsmqUtil() throws Exception {
  try {
    java.net.InetAddress thisIp=java.net.InetAddress.getLocalHost();
    ipAddr=thisIp.getHostAddress();
  }
 catch (  Exception ex1) {
    throw ex1;
  }
}
Program: 120301
Project: 120301
Buggy source:
private void delete(){
  try {
    String fullname=getQueueFullName("String_Node_Str",queueName);
    ionic.Msmq.Queue.delete(fullname);
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
  }
}

Fixed version (ground truth):
private void delete() throws MessageQueueException {
  try {
    String fullname=getQueueFullName("String_Node_Str",queueName);
    ionic.Msmq.Queue.delete(fullname);
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
}
Program: 120302
Project: 120302
Buggy source:
public void peek(){
  try {
    checkOpen();
    System.out.println("String_Node_Str");
    Message msg=msmqHandle.peek(2000);
    System.out.println("String_Node_Str" + msg.getBodyAsString());
    System.out.println("String_Node_Str" + msg.getLabel());
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void peek() throws MessageQueueException, UnsupportedEncodingException {
  try {
    checkOpen();
    System.out.println("String_Node_Str");
    Message msg=msmqHandle.peek(2000);
    System.out.println("String_Node_Str" + msg.getBodyAsString());
    System.out.println("String_Node_Str" + msg.getLabel());
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
catch (  UnsupportedEncodingException e) {
    throw e;
  }
}
Program: 120303
Project: 120303
Buggy source:
private void create(){
  try {
    if (!(host == null || "String_Node_Str".equals(host) || "String_Node_Str".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP.equals(host))) {
      throw new MessageQueueException("String_Node_Str",-1);
    }
    String fullname="String_Node_Str" + queueName;
    String qLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
    boolean transactional=false;
    msmqHandle=Queue.create(fullname,qLabel,transactional);
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
  }
}

Fixed version (ground truth):
private void create() throws MessageQueueException {
  try {
    if (!(host == null || "String_Node_Str".equals(host) || "String_Node_Str".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP.equals(host))) {
      throw new MessageQueueException("String_Node_Str",-1);
    }
    String fullname="String_Node_Str" + queueName;
    String qLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
    boolean transactional=false;
    msmqHandle=Queue.create(fullname,qLabel,transactional);
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
}
Program: 120304
Project: 120304
Buggy source:
public void close(){
  try {
    checkOpen();
    msmqHandle.close();
    msmqHandle=null;
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
  }
}

Fixed version (ground truth):
public void close() throws MessageQueueException {
  try {
    checkOpen();
    msmqHandle.close();
    msmqHandle=null;
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
}
Program: 120305
Project: 120305
Buggy source:
public void send(){
  try {
    checkOpen();
    int transactionFlag=0;
    String mLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
    String correlationID="String_Node_Str";
    Message msg=new Message(msgContent,mLabel,correlationID);
    msmqHandle.send(msg);
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
  }
catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void send() throws MessageQueueException, UnsupportedEncodingException {
  try {
    checkOpen();
    int transactionFlag=0;
    String mLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
    String correlationID="String_Node_Str";
    Message msg=new Message(msgContent,mLabel,correlationID);
    msmqHandle.send(msg);
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
catch (  UnsupportedEncodingException e) {
    throw e;
  }
}
Program: 120306
Project: 120306
Buggy source:
public void open(){
  try {
    if (msmqHandle != null) {
      msmqHandle.close();
      msmqHandle=null;
    }
    String fullname=getQueueFullName(host,queueName);
    msmqHandle=new Queue(fullname);
  }
 catch (  MessageQueueException ex1) {
    System.out.println("String_Node_Str" + ex1);
    if (bTried) {
      bTried=false;
      create();
    }
  }
}

Fixed version (ground truth):
public void open() throws MessageQueueException {
  try {
    if (msmqHandle != null) {
      msmqHandle.close();
      msmqHandle=null;
    }
    String fullname=getQueueFullName(host,queueName);
    msmqHandle=new Queue(fullname);
  }
 catch (  MessageQueueException ex1) {
    if (bTried) {
      System.out.println("String_Node_Str" + ex1);
      bTried=false;
      create();
    }
 else {
      throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
    }
  }
}
Program: 120307
Project: 120307
Buggy source:
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}

Fixed version (ground truth):
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    File tempFile=itemPath.toFile();
    if (!tempFile.exists()) {
      return;
    }
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}
Program: 120308
Project: 120308
Buggy source:
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}

Fixed version (ground truth):
public void resolveItem(ResourcesManager manager,ItemRecord itemRecord){
  if (itemRecord.isResolved()) {
    return;
  }
  InputStream stream=null;
  try {
    final Item item=itemRecord.getItem();
    boolean byteArray=(item instanceof FileItem);
    IPath itemPath=getItemPath(itemRecord.getPath(),item);
    File tempFile=itemPath.toFile();
    if (!tempFile.exists()) {
      return;
    }
    stream=manager.getStream(itemPath);
    Resource resource=createResource(itemRecord,itemPath,byteArray);
    if (byteArray) {
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      byte[] buf=new byte[1024];
      int i=0;
      while ((i=stream.read(buf)) != -1) {
        baos.write(buf,0,i);
      }
      ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
      resource.load(bais,null);
    }
 else {
      resource.load(stream,null);
    }
    for (    ReferenceFileItem rfItem : (List<ReferenceFileItem>)item.getReferenceResources()) {
      itemPath=getReferenceItemPath(itemRecord.getPath(),rfItem.getExtension());
      stream=manager.getStream(itemPath);
      Resource rfResource=createResource(itemRecord,itemPath,true);
      rfResource.load(stream,null);
    }
    resetItemReference(itemRecord,resource);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  itemRecord.setResolved(true);
}
Program: 120309
Project: 120309
Buggy source:
public String receive() throws MessageQueueException, UnsupportedEncodingException {
  try {
    checkOpen();
    Message msg=msmqHandle.receive(2000);
    return msg.getBodyAsString();
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
catch (  UnsupportedEncodingException e) {
    throw e;
  }
}

Fixed version (ground truth):
public String receive() throws MessageQueueException, UnsupportedEncodingException {
  checkOpen();
  Message msg=msmqHandle.receive(2000);
  return msg.getBodyAsString();
}
Program: 120310
Project: 120310
Buggy source:
public MsmqUtil() throws Exception {
  try {
    java.net.InetAddress thisIp=java.net.InetAddress.getLocalHost();
    ipAddr=thisIp.getHostAddress();
  }
 catch (  Exception ex1) {
    throw ex1;
  }
}

Fixed version (ground truth):
public MsmqUtil() throws Exception {
  java.net.InetAddress thisIp=java.net.InetAddress.getLocalHost();
  ipAddr=thisIp.getHostAddress();
}
Program: 120311
Project: 120311
Buggy source:
private void delete() throws MessageQueueException {
  try {
    String fullname=getQueueFullName("String_Node_Str",queueName);
    ionic.Msmq.Queue.delete(fullname);
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
}

Fixed version (ground truth):
private void delete() throws MessageQueueException {
  String fullname=getQueueFullName("String_Node_Str",queueName);
  ionic.Msmq.Queue.delete(fullname);
}
Program: 120312
Project: 120312
Buggy source:
public void peek() throws MessageQueueException, UnsupportedEncodingException {
  try {
    checkOpen();
    System.out.println("String_Node_Str");
    Message msg=msmqHandle.peek(2000);
    System.out.println("String_Node_Str" + msg.getBodyAsString());
    System.out.println("String_Node_Str" + msg.getLabel());
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
catch (  UnsupportedEncodingException e) {
    throw e;
  }
}

Fixed version (ground truth):
public void peek() throws MessageQueueException, UnsupportedEncodingException {
  checkOpen();
  System.out.println("String_Node_Str");
  Message msg=msmqHandle.peek(2000);
  System.out.println("String_Node_Str" + msg.getBodyAsString());
  System.out.println("String_Node_Str" + msg.getLabel());
}
Program: 120313
Project: 120313
Buggy source:
private void create() throws MessageQueueException {
  try {
    if (!(host == null || "String_Node_Str".equals(host) || "String_Node_Str".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP.equals(host))) {
      throw new MessageQueueException("String_Node_Str",-1);
    }
    String fullname="String_Node_Str" + queueName;
    String qLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
    boolean transactional=false;
    msmqHandle=Queue.create(fullname,qLabel,transactional);
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
}

Fixed version (ground truth):
private void create() throws MessageQueueException {
  if (!(host == null || "String_Node_Str".equals(host) || "String_Node_Str".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP.equals(host))) {
    throw new MessageQueueException("String_Node_Str",-1);
  }
  String fullname="String_Node_Str" + queueName;
  String qLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
  boolean transactional=false;
  msmqHandle=Queue.create(fullname,qLabel,transactional);
}
Program: 120314
Project: 120314
Buggy source:
public void close() throws MessageQueueException {
  try {
    checkOpen();
    msmqHandle.close();
    msmqHandle=null;
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
}

Fixed version (ground truth):
public void close() throws MessageQueueException {
  checkOpen();
  msmqHandle.close();
  msmqHandle=null;
}
Program: 120315
Project: 120315
Buggy source:
public void send() throws MessageQueueException, UnsupportedEncodingException {
  try {
    checkOpen();
    int transactionFlag=0;
    String mLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
    String correlationID="String_Node_Str";
    Message msg=new Message(msgContent,mLabel,correlationID);
    msmqHandle.send(msg);
  }
 catch (  MessageQueueException ex1) {
    throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
  }
catch (  UnsupportedEncodingException e) {
    throw e;
  }
}

Fixed version (ground truth):
public void send() throws MessageQueueException, UnsupportedEncodingException {
  checkOpen();
  int transactionFlag=0;
  String mLabel="String_Node_Str" + this.getClass().getName() + "String_Node_Str";
  String correlationID="String_Node_Str";
  Message msg=new Message(msgContent,mLabel,correlationID);
  msmqHandle.send(msg);
}
Program: 120316
Project: 120316
Buggy source:
public void open() throws MessageQueueException {
  try {
    if (msmqHandle != null) {
      msmqHandle.close();
      msmqHandle=null;
    }
    String fullname=getQueueFullName(host,queueName);
    msmqHandle=new Queue(fullname);
  }
 catch (  MessageQueueException ex1) {
    if (bTried) {
      System.out.println("String_Node_Str" + ex1);
      bTried=false;
      create();
    }
 else {
      throw new MessageQueueException("String_Node_Str" + ex1,ex1.hresult);
    }
  }
}

Fixed version (ground truth):
public void open() throws MessageQueueException {
  try {
    if (msmqHandle != null) {
      msmqHandle.close();
      msmqHandle=null;
    }
    String fullname=getQueueFullName(host,queueName);
    msmqHandle=new Queue(fullname);
  }
 catch (  MessageQueueException ex1) {
    if (bTried) {
      System.out.println("String_Node_Str" + ex1);
      bTried=false;
      create();
    }
 else {
      throw ex1;
    }
  }
}
Program: 120318
Project: 120318
Buggy source:
private void processPerformances(final String data,final PerformanceData perfData,final IConnection conn){
  processPerformanceForConnection(data,perfData,conn);
  String uniqueName=ConnectionUtil.getConnectionUnifiedName(conn);
  IConnection[] shadowConnections=traceConnectionsManager.getShadowConnenctions(uniqueName);
  if (shadowConnections != null) {
    for (    IConnection shadowConn : shadowConnections) {
      processPerformanceForConnection(data,perfData,shadowConn);
    }
  }
}

Fixed version (ground truth):
private void processPerformances(final String data,final PerformanceData perfData,final IConnection conn){
  if (conn == null) {
    return;
  }
  processPerformanceForConnection(data,perfData,conn);
  String uniqueName=ConnectionUtil.getConnectionUnifiedName(conn);
  IConnection[] shadowConnections=traceConnectionsManager.getShadowConnenctions(uniqueName);
  if (shadowConnections != null) {
    for (    IConnection shadowConn : shadowConnections) {
      processPerformanceForConnection(data,perfData,shadowConn);
    }
  }
}
Program: 120319
Project: 120319
Buggy source:
private void processPerformances(final String data,final PerformanceData perfData,final IConnection conn){
  processPerformanceForConnection(data,perfData,conn);
  String uniqueName=ConnectionUtil.getConnectionUnifiedName(conn);
  IConnection[] shadowConnections=traceConnectionsManager.getShadowConnenctions(uniqueName);
  if (shadowConnections != null) {
    for (    IConnection shadowConn : shadowConnections) {
      processPerformanceForConnection(data,perfData,shadowConn);
    }
  }
}

Fixed version (ground truth):
private void processPerformances(final String data,final PerformanceData perfData,final IConnection conn){
  if (conn == null) {
    return;
  }
  processPerformanceForConnection(data,perfData,conn);
  String uniqueName=ConnectionUtil.getConnectionUnifiedName(conn);
  IConnection[] shadowConnections=traceConnectionsManager.getShadowConnenctions(uniqueName);
  if (shadowConnections != null) {
    for (    IConnection shadowConn : shadowConnections) {
      processPerformanceForConnection(data,perfData,shadowConn);
    }
  }
}
Program: 120321
Project: 120321
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(),"String_Node_Str");
  GridData data=(GridData)container.getLayoutData();
  data.minimumHeight=400;
  data.heightHint=400;
  data.minimumWidth=500;
  data.widthHint=500;
  container.setLayoutData(data);
  textFilter=new ViewerTextFilter();
  createFilterField(container);
  RepoCommonViewerProvider provider=new RepoCommonViewerProvider();
  treeViewer=provider.createViewer(container);
  treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      getButton(IDialogConstants.OK_ID).setEnabled(isValidSelection(event));
    }
  }
);
  treeViewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      if (getButton(IDialogConstants.OK_ID).isEnabled()) {
        okPressed();
      }
    }
  }
);
  treeViewer.addFilter(textFilter);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      return filterByType(viewer,parentElement,element);
    }
  }
);
  treeViewer.expandAll();
  return container;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite container=(Composite)super.createDialogArea(parent);
  TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(),"String_Node_Str");
  GridData data=(GridData)container.getLayoutData();
  data.minimumHeight=400;
  data.heightHint=400;
  data.minimumWidth=500;
  data.widthHint=500;
  container.setLayoutData(data);
  textFilter=new ViewerTextFilter();
  createFilterField(container);
  RepoCommonViewerProvider provider=new RepoCommonViewerProvider();
  treeViewer=provider.createViewer(container);
  treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      getButton(IDialogConstants.OK_ID).setEnabled(isValidSelection(event));
    }
  }
);
  treeViewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      if (getButton(IDialogConstants.OK_ID).isEnabled()) {
        okPressed();
      }
    }
  }
);
  treeViewer.addFilter(textFilter);
  treeViewer.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      return filterByType(viewer,parentElement,element);
    }
  }
);
  return container;
}
Program: 120323
Project: 120323
Buggy source:
public int compare(LinkDescriptor<TreeItem,Object,Table,Object> link1,LinkDescriptor<TreeItem,Object,Table,Object> link2){
  IStyleLink link1StyleLink=link1.getStyleLink();
  IStyleLink link2StyleLink=link2.getStyleLink();
  if (link1StyleLink == link2StyleLink) {
    return 0;
  }
  if (link1StyleLink == getSelectedLoopStyleLink()) {
    return 1;
  }
  if (link2StyleLink == getSelectedLoopStyleLink()) {
    return -1;
  }
  if (link1StyleLink == getUnselectedStyleLink()) {
    return -1;
  }
  return 1;
}

Fixed version (ground truth):
@Override public int compare(LinkDescriptor<TreeItem,Object,Table,Object> link1,LinkDescriptor<TreeItem,Object,Table,Object> link2){
  IStyleLink link1StyleLink=link1.getStyleLink();
  IStyleLink link2StyleLink=link2.getStyleLink();
  if (link1StyleLink == link2StyleLink) {
    return 0;
  }
  if (link1StyleLink == getSelectedLoopStyleLink()) {
    return 1;
  }
  if (link2StyleLink == getSelectedLoopStyleLink()) {
    return -1;
  }
  if (link1StyleLink == getUnselectedStyleLink()) {
    return -1;
  }
  return 1;
}
Program: 120324
Project: 120324
Buggy source:
public void handleEvent(ListenableListEvent<SchemaTarget> event){
  handleListenableListAfterTableViewerRefreshedEvent(event);
}

Fixed version (ground truth):
@Override public void handleEvent(ListenableListEvent<SchemaTarget> event){
  handleListenableListAfterTableViewerRefreshedEvent(event);
}
Program: 120326
Project: 120326
Buggy source:
/** 
 * DOC amaumont Comment method "initListeners".
 */
private void initLoopListeners(){
  JSONExtractorLoopModel loopModel=this.loopTableEditorView.getModel();
  final Table loopTable=this.loopTableEditorView.getTableViewerCreator().getTable();
  loopModel.addModifiedBeanListener(new IModifiedBeanListener<JSONXPathLoopDescriptor>(){
    public void handleEvent(    ModifiedBeanEvent<JSONXPathLoopDescriptor> event){
      handleModifiedBeanEvent(event);
    }
    private void handleModifiedBeanEvent(    ModifiedBeanEvent<JSONXPathLoopDescriptor> event){
      if (event.column == loopTableEditorView.getXPathColumn()) {
        onXPathValueChanged(loopTable,(String)event.newValue,event.index);
      }
    }
  }
);
  this.loopTableEditorView.getExtendedTableViewer().addListener(new IExtendedControlListener(){
    public void handleEvent(    ExtendedControlEvent event){
      if (event.getType() == EVENT_TYPE.MODEL_CHANGED) {
        nodeRetriever.setCurrentLoopXPath(getCurrentLoopXPath());
      }
    }
  }
);
  SelectionHelper selectionHelper=this.loopTableEditorView.getTableViewerCreator().getSelectionHelper();
  final ILineSelectionListener afterLineSelectionListener=new ILineSelectionListener(){
    public void handle(    LineSelectionEvent e){
      updateLinksStyleAndControlsSelection(e.source.getTable(),true);
    }
  }
;
  selectionHelper.addAfterSelectionListener(afterLineSelectionListener);
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "initListeners".
 */
private void initLoopListeners(){
  JSONExtractorLoopModel loopModel=this.loopTableEditorView.getModel();
  final Table loopTable=this.loopTableEditorView.getTableViewerCreator().getTable();
  loopModel.addModifiedBeanListener(new IModifiedBeanListener<JSONXPathLoopDescriptor>(){
    @Override public void handleEvent(    ModifiedBeanEvent<JSONXPathLoopDescriptor> event){
      handleModifiedBeanEvent(event);
    }
    private void handleModifiedBeanEvent(    ModifiedBeanEvent<JSONXPathLoopDescriptor> event){
      if (event.column == loopTableEditorView.getXPathColumn()) {
        onXPathValueChanged(loopTable,(String)event.newValue,event.index);
      }
    }
  }
);
  this.loopTableEditorView.getExtendedTableViewer().addListener(new IExtendedControlListener(){
    @Override public void handleEvent(    ExtendedControlEvent event){
      if (event.getType() == EVENT_TYPE.MODEL_CHANGED) {
        nodeRetriever.setCurrentLoopXPath(getCurrentLoopXPath());
      }
    }
  }
);
  SelectionHelper selectionHelper=this.loopTableEditorView.getTableViewerCreator().getSelectionHelper();
  final ILineSelectionListener afterLineSelectionListener=new ILineSelectionListener(){
    @Override public void handle(    LineSelectionEvent e){
      updateLinksStyleAndControlsSelection(e.source.getTable(),true);
    }
  }
;
  selectionHelper.addAfterSelectionListener(afterLineSelectionListener);
}
Program: 120327
Project: 120327
Buggy source:
public void widgetDisposed(DisposeEvent e){
  selectedLoopLinkColor.dispose();
  selectedRelativeLinkColor.dispose();
  getTree().removeDisposeListener(this);
}

Fixed version (ground truth):
@Override public void widgetDisposed(DisposeEvent e){
  selectedLoopLinkColor.dispose();
  selectedRelativeLinkColor.dispose();
  getTree().removeDisposeListener(this);
}
Program: 120328
Project: 120328
Buggy source:
@Override protected Comparator<LinkDescriptor<TreeItem,Object,Table,Object>> getDrawingLinksComparator(){
  if (this.drawingLinksComparator == null) {
    this.drawingLinksComparator=new Comparator<LinkDescriptor<TreeItem,Object,Table,Object>>(){
      public int compare(      LinkDescriptor<TreeItem,Object,Table,Object> link1,      LinkDescriptor<TreeItem,Object,Table,Object> link2){
        IStyleLink link1StyleLink=link1.getStyleLink();
        IStyleLink link2StyleLink=link2.getStyleLink();
        if (link1StyleLink == link2StyleLink) {
          return 0;
        }
        if (link1StyleLink == getSelectedLoopStyleLink()) {
          return 1;
        }
        if (link2StyleLink == getSelectedLoopStyleLink()) {
          return -1;
        }
        if (link1StyleLink == getUnselectedStyleLink()) {
          return -1;
        }
        return 1;
      }
    }
;
  }
  return this.drawingLinksComparator;
}

Fixed version (ground truth):
@Override protected Comparator<LinkDescriptor<TreeItem,Object,Table,Object>> getDrawingLinksComparator(){
  if (this.drawingLinksComparator == null) {
    this.drawingLinksComparator=new Comparator<LinkDescriptor<TreeItem,Object,Table,Object>>(){
      @Override public int compare(      LinkDescriptor<TreeItem,Object,Table,Object> link1,      LinkDescriptor<TreeItem,Object,Table,Object> link2){
        IStyleLink link1StyleLink=link1.getStyleLink();
        IStyleLink link2StyleLink=link2.getStyleLink();
        if (link1StyleLink == link2StyleLink) {
          return 0;
        }
        if (link1StyleLink == getSelectedLoopStyleLink()) {
          return 1;
        }
        if (link2StyleLink == getSelectedLoopStyleLink()) {
          return -1;
        }
        if (link1StyleLink == getUnselectedStyleLink()) {
          return -1;
        }
        return 1;
      }
    }
;
  }
  return this.drawingLinksComparator;
}
Program: 120330
Project: 120330
Buggy source:
public void handle(LineSelectionEvent e){
  updateLinksStyleAndControlsSelection(e.source.getTable(),true);
}

Fixed version (ground truth):
@Override public void handle(LineSelectionEvent e){
  updateLinksStyleAndControlsSelection(e.source.getTable(),true);
}
Program: 120332
Project: 120332
Buggy source:
/** 
 * DOC amaumont Comment method "initColors".
 * @param display
 */
private void initColors(Display display){
  selectedLoopLinkColor=new Color(display,255,131,0);
  selectedRelativeLinkColor=new Color(display,110,168,255);
  getTree().addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      selectedLoopLinkColor.dispose();
      selectedRelativeLinkColor.dispose();
      getTree().removeDisposeListener(this);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "initColors".
 * @param display
 */
private void initColors(Display display){
  selectedLoopLinkColor=new Color(display,255,131,0);
  selectedRelativeLinkColor=new Color(display,110,168,255);
  getTree().addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      selectedLoopLinkColor.dispose();
      selectedRelativeLinkColor.dispose();
      getTree().removeDisposeListener(this);
    }
  }
);
}
Program: 120333
Project: 120333
Buggy source:
public void rollback() throws IOException {
  HttpClient client=new HttpClient();
  client.getState().setCredentials(AuthScope.ANY,new UsernamePasswordCredentials(username,password));
  HttpMethod method=new DeleteMethod(url + "String_Node_Str" + id);
  method.setDoAuthentication(true);
  try {
    client.executeMethod(method);
  }
 catch (  HttpException e) {
    throw e;
  }
catch (  IOException e) {
    throw e;
  }
 finally {
    method.releaseConnection();
  }
  int statuscode=method.getStatusCode();
  if (statuscode >= 400) {
    throw new MDMTransactionException("String_Node_Str" + statuscode);
  }
}

Fixed version (ground truth):
public void rollback() throws IOException {
  HttpClient client=new HttpClient();
  client.getState().setCredentials(AuthScope.ANY,new UsernamePasswordCredentials(username,password));
  HttpMethod method=new DeleteMethod(url + "String_Node_Str" + id);
  method.setDoAuthentication(true);
  try {
    client.executeMethod(method);
  }
 catch (  HttpException e) {
    throw e;
  }
catch (  IOException e) {
    throw e;
  }
 finally {
    method.releaseConnection();
  }
  int statuscode=method.getStatusCode();
  if (statuscode >= 400) {
    throw new MDMTransactionException("String_Node_Str" + statuscode + "String_Node_Str");
  }
}