nus-yam/ex-repair huggingface dataset:
Program: 145358
Project: 145358
Buggy source:
public void start(Context context){
  FormDef theForm=null;
  if (context.getClass() == FormEntryContext.class) {
    this.context=(FormEntryContext)context;
    FormDefRMSUtility utility=(FormDefRMSUtility)JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().getUtility(FormDefRMSUtility.getUtilityName());
    theForm=new FormDef();
    try {
      utility.retrieveFromRMS(this.context.getFormID(),theForm);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
catch (    IllegalAccessException e) {
      e.printStackTrace();
    }
catch (    InstantiationException e) {
      e.printStackTrace();
    }
catch (    UnavailableExternalizerException uee) {
      e.printStackTrace();
    }
  }
  if (theForm != null) {
    model=new FormEntryModel(theForm);
    controller=new FormEntryController(model,this);
    view=new Chatterbox("String_Node_Str",model,controller);
    controller.setView(view);
  }
 else {
    displayError(LOAD_ERROR);
  }
}

Fixed version (ground truth):
public void start(Context context){
  FormDef theForm=null;
  if (context.getClass() == FormEntryContext.class) {
    this.context=(FormEntryContext)context;
    FormDefRMSUtility utility=(FormDefRMSUtility)JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().getUtility(FormDefRMSUtility.getUtilityName());
    theForm=new FormDef();
    try {
      utility.retrieveFromRMS(this.context.getFormID(),theForm);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
catch (    IllegalAccessException e) {
      e.printStackTrace();
    }
catch (    InstantiationException e) {
      e.printStackTrace();
    }
catch (    UnavailableExternalizerException uee) {
      uee.printStackTrace();
    }
  }
  if (theForm != null) {
    model=new FormEntryModel(theForm);
    controller=new FormEntryController(model,this);
    view=new Chatterbox("String_Node_Str",model,controller);
    controller.setView(view);
  }
 else {
    displayError(LOAD_ERROR);
  }
}
Program: 145359
Project: 145359
Buggy source:
private static void parseInstance(FormDef f,Element e){
  int numChildElements=0;
  for (int i=0; i < e.getChildCount(); i++) {
    if (e.getType(i) == Node.ELEMENT) {
      numChildElements++;
    }
  }
  if (numChildElements > 1) {
    throw new XFormParseException("String_Node_Str");
  }
  TreeElement root=parseInstanceNodes(e,"String_Node_Str").getRoot();
  DataModelTree instanceModel=new DataModelTree(root);
  f.setDataModel(instanceModel);
}

Fixed version (ground truth):
private static void parseInstance(FormDef f,Element e){
  Element dataElement=null;
  for (int i=0; i < e.getChildCount(); i++) {
    if (e.getType(i) == Node.ELEMENT) {
      if (dataElement != null) {
        throw new XFormParseException("String_Node_Str");
      }
 else {
        dataElement=e.getElement(i);
      }
    }
  }
  TreeElement root=parseInstanceNodes(dataElement,"String_Node_Str").getRoot();
  DataModelTree instanceModel=new DataModelTree(root);
  f.setDataModel(instanceModel);
}
Program: 145360
Project: 145360
Buggy source:
private static TreeElement parseInstanceNodes(Element node,String currentPath){
  int childNum=node.getChildCount();
  TreeElement element;
  if (childNum == 0) {
    XPathReference reference=new XPathReference(currentPath + node.getName());
    element=new QuestionDataElement(node.getName(),reference);
  }
 else {
    element=new QuestionDataGroup(node.getName());
    for (int i=0; i < childNum; ++i) {
      String newPath=currentPath + node.getName() + "String_Node_Str";
      ((QuestionDataGroup)element).addChild(parseInstanceNodes((Element)node.getChild(i),newPath));
    }
  }
  return element;
}

Fixed version (ground truth):
private static TreeElement parseInstanceNodes(Element node,String currentPath){
  int childNum=node.getChildCount();
  TreeElement element;
  if (childNum == 0) {
    XPathReference reference=new XPathReference(currentPath + node.getName());
    element=new QuestionDataElement(node.getName(),reference);
  }
 else {
    element=new QuestionDataGroup(node.getName());
    for (int i=0; i < childNum; ++i) {
      if (node.getType(i) != Node.ELEMENT)       continue;
      String newPath=currentPath + node.getName() + "String_Node_Str";
      ((QuestionDataGroup)element).addChild(parseInstanceNodes(node.getElement(i),newPath));
    }
  }
  return element;
}
Program: 145361
Project: 145361
Buggy source:
public FormDef(){
}

Fixed version (ground truth):
public FormDef(){
  setChildren(null);
}
Program: 145362
Project: 145362
Buggy source:
/** 
 * Creates a new QuestionDataGroup.
 * @param name The name of this TreeElement
 */
public QuestionDataGroup(String name){
  this();
  this.name=name;
}

Fixed version (ground truth):
/** 
 * Creates a new QuestionDataGroup.
 * @param name The name of this TreeElement
 */
public QuestionDataGroup(String name){
  this();
  this.name=name;
  this.children=new Vector();
}
Program: 145363
Project: 145363
Buggy source:
private void workflow(IModule lastModule,String cmd,Hashtable returnVals){
  if (stack.size() != 0) {
    stack.pop().resume(context);
  }
  if (lastModule == this.splashScreen) {
    currentModule=formTransport;
    this.formTransport.start(context);
  }
}

Fixed version (ground truth):
private void workflow(IModule lastModule,String returnCode,Hashtable returnVals){
  if (stack.size() != 0) {
    stack.pop().resume(context);
  }
  if (lastModule == this.splashScreen) {
    currentModule=modelModule;
    this.modelModule.start(context);
  }
  if (lastModule == this.modelModule) {
    if (returnCode == Constants.ACTIVITY_NEEDS_RESOLUTION) {
      Object returnVal=returnVals.get(ModelListModule.returnKey);
      if (returnVal == ModelListModule.CMD_MSGS) {
        TransportContext msgContext=new TransportContext(context);
        msgContext.setRequestedView(TransportContext.MESSAGE_VIEW);
        currentModule=formTransport;
        formTransport.start(msgContext);
      }
    }
    if (returnCode == Constants.ACTIVITY_COMPLETE) {
      Object returnVal=returnVals.get(ModelListModule.returnKey);
      if (returnVal == ModelListModule.CMD_EDIT) {
        FormDef form=(FormDef)returnVals.get("String_Node_Str");
        FormData data=(FormData)returnVals.get("String_Node_Str");
      }
      if (returnVal == ModelListModule.CMD_SEND) {
        FormData data=(FormData)returnVals.get("String_Node_Str");
      }
    }
  }
  if (lastModule == this.formTransport) {
    if (returnCode == Constants.ACTIVITY_NEEDS_RESOLUTION) {
    }
    if (returnCode == Constants.ACTIVITY_COMPLETE) {
    }
  }
}
Program: 145364
Project: 145364
Buggy source:
public void resume(Context globalContext){
  createView();
}

Fixed version (ground truth):
public void resume(Context globalContext){
  createView(currentView);
}
Program: 145365
Project: 145365
Buggy source:
public void start(Context context){
  this.context=context;
  createView();
}

Fixed version (ground truth):
public void start(Context context){
  this.context=new TransportContext(context);
  createView(this.context.getRequestedView());
}
Program: 145366
Project: 145366
Buggy source:
public void halt(){
}

Fixed version (ground truth):
public void halt(){
  currentView=TransportContext.MAIN_MENU;
}
Program: 145367
Project: 145367
Buggy source:
public void createView(){
  transportMethods=new Vector();
  Enumeration availableMethods=JavaRosaPlatform.instance().getTransportManager().getTransportMethods();
  Vector menuItems=new Vector();
  while (availableMethods.hasMoreElements()) {
    TransportMethod method=(TransportMethod)availableMethods.nextElement();
    menuItems.addElement("String_Node_Str" + method.getName());
    transportMethods.addElement(new Integer(method.getId()));
  }
  String[] elements=new String[]{"String_Node_Str","String_Node_Str"};
  menuItems.copyInto(elements);
  mainMenu=new List("String_Node_Str",List.IMPLICIT,elements,null);
  mainMenu.addCommand(CMD_BACK);
  mainMenu.addCommand(CMD_DEBUG);
  mainMenu.setSelectCommand(CMD_OK);
  mainMenu.setCommandListener(this);
  messageList=new List("String_Node_Str",List.IMPLICIT);
  messageList.addCommand(CMD_BACK);
  messageList.addCommand(CMD_DETAILS);
  messageList.addCommand(CMD_DELETEMSG);
  messageList.setSelectCommand(CMD_DETAILS);
  messageList.setCommandListener(this);
  loggingTextBox=new TextBox("String_Node_Str",null,1000,TextField.UNEDITABLE);
  loggingTextBox.addCommand(CMD_BACK);
  messageDetailTextBox=new TextBox("String_Node_Str",null,250,TextField.UNEDITABLE);
  messageDetailTextBox.addCommand(CMD_BACK);
  messageDetailTextBox.addCommand(CMD_SEND);
  messageDetailTextBox.setCommandListener(this);
  shell.setDisplay(this,mainMenu);
  System.out.println(this.data);
}

Fixed version (ground truth):
public void createView(String view){
  transportMethods=new Vector();
  Enumeration availableMethods=JavaRosaPlatform.instance().getTransportManager().getTransportMethods();
  Vector menuItems=new Vector();
  while (availableMethods.hasMoreElements()) {
    TransportMethod method=(TransportMethod)availableMethods.nextElement();
    menuItems.addElement("String_Node_Str" + method.getName());
    transportMethods.addElement(new Integer(method.getId()));
  }
  String[] elements=new String[]{"String_Node_Str","String_Node_Str"};
  menuItems.copyInto(elements);
  mainMenu=new List("String_Node_Str",List.IMPLICIT,elements,null);
  mainMenu.addCommand(CMD_BACK);
  mainMenu.addCommand(CMD_DEBUG);
  mainMenu.setSelectCommand(CMD_OK);
  mainMenu.setCommandListener(this);
  messageList=new List("String_Node_Str",List.IMPLICIT);
  messageList.addCommand(CMD_BACK);
  messageList.addCommand(CMD_DETAILS);
  messageList.addCommand(CMD_DELETEMSG);
  messageList.setSelectCommand(CMD_DETAILS);
  messageList.setCommandListener(this);
  loggingTextBox=new TextBox("String_Node_Str",null,1000,TextField.UNEDITABLE);
  loggingTextBox.addCommand(CMD_BACK);
  messageDetailTextBox=new TextBox("String_Node_Str",null,250,TextField.UNEDITABLE);
  messageDetailTextBox.addCommand(CMD_BACK);
  messageDetailTextBox.addCommand(CMD_SEND);
  messageDetailTextBox.setCommandListener(this);
  if (view.equals(TransportContext.MAIN_MENU)) {
    shell.setDisplay(this,mainMenu);
  }
 else   if (view.equals(TransportContext.MESSAGE_VIEW)) {
    shell.setDisplay(this,messageList);
  }
}
Program: 145369
Project: 145369
Buggy source:
/** 
 * Draws the Small (read only) Version of the frame onto a Screen
 * @param target the Screen to which the Frame will be Added
 */
public void drawSmallFormOnScreen(ChatScreen target){
  questiontext=new StringItem(null,questiontext.getText());
  questiontext.setStyle(StyleSheet.getStyle("String_Node_Str"));
  target.append(questiontext);
  questionResponse=new StringItem(null,questionValueToString(thePrompt));
  target.append(questionResponse);
  displayedItems=new Item[]{questiontext,questionResponse};
}

Fixed version (ground truth):
/** 
 * Draws the Small (read only) Version of the frame onto a Screen
 * @param target the Screen to which the Frame will be Added
 */
public void drawSmallFormOnScreen(ChatScreen target){
  questiontext=new StringItem(null,questiontext.getText());
  target.append(questiontext);
  questionResponse=new StringItem(null,questionValueToString(thePrompt));
  target.append(questionResponse);
  displayedItems=new Item[]{questiontext,questionResponse};
}
Program: 145370
Project: 145370
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (isHeaderRefreshing && isHeaderShowing) {
  }
  if (lockScrollWhileRefreshing && (state == State.REFRESHING || getAnimation() != null && !getAnimation().hasEnded())) {
    return true;
  }
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
    if (isPull(event) && (state == State.RELEASE_TO_REFRESH || getFirstVisiblePosition() == 0)) {
switch (state) {
case RELEASE_TO_REFRESH:
        setState(State.REFRESHING);
      bounceBackHeader();
    break;
case PULL_TO_REFRESH:
  resetHeader();
break;
default :
break;
}
}
break;
case MotionEvent.ACTION_MOVE:
if (isPull(event)) {
float y=event.getY();
float diff=y - previousY;
if (diff > 0) diff/=PULL_RESISTANCE;
previousY=y;
int newHeaderPadding=Math.max(Math.round(headerPadding + diff),-header.getHeight());
if (newHeaderPadding != headerPadding && state != State.REFRESHING) {
setHeaderPadding(newHeaderPadding);
if (state == State.PULL_TO_REFRESH && headerPadding > 0) {
setState(State.RELEASE_TO_REFRESH);
image.clearAnimation();
image.startAnimation(flipAnimation);
}
 else if (state == State.RELEASE_TO_REFRESH && headerPadding < 0) {
setState(State.PULL_TO_REFRESH);
image.clearAnimation();
image.startAnimation(reverseFlipAnimation);
}
}
}
break;
}
return super.onTouchEvent(event);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (isHeaderRefreshing && isHeaderShowing) {
  }
  if (lockScrollWhileRefreshing && (state == State.REFRESHING || getAnimation() != null && !getAnimation().hasEnded())) {
    return true;
  }
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
    if (couldRefresh() && (state == State.RELEASE_TO_REFRESH || getFirstVisiblePosition() == 0)) {
switch (state) {
case RELEASE_TO_REFRESH:
        setState(State.REFRESHING);
      bounceBackHeader();
    break;
case PULL_TO_REFRESH:
  resetHeader();
break;
default :
break;
}
}
break;
case MotionEvent.ACTION_MOVE:
if (couldRefresh()) {
float y=event.getY();
float diff=y - previousY;
if (diff > 0) diff/=PULL_RESISTANCE;
previousY=y;
int newHeaderPadding=Math.max(Math.round(headerPadding + diff),-header.getHeight());
if (newHeaderPadding != headerPadding && state != State.REFRESHING) {
setHeaderPadding(newHeaderPadding);
if (state == State.PULL_TO_REFRESH && headerPadding > 0) {
setState(State.RELEASE_TO_REFRESH);
image.clearAnimation();
image.startAnimation(flipAnimation);
}
 else if (state == State.RELEASE_TO_REFRESH && headerPadding < 0) {
setState(State.PULL_TO_REFRESH);
image.clearAnimation();
image.startAnimation(reverseFlipAnimation);
}
}
}
break;
}
return super.onTouchEvent(event);
}
Program: 145371
Project: 145371
Buggy source:
private void addDatas(){
  int j=i + 30;
  for (; i < j; ++i) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    builder.append(i);
    builder.append("String_Node_Str");
    char[] chars=new char[mRand.nextInt(500)];
    Arrays.fill(chars,'1');
    builder.append(chars);
    mAdapter.add(builder.toString());
  }
}

Fixed version (ground truth):
private void addDatas(){
  int j=i + 15;
  for (; i < j; ++i) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    builder.append(i);
    builder.append("String_Node_Str");
    char[] chars=new char[mRand.nextInt(500)];
    Arrays.fill(chars,'1');
    builder.append(chars);
    mAdapter.add(builder.toString());
  }
}
Program: 145372
Project: 145372
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (isHeaderRefreshing && isHeaderShowing) {
  }
  if (lockScrollWhileRefreshing && (state == State.REFRESHING || getAnimation() != null && !getAnimation().hasEnded())) {
    return true;
  }
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
    if (couldRefresh() && (state == State.RELEASE_TO_REFRESH || getFirstVisiblePosition() == 0)) {
switch (state) {
case RELEASE_TO_REFRESH:
        setState(State.REFRESHING);
      bounceBackHeader();
    break;
case PULL_TO_REFRESH:
  resetHeader();
break;
default :
break;
}
}
break;
case MotionEvent.ACTION_MOVE:
if (couldRefresh()) {
float y=event.getY();
float diff=y - previousY;
if (diff > 0) diff/=PULL_RESISTANCE;
previousY=y;
int newHeaderPadding=Math.max(Math.round(headerPadding + diff),-header.getHeight());
if (newHeaderPadding != headerPadding && state != State.REFRESHING) {
setHeaderPadding(newHeaderPadding);
if (state == State.PULL_TO_REFRESH && headerPadding > 0) {
setState(State.RELEASE_TO_REFRESH);
image.clearAnimation();
image.startAnimation(flipAnimation);
}
 else if (state == State.RELEASE_TO_REFRESH && headerPadding < 0) {
setState(State.PULL_TO_REFRESH);
image.clearAnimation();
image.startAnimation(reverseFlipAnimation);
}
}
}
break;
}
return super.onTouchEvent(event);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (isHeaderRefreshing && isHeaderShowing) {
  }
  if (lockScrollWhileRefreshing && (state == State.REFRESHING || getAnimation() != null && !getAnimation().hasEnded())) {
    return true;
  }
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
    if (couldRefresh() && (state == State.RELEASE_TO_REFRESH || getFirstVisiblePosition() == 0)) {
switch (state) {
case RELEASE_TO_REFRESH:
        setState(State.REFRESHING);
      bounceBackHeader();
    break;
case PULL_TO_REFRESH:
  resetHeader();
break;
default :
break;
}
}
break;
case MotionEvent.ACTION_MOVE:
if (couldRefresh()) {
float y=event.getY();
float diff=y - previousY;
if (diff > 0) diff/=PULL_RESISTANCE;
previousY=y;
int newHeaderPadding=Math.max(Math.round(headerPadding + diff),-header.getHeight());
if (newHeaderPadding != headerPadding && state != State.REFRESHING) {
setHeaderPadding(newHeaderPadding);
if (hackGetScrollY() < 50) {
if (state == State.PULL_TO_REFRESH && headerPadding > 0) {
setState(State.RELEASE_TO_REFRESH);
image.clearAnimation();
image.startAnimation(flipAnimation);
}
 else if (state == State.RELEASE_TO_REFRESH && headerPadding < 0) {
setState(State.PULL_TO_REFRESH);
image.clearAnimation();
image.startAnimation(reverseFlipAnimation);
}
}
}
}
break;
}
return super.onTouchEvent(event);
}
Program: 145373
Project: 145373
Buggy source:
public void loadRegions() throws IOException {
  if (!Files.isDirectory(path))   throw new InvalidSaveFormatException("String_Node_Str");
  try (DirectoryStream<Path> ds=Files.newDirectoryStream(path)){
    Pattern fileNamePattern=Pattern.compile("String_Node_Str");
    for (    Path regionPath : ds) {
      Matcher fileNameMatcher=fileNamePattern.matcher(regionPath.getFileName().toString());
      if (!fileNameMatcher.matches())       continue;
      System.out.println("String_Node_Str" + regionPath);
      int regionX=Integer.parseInt(fileNameMatcher.group(1));
      int regionZ=Integer.parseInt(fileNameMatcher.group(2));
      try (AnvilReader reader=new AnvilReader(regionPath)){
        int i=0;
        while (reader.hasMore()) {
          try (InputStream chunkStream=reader.readChunkColumn()){
            try {
              ChunkColumn column=ChunkColumn.load(chunkStream,regionX,regionZ);
              i++;
              System.out.print("String_Node_Str");
              items.addAll(column.getDroppedItems());
            }
 catch (            Exception e) {
              e.printStackTrace();
            }
          }
         }
      }
     }
  }
 }

Fixed version (ground truth):
public void loadRegions() throws IOException {
  if (!Files.isDirectory(path))   throw new InvalidSaveFormatException("String_Node_Str");
  try (DirectoryStream<Path> ds=Files.newDirectoryStream(path)){
    Pattern fileNamePattern=Pattern.compile("String_Node_Str");
    for (    Path regionPath : ds) {
      Matcher fileNameMatcher=fileNamePattern.matcher(regionPath.getFileName().toString());
      if (!fileNameMatcher.matches())       continue;
      System.out.println("String_Node_Str" + regionPath);
      int regionX=Integer.parseInt(fileNameMatcher.group(1));
      int regionZ=Integer.parseInt(fileNameMatcher.group(2));
      try (AnvilReader reader=new AnvilReader(regionPath)){
        while (reader.hasMore()) {
          try (InputStream chunkStream=reader.readChunkColumn()){
            ChunkColumn column=ChunkColumn.load(chunkStream,regionX,regionZ);
            items.addAll(column.getDroppedItems());
          }
         }
      }
     }
  }
 }
Program: 145374
Project: 145374
Buggy source:
public World(Path path) throws IOException {
  this.path=path;
  overworld=new Dimension(path.resolve("String_Node_Str"));
  Path p=path.resolve("String_Node_Str").resolve("String_Node_Str");
  if (Files.isDirectory(p))   nether=new Dimension(p);
  p=path.resolve("String_Node_Str").resolve("String_Node_Str");
  if (Files.isDirectory(p))   end=new Dimension(p);
}

Fixed version (ground truth):
public World(Path path) throws IOException {
  overworld=new Dimension(path.resolve("String_Node_Str"));
  Path p=path.resolve("String_Node_Str").resolve("String_Node_Str");
  if (Files.isDirectory(p))   nether=new Dimension(p);
  p=path.resolve("String_Node_Str").resolve("String_Node_Str");
  if (Files.isDirectory(p))   end=new Dimension(p);
}
Program: 145375
Project: 145375
Buggy source:
protected void addTableFieldsToSelectResults(SqlQuery aQuery,Table aFieldsSource) throws Exception {
  FieldsResult fieldsRes=getTablyFields(aQuery.getDatasourceName(),aFieldsSource.getWholeTableName());
  if (fieldsRes != null && fieldsRes.fields != null) {
    TypesResolver resolver=basesProxy.getMetadataCache(aQuery.getDatasourceName()).getDatasourceSqlDriver().getTypesResolver();
    fieldsRes.fields.toCollection().stream().forEach((    Field field) -> {
      Field copied=new Field();
      copied.assignFrom(field);
      if (fieldsRes.fromRealTable) {
        JdbcField jField=(JdbcField)field;
        copied.setType(resolver.toApplicationType(jField.getJdbcType(),jField.getType()));
        if (jField.getSchemaName() != null && !jField.getSchemaName().isEmpty()) {
          copied.setTableName(jField.getSchemaName() + "String_Node_Str" + copied.getTableName());
        }
      }
      if (aliasesToTableNames && aFieldsSource.getAlias() != null && !aFieldsSource.getAlias().getName().isEmpty()) {
        copied.setTableName(aFieldsSource.getAlias().getName());
      }
      aQuery.getFields().add(copied);
    }
);
  }
}

Fixed version (ground truth):
protected void addTableFieldsToSelectResults(SqlQuery aQuery,Table aFieldsSource) throws Exception {
  FieldsResult fieldsRes=getTablyFields(aQuery.getDatasourceName(),aFieldsSource.getWholeTableName());
  if (fieldsRes != null && fieldsRes.fields != null) {
    MetadataCache mdCache=basesProxy.getMetadataCache(aQuery.getDatasourceName());
    if (mdCache != null) {
      TypesResolver resolver=mdCache.getDatasourceSqlDriver().getTypesResolver();
      fieldsRes.fields.toCollection().stream().forEach((      Field field) -> {
        Field copied=new Field();
        copied.assignFrom(field);
        if (fieldsRes.fromRealTable) {
          JdbcField jField=(JdbcField)field;
          copied.setType(resolver.toApplicationType(jField.getJdbcType(),jField.getType()));
          if (jField.getSchemaName() != null && !jField.getSchemaName().isEmpty()) {
            copied.setTableName(jField.getSchemaName() + "String_Node_Str" + copied.getTableName());
          }
        }
        if (aliasesToTableNames && aFieldsSource.getAlias() != null && !aFieldsSource.getAlias().getName().isEmpty()) {
          copied.setTableName(aFieldsSource.getAlias().getName());
        }
        aQuery.getFields().add(copied);
      }
);
    }
  }
}
Program: 145376
Project: 145376
Buggy source:
@ScriptFunction public ModelWidget getView(){
  return ((ModelColumn)getTableColumn()).getView();
}

Fixed version (ground truth):
@Undesignable @ScriptFunction public ModelWidget getView(){
  return ((ModelColumn)getTableColumn()).getView();
}
Program: 145377
Project: 145377
Buggy source:
@ScriptFunction public ModelWidget getEditor(){
  return ((ModelColumn)getTableColumn()).getEditor();
}

Fixed version (ground truth):
@Undesignable @ScriptFunction public ModelWidget getEditor(){
  return ((ModelColumn)getTableColumn()).getEditor();
}
Program: 145378
Project: 145378
Buggy source:
protected void bind(){
  if (data != null && field != null && !field.isEmpty() && Scripts.isInitialized()) {
    boundToData=Scripts.getSpace().listen(data,field,new AbstractJSObject(){
      @Override public Object call(      Object thiz,      Object... args){
        rebind();
        return null;
      }
    }
);
    Object oData=ModelWidget.getPathData(data,field);
    setJsValue(oData);
    boundToValue=(    PropertyChangeEvent evt) -> {
      if (!settingValueFromJs) {
        settingValueToJs=true;
        try {
          ModelWidget.setPathData(data,field,Scripts.getSpace().toJs(evt.getNewValue()));
        }
  finally {
          settingValueToJs=false;
        }
      }
    }
;
    addValueChangeListener(boundToValue);
  }
}

Fixed version (ground truth):
protected void bind(){
  if (data != null && field != null && !field.isEmpty() && Scripts.isInitialized()) {
    boundToData=Scripts.getSpace().listen(data,field,new AbstractJSObject(){
      @Override public Object call(      Object thiz,      Object... args){
        rebind();
        return null;
      }
    }
);
    Object oData=ModelWidget.getPathData(data,field);
    setJsValue(oData);
    boundToValue=(    PropertyChangeEvent evt) -> {
      if (!settingValueFromJs) {
        settingValueToJs=true;
        try {
          ModelWidget.setPathData(data,field,Scripts.getSpace().toJs(evt.getNewValue()));
        }
  finally {
          settingValueToJs=false;
        }
      }
    }
;
    addValueChangeListener(boundToValue);
  }
 else {
    setJsValue(null);
  }
}
Program: 145379
Project: 145379
Buggy source:
@Override public void focusLost(FocusEvent e){
  checkValueChanged();
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
  String text=getText();
  if (text != null && !"String_Node_Str".equals(text)) {
    nullValue=false;
  }
  checkValueChanged();
}
Program: 145380
Project: 145380
Buggy source:
public static Path lookupPlatypusJs() throws URISyntaxException {
  URL platypusURL=Thread.currentThread().getContextClassLoader().getResource(Scripts.PLATYPUS_JS_FILENAME);
  Path apiPath=Paths.get(platypusURL.toURI());
  apiPath=apiPath.getParent();
  return apiPath;
}

Fixed version (ground truth):
public static Path lookupPlatypusJs() throws URISyntaxException {
  URL platypusURL=Thread.currentThread().getContextClassLoader().getResource(Scripts.INTERNALS_JS_FILENAME);
  Path apiPath=Paths.get(platypusURL.toURI());
  apiPath=apiPath.getParent();
  return apiPath;
}
Program: 145381
Project: 145381
Buggy source:
public static void init(Path aAbsoluteApiPath,boolean aGlobalAPI) throws MalformedURLException {
  globalAPI=aGlobalAPI;
  platypusJsUrl=aAbsoluteApiPath.resolve(PLATYPUS_JS_FILENAME).toUri().toURL();
  internalsUrl=aAbsoluteApiPath.resolve(INTERNALS_JS_FILENAME).toUri().toURL();
  absoluteApiPath=aAbsoluteApiPath;
}

Fixed version (ground truth):
public static void init(Path aAbsoluteApiPath,boolean aGlobalAPI) throws MalformedURLException {
  globalAPI=aGlobalAPI;
  internalsUrl=aAbsoluteApiPath.resolve(INTERNALS_JS_FILENAME).toUri().toURL();
  absoluteApiPath=aAbsoluteApiPath;
}
Program: 145382
Project: 145382
Buggy source:
public static String lookupCallerJsFile(){
  String calledFromFile=null;
  try {
    throw new Exception("String_Node_Str");
  }
 catch (  Exception ex) {
    StackTraceElement[] stackFrames=ex.getStackTrace();
    String firstFileName=extractFileName(stackFrames[0]);
    if (firstFileName != null) {
      for (int frameIdx=1; frameIdx < stackFrames.length; frameIdx++) {
        String fileName=extractFileName(stackFrames[frameIdx]);
        if (fileName != null && !fileName.equals(firstFileName)) {
          calledFromFile=fileName;
          int lastQuestionIndex=calledFromFile.lastIndexOf('?');
          return calledFromFile.substring(0,lastQuestionIndex);
        }
      }
    }
  }
  return calledFromFile;
}

Fixed version (ground truth):
public static String lookupCallerJsFile(){
  String calledFromFile=null;
  try {
    throw new Exception("String_Node_Str");
  }
 catch (  Exception ex) {
    StackTraceElement[] stackFrames=ex.getStackTrace();
    String firstFileName=extractFileName(stackFrames[0]);
    if (firstFileName != null) {
      for (int frameIdx=1; frameIdx < stackFrames.length; frameIdx++) {
        String fileName=extractFileName(stackFrames[frameIdx]);
        if (fileName != null && !fileName.equals(firstFileName)) {
          calledFromFile=fileName;
          int lastQuestionIndex=calledFromFile.lastIndexOf('?');
          return lastQuestionIndex != -1 ? calledFromFile.substring(0,lastQuestionIndex) : calledFromFile;
        }
      }
    }
  }
  return calledFromFile;
}
Program: 145384
Project: 145384
Buggy source:
@Override protected void projectClosed(){
  try {
    if (datasourceListener != null) {
      datasourceListener.remove();
    }
    GlobalPathRegistry.getDefault().unregister(PlatypusPathRecognizer.SOURCE_CP,new ClassPath[]{sourceCp});
    GlobalPathRegistry.getDefault().unregister(PlatypusPathRecognizer.API_CP,new ClassPath[]{apiCp});
    GlobalPathRegistry.getDefault().unregister(ClassPath.SOURCE,new ClassPath[]{sourceCp});
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.INFO,"String_Node_Str");
  }
 catch (  Exception ex) {
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
@Override protected void projectClosed(){
  try {
    if (datasourceListener != null) {
      datasourceListener.remove();
    }
    GlobalPathRegistry.getDefault().unregister(PlatypusPathRecognizer.API_CP,new ClassPath[]{apiCp});
    GlobalPathRegistry.getDefault().unregister(PlatypusPathRecognizer.SOURCE_CP,new ClassPath[]{sourceCp});
    GlobalPathRegistry.getDefault().unregister(ClassPath.SOURCE,new ClassPath[]{apiCp,sourceCp});
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.INFO,"String_Node_Str",getDisplayName());
  }
 catch (  Exception ex) {
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 145385
Project: 145385
Buggy source:
@Override protected void projectOpened(){
  try {
    datasourceListener=DatabaseConnections.getDefault().addListener(this);
    sourceCp=ClassPath.getClassPath(getSrcRoot(),PlatypusPathRecognizer.SOURCE_CP);
    apiCp=ClassPath.getClassPath(getApiRoot(),PlatypusPathRecognizer.API_CP);
    GlobalPathRegistry.getDefault().register(PlatypusPathRecognizer.SOURCE_CP,new ClassPath[]{sourceCp});
    GlobalPathRegistry.getDefault().register(PlatypusPathRecognizer.API_CP,new ClassPath[]{apiCp});
    GlobalPathRegistry.getDefault().register(ClassPath.SOURCE,new ClassPath[]{sourceCp});
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.INFO,"String_Node_Str");
    settings.load();
    startConnecting2db(getSettings().getDefaultDataSourceName());
    updatePlatypusRuntime();
  }
 catch (  Exception ex) {
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
@Override protected void projectOpened(){
  try {
    datasourceListener=DatabaseConnections.getDefault().addListener(this);
    apiCp=ClassPath.getClassPath(getApiRoot(),PlatypusPathRecognizer.API_CP);
    sourceCp=ClassPath.getClassPath(getSrcRoot(),PlatypusPathRecognizer.SOURCE_CP);
    GlobalPathRegistry.getDefault().register(PlatypusPathRecognizer.API_CP,new ClassPath[]{apiCp});
    GlobalPathRegistry.getDefault().register(PlatypusPathRecognizer.SOURCE_CP,new ClassPath[]{sourceCp});
    GlobalPathRegistry.getDefault().register(ClassPath.SOURCE,new ClassPath[]{apiCp,sourceCp});
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.INFO,"String_Node_Str",getDisplayName());
    settings.load();
    startConnecting2db(getSettings().getDefaultDataSourceName());
    updatePlatypusRuntime();
  }
 catch (  Exception ex) {
    Logger.getLogger(PlatypusProjectImpl.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 145386
Project: 145386
Buggy source:
public static String getApiClasspath(String executablePath){
  StringBuilder classpathStr=new StringBuilder(executablePath);
  File apiDir=getPlatformApiDirectory();
  if (apiDir.exists() && apiDir.isDirectory()) {
    classpathStr.append(File.pathSeparator);
    classpathStr.append(apiDir);
  }
  return classpathStr.toString();
}

Fixed version (ground truth):
public static String getApiClasspath(PlatypusProject aProject,String executablePath){
  StringBuilder classpathStr=new StringBuilder(executablePath);
  File apiDir=FileUtil.toFile(aProject.getApiRoot());
  if (apiDir.exists() && apiDir.isDirectory()) {
    classpathStr.append(File.pathSeparator);
    classpathStr.append(apiDir);
  }
  return classpathStr.toString();
}
Program: 145387
Project: 145387
Buggy source:
private static void start(PlatypusProject project,String appElementName,boolean debug) throws Exception {
}

Fixed version (ground truth):
private static void start(PlatypusProject aProject,String appElementName,boolean aDebug) throws Exception {
}
Program: 145388
Project: 145388
Buggy source:
public List<Change> getChangeLog(String aDatasourceName){
  List<Change> changeLog=changeLogs.get(aDatasourceName);
  if (changeLog == null) {
    changeLog=new ArrayList<>();
    changeLogs.put(aDatasourceName,changeLog);
  }
  return changeLog;
}

Fixed version (ground truth):
public List<Change> getChangeLog(String aDatasourceName){
  String datasourceName=aDatasourceName;
  if (datasourceName == null || datasourceName.isEmpty())   datasourceName=basesProxy.getDefaultDatasourceName();
  List<Change> changeLog=changeLogs.get(datasourceName);
  if (changeLog == null) {
    changeLog=new ArrayList<>();
    changeLogs.put(datasourceName,changeLog);
  }
  return changeLog;
}
Program: 145389
Project: 145389
Buggy source:
public ChangesSortProcess(List<Change> aChanges,Consumer<Map<String,List<Change>>> aOnSuccess,Consumer<Exception> aOnFailure){
  super();
  expectedChanges=aChanges;
  onSuccess=aOnSuccess;
  onFailure=aOnFailure;
}

Fixed version (ground truth):
public ChangesSortProcess(List<Change> aChanges,String aDefaultDatasource,Consumer<Map<String,List<Change>>> aOnSuccess,Consumer<Exception> aOnFailure){
  super();
  expectedChanges=aChanges;
  defaultDatasource=aDefaultDatasource;
  onSuccess=aOnSuccess;
  onFailure=aOnFailure;
}
Program: 145392
Project: 145392
Buggy source:
public static void initUsersSpace(DataSource aSource) throws Exception {
  try (Connection lconn=aSource.getConnection()){
    lconn.setAutoCommit(false);
    String dialect=dialectByConnection(lconn);
    SqlDriver driver=SQLUtils.getSqlDriver(dialect);
    driver.initializeUsersSpace(lconn);
  }
 }

Fixed version (ground truth):
public static void initUsersSpace(DataSource aSource) throws Exception {
  try (Connection lconn=aSource.getConnection()){
    boolean autoCommit=lconn.getAutoCommit();
    try {
      lconn.setAutoCommit(false);
      String dialect=dialectByConnection(lconn);
      SqlDriver driver=SQLUtils.getSqlDriver(dialect);
      driver.initializeUsersSpace(lconn);
    }
  finally {
      lconn.setAutoCommit(autoCommit);
    }
  }
 }
Program: 145393
Project: 145393
Buggy source:
public static void initVersioning(DataSource aSource) throws Exception {
  try (Connection lconn=aSource.getConnection()){
    lconn.setAutoCommit(false);
    String dialect=dialectByConnection(lconn);
    SqlDriver driver=SQLUtils.getSqlDriver(dialect);
    driver.initializeVersion(lconn);
  }
 }

Fixed version (ground truth):
public static void initVersioning(DataSource aSource) throws Exception {
  try (Connection lconn=aSource.getConnection()){
    boolean autoCommit=lconn.getAutoCommit();
    try {
      lconn.setAutoCommit(false);
      String dialect=dialectByConnection(lconn);
      SqlDriver driver=SQLUtils.getSqlDriver(dialect);
      driver.initializeVersion(lconn);
    }
  finally {
      lconn.setAutoCommit(autoCommit);
    }
  }
 }
Program: 145394
Project: 145394
Buggy source:
public ApplyResult(int rowsAffected,Connection connection){
  this.rowsAffected=rowsAffected;
  this.connection=connection;
}

Fixed version (ground truth):
public ApplyResult(int aRowsAffected,Connection aConnection,boolean aAutoCommit){
  super();
  rowsAffected=aRowsAffected;
  connection=aConnection;
  autoCommit=aAutoCommit;
}
Program: 145396
Project: 145396
Buggy source:
public static void applyScript(String scriptText,Connection aConnection) throws Exception {
  String[] commandsTexts=scriptText.split(EAS_SQL_SCRIPT_DELIMITER);
  aConnection.setAutoCommit(false);
  if (commandsTexts != null) {
    try (Statement stmt=aConnection.createStatement()){
      for (int i=0; i < commandsTexts.length; i++) {
        try {
          String queryText=commandsTexts[i];
          queryText=queryText.replace('\r',' ');
          queryText=queryText.replace('\n',' ');
          if (!queryText.isEmpty()) {
            stmt.execute(queryText);
            aConnection.commit();
          }
        }
 catch (        Exception ex) {
          aConnection.rollback();
          Logger.getLogger(SqlDriver.class.getName()).log(Level.WARNING,"String_Node_Str",ex.getMessage());
        }
      }
    }
   }
}

Fixed version (ground truth):
public static void applyScript(String scriptText,Connection aConnection) throws Exception {
  String[] commandsTexts=scriptText.split(EAS_SQL_SCRIPT_DELIMITER);
  if (commandsTexts != null) {
    boolean autoCommit=aConnection.getAutoCommit();
    try {
      aConnection.setAutoCommit(false);
      try (Statement stmt=aConnection.createStatement()){
        for (        String commandText : commandsTexts) {
          String queryText=commandText;
          queryText=queryText.replace('\r',' ');
          queryText=queryText.replace('\n',' ');
          if (!queryText.isEmpty()) {
            try {
              stmt.execute(queryText);
              aConnection.commit();
            }
 catch (            Exception ex) {
              aConnection.rollback();
              Logger.getLogger(SqlDriver.class.getName()).log(Level.WARNING,"String_Node_Str",ex.getMessage());
            }
          }
        }
      }
     }
  finally {
      aConnection.setAutoCommit(autoCommit);
    }
  }
}
Program: 145398
Project: 145398
Buggy source:
public void applyColumns(){
  for (int i=getDataColumnCount() - 1; i >= 0; i--) {
    removeColumn(i);
  }
  List<HeaderNode<JavaScriptObject>> leaves=new ArrayList<>();
  HeaderAnalyzer.achieveLeaves(header,leaves);
  for (  HeaderNode<JavaScriptObject> leaf : leaves) {
    Header<String> header=leaf.getHeader();
    ModelColumn column=(ModelColumn)leaf.getColumn();
    column.setGrid(this);
    addColumn(column,column.getWidth() + "String_Node_Str",header,null,!column.isVisible());
  }
  ThemedHeaderOrFooterBuilder<JavaScriptObject> leftBuilder=(ThemedHeaderOrFooterBuilder<JavaScriptObject>)headerLeft.getHeaderBuilder();
  ThemedHeaderOrFooterBuilder<JavaScriptObject> rightBuilder=(ThemedHeaderOrFooterBuilder<JavaScriptObject>)headerRight.getHeaderBuilder();
  List<HeaderNode<JavaScriptObject>> leftHeader=HeaderSplitter.split(header,0,frozenColumns);
  leftBuilder.setHeaderNodes(leftHeader);
  List<HeaderNode<JavaScriptObject>> rightHeader=HeaderSplitter.split(header,frozenColumns,getDataColumnCount());
  rightBuilder.setHeaderNodes(rightHeader);
  checkTreeIndicatorColumnDataProvider();
  redrawHeaders();
}

Fixed version (ground truth):
public void applyColumns(){
  clearColumns();
  List<HeaderNode<JavaScriptObject>> leaves=new ArrayList<>();
  HeaderAnalyzer.achieveLeaves(header,leaves);
  for (  HeaderNode<JavaScriptObject> leaf : leaves) {
    Header<String> header=leaf.getHeader();
    ModelColumn column=(ModelColumn)leaf.getColumn();
    column.setGrid(this);
    addColumn(column,column.getWidth() + "String_Node_Str",header,null,!column.isVisible());
  }
  ThemedHeaderOrFooterBuilder<JavaScriptObject> leftBuilder=(ThemedHeaderOrFooterBuilder<JavaScriptObject>)headerLeft.getHeaderBuilder();
  ThemedHeaderOrFooterBuilder<JavaScriptObject> rightBuilder=(ThemedHeaderOrFooterBuilder<JavaScriptObject>)headerRight.getHeaderBuilder();
  List<HeaderNode<JavaScriptObject>> leftHeader=HeaderSplitter.split(header,0,frozenColumns);
  leftBuilder.setHeaderNodes(leftHeader);
  List<HeaderNode<JavaScriptObject>> rightHeader=HeaderSplitter.split(header,frozenColumns,getDataColumnCount());
  rightBuilder.setHeaderNodes(rightHeader);
  checkTreeIndicatorColumnDataProvider();
  redrawHeaders();
}
Program: 145399
Project: 145399
Buggy source:
@Override public void setFrozenColumns(int aValue){
  if (aValue >= 0 && frozenColumns != aValue) {
    if (aValue >= 0) {
      frozenColumns=aValue;
      if (autoRefreshHeader && getDataColumnCount() > 0 && aValue <= getDataColumnCount()) {
        applyColumns();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setFrozenColumns(int aValue){
  if (aValue >= 0 && frozenColumns != aValue) {
    frozenColumns=aValue;
    if (autoRefreshHeader && getDataColumnCount() > 0 && aValue <= getDataColumnCount()) {
      applyColumns();
    }
  }
}
Program: 145400
Project: 145400
Buggy source:
public static SqlDriver getSqlDriver(String aDialect){
  if (aDialect != null) {
    if (ClientConstants.SERVER_PROPERTY_ORACLE_DIALECT.equalsIgnoreCase(aDialect)) {
      return easOraDriver;
    }
 else     if (ClientConstants.SERVER_PROPERTY_MSSQL_DIALECT.equalsIgnoreCase(aDialect)) {
      return easMsSqlDriver;
    }
 else     if (ClientConstants.SERVER_PROPERTY_POSTGRE_DIALECT.equalsIgnoreCase(aDialect)) {
      return easPostgreSqlDriver;
    }
 else     if (ClientConstants.SERVER_PROPERTY_MYSQL_DIALECT.equalsIgnoreCase(aDialect)) {
      return easMySqlSqlDriver;
    }
 else     if (ClientConstants.SERVER_PROPERTY_DB2_DIALECT.equalsIgnoreCase(aDialect)) {
      return easDb2Driver;
    }
 else     if (ClientConstants.SERVER_PROPERTY_H2_DIALECT.equalsIgnoreCase(aDialect)) {
      return easH2Driver;
    }
  }
  return null;
}

Fixed version (ground truth):
public static SqlDriver getSqlDriver(String aDialect){
  if (ClientConstants.SERVER_PROPERTY_ORACLE_DIALECT.equalsIgnoreCase(aDialect)) {
    return new OracleSqlDriver();
  }
 else   if (ClientConstants.SERVER_PROPERTY_MSSQL_DIALECT.equalsIgnoreCase(aDialect)) {
    return new MsSqlSqlDriver();
  }
 else   if (ClientConstants.SERVER_PROPERTY_POSTGRE_DIALECT.equalsIgnoreCase(aDialect)) {
    return new PostgreSqlDriver();
  }
 else   if (ClientConstants.SERVER_PROPERTY_MYSQL_DIALECT.equalsIgnoreCase(aDialect)) {
    return new MySqlSqlDriver();
  }
 else   if (ClientConstants.SERVER_PROPERTY_DB2_DIALECT.equalsIgnoreCase(aDialect)) {
    return new Db2SqlDriver();
  }
 else   if (ClientConstants.SERVER_PROPERTY_H2_DIALECT.equalsIgnoreCase(aDialect)) {
    return new H2SqlDriver();
  }
  return null;
}
Program: 145401
Project: 145401
Buggy source:
@Override public void onDrag(DragEvent event){
  if (DraggedColumn.instance != null && DraggedColumn.instance.isResize()) {
    event.stopPropagation();
    Element hostElement=Grid.this.getElement();
    int clientX=event.getNativeEvent().getClientX();
    int hostAbsX=hostElement.getAbsoluteLeft();
    int hostScrollX=hostElement.getScrollLeft();
    int docScrollX=hostElement.getOwnerDocument().getScrollLeft();
    int relativeX=clientX - hostAbsX + hostScrollX + docScrollX;
    ghostLine.getStyle().setLeft(relativeX,Style.Unit.PX);
    ghostLine.getStyle().setHeight(hostElement.getClientHeight(),Style.Unit.PX);
    if (ghostLine.getParentElement() != hostElement) {
      hostElement.appendChild(ghostLine);
    }
    int newWidth=event.getNativeEvent().getClientX() - DraggedColumn.instance.getCellElement().getAbsoluteLeft();
    if (newWidth > MINIMUM_COLUMN_WIDTH) {
      event.getDataTransfer().<XDataTransfer>cast().setDropEffect("String_Node_Str");
    }
 else {
      event.getDataTransfer().<XDataTransfer>cast().setDropEffect("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void onDrag(DragEvent event){
  if (DraggedColumn.instance != null && DraggedColumn.instance.isResize()) {
    event.stopPropagation();
  }
}
Program: 145403
Project: 145403
Buggy source:
@Override public void onDragOver(DragOverEvent event){
  if (DraggedColumn.instance != null) {
    event.preventDefault();
    event.stopPropagation();
    if (DraggedColumn.instance.isMove()) {
      DraggedColumn<T> target=findTargetDraggedColumn(event.getNativeEvent().getEventTarget());
      if (target != null) {
        event.getDataTransfer().<XDataTransfer>cast().setDropEffect("String_Node_Str");
      }
 else {
        hideColumnDecorations();
        event.getDataTransfer().<XDataTransfer>cast().setDropEffect("String_Node_Str");
      }
    }
 else {
    }
  }
}

Fixed version (ground truth):
@Override public void onDragOver(DragOverEvent event){
  if (DraggedColumn.instance != null) {
    event.preventDefault();
    event.stopPropagation();
    if (DraggedColumn.instance.isMove()) {
      DraggedColumn<T> target=findTargetDraggedColumn(event.getNativeEvent().getEventTarget());
      if (target != null) {
        event.getDataTransfer().<XDataTransfer>cast().setDropEffect("String_Node_Str");
      }
 else {
        hideColumnDecorations();
        event.getDataTransfer().<XDataTransfer>cast().setDropEffect("String_Node_Str");
      }
    }
 else {
      Element hostElement=Grid.this.getElement();
      int clientX=event.getNativeEvent().getClientX();
      int hostAbsX=hostElement.getAbsoluteLeft();
      int hostScrollX=hostElement.getScrollLeft();
      int docScrollX=hostElement.getOwnerDocument().getScrollLeft();
      int relativeX=clientX - hostAbsX + hostScrollX + docScrollX;
      ghostLine.getStyle().setLeft(relativeX,Style.Unit.PX);
      ghostLine.getStyle().setHeight(hostElement.getClientHeight(),Style.Unit.PX);
      if (ghostLine.getParentElement() != hostElement) {
        hostElement.appendChild(ghostLine);
      }
    }
  }
}
Program: 145404
Project: 145404
Buggy source:
public CheckBoxCell(String aGroupName){
  super(BrowserEvents.CHANGE,BrowserEvents.KEYDOWN);
  groupName=aGroupName;
}

Fixed version (ground truth):
public CheckBoxCell(String aGroupName){
  super(BrowserEvents.CLICK,BrowserEvents.CHANGE,BrowserEvents.KEYDOWN);
  groupName=aGroupName;
}
Program: 145405
Project: 145405
Buggy source:
@Override public void onBrowserEvent(Context context,Element parent,Object value,NativeEvent event,ValueUpdater<Object> valueUpdater){
  String type=event.getType();
  boolean enterPressed=(BrowserEvents.KEYDOWN.equals(type) && event.getKeyCode() == KeyCodes.KEY_ENTER);
  if (BrowserEvents.CHANGE.equals(type) || enterPressed) {
    InputElement input=parent.getFirstChild().cast();
    Boolean isChecked=input.isChecked();
    if (enterPressed && (handlesSelection() || !dependsOnSelection())) {
      isChecked=!isChecked;
      input.setChecked(isChecked);
    }
    if (value != isChecked && !dependsOnSelection()) {
      setViewData(context.getKey(),isChecked);
    }
 else {
      clearViewData(context.getKey());
    }
    if (valueUpdater != null) {
      valueUpdater.update(isChecked);
    }
  }
}

Fixed version (ground truth):
@Override public void onBrowserEvent(Context context,Element parent,Object value,NativeEvent event,ValueUpdater<Object> valueUpdater){
  String type=event.getType();
  boolean enterPressed=(BrowserEvents.KEYDOWN.equals(type) && event.getKeyCode() == KeyCodes.KEY_ENTER);
  if (BrowserEvents.CLICK.equals(type) || BrowserEvents.CHANGE.equals(type) || enterPressed) {
    InputElement input=parent.getFirstChild().cast();
    Boolean isChecked=input.isChecked();
    if (enterPressed && (handlesSelection() || !dependsOnSelection())) {
      isChecked=!isChecked;
      input.setChecked(isChecked);
    }
    if (value != isChecked && !dependsOnSelection()) {
      setViewData(context.getKey(),isChecked);
    }
 else {
      clearViewData(context.getKey());
    }
    if (valueUpdater != null) {
      valueUpdater.update(isChecked);
    }
  }
}