nus-yam/ex-repair huggingface dataset:
Program: 178499
Project: 178499
Buggy source:
/** 
 * {@inheritDoc}
 * @see KeyPressHandler#onKeyPress(KeyPressEvent)
 */
public void onKeyPress(KeyPressEvent event){
  log.info("String_Node_Str" + getTextArea().getHTML());
  log.fine("String_Node_Str" + event.getCharCode() + "String_Node_Str"+ event.getNativeEvent().getKeyCode()+ "String_Node_Str"+ event.getUnicodeCharCode());
  boolean isAltControlOrMetaDown=event.isAltKeyDown() || event.isControlKeyDown() || event.isMetaKeyDown();
  boolean isNoteworthyKeyPressed=event.getCharCode() != '\u0000';
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !isAltControlOrMetaDown&& isNoteworthyKeyPressed) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      doStuff(range);
      OperationTarget target=getTarget(range);
      List<Integer> path=target.getStartContainer();
      clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),convertPath(path),new String(new int[]{event.getUnicodeCharCode()},0,1).charAt(0)));
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see KeyPressHandler#onKeyPress(KeyPressEvent)
 */
public void onKeyPress(KeyPressEvent event){
  log.info("String_Node_Str" + getTextArea().getHTML());
  boolean isAltControlOrMetaDown=event.isAltKeyDown() || event.isControlKeyDown() || event.isMetaKeyDown();
  boolean isNoteworthyKeyPressed=event.getCharCode() != '\u0000';
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !isAltControlOrMetaDown&& isNoteworthyKeyPressed) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      doStuff(range);
      OperationTarget target=getTarget(range);
      List<Integer> path=target.getStartContainer();
      clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),convertPath(path),new String(new int[]{event.getUnicodeCharCode()},0,1).charAt(0)));
    }
  }
}
Program: 178505
Project: 178505
Buggy source:
/** 
 * {@inheritDoc}
 * @see AbstractPlugin#init(RichTextArea,Config)
 */
public void init(RichTextArea textArea,Config config){
  super.init(textArea,config);
  saveRegistration(textArea.addKeyDownHandler(this));
  saveRegistration(textArea.addKeyPressHandler(this));
  saveRegistration(textArea.addKeyUpHandler(this));
  getTextArea().getCommandManager().addCommandListener(this);
  bodyNode=textArea.getDocument().getBody();
  final Element p=Document.get().createElement("String_Node_Str");
  if (bodyNode.getChildCount() == 0) {
    bodyNode.insertFirst(p);
  }
 else   if (bodyNode.getChildCount() == 1 && bodyNode.getFirstChild().getNodeName().equalsIgnoreCase("String_Node_Str")) {
    bodyNode.insertBefore(bodyNode.getFirstChild(),p);
  }
  Tree t=Converter.fromNativeToCustom(Element.as(bodyNode));
  clientJupiter=new ClientJupiterAlg(new TreeDocument(t));
  clientJupiter.setEditingSessionId(Integer.parseInt(config.getParameter(RtApi.DOCUMENT_ID)));
  clientJupiter.setCommunicationService(CommunicationService.ServiceHelper.getCommunicationService());
  clientJupiter.setCallback(new TreeClientCallback(bodyNode));
  clientJupiter.connect();
  customizeActionListeners();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see AbstractPlugin#init(RichTextArea,Config)
 */
public void init(RichTextArea textArea,Config config){
  super.init(textArea,config);
  saveRegistration(textArea.addKeyDownHandler(this));
  saveRegistration(textArea.addKeyPressHandler(this));
  saveRegistration(textArea.addKeyUpHandler(this));
  getTextArea().getCommandManager().addCommandListener(this);
  bodyNode=textArea.getDocument().getBody();
  final Element p=Document.get().createElement("String_Node_Str");
  if (bodyNode.getChildCount() == 0) {
    bodyNode.insertFirst(p);
  }
 else   if (bodyNode.getChildCount() == 1 && bodyNode.getFirstChild().getNodeName().equalsIgnoreCase("String_Node_Str")) {
    bodyNode.insertBefore(p,bodyNode.getFirstChild());
  }
  Tree t=Converter.fromNativeToCustom(Element.as(bodyNode));
  clientJupiter=new ClientJupiterAlg(new TreeDocument(t));
  clientJupiter.setEditingSessionId(Integer.parseInt(config.getParameter(RtApi.DOCUMENT_ID)));
  clientJupiter.setCommunicationService(CommunicationService.ServiceHelper.getCommunicationService());
  clientJupiter.setCallback(new TreeClientCallback(bodyNode));
  clientJupiter.connect();
  customizeActionListeners();
}
Program: 178507
Project: 178507
Buggy source:
/** 
 * {@inheritDoc}
 * @see CommandListener#onCommand(CommandManager,Command,String)
 */
public void onCommand(CommandManager sender,final Command command,final String param){
  log.finest("String_Node_Str" + command + "String_Node_Str"+ param);
  if (commandOperationCall != null) {
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see CommandListener#onCommand(CommandManager,Command,String)
 */
public void onCommand(CommandManager sender,final Command command,final String param){
  if (commandOperationCall != null) {
  }
}
Program: 178508
Project: 178508
Buggy source:
/** 
 * {@inheritDoc}
 * @see KeyPressHandler#onKeyPress(KeyPressEvent)
 */
public void onKeyPress(KeyPressEvent event){
  log.info("String_Node_Str" + getTextArea().getHTML());
  log.info("String_Node_Str" + event.getCharCode() + "String_Node_Str"+ event.getNativeEvent().getKeyCode());
  boolean isAltControlOrMetaDown=event.isAltKeyDown() || event.isControlKeyDown() || event.isMetaKeyDown();
  boolean isNoteworthyKeyPressed=event.getCharCode() != '\u0000';
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !isAltControlOrMetaDown&& isNoteworthyKeyPressed) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      OperationTarget target=getTarget(range);
      List<Integer> path=target.getStartContainer();
      clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),convertPath(path),new String(new int[]{event.getUnicodeCharCode()},0,1).charAt(0)));
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see KeyPressHandler#onKeyPress(KeyPressEvent)
 */
public void onKeyPress(KeyPressEvent event){
  log.info("String_Node_Str" + getTextArea().getHTML());
  log.info("String_Node_Str" + event.getCharCode() + "String_Node_Str"+ event.getNativeEvent().getKeyCode());
  boolean isAltControlOrMetaDown=event.isAltKeyDown() || event.isControlKeyDown() || event.isMetaKeyDown();
  boolean isNoteworthyKeyPressed=event.getCharCode() != '\u0000';
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !isAltControlOrMetaDown&& isNoteworthyKeyPressed) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      OperationTarget target=getTarget(range);
      log.info("String_Node_Str" + target);
      List<Integer> path=target.getStartContainer();
      clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),convertPath(path),new String(new int[]{event.getUnicodeCharCode()},0,1).charAt(0)));
    }
  }
}
Program: 178509
Project: 178509
Buggy source:
/** 
 * {@inheritDoc}
 * @see CommandListener#onBeforeCommand(CommandManager,Command,String)
 */
public boolean onBeforeCommand(CommandManager sender,Command command,String param){
  log.finest("String_Node_Str" + command + "String_Node_Str"+ param);
  commandOperationCall=null;
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !IGNORED_COMMANDS.contains(command)) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      commandOperationCall=new OperationCall(command.toString(),param,getTarget(range));
      log.info(commandOperationCall.toString());
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see CommandListener#onBeforeCommand(CommandManager,Command,String)
 */
public boolean onBeforeCommand(CommandManager sender,Command command,String param){
  commandOperationCall=null;
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !IGNORED_COMMANDS.contains(command)) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      commandOperationCall=new OperationCall(command.toString(),param,getTarget(range));
      log.info(commandOperationCall.toString());
    }
  }
  return false;
}
Program: 178510
Project: 178510
Buggy source:
/** 
 * {@inheritDoc}
 * @see AbstractPlugin#init(RichTextArea,Config)
 */
public void init(RichTextArea textArea,Config config){
  super.init(textArea,config);
  saveRegistration(textArea.addKeyDownHandler(this));
  saveRegistration(textArea.addKeyPressHandler(this));
  saveRegistration(textArea.addKeyUpHandler(this));
  getTextArea().getCommandManager().addCommandListener(this);
  Tree t=Converter.fromNativeToCustom(textArea.getDocument().getBody());
  clientJupiter=new ClientJupiterAlg(new TreeDocument(t));
  clientJupiter.setEditingSessionId(Integer.parseInt(config.getParameter(RtApi.DOCUMENT_ID)));
  clientJupiter.setCommunicationService(CommunicationService.ServiceHelper.getCommunicationService());
  clientJupiter.setCallback(new ClientCallback.TreeClientCallback(textArea.getDocument().getBody()));
  clientJupiter.connect();
  customizeActionListeners();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see AbstractPlugin#init(RichTextArea,Config)
 */
public void init(RichTextArea textArea,Config config){
  super.init(textArea,config);
  saveRegistration(textArea.addKeyDownHandler(this));
  saveRegistration(textArea.addKeyPressHandler(this));
  saveRegistration(textArea.addKeyUpHandler(this));
  getTextArea().getCommandManager().addCommandListener(this);
  bodyNode=textArea.getDocument().getBody();
  Tree t=Converter.fromNativeToCustom(Element.as(bodyNode));
  clientJupiter=new ClientJupiterAlg(new TreeDocument(t));
  clientJupiter.setEditingSessionId(Integer.parseInt(config.getParameter(RtApi.DOCUMENT_ID)));
  clientJupiter.setCommunicationService(CommunicationService.ServiceHelper.getCommunicationService());
  clientJupiter.setCallback(new TreeClientCallback(bodyNode));
  clientJupiter.connect();
  customizeActionListeners();
}
Program: 178511
Project: 178511
Buggy source:
@Override public void onKeyDown(KeyDownEvent event){
  final int keyCode=event.getNativeKeyCode();
  log.fine("String_Node_Str" + keyCode + "String_Node_Str"+ event.getNativeEvent().getKeyCode());
  Selection selection=getTextArea().getDocument().getSelection();
  if (selection.getRangeCount() > 0) {
    Range range=selection.getRangeAt(0);
    OperationTarget t=getTarget(range);
    log.fine("String_Node_Str" + t);
    int pos=t.getStartOffset();
    List<Integer> path=t.getStartContainer();
    TreeOperation op=null;
    if (keyCode == 8) {
      if (pos == 0) {
        if (isNoteworthyPath(path)) {
          op=new TreeMergeParagraph(clientJupiter.getSiteId(),path.get(0),1,1);
          op.setPath(convertPath(path));
        }
      }
 else {
        pos=pos - 1;
        op=new TreeDeleteText(clientJupiter.getSiteId(),pos,convertPath(path));
      }
    }
 else     if (keyCode == 46) {
      op=new TreeDeleteText(clientJupiter.getSiteId(),pos,convertPath(path));
    }
 else     if (keyCode == 13) {
      op=new TreeInsertParagraph(clientJupiter.getSiteId(),pos,convertPath(path));
    }
    if (op != null) {
      clientJupiter.generate(op);
    }
  }
}

Fixed version (ground truth):
@Override public void onKeyDown(KeyDownEvent event){
  final int keyCode=event.getNativeKeyCode();
  log.fine("String_Node_Str" + keyCode + "String_Node_Str"+ event.getNativeEvent().getKeyCode());
  Selection selection=getTextArea().getDocument().getSelection();
  if (selection.getRangeCount() > 0) {
    Range range=selection.getRangeAt(0);
    OperationTarget t=getTarget(range);
    log.fine("String_Node_Str" + t);
    int pos=t.getStartOffset();
    List<Integer> path=t.getStartContainer();
    TreeOperation op=null;
    if (keyCode == 8) {
      if (pos == 0) {
        if (isNoteworthyPath(path)) {
          op=new TreeMergeParagraph(clientJupiter.getSiteId(),path.get(0),1,1);
          op.setPath(convertPath(path));
        }
      }
 else {
        pos=pos - 1;
        op=new TreeDeleteText(clientJupiter.getSiteId(),pos,convertPath(path));
      }
    }
 else     if (keyCode == 46) {
      Text textNode=Text.as(TreeHelper.getChildNodeFromLocator(bodyNode,convertPath(t.getStartContainer())));
      if ((t.getStartOffset() == t.getEndOffset()) && (textNode.getLength() == t.getStartOffset())) {
        path.set(0,path.get(0) + 1);
        op=new TreeMergeParagraph(clientJupiter.getSiteId(),path.get(0),1,1);
      }
 else {
        op=new TreeDeleteText(clientJupiter.getSiteId(),pos,convertPath(path));
      }
    }
 else     if (keyCode == 13) {
      op=new TreeInsertParagraph(clientJupiter.getSiteId(),pos,convertPath(path));
    }
    if (op != null) {
      clientJupiter.generate(op);
    }
  }
}
Program: 178512
Project: 178512
Buggy source:
/** 
 * {@inheritDoc}
 * @see CommandListener#onCommand(CommandManager,Command,String)
 */
public void onCommand(CommandManager sender,final Command command,final String param){
  log.finest("String_Node_Str" + command + "String_Node_Str"+ param);
  if (commandOperationCall != null) {
    broadcast(commandOperationCall);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see CommandListener#onCommand(CommandManager,Command,String)
 */
public void onCommand(CommandManager sender,final Command command,final String param){
  log.finest("String_Node_Str" + command + "String_Node_Str"+ param);
  if (commandOperationCall != null) {
  }
}
Program: 178513
Project: 178513
Buggy source:
/** 
 * {@inheritDoc}
 * @see KeyPressHandler#onKeyPress(KeyPressEvent)
 */
public void onKeyPress(KeyPressEvent event){
  log.info("String_Node_Str" + getTextArea().getHTML());
  log.info("String_Node_Str" + event.getCharCode() + "String_Node_Str"+ event.getNativeEvent().getKeyCode());
  boolean isAltControlOrMetaDown=event.isAltKeyDown() || event.isControlKeyDown() || event.isMetaKeyDown();
  boolean isNoteworthyKeyPressed=event.getCharCode() != '\u0000';
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !isAltControlOrMetaDown&& isNoteworthyKeyPressed) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      broadcast(new OperationCall("String_Node_Str",new String(new int[]{event.getUnicodeCharCode()},0,1),getTarget(range)));
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see KeyPressHandler#onKeyPress(KeyPressEvent)
 */
public void onKeyPress(KeyPressEvent event){
  log.info("String_Node_Str" + getTextArea().getHTML());
  log.info("String_Node_Str" + event.getCharCode() + "String_Node_Str"+ event.getNativeEvent().getKeyCode());
  boolean isAltControlOrMetaDown=event.isAltKeyDown() || event.isControlKeyDown() || event.isMetaKeyDown();
  boolean isNoteworthyKeyPressed=event.getCharCode() != '\u0000';
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !isAltControlOrMetaDown&& isNoteworthyKeyPressed) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      OperationTarget target=getTarget(range);
      List<Integer> path=target.getStartContainer();
      clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),convertPath(path),new String(new int[]{event.getUnicodeCharCode()},0,1).charAt(0)));
    }
  }
}
Program: 178514
Project: 178514
Buggy source:
@Override public void onConnected(ClientDTO dto,Document document,boolean updateUI){
  if (updateUI) {
    log.finest("String_Node_Str" + nativeNode);
    Node newNode=Converter.fromCustomToNative(((TreeDocument)document).getRoot());
    nativeNode.getParentNode().replaceChild(newNode,nativeNode);
  }
}

Fixed version (ground truth):
@Override public void onConnected(ClientDTO dto,Document document,boolean updateUI){
  if (updateUI) {
    log.finest("String_Node_Str" + Element.as(nativeNode).getString());
    Node newNode=Converter.fromCustomToNative(((TreeDocument)document).getRoot());
    nativeNode.getParentNode().replaceChild(newNode,nativeNode);
    nativeNode=newNode;
    log.finest("String_Node_Str" + Element.as(nativeNode).getString());
  }
}
Program: 178516
Project: 178516
Buggy source:
/** 
 * {@inheritDoc}
 * @see AbstractPlugin#init(RichTextArea,Config)
 */
public void init(RichTextArea textArea,Config config){
  super.init(textArea,config);
  saveRegistration(textArea.addKeyDownHandler(this));
  saveRegistration(textArea.addKeyPressHandler(this));
  saveRegistration(textArea.addKeyUpHandler(this));
  getTextArea().getCommandManager().addCommandListener(this);
  clientJupiter=new ClientJupiterAlg();
  Converter converter=new Converter();
  Tree t=converter.fromNativeToCustom(textArea.getDocument().getBody());
  clientJupiter.setEditingSessionId(Integer.parseInt(config.getParameter(RtApi.DOCUMENT_ID)));
  clientJupiter.setCommunicationService(CommunicationService.ServiceHelper.getCommunicationService());
  clientJupiter.setCallback(new ClientCallback.TreeClientCallback(textArea.getDocument().getBody()));
  clientJupiter.setDocument(new TreeDocument(t));
  clientJupiter.connect();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see AbstractPlugin#init(RichTextArea,Config)
 */
public void init(RichTextArea textArea,Config config){
  super.init(textArea,config);
  saveRegistration(textArea.addKeyDownHandler(this));
  saveRegistration(textArea.addKeyPressHandler(this));
  saveRegistration(textArea.addKeyUpHandler(this));
  getTextArea().getCommandManager().addCommandListener(this);
  Converter converter=new Converter();
  Tree t=converter.fromNativeToCustom(textArea.getDocument().getBody());
  clientJupiter=new ClientJupiterAlg(new TreeDocument(t),-1);
  clientJupiter.setEditingSessionId(Integer.parseInt(config.getParameter(RtApi.DOCUMENT_ID)));
  clientJupiter.setCommunicationService(CommunicationService.ServiceHelper.getCommunicationService());
  clientJupiter.setCallback(new ClientCallback.TreeClientCallback(textArea.getDocument().getBody()));
  clientJupiter.connect();
}
Program: 178517
Project: 178517
Buggy source:
/** 
 * Broadcast an operation call.
 * @param operationCall the operation call to broadcast
 */
private void broadcast(OperationCall operationCall){
  JSONObject jsonTarget=new JSONObject();
  jsonTarget.put("String_Node_Str",new JSONString(operationCall.getTarget().getStartContainer().toString()));
  jsonTarget.put("String_Node_Str",new JSONNumber(operationCall.getTarget().getStartOffset()));
  jsonTarget.put("String_Node_Str",new JSONString(operationCall.getTarget().getEndContainer().toString()));
  jsonTarget.put("String_Node_Str",new JSONNumber(operationCall.getTarget().getEndOffset()));
  JSONObject jsonOperationCall=new JSONObject();
  jsonOperationCall.put("String_Node_Str",new JSONString(operationCall.getOperationId()));
  if (operationCall.getValue() != null) {
    jsonOperationCall.put("String_Node_Str",new JSONString(operationCall.getValue()));
  }
  jsonOperationCall.put("String_Node_Str",jsonTarget);
  Console.getInstance().log(jsonOperationCall.toString());
  OperationTarget target=operationCall.getTarget();
  List<Integer> path=target.getStartContainer();
  clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),path,operationCall.getValue().charAt(0)));
}

Fixed version (ground truth):
/** 
 * Broadcast an operation call.
 * @param operationCall the operation call to broadcast
 */
private void broadcast(OperationCall operationCall){
  JSONObject jsonTarget=new JSONObject();
  jsonTarget.put("String_Node_Str",new JSONString(operationCall.getTarget().getStartContainer().toString()));
  jsonTarget.put("String_Node_Str",new JSONNumber(operationCall.getTarget().getStartOffset()));
  jsonTarget.put("String_Node_Str",new JSONString(operationCall.getTarget().getEndContainer().toString()));
  jsonTarget.put("String_Node_Str",new JSONNumber(operationCall.getTarget().getEndOffset()));
  JSONObject jsonOperationCall=new JSONObject();
  jsonOperationCall.put("String_Node_Str",new JSONString(operationCall.getOperationId()));
  if (operationCall.getValue() != null) {
    jsonOperationCall.put("String_Node_Str",new JSONString(operationCall.getValue()));
  }
  jsonOperationCall.put("String_Node_Str",jsonTarget);
  Console.getInstance().log(jsonOperationCall.toString());
  OperationTarget target=operationCall.getTarget();
  List<Integer> path=target.getStartContainer();
  int[] ppath=new int[path.size()];
  for (int i=0; i < path.size(); i++) {
    ppath[i]=path.get(i);
  }
  clientJupiter.generate(new TreeInsertText(clientJupiter.getSiteId(),target.getStartOffset(),ppath,operationCall.getValue().charAt(0)));
}
Program: 178518
Project: 178518
Buggy source:
private void copyAttributes(Node currentNode,Tree treeNode){
  Map<String,String> attributes=new HashMap<String,String>();
  putIfValueNotNull(attributes,Tree.NODE_VALUE,currentNode.getNodeName());
  putIfValueNotNull(attributes,Tree.NODE_VALUE,currentNode.getNodeValue());
  int type=currentNode.getNodeType();
  putIfValueNotNull(attributes,Tree.NODE_TYPE,String.valueOf(type));
  if (type == Node.ELEMENT_NODE) {
    Element element=(Element)currentNode;
    putIfValueNotNull(attributes,"String_Node_Str",element.getClassName());
    putIfValueNotNull(attributes,"String_Node_Str",element.getId());
    putIfValueNotNull(attributes,"String_Node_Str",element.getStyle().toString());
    putIfValueNotNull(attributes,"String_Node_Str",element.getTagName());
    putIfValueNotNull(attributes,"String_Node_Str",element.getTitle());
  }
 else   if (type == Node.TEXT_NODE) {
    Text textElement=(Text)currentNode;
    treeNode.setValue(textElement.getData());
  }
  treeNode.setAttributes(attributes);
}

Fixed version (ground truth):
private void copyAttributes(Node currentNode,Tree treeNode){
  Map<String,String> attributes=new HashMap<String,String>();
  putIfValueNotNull(attributes,Tree.NODE_NAME,currentNode.getNodeName());
  putIfValueNotNull(attributes,Tree.NODE_VALUE,currentNode.getNodeValue());
  int type=currentNode.getNodeType();
  putIfValueNotNull(attributes,Tree.NODE_TYPE,String.valueOf(type));
  if (type == Node.ELEMENT_NODE) {
    Element element=(Element)currentNode;
    putIfValueNotNull(attributes,"String_Node_Str",element.getClassName());
    putIfValueNotNull(attributes,"String_Node_Str",element.getId());
    putIfValueNotNull(attributes,"String_Node_Str",element.getStyle().toString());
    putIfValueNotNull(attributes,"String_Node_Str",element.getTagName());
    putIfValueNotNull(attributes,"String_Node_Str",element.getTitle());
  }
 else   if (type == Node.TEXT_NODE) {
    Text textElement=(Text)currentNode;
    treeNode.setValue(textElement.getData());
  }
  treeNode.setAttributes(attributes);
}
Program: 178519
Project: 178519
Buggy source:
public static boolean inf(List<Integer> t1,List<Integer> t2){
  int i=0;
  while (i < t1.size() && i < t2.size()) {
    if (t1.get(i) < t2.get(i)) {
      return true;
    }
    if (t1.get(i) > t2.get(i)) {
      return false;
    }
    i++;
  }
  return (t1.size() < t2.size());
}

Fixed version (ground truth):
public static boolean inf(int[] t1,int[] t2){
  int i=0;
  while (i < t1.length && i < t2.length) {
    if (t1[i] < t2[i]) {
      return true;
    }
    if (t1[i] > t2[i]) {
      return false;
    }
    i++;
  }
  return (t1.length < t2.length);
}
Program: 178520
Project: 178520
Buggy source:
public static List<Integer> reference(List<Integer> path,List<Integer> ref){
  List<Integer> tab=addP(path,1);
  int i=1;
  while (ref.get(i).equals(tab.get(i))) {
    tab.set(i,0);
    i++;
  }
  tab.set(i,tab.get(i) - ref.get(i));
  return tab;
}

Fixed version (ground truth):
public static int[] reference(int[] path,int[] ref){
  int[] tab=addP(path,1);
  int i=1;
  while (ref[i] == tab[i]) {
    tab[i]=0;
    i++;
  }
  tab[i]=tab[i] - ref[i];
  return tab;
}
Program: 178521
Project: 178521
Buggy source:
public static List<Integer> addP(List<Integer> path,int nb){
  List<Integer> copy=new ArrayList<Integer>(path.size());
  copy.add(0,path.get(0) + nb);
  for (int i=1; i < path.size(); i++) {
    copy.add(new Integer(path.get(i).intValue()));
  }
  return copy;
}

Fixed version (ground truth):
public static int[] addP(int[] path,int nb){
  int[] tab=new int[path.length];
  tab[0]=path[0] + nb;
  for (int i=1; i < path.length; i++) {
    tab[i]=path[i];
  }
  return tab;
}
Program: 178522
Project: 178522
Buggy source:
public static List<Integer> addLevel(List<Integer> path){
  List<Integer> tab=new ArrayList<Integer>(path.size() + 1);
  for (int i=0; i < path.size(); i++) {
    tab.add(new Integer(path.get(i).intValue()));
  }
  tab.add(0);
  return tab;
}

Fixed version (ground truth):
public static int[] addLevel(int[] path){
  int[] tab=new int[path.length + 1];
  for (int i=0; i < path.length; i++) {
    tab[i]=path[i];
  }
  tab[tab.length - 1]=0;
  return tab;
}
Program: 178523
Project: 178523
Buggy source:
public static boolean diff(List<Integer> t1,List<Integer> t2){
  return !Arrays.equals(t1.toArray(),t2.toArray());
}

Fixed version (ground truth):
public static boolean diff(int[] t1,int[] t2){
  return !Arrays.equals(t1,t2);
}
Program: 178524
Project: 178524
Buggy source:
public static List<Integer> setP(List<Integer> path,int nb){
  List<Integer> tab=new ArrayList<Integer>(path.size());
  tab.add(0,nb);
  for (int i=1; i < path.size(); i++) {
    tab.add(new Integer(path.get(i).intValue()));
  }
  return tab;
}

Fixed version (ground truth):
public static int[] setP(int[] path,int nb){
  int[] tab=new int[path.length];
  tab[0]=nb;
  for (int i=1; i < path.length; i++) {
    tab[i]=path[i];
  }
  return tab;
}
Program: 178525
Project: 178525
Buggy source:
public static List<Integer> addC(List<Integer> path,int pos,int nb){
  List<Integer> tab=new ArrayList<Integer>(path.size());
  for (int i=0; i < path.size(); i++) {
    tab.add(new Integer(path.get(i).intValue()));
  }
  tab.set(pos,tab.get(pos) + nb);
  return tab;
}

Fixed version (ground truth):
public static int[] addC(int[] path,int pos,int nb){
  int[] tab=new int[path.length];
  for (int i=0; i < path.length; i++) {
    tab[i]=path[i];
  }
  tab[pos]=tab[pos] + nb;
  return tab;
}
Program: 178526
Project: 178526
Buggy source:
/** 
 * Creates a new server correspondent for the given client
 * @param clientDTO the client for which to create a server correspondent
 * @return the document on some server in same editing session if any, otherwise the document sent by the client
 */
public Document addServerForClient(ClientDTO clientDTO){
  int editingSessionId=clientDTO.getEditingSessionId();
synchronized (editingSessions) {
    if (!editingSessions.containsKey(editingSessionId)) {
      editingSessions.put(editingSessionId,new ArrayList<Integer>());
    }
    editingSessions.get(editingSessionId).add(clientDTO.getSiteId());
  }
  int siteId=clientDTO.getSiteId();
  Document document=clientDTO.getDocument();
  List<Integer> serverIds=editingSessions.get(editingSessionId);
  if (serverIds.size() > 0) {
    ServerJupiterAlg serverPair=correspondents.get(serverIds.get(0));
    if (serverPair != null) {
      document=serverPair.getDocument();
    }
  }
  ServerJupiterAlg serverJupiter=new ServerJupiterAlg(document,siteId);
synchronized (correspondents) {
    correspondents.put(siteId,serverJupiter);
  }
  return document;
}

Fixed version (ground truth):
/** 
 * Creates a new server correspondent for the given client
 * @param clientDTO the client for which to create a server correspondent
 * @return the document on some server in same editing session if any, otherwise the document sent by the client
 */
public Document addServerForClient(ClientDTO clientDTO){
  int editingSessionId=clientDTO.getEditingSessionId();
synchronized (editingSessions) {
    if (!editingSessions.containsKey(editingSessionId)) {
      editingSessions.put(editingSessionId,new ArrayList<Integer>());
    }
    editingSessions.get(editingSessionId).add(clientDTO.getSiteId());
  }
  int siteId=clientDTO.getSiteId();
  Document document=clientDTO.getDocument();
  List<Integer> serverIds=editingSessions.get(editingSessionId);
  if (serverIds.size() > 0) {
    ServerJupiterAlg serverPair=correspondents.get(serverIds.get(0));
    if (serverPair != null) {
      document=serverPair.getDocument().deepCloneDocument();
    }
  }
  ServerJupiterAlg serverJupiter=new ServerJupiterAlg(document,siteId);
synchronized (correspondents) {
    correspondents.put(siteId,serverJupiter);
  }
  return document;
}
Program: 178527
Project: 178527
Buggy source:
/** 
 * Creates a new server correspondent for the given client
 * @param clientJupiterAlg the client for which to create a server correspondent
 * @return the document on some server in same editing session if any, otherwise the document sent by the client
 */
public Document addServerForClient(ClientDTO clientJupiterAlg){
  int editingSessionId=clientJupiterAlg.getEditingSessionId();
synchronized (editingSessions) {
    if (!editingSessions.containsKey(editingSessionId)) {
      editingSessions.put(editingSessionId,new ArrayList<Integer>());
    }
    editingSessions.get(editingSessionId).add(clientJupiterAlg.getSiteId());
  }
  int siteId=clientJupiterAlg.getSiteId();
  Document document=clientJupiterAlg.getDocument();
  List<Integer> serverIds=editingSessions.get(editingSessionId);
  if (serverIds.size() > 0) {
    ServerJupiterAlg serverPair=correspondents.get(serverIds.get(0));
    if (serverPair != null) {
      document=serverPair.getDocument();
    }
  }
  ServerJupiterAlg serverJupiter=new ServerJupiterAlg(document,siteId);
synchronized (correspondents) {
    correspondents.put(siteId,serverJupiter);
  }
  return document;
}

Fixed version (ground truth):
/** 
 * Creates a new server correspondent for the given client
 * @param clientDTO the client for which to create a server correspondent
 * @return the document on some server in same editing session if any, otherwise the document sent by the client
 */
public Document addServerForClient(ClientDTO clientDTO){
  int editingSessionId=clientDTO.getEditingSessionId();
synchronized (editingSessions) {
    if (!editingSessions.containsKey(editingSessionId)) {
      editingSessions.put(editingSessionId,new ArrayList<Integer>());
    }
    editingSessions.get(editingSessionId).add(clientDTO.getSiteId());
  }
  int siteId=clientDTO.getSiteId();
  Document document=clientDTO.getDocument();
  List<Integer> serverIds=editingSessions.get(editingSessionId);
  if (serverIds.size() > 0) {
    ServerJupiterAlg serverPair=correspondents.get(serverIds.get(0));
    if (serverPair != null) {
      document=serverPair.getDocument();
    }
  }
  ServerJupiterAlg serverJupiter=new ServerJupiterAlg(document,siteId);
synchronized (correspondents) {
    correspondents.put(siteId,serverJupiter);
  }
  return document;
}
Program: 178528
Project: 178528
Buggy source:
public void removeServerForClient(ClientDTO clientJupiterAlg){
  int editingSessionId=clientJupiterAlg.getEditingSessionId();
  int siteId=clientJupiterAlg.getSiteId();
  if (editingSessions.containsKey(editingSessionId)) {
synchronized (editingSessions) {
      editingSessions.get(editingSessionId).remove(Integer.valueOf(siteId));
    }
  }
  if (correspondents.containsKey(siteId)) {
synchronized (correspondents) {
      correspondents.remove(siteId);
    }
  }
}

Fixed version (ground truth):
public void removeServerForClient(ClientDTO clientDTO){
  int editingSessionId=clientDTO.getEditingSessionId();
  int siteId=clientDTO.getSiteId();
  if (editingSessions.containsKey(editingSessionId)) {
synchronized (editingSessions) {
      List<Integer> serverIds=editingSessions.get(editingSessionId);
      int idx=serverIds.indexOf(siteId);
      if (idx > -1) {
        serverIds.remove(idx);
      }
      if (serverIds.size() == 0) {
        editingSessions.remove(editingSessionId);
      }
    }
  }
  if (correspondents.containsKey(siteId)) {
synchronized (correspondents) {
      correspondents.remove(siteId);
    }
  }
}
Program: 178529
Project: 178529
Buggy source:
protected TreeOperation handleTreeInsertText(TreeInsertText op1){
  if (!TreeUtils.diff(op1.path,path)) {
    if (op1.getPosition() < position) {
      return op1;
    }
    List<Integer> tab=new ArrayList<Integer>(op1.path.size());
    tab.set(0,op1.path.get(0) + 1);
    return new TreeInsertText(op1.getSiteId(),op1.getPosition() - position,tab,op1.text);
  }
  if (TreeUtils.inf(op1.path,path)) {
    return op1;
  }
  if (op1.path.get(0) > path.get(0)) {
    List<Integer> tab=TreeUtils.addP(op1.path,1);
    return new TreeInsertText(op1.getSiteId(),op1.getPosition(),tab,op1.text);
  }
  List<Integer> tab=TreeUtils.reference(op1.path,path);
  return new TreeInsertText(op1.getSiteId(),op1.getPosition(),tab,op1.text);
}

Fixed version (ground truth):
protected TreeOperation handleTreeInsertText(TreeInsertText op1){
  if (!TreeUtils.diff(op1.path,path)) {
    if (op1.getPosition() < position) {
      return op1;
    }
    List<Integer> tab=new ArrayList<Integer>(op1.path.size());
    tab.set(0,op1.path.get(0) + 1);
    return new TreeInsertText(op1.getSiteId(),op1.getPosition() - position,tab,op1.getText());
  }
  if (TreeUtils.inf(op1.path,path)) {
    return op1;
  }
  if (op1.path.get(0) > path.get(0)) {
    List<Integer> tab=TreeUtils.addP(op1.path,1);
    return new TreeInsertText(op1.getSiteId(),op1.getPosition(),tab,op1.getText());
  }
  List<Integer> tab=TreeUtils.reference(op1.path,path);
  return new TreeInsertText(op1.getSiteId(),op1.getPosition(),tab,op1.getText());
}
Program: 178530
Project: 178530
Buggy source:
protected TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == path.get(0)) {
    return new TreeMergeParagraph(op1.getPosition(),op1.leftSiblingChildrenNr,path.get(1) + (splitLeft ? 1 : 0));
  }
  if (op1.getPosition() == path.get(0) + 1) {
    return new TreeMergeParagraph(op1.getPosition() + 1,op1.leftSiblingChildrenNr - path.get(1),op1.rightSiblingChildrenNr);
  }
  if (op1.getPosition() < path.get(0)) {
    return op1;
  }
  return new TreeMergeParagraph(op1.getPosition() + 1,op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
}

Fixed version (ground truth):
protected TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == path.get(0)) {
    return new TreeMergeParagraph(op1.getSiteId(),op1.getPosition(),op1.leftSiblingChildrenNr,path.get(1) + (splitLeft ? 1 : 0));
  }
  if (op1.getPosition() == path.get(0) + 1) {
    return new TreeMergeParagraph(op1.getSiteId(),op1.getPosition() + 1,op1.leftSiblingChildrenNr - path.get(1),op1.rightSiblingChildrenNr);
  }
  if (op1.getPosition() < path.get(0)) {
    return op1;
  }
  return new TreeMergeParagraph(op1.getSiteId(),op1.getPosition() + 1,op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
}
Program: 178531
Project: 178531
Buggy source:
public String toString(){
  return "String_Node_Str" + super.toString() + "String_Node_Str"+ path+ "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + super.toString() + "String_Node_Str"+ path+ "String_Node_Str"+ splitLeft+ "String_Node_Str";
}
Program: 178532
Project: 178532
Buggy source:
public TreeMergeParagraph(int position,int leftSiblingChildrenNr,int rightSiblingChildrenNr){
  this.position=position;
  this.leftSiblingChildrenNr=leftSiblingChildrenNr;
  this.rightSiblingChildrenNr=rightSiblingChildrenNr;
}

Fixed version (ground truth):
public TreeMergeParagraph(int siteId,int position,int leftSiblingChildrenNr,int rightSiblingChildrenNr){
  super(siteId,position);
  this.leftSiblingChildrenNr=leftSiblingChildrenNr;
  this.rightSiblingChildrenNr=rightSiblingChildrenNr;
}
Program: 178533
Project: 178533
Buggy source:
public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == position) {
    return new TreeIdOp();
  }
  if (op1.getPosition() == position + 1) {
    return new TreeMergeParagraph(op1.getPosition() - 1,op1.leftSiblingChildrenNr + leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
  }
  if (op1.getPosition() == position - 1) {
    return new TreeMergeParagraph(op1.getPosition(),op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr + rightSiblingChildrenNr);
  }
  if (op1.getPosition() < position) {
    return op1;
  }
  return new TreeMergeParagraph(op1.getPosition() - 1,op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
}

Fixed version (ground truth):
public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == position) {
    return new TreeIdOp();
  }
  if (op1.getPosition() == position + 1) {
    return new TreeMergeParagraph(siteId,op1.getPosition() - 1,op1.leftSiblingChildrenNr + leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
  }
  if (op1.getPosition() == position - 1) {
    return new TreeMergeParagraph(siteId,op1.getPosition(),op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr + rightSiblingChildrenNr);
  }
  if (op1.getPosition() < position) {
    return op1;
  }
  return new TreeMergeParagraph(siteId,op1.getPosition() - 1,op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
}
Program: 178535
Project: 178535
Buggy source:
public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == position) {
    return new TreeCompositeOperation(new TreeMoveParagraph(op1.getSiteId(),position,position + 2),op1);
  }
  if (op1.getPosition() < position) {
    return op1;
  }
  return new TreeMergeParagraph(op1.getPosition() + 1,op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
}

Fixed version (ground truth):
public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == position) {
    return new TreeCompositeOperation(new TreeMoveParagraph(op1.getSiteId(),position,position + 2),op1);
  }
  if (op1.getPosition() < position) {
    return op1;
  }
  return new TreeMergeParagraph(op1.getSiteId(),op1.getPosition() + 1,op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr);
}
Program: 178536
Project: 178536
Buggy source:
public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == path.get(0)) {
    int d=0;
    if (splitLeft) {
      d++;
    }
    if (sr) {
      d++;
    }
    return new TreeMergeParagraph(op1.getPosition(),op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr + d);
  }
  if (op1.getPosition() == path.get(0) + 1) {
    int d=0;
    if (splitLeft) {
      d++;
    }
    if (sr) {
      d++;
    }
    return new TreeMergeParagraph(op1.getPosition(),op1.leftSiblingChildrenNr + d,op1.rightSiblingChildrenNr);
  }
  return op1;
}

Fixed version (ground truth):
public TreeOperation handleTreeMergeParagraph(TreeMergeParagraph op1){
  if (op1.getPosition() == path.get(0)) {
    int d=0;
    if (splitLeft) {
      d++;
    }
    if (sr) {
      d++;
    }
    return new TreeMergeParagraph(op1.getSiteId(),op1.getPosition(),op1.leftSiblingChildrenNr,op1.rightSiblingChildrenNr + d);
  }
  if (op1.getPosition() == path.get(0) + 1) {
    int d=0;
    if (splitLeft) {
      d++;
    }
    if (sr) {
      d++;
    }
    return new TreeMergeParagraph(op1.getSiteId(),op1.getPosition(),op1.leftSiblingChildrenNr + d,op1.rightSiblingChildrenNr);
  }
  return op1;
}
Program: 178537
Project: 178537
Buggy source:
/** 
 * @see org.xwiki.contrib.wiki30.WorkspaceManager#editWorkspace(java.lang.String,com.xpn.xwiki.plugin.wikimanager.doc.XWikiServer)
 */
public void editWorkspace(String workspaceName,XWikiServer modifiedWikiXObjectDocument){
  try {
    String currentUser=getPrefixedUserName(getXWikiContext().getUser());
    if (!canEditWorkspace(currentUser,workspaceName)) {
      error(new WorkspaceManagerException(String.format("String_Node_Str",currentUser,workspaceName)));
    }
    if (!getXWikiContext().getWiki().getRightService().hasProgrammingRights(getXWikiContext())) {
      throw new WorkspaceManagerException(String.format("String_Node_Str",workspaceName));
    }
    workspaceManager.editWorkspace(workspaceName,modifiedWikiXObjectDocument);
  }
 catch (  Exception e) {
    error(String.format("String_Node_Str",workspaceName),e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.xwiki.contrib.wiki30.WorkspaceManager#editWorkspace(java.lang.String,com.xpn.xwiki.plugin.wikimanager.doc.XWikiServer)
 */
public void editWorkspace(String workspaceName,XWikiServer modifiedWikiXObjectDocument){
  try {
    String currentUser=getPrefixedUserName(getXWikiContext().getUser());
    if (!canEditWorkspace(currentUser,workspaceName)) {
      throw new WorkspaceManagerException(String.format("String_Node_Str",currentUser,workspaceName));
    }
    if (!getXWikiContext().getWiki().getRightService().hasProgrammingRights(getXWikiContext())) {
      throw new WorkspaceManagerException(String.format("String_Node_Str",workspaceName));
    }
    workspaceManager.editWorkspace(workspaceName,modifiedWikiXObjectDocument);
  }
 catch (  Exception e) {
    error(String.format("String_Node_Str",workspaceName),e);
  }
}
Program: 178538
Project: 178538
Buggy source:
public void removeServerPairForClient(ClientJupiterAlg clientJupiterAlg){
  logger.debug("String_Node_Str" + clientJupiterAlg.getSiteId());
  int esid=clientJupiterAlg.getEditingSessionId();
  if (locks.containsKey(esid)) {
synchronized (locks) {
      locks.get(esid).remove(Integer.valueOf(clientJupiterAlg.getSiteId()));
    }
  }
  ClientServerCorrespondents.getInstance().removeServerForClient(clientJupiterAlg);
}

Fixed version (ground truth):
public void removeServerPairForClient(ClientJupiterAlg clientJupiterAlg){
  logger.debug("String_Node_Str" + clientJupiterAlg.getSiteId());
  int esid=clientJupiterAlg.getEditingSessionId();
  if (locks.containsKey(esid)) {
synchronized (locks) {
      locks.get(esid).remove(Integer.valueOf(clientJupiterAlg.getSiteId()));
      ClientServerCorrespondents.getInstance().setEditingSessions(locks);
    }
  }
  ClientServerCorrespondents.getInstance().removeServerForClient(clientJupiterAlg);
}
Program: 178539
Project: 178539
Buggy source:
public RtApi(JavaScriptObject jsConfig){
  initClient();
  editor.addHooksToEventListeners(new EditorApi());
  Config config=new DefaultConfig(jsConfig);
  Element htmlTextAreaElement=DOM.getElementById("String_Node_Str");
  if (htmlTextAreaElement == null) {
    return;
  }
  if (htmlTextAreaElement.getTagName().equalsIgnoreCase("String_Node_Str")) {
    int width=500;
    int height=210;
    TextArea tArea=TextArea.wrap(htmlTextAreaElement);
    height=tArea.getOffsetHeight();
    width=tArea.getOffsetWidth();
    Element canvasEl=DOM.createElement("String_Node_Str");
    canvasEl.setId("String_Node_Str");
    canvasEl.setPropertyInt("String_Node_Str",width);
    canvasEl.setPropertyInt("String_Node_Str",height);
    com.google.gwt.dom.client.Element parentElem=htmlTextAreaElement.getParentElement();
    parentElem.insertFirst(canvasEl);
    parentElem.removeChild(htmlTextAreaElement);
    injectJSFilesForRTEditor(parentElem);
  }
}

Fixed version (ground truth):
public RtApi(JavaScriptObject jsConfig){
  Config config=new DefaultConfig(jsConfig);
  Element htmlTextAreaElement=DOM.getElementById("String_Node_Str");
  if (htmlTextAreaElement == null) {
    return;
  }
  if (htmlTextAreaElement.getTagName().equalsIgnoreCase("String_Node_Str")) {
    int width=500;
    int height=210;
    TextArea tArea=TextArea.wrap(htmlTextAreaElement);
    height=tArea.getOffsetHeight();
    width=tArea.getOffsetWidth();
    Element canvasEl=DOM.createElement("String_Node_Str");
    canvasEl.setId("String_Node_Str");
    canvasEl.setPropertyInt("String_Node_Str",width);
    canvasEl.setPropertyInt("String_Node_Str",height);
    com.google.gwt.dom.client.Element parentElem=htmlTextAreaElement.getParentElement();
    parentElem.insertFirst(canvasEl);
    parentElem.removeChild(htmlTextAreaElement);
    injectJSFilesForRTEditor(parentElem);
    clientJupiter.setData(tArea.getText());
    initClient();
  }
}
Program: 178540
Project: 178540
Buggy source:
/** 
 * Create the corresponding server component for this client on the server side AND update the text area with the available content
 */
private void createServerPairForClient(){
  comService.createServerPairForClient(clientJupiter,new AsyncCallback<String>(){
    public void onFailure(    Throwable caught){
      GWT.log("String_Node_Str" + caught);
    }
    public void onSuccess(    String result){
      GWT.log("String_Node_Str");
      if (result != null) {
        clientJupiter.setData(result);
        editor.setContent(result);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create the corresponding server component for this client on the server side AND update the text area with the available content
 */
private void createServerPairForClient(){
  comService.createServerPairForClient(clientJupiter,new AsyncCallback<String>(){
    public void onFailure(    Throwable caught){
      GWT.log("String_Node_Str" + caught);
    }
    public void onSuccess(    String result){
      GWT.log("String_Node_Str");
      if (result != null) {
        clientJupiter.setData(result);
        editor=Editor.getEditor();
        editor.addHooksToEventListeners(new EditorApi());
        clientJupiter.setEditor(editor);
        editor.setContent(result);
        editor.paint();
      }
    }
  }
);
}
Program: 178541
Project: 178541
Buggy source:
public Operation transform(Operation m1,Operation m2){
  if (m1 instanceof InsertOperation) {
    if (m2 instanceof InsertOperation) {
      return handleInsertInsert(m1,m2);
    }
 else     if (m2 instanceof DeleteOperation) {
      return handleInsertDelete(m1,m2);
    }
 else     return new NoOperation();
  }
 else   if (m1 instanceof DeleteOperation) {
    if (m2 instanceof InsertOperation) {
      return handleDeleteInsert(m1,m2);
    }
 else     if (m2 instanceof DeleteOperation) {
      return handleDeleteDelete(m1,m2);
    }
 else     return new NoOperation();
  }
  return new NoOperation(0);
}

Fixed version (ground truth):
public Operation transform(Operation m1,Operation m2){
  if (m1 instanceof InsertOperation) {
    if (m2 instanceof InsertOperation) {
      return handleInsertInsert(m1,m2);
    }
 else     if (m2 instanceof DeleteOperation) {
      return handleInsertDelete(m1,m2);
    }
 else {
      return m1;
    }
  }
 else   if (m1 instanceof DeleteOperation) {
    if (m2 instanceof InsertOperation) {
      return handleDeleteInsert(m1,m2);
    }
 else     if (m2 instanceof DeleteOperation) {
      return handleDeleteDelete(m1,m2);
    }
 else {
      return m1;
    }
  }
  return new NoOperation(0);
}
Program: 178542
Project: 178542
Buggy source:
/** 
 * Set test info
 * @param description
 */
protected void setTestInfo(Description description){
  JUnitTestData testMethod=new JUnitTestData(false,false);
  testMethod.setDescription(description);
  if (!testMethodsList.contains(description))   testMethodsList.add(testMethod);
}

Fixed version (ground truth):
/** 
 * Set test info
 * @param description
 */
protected void setTestInfo(Description description){
  JUnitTestData testMethod=new JUnitTestData(false,false);
  testMethod.setDescription(description);
  if (!testMethodsList.contains(testMethod))   testMethodsList.add(testMethod);
}