nus-yam/ex-repair huggingface dataset:
Program: 146195
Project: 146195
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationWrite_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146196
Project: 146196
Buggy source:
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName,AMainPageV2 parentPage,int actionType){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
  this.parentPage=parentPage;
  this.xObject=parentPage.getXObject();
  this.actionType=actionType;
}
Program: 146198
Project: 146198
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirty();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 146199
Project: 146199
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}
Program: 146200
Project: 146200
Buggy source:
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
}

Fixed version (ground truth):
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
  linkDirty(page);
}
Program: 146201
Project: 146201
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 146202
Project: 146202
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}
Program: 146207
Project: 146207
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirty();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 146208
Project: 146208
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}
Program: 146209
Project: 146209
Buggy source:
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
}

Fixed version (ground truth):
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
  linkDirty(page);
}
Program: 146210
Project: 146210
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 146211
Project: 146211
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}
Program: 146214
Project: 146214
Buggy source:
private static void addMenuEntries(HashMap<String,Menu> index,WSRoleSpecificationInstance instance) throws XtentisWebappException {
  org.apache.log4j.Logger.getLogger(Menu.class).debug("String_Node_Str" + instance.getInstanceName());
  try {
    RoleMenuParameters params=RoleMenuParameters.unmarshalMenuParameters(instance.getParameter()[0]);
    WSMenu wsMenu=Util.getPort().getMenu(new WSGetMenu(new WSMenuPK(instance.getInstanceName())));
    WSMenuEntry[] wsEntries=wsMenu.getMenuEntries();
    if (wsEntries != null) {
      for (int i=0; i < wsEntries.length; i++) {
        index.put(wsEntries[i].getId(),wsMenu2Menu(index,wsEntries[i],null,params.getParentID(),params.getPosition()));
      }
    }
  }
 catch (  Exception e) {
    String err;
    try {
      err="String_Node_Str" + instance.getInstanceName() + "String_Node_Str"+ Util.getAjaxSubject().getUsername()+ "String_Node_Str"+ (e.getClass().getName().contains("String_Node_Str") ? "String_Node_Str" : e.getClass().getName() + "String_Node_Str")+ e.getLocalizedMessage();
    }
 catch (    Exception ex) {
      err="String_Node_Str" + "String_Node_Str" + ex.getClass().getName() + "String_Node_Str"+ ex.getLocalizedMessage();
    }
  }
}

Fixed version (ground truth):
private static void addMenuEntries(HashMap<String,Menu> index,WSRoleSpecificationInstance instance) throws XtentisWebappException {
  org.apache.log4j.Logger.getLogger(Menu.class).debug("String_Node_Str" + instance.getInstanceName());
  try {
    WSBoolean menuExist=Util.getPort().existsMenu(new WSExistsMenu(new WSMenuPK(instance.getInstanceName())));
    if (menuExist.is_true()) {
      RoleMenuParameters params=RoleMenuParameters.unmarshalMenuParameters(instance.getParameter()[0]);
      WSMenu wsMenu=Util.getPort().getMenu(new WSGetMenu(new WSMenuPK(instance.getInstanceName())));
      WSMenuEntry[] wsEntries=wsMenu.getMenuEntries();
      if (wsEntries != null) {
        for (int i=0; i < wsEntries.length; i++) {
          index.put(wsEntries[i].getId(),wsMenu2Menu(index,wsEntries[i],null,params.getParentID(),params.getPosition()));
        }
      }
    }
  }
 catch (  XtentisWebappException e) {
    throw (e);
  }
catch (  Exception e) {
    String err;
    try {
      err="String_Node_Str" + instance.getInstanceName() + "String_Node_Str"+ Util.getAjaxSubject().getUsername()+ "String_Node_Str"+ (e.getClass().getName().contains("String_Node_Str") ? "String_Node_Str" : e.getClass().getName() + "String_Node_Str")+ e.getLocalizedMessage();
    }
 catch (    Exception ex) {
      err="String_Node_Str" + "String_Node_Str" + ex.getClass().getName() + "String_Node_Str"+ ex.getLocalizedMessage();
    }
    throw new XtentisWebappException(err);
  }
}
Program: 146215
Project: 146215
Buggy source:
private static void addMenuEntries(HashMap<String,Menu> index,WSRoleSpecificationInstance instance) throws XtentisWebappException {
  org.apache.log4j.Logger.getLogger(Menu.class).debug("String_Node_Str" + instance.getInstanceName());
  try {
    RoleMenuParameters params=RoleMenuParameters.unmarshalMenuParameters(instance.getParameter()[0]);
    WSMenu wsMenu=Util.getPort().getMenu(new WSGetMenu(new WSMenuPK(instance.getInstanceName())));
    WSMenuEntry[] wsEntries=wsMenu.getMenuEntries();
    if (wsEntries != null) {
      for (int i=0; i < wsEntries.length; i++) {
        index.put(wsEntries[i].getId(),wsMenu2Menu(index,wsEntries[i],null,params.getParentID(),params.getPosition()));
      }
    }
  }
 catch (  Exception e) {
    String err;
    try {
      err="String_Node_Str" + instance.getInstanceName() + "String_Node_Str"+ Util.getAjaxSubject().getUsername()+ "String_Node_Str"+ (e.getClass().getName().contains("String_Node_Str") ? "String_Node_Str" : e.getClass().getName() + "String_Node_Str")+ e.getLocalizedMessage();
    }
 catch (    Exception ex) {
      err="String_Node_Str" + "String_Node_Str" + ex.getClass().getName() + "String_Node_Str"+ ex.getLocalizedMessage();
    }
  }
}

Fixed version (ground truth):
private static void addMenuEntries(HashMap<String,Menu> index,WSRoleSpecificationInstance instance) throws XtentisWebappException {
  org.apache.log4j.Logger.getLogger(Menu.class).debug("String_Node_Str" + instance.getInstanceName());
  try {
    WSBoolean menuExist=Util.getPort().existsMenu(new WSExistsMenu(new WSMenuPK(instance.getInstanceName())));
    if (menuExist.is_true()) {
      RoleMenuParameters params=RoleMenuParameters.unmarshalMenuParameters(instance.getParameter()[0]);
      WSMenu wsMenu=Util.getPort().getMenu(new WSGetMenu(new WSMenuPK(instance.getInstanceName())));
      WSMenuEntry[] wsEntries=wsMenu.getMenuEntries();
      if (wsEntries != null) {
        for (int i=0; i < wsEntries.length; i++) {
          index.put(wsEntries[i].getId(),wsMenu2Menu(index,wsEntries[i],null,params.getParentID(),params.getPosition()));
        }
      }
    }
  }
 catch (  XtentisWebappException e) {
    throw (e);
  }
catch (  Exception e) {
    String err;
    try {
      err="String_Node_Str" + instance.getInstanceName() + "String_Node_Str"+ Util.getAjaxSubject().getUsername()+ "String_Node_Str"+ (e.getClass().getName().contains("String_Node_Str") ? "String_Node_Str" : e.getClass().getName() + "String_Node_Str")+ e.getLocalizedMessage();
    }
 catch (    Exception ex) {
      err="String_Node_Str" + "String_Node_Str" + ex.getClass().getName() + "String_Node_Str"+ ex.getLocalizedMessage();
    }
    throw new XtentisWebappException(err);
  }
}
Program: 146216
Project: 146216
Buggy source:
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSRolePK putRole(WSPutRole wsRole) throws RemoteException {
  try {
    RoleCtrlLocal ctrl=RoleCtrlUtil.getLocalHome().create();
    RolePOJOPK pk=ctrl.putRole(WS2POJO(wsRole.getWsRole()));
    return new WSRolePK(pk.getUniqueId());
  }
 catch (  Exception e) {
    String err="String_Node_Str" + e.getMessage();
    org.apache.log4j.Logger.getLogger(this.getClass()).debug(err,e);
    throw new RemoteException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSRolePK putRole(WSPutRole wsRole) throws RemoteException {
  try {
    RoleCtrlLocal ctrl=RoleCtrlUtil.getLocalHome().create();
    RolePOJOPK pk=ctrl.putRole(WS2POJO(wsRole.getWsRole()));
    LocalUser.resetLocalUsers();
    return new WSRolePK(pk.getUniqueId());
  }
 catch (  Exception e) {
    String err="String_Node_Str" + e.getMessage();
    org.apache.log4j.Logger.getLogger(this.getClass()).debug(err,e);
    throw new RemoteException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146217
Project: 146217
Buggy source:
public void keyReleased(KeyEvent e){
  if ((e.stateMask == 0) && (e.character == SWT.CR)) {
    DataClusterBrowserMainPage.this.resultsViewer.setInput(getResults());
  }
}

Fixed version (ground truth):
public void keyReleased(KeyEvent e){
  if (e.keyCode == SWT.DEL) {
    new DeleteItemsAction(DataClusterBrowserMainPage.this.getSite().getShell(),DataClusterBrowserMainPage.this.resultsViewer).run();
  }
}
Program: 146220
Project: 146220
Buggy source:
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSRolePK putRole(WSPutRole wsRole) throws RemoteException {
  try {
    RoleCtrlLocal ctrl=RoleCtrlUtil.getLocalHome().create();
    RolePOJOPK pk=ctrl.putRole(WS2POJO(wsRole.getWsRole()));
    return new WSRolePK(pk.getUniqueId());
  }
 catch (  Exception e) {
    String err="String_Node_Str" + e.getMessage();
    org.apache.log4j.Logger.getLogger(this.getClass()).debug(err,e);
    throw new RemoteException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @ejb.interface-method view-type = "service-endpoint"
 * @ejb.permission role-name = "authenticated" view-type = "service-endpoint"
 */
public WSRolePK putRole(WSPutRole wsRole) throws RemoteException {
  try {
    RoleCtrlLocal ctrl=RoleCtrlUtil.getLocalHome().create();
    RolePOJOPK pk=ctrl.putRole(WS2POJO(wsRole.getWsRole()));
    LocalUser.resetLocalUsers();
    return new WSRolePK(pk.getUniqueId());
  }
 catch (  Exception e) {
    String err="String_Node_Str" + e.getMessage();
    org.apache.log4j.Logger.getLogger(this.getClass()).debug(err,e);
    throw new RemoteException(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146221
Project: 146221
Buggy source:
public void keyReleased(KeyEvent e){
  if ((e.stateMask == 0) && (e.character == SWT.CR)) {
    DataClusterBrowserMainPage.this.resultsViewer.setInput(getResults());
  }
}

Fixed version (ground truth):
public void keyReleased(KeyEvent e){
  if (e.keyCode == SWT.DEL) {
    new DeleteItemsAction(DataClusterBrowserMainPage.this.getSite().getShell(),DataClusterBrowserMainPage.this.resultsViewer).run();
  }
}
Program: 146224
Project: 146224
Buggy source:
/** 
 * Refresh the content of the menu parameters
 * @param instanceName
 */
private void refreshMenuParameters(String instanceName){
  paramsLabel.setText("String_Node_Str" + instanceName + "String_Node_Str");
  LinkedHashSet<String> parameters=role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).getParameters();
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParametersRefreshing=true;
  if ((parameters != null) && (parameters.size() > 0)) {
    try {
      menuParameters=RoleMenuParameters.unmarshalMenuParameters(parameters);
    }
 catch (    Exception e) {
    }
    menuParentIDCombo.select(menuParameters.getPosition());
    menuPositionCombo.select(menuParameters.getPosition());
  }
 else {
    menuParentIDCombo.select(0);
    menuPositionCombo.select(0);
    commitMenuParameters();
  }
  menuParametersRefreshing=false;
}

Fixed version (ground truth):
/** 
 * Refresh the content of the menu parameters
 * @param instanceName
 */
private void refreshMenuParameters(String instanceName){
  paramsLabel.setText("String_Node_Str" + instanceName + "String_Node_Str");
  LinkedHashSet<String> parameters=role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).getParameters();
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParametersRefreshing=true;
  if ((parameters != null) && (parameters.size() > 0)) {
    try {
      menuParameters=RoleMenuParameters.unmarshalMenuParameters(parameters);
    }
 catch (    Exception e) {
    }
    menuParentIDCombo.select(menuParameters.getPosition());
    menuPositionCombo.select(menuParameters.getPosition() - 1);
  }
 else {
    menuParentIDCombo.select(0);
    menuPositionCombo.select(0);
    commitMenuParameters();
  }
  menuParametersRefreshing=false;
}
Program: 146226
Project: 146226
Buggy source:
/** 
 * Commit the content of the menu parameters
 * @param instanceName
 */
protected void commitMenuParameters(){
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParameters.setParentID(menuParentIDCombo.getText());
  menuParameters.setPosition(menuPositionCombo.getSelectionIndex());
  String instanceName=((InstanceLine)((IStructuredSelection)instancesViewer.getSelection()).getFirstElement()).getInstanceName();
  role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).setParameters(menuParameters.marshalMenuParameters());
  markDirty();
}

Fixed version (ground truth):
/** 
 * Commit the content of the menu parameters
 * @param instanceName
 */
protected void commitMenuParameters(){
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParameters.setParentID(menuParentIDCombo.getText());
  menuParameters.setPosition(menuPositionCombo.getSelectionIndex() + 1);
  String instanceName=((InstanceLine)((IStructuredSelection)instancesViewer.getSelection()).getFirstElement()).getInstanceName();
  role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).setParameters(menuParameters.marshalMenuParameters());
  markDirty();
}
Program: 146228
Project: 146228
Buggy source:
/** 
 * Refresh the content of the menu parameters
 * @param instanceName
 */
private void refreshMenuParameters(String instanceName){
  paramsLabel.setText("String_Node_Str" + instanceName + "String_Node_Str");
  LinkedHashSet<String> parameters=role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).getParameters();
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParametersRefreshing=true;
  if ((parameters != null) && (parameters.size() > 0)) {
    try {
      menuParameters=RoleMenuParameters.unmarshalMenuParameters(parameters);
    }
 catch (    Exception e) {
    }
    menuParentIDCombo.select(menuParameters.getPosition());
    menuPositionCombo.select(menuParameters.getPosition());
  }
 else {
    menuParentIDCombo.select(0);
    menuPositionCombo.select(0);
    commitMenuParameters();
  }
  menuParametersRefreshing=false;
}

Fixed version (ground truth):
/** 
 * Refresh the content of the menu parameters
 * @param instanceName
 */
private void refreshMenuParameters(String instanceName){
  paramsLabel.setText("String_Node_Str" + instanceName + "String_Node_Str");
  LinkedHashSet<String> parameters=role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).getParameters();
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParametersRefreshing=true;
  if ((parameters != null) && (parameters.size() > 0)) {
    try {
      menuParameters=RoleMenuParameters.unmarshalMenuParameters(parameters);
    }
 catch (    Exception e) {
    }
    menuParentIDCombo.select(menuParameters.getPosition());
    menuPositionCombo.select(menuParameters.getPosition() - 1);
  }
 else {
    menuParentIDCombo.select(0);
    menuPositionCombo.select(0);
    commitMenuParameters();
  }
  menuParametersRefreshing=false;
}
Program: 146230
Project: 146230
Buggy source:
/** 
 * Commit the content of the menu parameters
 * @param instanceName
 */
protected void commitMenuParameters(){
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParameters.setParentID(menuParentIDCombo.getText());
  menuParameters.setPosition(menuPositionCombo.getSelectionIndex());
  String instanceName=((InstanceLine)((IStructuredSelection)instancesViewer.getSelection()).getFirstElement()).getInstanceName();
  role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).setParameters(menuParameters.marshalMenuParameters());
  markDirty();
}

Fixed version (ground truth):
/** 
 * Commit the content of the menu parameters
 * @param instanceName
 */
protected void commitMenuParameters(){
  RoleMenuParameters menuParameters=new RoleMenuParameters();
  menuParameters.setParentID(menuParentIDCombo.getText());
  menuParameters.setPosition(menuPositionCombo.getSelectionIndex() + 1);
  String instanceName=((InstanceLine)((IStructuredSelection)instancesViewer.getSelection()).getFirstElement()).getInstanceName();
  role.getSpecifications().get(objectTypesCombo.getText()).getInstances().get(instanceName).setParameters(menuParameters.marshalMenuParameters());
  markDirty();
}
Program: 146235
Project: 146235
Buggy source:
public DescAnnotationComposite(String labelName,String buttonName,FormToolkit toolkit,Composite parent,AMainPageV2 dialog){
  descAntionHolder=toolkit.createComposite(parent);
  descAntionHolder.setLayoutData(new GridData(SWT.FILL,SWT.RIGHT,true,true,2,1));
  descAntionHolder.setLayout(new GridLayout(3,false));
  Label descriptionLabel=toolkit.createLabel(descAntionHolder,labelName,SWT.NULL);
  descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  annotationButton=toolkit.createButton(descAntionHolder,buttonName,SWT.PUSH);
  annotationButton.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  annotationButton.addSelectionListener(this);
  descriptionText=toolkit.createText(descAntionHolder,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  descriptionText.setEnabled(false);
  accommodation=dialog;
}

Fixed version (ground truth):
public DescAnnotationComposite(String labelName,String buttonName,FormToolkit toolkit,Composite parent,AMainPageV2 dialog){
  descAntionHolder=toolkit.createComposite(parent);
  descAntionHolder.setLayoutData(new GridData(SWT.FILL,SWT.RIGHT,true,true,2,1));
  descAntionHolder.setLayout(new GridLayout(3,false));
  Label descriptionLabel=toolkit.createLabel(descAntionHolder,labelName,SWT.NULL);
  descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  annotationButton=toolkit.createButton(descAntionHolder,buttonName,SWT.PUSH);
  annotationButton.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  annotationButton.addSelectionListener(this);
  descriptionText=toolkit.createText(descAntionHolder,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  descriptionText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (descriptionValue != null && !descriptionValue.equals(descriptionText.getText())) {
        accommodation.markDirty();
      }
      descriptionValue=descriptionText.getText();
      fillDataStore(descriptionText.getText());
    }
  }
);
  accommodation=dialog;
  dlgTitle="String_Node_Str";
}
Program: 146236
Project: 146236
Buggy source:
public void setText(String text){
  dataStore.clear();
  descriptionText.setText(text);
  boolean find=false;
  Matcher match=DESC_PATTERN.matcher(text);
  while (match.find()) {
    find=true;
    String country=match.group(1);
    String desc=match.group(2);
    dataStore.put(country.toLowerCase(),desc.trim());
  }
  if (!find && !text.equals("String_Node_Str")) {
    dataStore.put("String_Node_Str",text);
  }
}

Fixed version (ground truth):
public void setText(String text){
  descriptionText.setText(text);
  descriptionValue=text;
  fillDataStore(text);
}
Program: 146240
Project: 146240
Buggy source:
public DescAnnotationComposite(String labelName,String buttonName,FormToolkit toolkit,Composite parent,AMainPageV2 dialog){
  descAntionHolder=toolkit.createComposite(parent);
  descAntionHolder.setLayoutData(new GridData(SWT.FILL,SWT.RIGHT,true,true,2,1));
  descAntionHolder.setLayout(new GridLayout(3,false));
  Label descriptionLabel=toolkit.createLabel(descAntionHolder,labelName,SWT.NULL);
  descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  annotationButton=toolkit.createButton(descAntionHolder,buttonName,SWT.PUSH);
  annotationButton.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  annotationButton.addSelectionListener(this);
  descriptionText=toolkit.createText(descAntionHolder,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  descriptionText.setEnabled(false);
  accommodation=dialog;
}

Fixed version (ground truth):
public DescAnnotationComposite(String labelName,String buttonName,FormToolkit toolkit,Composite parent,AMainPageV2 dialog){
  descAntionHolder=toolkit.createComposite(parent);
  descAntionHolder.setLayoutData(new GridData(SWT.FILL,SWT.RIGHT,true,true,2,1));
  descAntionHolder.setLayout(new GridLayout(3,false));
  Label descriptionLabel=toolkit.createLabel(descAntionHolder,labelName,SWT.NULL);
  descriptionLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,false,true,1,1));
  annotationButton=toolkit.createButton(descAntionHolder,buttonName,SWT.PUSH);
  annotationButton.setLayoutData(new GridData(SWT.RIGHT,SWT.CENTER,false,false,1,1));
  annotationButton.addSelectionListener(this);
  descriptionText=toolkit.createText(descAntionHolder,"String_Node_Str",SWT.BORDER | SWT.MULTI);
  descriptionText.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  descriptionText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (descriptionValue != null && !descriptionValue.equals(descriptionText.getText())) {
        accommodation.markDirty();
      }
      descriptionValue=descriptionText.getText();
      fillDataStore(descriptionText.getText());
    }
  }
);
  accommodation=dialog;
  dlgTitle="String_Node_Str";
}
Program: 146241
Project: 146241
Buggy source:
public void setText(String text){
  dataStore.clear();
  descriptionText.setText(text);
  boolean find=false;
  Matcher match=DESC_PATTERN.matcher(text);
  while (match.find()) {
    find=true;
    String country=match.group(1);
    String desc=match.group(2);
    dataStore.put(country.toLowerCase(),desc.trim());
  }
  if (!find && !text.equals("String_Node_Str")) {
    dataStore.put("String_Node_Str",text);
  }
}

Fixed version (ground truth):
public void setText(String text){
  descriptionText.setText(text);
  descriptionValue=text;
  fillDataStore(text);
}
Program: 146242
Project: 146242
Buggy source:
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    if ((results == null) || (results.length == 0))     return null;
    ArrayList<User> names=new ArrayList<User>();
    for (int i=0; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    ArrayList<User> names=new ArrayList<User>();
    for (int i=0; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146243
Project: 146243
Buggy source:
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    if ((results == null) || (results.length == 0))     return null;
    ArrayList<User> names=new ArrayList<User>();
    for (int i=0; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public ListRange getUsers(String regex,String language) throws Exception {
  org.apache.log4j.Logger.getLogger(this.getClass()).debug("String_Node_Str" + regex + "String_Node_Str"+ language);
  try {
    WSWhereItem wi=new WSWhereItem();
    if ((regex == null) || ("String_Node_Str".equals(regex)) || "String_Node_Str".equals(regex)) {
      wi=null;
    }
 else {
      WSWhereCondition wc=new WSWhereCondition("String_Node_Str",WSWhereOperator.CONTAINS,regex,WSStringPredicate.NONE,true);
      wi.setWhereCondition(wc);
    }
    String[] results=Util.getPort().getItems(new WSGetItems(new WSDataClusterPK(dataclusterPK),"String_Node_Str",wi,0,0,Integer.MAX_VALUE)).getStrings();
    ArrayList<User> names=new ArrayList<User>();
    for (int i=0; i < results.length; i++) {
      User user=User.parse(results[i]);
      names.add(user);
    }
    ListRange listRange=new ListRange();
    listRange.setData(names.toArray(new User[names.size()]));
    listRange.setTotalSize(names.size());
    return listRange;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new Exception(e.getClass().getName() + "String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 146244
Project: 146244
Buggy source:
public static boolean doMobSpawning(WorldServer par1WorldServer){
  if (!proxy.disableCreatureSpawning || !par1WorldServer.getGameRules().getGameRuleBooleanValue("String_Node_Str"))   return false;
  for (  ServerTickHandler serverTickHandler : instance.tickHandlers) {
    if (serverTickHandler.worldServer == par1WorldServer)     return serverTickHandler.currentState != SomniaState.ACTIVE;
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
public static boolean doMobSpawning(WorldServer par1WorldServer){
  boolean defValue=par1WorldServer.getGameRules().getGameRuleBooleanValue("String_Node_Str");
  if (!proxy.disableCreatureSpawning || !defValue)   return defValue;
  for (  ServerTickHandler serverTickHandler : instance.tickHandlers) {
    if (serverTickHandler.worldServer == par1WorldServer)     return serverTickHandler.currentState != SomniaState.ACTIVE;
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 146245
Project: 146245
Buggy source:
public void tickStart(){
  incrementCounters();
  if (++checkTimer == 10) {
    checkTimer=0;
    SomniaState prevState=currentState;
    currentState=SomniaState.getState(this);
    if (prevState != currentState) {
      currentSleepPeriod=0;
      if (currentState == ACTIVE) {
        lastSleepStart=worldServer.getTotalWorldTime();
        activeTickHandlers++;
      }
 else       if (prevState == ACTIVE) {
        activeTickHandlers--;
        if (currentState == EXPIRED || currentState == NOT_NOW)         closeGuiWithMessage(currentState.toString());
      }
    }
    if (currentState == ACTIVE || currentState == WAITING_PLAYERS || currentState == COOLDOWN) {
      FMLProxyPacket packet=PacketHandler.buildGUIUpdatePacket("String_Node_Str",currentState == ACTIVE ? Somnia.timeStringForWorldTime(worldServer.getWorldTime()) : "String_Node_Str" + currentState.toString(),"String_Node_Str",currentState == ACTIVE ? (double)tps / 20d : .0d);
      Somnia.channel.sendToDimension(packet,worldServer.provider.dimensionId);
    }
  }
  if (currentState == ACTIVE)   doMultipliedTicking();
}

Fixed version (ground truth):
public void tickStart(){
  if (++checkTimer == 10) {
    checkTimer=0;
    SomniaState prevState=currentState;
    currentState=SomniaState.getState(this);
    if (prevState != currentState) {
      currentSleepPeriod=0;
      if (currentState == ACTIVE) {
        lastSleepStart=worldServer.getTotalWorldTime();
        activeTickHandlers++;
      }
 else       if (prevState == ACTIVE) {
        activeTickHandlers--;
        if (currentState == EXPIRED || currentState == NOT_NOW)         closeGuiWithMessage(currentState.toString());
      }
    }
    if (currentState == ACTIVE || currentState == WAITING_PLAYERS || currentState == COOLDOWN) {
      FMLProxyPacket packet=PacketHandler.buildGUIUpdatePacket("String_Node_Str",currentState == ACTIVE ? Somnia.timeStringForWorldTime(worldServer.getWorldTime()) : "String_Node_Str" + currentState.toString(),"String_Node_Str",currentState == ACTIVE ? (double)tps / 20d : .0d);
      Somnia.channel.sendToDimension(packet,worldServer.provider.dimensionId);
    }
  }
  if (currentState == ACTIVE)   doMultipliedTicking();
}
Program: 146246
Project: 146246
Buggy source:
private void incrementCounters(){
  liTps++;
  if (currentState == ACTIVE)   currentSleepPeriod++;
}

Fixed version (ground truth):
private void incrementCounters(){
  liTps++;
  currentSleepPeriod++;
}
Program: 146247
Project: 146247
Buggy source:
public void tickEnd(){
  Minecraft mc=Minecraft.getMinecraft();
  if (mc == null || mc.thePlayer == null)   return;
  GameSettings gameSettings=Minecraft.getMinecraft().gameSettings;
  if (mc.currentScreen != null && mc.currentScreen instanceof GuiSleepMP) {
    if (Somnia.proxy.vanillaBugFixes) {
      if (!moddedFOV) {
        moddedFOV=true;
        if (gameSettings.fovSetting >= 0.75352114) {
          fov=gameSettings.fovSetting;
          gameSettings.fovSetting=0.7253521f;
        }
      }
    }
  }
 else   if (moddedFOV) {
    moddedFOV=false;
    Minecraft.getMinecraft().gameSettings.fovSetting=fov;
  }
  if (mc.thePlayer.isPlayerSleeping()) {
    if (Somnia.proxy.muteSoundWhenSleeping) {
      if (!muted) {
        muted=true;
        defVol=gameSettings.getSoundLevel(SoundCategory.MASTER);
        gameSettings.setSoundLevel(SoundCategory.MASTER,.0f);
      }
    }
  }
 else {
    if (muted) {
      muted=false;
      gameSettings.setSoundLevel(SoundCategory.MASTER,defVol);
    }
  }
  if (Somnia.clientAutoWakeTime > -1 && mc.theWorld.getTotalWorldTime() >= Somnia.clientAutoWakeTime) {
    Somnia.clientAutoWakeTime=-1;
    mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer,3));
  }
}

Fixed version (ground truth):
public void tickEnd(){
  Minecraft mc=Minecraft.getMinecraft();
  if (mc == null || mc.thePlayer == null)   return;
  GameSettings gameSettings=Minecraft.getMinecraft().gameSettings;
  if (mc.currentScreen != null && mc.currentScreen instanceof GuiSleepMP) {
    if (Somnia.proxy.vanillaBugFixes) {
      if (!moddedFOV) {
        moddedFOV=true;
        if (gameSettings.fovSetting >= 0.75352114) {
          fov=gameSettings.fovSetting;
          gameSettings.fovSetting=0.7253521f;
        }
      }
    }
  }
 else   if (moddedFOV) {
    moddedFOV=false;
    if (fov > .0f)     Minecraft.getMinecraft().gameSettings.fovSetting=fov;
  }
  if (mc.thePlayer.isPlayerSleeping()) {
    if (Somnia.proxy.muteSoundWhenSleeping) {
      if (!muted) {
        muted=true;
        defVol=gameSettings.getSoundLevel(SoundCategory.MASTER);
        gameSettings.setSoundLevel(SoundCategory.MASTER,.0f);
      }
    }
  }
 else {
    if (muted) {
      muted=false;
      gameSettings.setSoundLevel(SoundCategory.MASTER,defVol);
    }
  }
  if (Somnia.clientAutoWakeTime > -1 && mc.theWorld.getTotalWorldTime() >= Somnia.clientAutoWakeTime) {
    Somnia.clientAutoWakeTime=-1;
    mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer,3));
  }
}
Program: 146248
Project: 146248
Buggy source:
public static FMLProxyPacket buildGUIUpdatePacket(Object... fields){
  ByteBufOutputStream bbos=unpooled();
  try {
    bbos.writeByte(0x02);
    bbos.writeInt(fields.length);
    for (int i=0; i < fields.length; i++) {
      StreamUtils.writeString(fields[i].toString(),bbos);
      StreamUtils.writeObject(fields[++i],bbos);
    }
    return new FMLProxyPacket(bbos.buffer(),Somnia.MOD_ID);
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
  }
 finally {
    close(bbos);
  }
  return null;
}

Fixed version (ground truth):
public static FMLProxyPacket buildGUIUpdatePacket(Object... fields){
  ByteBufOutputStream bbos=unpooled();
  try {
    bbos.writeByte(0x02);
    bbos.writeInt(fields.length / 2);
    for (int i=0; i < fields.length; i++) {
      StreamUtils.writeString(fields[i].toString(),bbos);
      StreamUtils.writeObject(fields[++i],bbos);
    }
    return new FMLProxyPacket(bbos.buffer(),Somnia.MOD_ID);
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
  }
 finally {
    close(bbos);
  }
  return null;
}
Program: 146249
Project: 146249
Buggy source:
public static boolean deobfuscatedEnvironment(){
  if (mcp == null) {
    mcp=(boolean)Launch.blackboard.get("String_Node_Str");
    System.out.println("String_Node_Str" + (mcp ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
  }
  return mcp;
}

Fixed version (ground truth):
public static boolean deobfuscatedEnvironment(){
  if (mcp == null) {
    mcp=(Boolean)Launch.blackboard.get("String_Node_Str");
    System.out.println("String_Node_Str" + (mcp ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
  }
  return mcp;
}
Program: 146250
Project: 146250
Buggy source:
public static double odToMs(double od){
  return 80 - 6 * od;
}

Fixed version (ground truth):
public static double odToMs(double od){
  return 79.5 - Math.ceil(6 * od);
}
Program: 146251
Project: 146251
Buggy source:
public static double msToOd(double ms){
  return (80 - ms) / 6;
}

Fixed version (ground truth):
public static double msToOd(double ms){
  return (79.5 - ms) / 6;
}
Program: 146252
Project: 146252
Buggy source:
public static double calcOd(double od,@BitwiseMods long mods){
  if (Easy.is(mods)) {
    od/=2;
  }
  if (HardRock.is(mods)) {
    od=min(10,od * 1.4);
  }
  if (DoubleTime.is(mods) || Nightcore.is(mods)) {
    od=msToOd(odToMs(od) * 2 / 3);
  }
  if (HalfTime.is(mods)) {
    od=msToOd(odToMs(od) * 1.5);
  }
  return od;
}

Fixed version (ground truth):
public static double calcOd(double od,@BitwiseMods long mods){
  if (Easy.is(mods)) {
    od/=2;
  }
  if (HardRock.is(mods)) {
    od=min(10,od * 1.4);
  }
  if (DoubleTime.is(mods) || Nightcore.is(mods)) {
    od=msToOd(odToMs(od) * 2 / 3);
  }
  if (HalfTime.is(mods)) {
    od=msToOd(odToMs(od) * 4 / 3d);
  }
  return od;
}
Program: 146253
Project: 146253
Buggy source:
@Test public void testOdToMs() throws Exception {
  assertEquals(80,OsuApiBeatmap.odToMs(0),1E-15);
  assertEquals(50,OsuApiBeatmap.odToMs(5),1E-15);
  assertEquals(20,OsuApiBeatmap.odToMs(10),1E-15);
  assertEquals(14,OsuApiBeatmap.odToMs(11),1E-15);
  assertEquals(54,OsuApiBeatmap.odToMs(4 + 1 / 3d),1E-15);
  assertEquals(87.5,OsuApiBeatmap.odToMs(-1.25),1E-15);
  assertEquals(119,OsuApiBeatmap.odToMs(-6.5),1E-15);
}

Fixed version (ground truth):
@Test public void testOdToMs() throws Exception {
  assertEquals(79.5,OsuApiBeatmap.odToMs(0),1E-15);
  assertEquals(52.5,OsuApiBeatmap.odToMs(4.34),1E-15);
  assertEquals(25.5,OsuApiBeatmap.odToMs(9),1E-15);
  assertEquals(24.5,OsuApiBeatmap.odToMs(9.1),1E-15);
  assertEquals(23.5,OsuApiBeatmap.odToMs(9.2),1E-15);
  assertEquals(23.5,OsuApiBeatmap.odToMs(9.3),1E-15);
  assertEquals(20.5,OsuApiBeatmap.odToMs(9.8),1E-15);
}
Program: 146254
Project: 146254
Buggy source:
@Test public void testCalcOd() throws Exception {
  assertEquals(-2 - 1 / 6d,OsuApiBeatmap.calcOd(6,getMask(HalfTime,Easy)),1E-15);
  assertEquals(3 + 5 / 6d,OsuApiBeatmap.calcOd(7,getMask(HalfTime)),1E-15);
  assertEquals(8 + 1 / 3d,OsuApiBeatmap.calcOd(10,getMask(HalfTime,HardRock)),1E-15);
  assertEquals(5.777777777,OsuApiBeatmap.calcOd(4,getMask(DoubleTime,Easy)),1E-6);
  assertEquals(9.777777777,OsuApiBeatmap.calcOd(8,getMask(DoubleTime)),2E-6);
  assertEquals(10.44444444,OsuApiBeatmap.calcOd(9,getMask(DoubleTime)),2E-6);
  assertEquals(11.111111111,OsuApiBeatmap.calcOd(10,getMask(DoubleTime,HardRock)),1E-6);
}

Fixed version (ground truth):
@Test public void testCalcOd() throws Exception {
  assertEquals(-0.42,OsuApiBeatmap.calcOd(6,getMask(HalfTime,Easy)),1E-2);
  assertEquals(4.92,OsuApiBeatmap.calcOd(7,getMask(HalfTime)),1E-2);
  assertEquals(8.92,OsuApiBeatmap.calcOd(10,getMask(HalfTime,HardRock)),1E-2);
  assertEquals(5.75,OsuApiBeatmap.calcOd(4,getMask(DoubleTime,Easy)),1E-2);
  assertEquals(9.75,OsuApiBeatmap.calcOd(8,getMask(DoubleTime)),2E-2);
  assertEquals(10.42,OsuApiBeatmap.calcOd(9,getMask(DoubleTime)),2E-2);
  assertEquals(11.08,OsuApiBeatmap.calcOd(10,getMask(DoubleTime,HardRock)),1E-2);
}
Program: 146255
Project: 146255
Buggy source:
@Test public void testMsToOd() throws Exception {
  assertEquals(0,OsuApiBeatmap.msToOd(80),1E-15);
  assertEquals(5,OsuApiBeatmap.msToOd(50),1E-15);
  assertEquals(10,OsuApiBeatmap.msToOd(20),1E-15);
  assertEquals(11,OsuApiBeatmap.msToOd(14),1E-15);
  assertEquals(4 + 1 / 3d,OsuApiBeatmap.msToOd(54),1E-15);
  assertEquals(-1.25,OsuApiBeatmap.msToOd(87.5),1E-15);
  assertEquals(-6.5,OsuApiBeatmap.msToOd(119),1E-15);
}

Fixed version (ground truth):
@Test public void testMsToOd() throws Exception {
  assertEquals(0,OsuApiBeatmap.msToOd(79.5),1E-15);
  assertEquals(5,OsuApiBeatmap.msToOd(49.5),1E-15);
  assertEquals(10,OsuApiBeatmap.msToOd(19.5),1E-15);
}
Program: 146256
Project: 146256
Buggy source:
@Override public void run(){
  Log.d(TAG,"String_Node_Str");
  close();
}

Fixed version (ground truth):
@Override public void run(){
  Log.d(TAG,scanTimeout + "String_Node_Str");
  close();
}
Program: 146259
Project: 146259
Buggy source:
public StockItemSnapshot getLatest(final Commodity commodity,final Date currentDate){
  return dbUtil.withDao(StockItemSnapshot.class,new DbUtil.Operation<StockItemSnapshot,StockItemSnapshot>(){
    @Override public StockItemSnapshot operate(    Dao<StockItemSnapshot,String> dao) throws SQLException {
      QueryBuilder<StockItemSnapshot,String> queryBuilder=dao.queryBuilder();
      queryBuilder.where().eq("String_Node_Str",commodity.getId()).and().le("String_Node_Str",currentDate);
      queryBuilder.orderBy("String_Node_Str",false);
      PreparedQuery<StockItemSnapshot> query=queryBuilder.prepare();
      return dao.queryForFirst(query);
    }
  }
);
}

Fixed version (ground truth):
public StockItemSnapshot getLatest(final Commodity commodity,final Date currentDate){
  return dbUtil.withDao(StockItemSnapshot.class,new DbUtil.Operation<StockItemSnapshot,StockItemSnapshot>(){
    @Override public StockItemSnapshot operate(    Dao<StockItemSnapshot,String> dao) throws SQLException {
      QueryBuilder<StockItemSnapshot,String> queryBuilder=dao.queryBuilder();
      queryBuilder.where().eq("String_Node_Str",commodity.getId()).and().eq("String_Node_Str",currentDate);
      queryBuilder.orderBy("String_Node_Str",false);
      PreparedQuery<StockItemSnapshot> query=queryBuilder.prepare();
      return dao.queryForFirst(query);
    }
  }
);
}
Program: 146260
Project: 146260
Buggy source:
@Override public StockItemSnapshot operate(Dao<StockItemSnapshot,String> dao) throws SQLException {
  QueryBuilder<StockItemSnapshot,String> queryBuilder=dao.queryBuilder();
  queryBuilder.where().eq("String_Node_Str",commodity.getId()).and().le("String_Node_Str",currentDate);
  queryBuilder.orderBy("String_Node_Str",false);
  PreparedQuery<StockItemSnapshot> query=queryBuilder.prepare();
  return dao.queryForFirst(query);
}

Fixed version (ground truth):
@Override public StockItemSnapshot operate(Dao<StockItemSnapshot,String> dao) throws SQLException {
  QueryBuilder<StockItemSnapshot,String> queryBuilder=dao.queryBuilder();
  queryBuilder.where().eq("String_Node_Str",commodity.getId()).and().eq("String_Node_Str",currentDate);
  queryBuilder.orderBy("String_Node_Str",false);
  PreparedQuery<StockItemSnapshot> query=queryBuilder.prepare();
  return dao.queryForFirst(query);
}