nus-yam/ex-repair huggingface dataset:
Program: 56689
Project: 56689
Buggy source:
/** 
 * Creates a new wrapper instance.
 * @param amount the underlying amount, not null and not negative.
 * @throws IllegalArgumentException if the amount passed is negative.
 */
ConstraintMoney(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount> predicate){
  if (amount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (predicate == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!predicate.test(amount)) {
    throw new IllegalArgumentException("String_Node_Str" + predicate + "String_Node_Str"+ amount);
  }
  this.amount=amount;
  this.predicate=predicate;
}

Fixed version (ground truth):
/** 
 * Creates a new wrapper instance.
 * @param amount the underlying amount, not null and not negative.
 * @throws IllegalArgumentException if the amount passed is negative.
 */
ConstraintMoney(MonetaryAmount<?> amount,MonetaryPredicate<MonetaryAmount<?>> predicate){
  if (amount == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (predicate == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!predicate.test(amount)) {
    throw new IllegalArgumentException("String_Node_Str" + predicate + "String_Node_Str"+ amount);
  }
  this.amount=amount;
  this.predicate=predicate;
}
Program: 56690
Project: 56690
Buggy source:
@Override public ConstraintMoney subtract(MonetaryAmount<?> amount){
  return new ConstraintMoney(amount.subtract(amount),predicate);
}

Fixed version (ground truth):
@Override public ConstraintMoney subtract(MonetaryAmount<?> amount){
  return new ConstraintMoney(this.amount.subtract(amount),predicate);
}
Program: 56691
Project: 56691
Buggy source:
@Override public ConstraintMoney with(CurrencyUnit unit,double amount){
  return new ConstraintMoney(amount.with(unit,amount),predicate);
}

Fixed version (ground truth):
@Override public ConstraintMoney with(CurrencyUnit unit,double amount){
  return new ConstraintMoney(this.amount.with(unit,amount),predicate);
}
Program: 56692
Project: 56692
Buggy source:
@Override public ConstraintMoney[] divideAndRemainder(double divisor){
  return new ConstraintMoney(amount.divideAndRemainder(divisor),predicate);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public ConstraintMoney[] divideAndRemainder(double divisor){
  MonetaryAmount<?>[] result=this.amount.divideAndRemainder(divisor);
  return new ConstraintMoney[]{new ConstraintMoney(result[0],predicate),new ConstraintMoney(result[1],predicate)};
}
Program: 56693
Project: 56693
Buggy source:
private TablePerspective createTablePerspective(ATableBasedDataDomain dd,Perspective ownDimensionPerspective,Perspective foreignRecordPerspective){
  if (dd == null || ownDimensionPerspective == null || foreignRecordPerspective == null)   return null;
  Perspective convertedPerspective=dd.convertForeignPerspective(foreignRecordPerspective);
  TablePerspective tablePerspective=new TablePerspective(dd,convertedPerspective,ownDimensionPerspective);
  tablePerspective.setLabel(dd.getLabel() + "String_Node_Str" + foreignRecordPerspective.getLabel());
  return tablePerspective;
}

Fixed version (ground truth):
private TablePerspective createTablePerspective(ATableBasedDataDomain dd,Perspective ownPerspective,Perspective foreignPerspective){
  if (dd == null || ownPerspective == null || foreignPerspective == null)   return null;
  Perspective convertedPerspective=dd.convertForeignPerspective(foreignPerspective);
  Perspective recordPerspective=dd.getRecordIDCategory().equals(convertedPerspective.getIdType().getIDCategory()) ? convertedPerspective : ownPerspective;
  Perspective dimensionPerspective=dd.getDimensionIDCategory().equals(convertedPerspective.getIdType().getIDCategory()) ? convertedPerspective : ownPerspective;
  TablePerspective tablePerspective=new TablePerspective(dd,recordPerspective,dimensionPerspective);
  tablePerspective.setLabel(dd.getLabel() + "String_Node_Str" + foreignPerspective.getLabel());
  return tablePerspective;
}
Program: 56695
Project: 56695
Buggy source:
private int getContingencyIndex(ATableBasedDataDomain dataDomain,IDType columnIDType,int columnID,IDType rowIDType,int rowID,IDataClassifier classifier){
  Object value=dataDomain.getRaw(columnIDType,columnID,rowIDType,rowID);
  List<SimpleCategory> classes=classifier.getDataClasses();
  SimpleCategory c=classifier.apply(value);
  if (c == null)   return -1;
  return classes.indexOf(c);
}

Fixed version (ground truth):
private int getContingencyIndex(ATableBasedDataDomain dataDomain,IDType columnIDType,int columnID,IDType rowIDType,int rowID,IDataClassifier classifier){
  List<SimpleCategory> classes=classifier.getDataClasses();
  SimpleCategory c=getCategory(dataDomain,columnIDType,columnID,rowIDType,rowID,classifier);
  if (c == null)   return -1;
  return classes.indexOf(c);
}
Program: 56696
Project: 56696
Buggy source:
@Override public void createControl(Composite parent){
  parentComposite=new Composite(parent,SWT.NONE);
  parentComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  parentComposite.setLayout(new GridLayout(1,false));
  contingencyTableGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  contingencyTableGroup.setText("String_Node_Str");
  contingencyTableGroup.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  contingencyTableGroup.setLayout(new GridLayout(1,false));
  buildTable(contingencyTableGroup);
  Group pValuesGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  pValuesGroup.setText("String_Node_Str");
  pValuesGroup.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  pValuesGroup.setLayout(new GridLayout(1,false));
  twoSidedPValueLabel=createLabel(pValuesGroup,"String_Node_Str");
  leftTailPValueLabel=createLabel(pValuesGroup,"String_Node_Str");
  rightTailPValueLabel=createLabel(pValuesGroup,"String_Node_Str");
  setControl(parentComposite);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  parentComposite=new Composite(parent,SWT.NONE);
  parentComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  parentComposite.setLayout(new GridLayout(1,false));
  contingencyTableGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  contingencyTableGroup.setText("String_Node_Str");
  contingencyTableGroup.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  contingencyTableGroup.setLayout(new GridLayout(1,false));
  buildTable(contingencyTableGroup);
  Group pValuesGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  pValuesGroup.setText("String_Node_Str");
  pValuesGroup.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  pValuesGroup.setLayout(new GridLayout(1,false));
  twoSidedPValueLabel=createLabel(pValuesGroup,"String_Node_Str");
  leftTailPValueLabel=createLabel(pValuesGroup,"String_Node_Str");
  rightTailPValueLabel=createLabel(pValuesGroup,"String_Node_Str");
  Button exportButton=new Button(pValuesGroup,SWT.PUSH);
  exportButton.setText("String_Node_Str");
  exportButton.setLayoutData(new GridData());
  exportButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      FileDialog fileDialog=new FileDialog(new Shell(),SWT.SAVE);
      fileDialog.setText("String_Node_Str");
      String[] filterExt={"String_Node_Str","String_Node_Str","String_Node_Str"};
      fileDialog.setFilterExtensions(filterExt);
      fileDialog.setFileName("String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(new Date()) + "String_Node_Str");
      String fileName=fileDialog.open();
      if (fileName != null) {
        exportResults(fileName);
      }
    }
  }
);
  setControl(parentComposite);
}
Program: 56698
Project: 56698
Buggy source:
@Override public void pageChanged(PageChangedEvent event){
  if (event.getSelectedPage() == getNextPage()) {
    WilcoxonRankSumTestWizard wizard=(WilcoxonRankSumTestWizard)getWizard();
    wizard.setSourceInfo(info);
    IDataClassifier classifier=classificationWidget.getClassifier();
    wizard.setSourceClassifier(classifier);
    wizard.setDerivedIDClassifier(WilcoxonUtil.createDerivedClassifier(classifier,info));
  }
 else   if (event.getSelectedPage() == this) {
    UpdateDataCellSelectionValidatorEvent e=new UpdateDataCellSelectionValidatorEvent(CellSelectionValidators.nonEmptyCellValidator());
    EventPublisher.trigger(e);
  }
}

Fixed version (ground truth):
@Override public void pageChanged(PageChangedEvent event){
  if (event.getSelectedPage() == getNextPage()) {
    WilcoxonRankSumTestWizard wizard=(WilcoxonRankSumTestWizard)getWizard();
    wizard.setSourceInfo(info);
    IDataClassifier classifier=classificationWidget.getClassifier();
    wizard.setSourceClassifier(classifier);
  }
 else   if (event.getSelectedPage() == this) {
    UpdateDataCellSelectionValidatorEvent e=new UpdateDataCellSelectionValidatorEvent(CellSelectionValidators.nonEmptyCellValidator());
    EventPublisher.trigger(e);
  }
}
Program: 56699
Project: 56699
Buggy source:
@Override public void pageChanged(PageChangedEvent event){
  WilcoxonRankSumTestWizard wizard=(WilcoxonRankSumTestWizard)getWizard();
  if (event.getSelectedPage() == this) {
    if (info != null) {
      if (!CellSelectionValidators.overlappingSamplesValidator(wizard.getSourceInfo()).apply(info)) {
        info=null;
        classificationGroup.setVisible(false);
        dataCellInfoWidget.updateInfo(null);
        getWizard().getContainer().updateButtons();
        EventPublisher.trigger(new ShowOverlayEvent(null,null,getWizard().getStartingPage() == this));
      }
    }
    @SuppressWarnings("String_Node_Str") Predicate<DataCellInfo> validator=Predicates.and(CellSelectionValidators.nonEmptyCellValidator(),CellSelectionValidators.numericalValuesValidator(),CellSelectionValidators.overlappingSamplesValidator(wizard.getSourceInfo()));
    EventPublisher.trigger(new UpdateDataCellSelectionValidatorEvent(validator));
    if (classificationWidget != null) {
      classificationWidget.setClassifier(wizard.getDerivedIDClassifier());
      EventPublisher.trigger(new ShowOverlayEvent(info,classificationWidget.getClassifier().getOverlayProvider(),false));
    }
  }
 else   if (event.getSelectedPage() == getNextPage()) {
    wizard.setTargetInfo(info);
  }
}

Fixed version (ground truth):
@Override public void pageChanged(PageChangedEvent event){
  WilcoxonRankSumTestWizard wizard=(WilcoxonRankSumTestWizard)getWizard();
  if (event.getSelectedPage() == this) {
    if (info != null) {
      if (!CellSelectionValidators.overlappingSamplesValidator(wizard.getSourceInfo()).apply(info)) {
        info=null;
        classificationGroup.setVisible(false);
        dataCellInfoWidget.updateInfo(null);
        getWizard().getContainer().updateButtons();
        EventPublisher.trigger(new ShowOverlayEvent(null,null,getWizard().getStartingPage() == this));
      }
    }
    @SuppressWarnings("String_Node_Str") Predicate<DataCellInfo> validator=Predicates.and(CellSelectionValidators.nonEmptyCellValidator(),CellSelectionValidators.numericalValuesValidator(),CellSelectionValidators.overlappingSamplesValidator(wizard.getSourceInfo()));
    EventPublisher.trigger(new UpdateDataCellSelectionValidatorEvent(validator));
    if (classificationWidget != null && info != null) {
      SimpleIDClassifier derivedClassifier=WilcoxonUtil.createDerivedClassifier(wizard.getSourceClassifier(),wizard.getSourceInfo(),info);
      wizard.setDerivedIDClassifier(derivedClassifier);
      classificationWidget.setClassifier(derivedClassifier);
      EventPublisher.trigger(new ShowOverlayEvent(info,derivedClassifier.getOverlayProvider(),false));
    }
  }
 else   if (event.getSelectedPage() == getNextPage()) {
    wizard.setTargetInfo(info);
  }
}
Program: 56700
Project: 56700
Buggy source:
@Override protected void dataCellChanged(DataCellInfo info){
  Object description=info.dataDomain.getDataClassSpecificDescription(info.rowIDType,info.rowID,info.columnPerspective.getIdType(),info.columnPerspective.getVirtualArray().get(0));
  if (description != null && description instanceof CategoricalClassDescription) {
    CategoricalClassDescription<?> desc=(CategoricalClassDescription<?>)description;
    if (desc.getCategoryType() == ECategoryType.NOMINAL) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
  classificationGroup.setVisible(true);
  if (classificationWidget == null) {
    classificationWidget=new DerivedClassificationWidget(classificationGroup);
    classificationGroup.getShell().layout(true,true);
    classificationGroup.getShell().pack(true);
    getWizard().getContainer().updateButtons();
    WilcoxonRankSumTestWizard wizard=(WilcoxonRankSumTestWizard)getWizard();
    classificationWidget.setClassifier(wizard.getDerivedIDClassifier());
  }
  EventPublisher.trigger(new ShowOverlayEvent(info,classificationWidget.getClassifier().getOverlayProvider(),false));
  getWizard().getContainer().updateButtons();
}

Fixed version (ground truth):
@Override protected void dataCellChanged(DataCellInfo info){
  Object description=info.dataDomain.getDataClassSpecificDescription(info.rowIDType,info.rowID,info.columnPerspective.getIdType(),info.columnPerspective.getVirtualArray().get(0));
  if (description != null && description instanceof CategoricalClassDescription) {
    CategoricalClassDescription<?> desc=(CategoricalClassDescription<?>)description;
    if (desc.getCategoryType() == ECategoryType.NOMINAL) {
      throw new UnsupportedOperationException("String_Node_Str");
    }
  }
  classificationGroup.setVisible(true);
  WilcoxonRankSumTestWizard wizard=(WilcoxonRankSumTestWizard)getWizard();
  SimpleIDClassifier derivedClassifier=WilcoxonUtil.createDerivedClassifier(wizard.getSourceClassifier(),wizard.getSourceInfo(),info);
  wizard.setDerivedIDClassifier(derivedClassifier);
  if (classificationWidget == null) {
    classificationWidget=new DerivedClassificationWidget(classificationGroup);
    classificationGroup.getShell().layout(true,true);
    classificationGroup.getShell().pack(true);
    getWizard().getContainer().updateButtons();
  }
  classificationWidget.setClassifier(wizard.getDerivedIDClassifier());
  EventPublisher.trigger(new ShowOverlayEvent(info,classificationWidget.getClassifier().getOverlayProvider(),false));
  getWizard().getContainer().updateButtons();
}
Program: 56701
Project: 56701
Buggy source:
public void updateTable(int numberOfHeaderRows,List<RowColDesc> rowDescriptions,List<RowColDesc> columnDescriptions){
  boolean needsReconfiguration=rowDescriptions.size() != this.rowDescriptions.size() || columnDescriptions.size() != this.columnDescriptions.size();
  this.rowDescriptions.clear();
  this.columnDescriptions.clear();
  for (  RowColDesc r : rowDescriptions) {
    this.rowDescriptions.add(new RowColDescInternal(r));
  }
  for (  RowColDesc c : columnDescriptions) {
    this.columnDescriptions.add(new RowColDescInternal(c));
  }
  if (columnSelectionStatus != null && !columnSelectionStatus.isEmpty()) {
    for (    RowColDescInternal desc : this.columnDescriptions) {
      columnSelectionStatus.set(desc.index,true);
    }
  }
  this.numberOfHeaderRows=numberOfHeaderRows;
  if (needsReconfiguration)   table.configure();
  table.refresh();
}

Fixed version (ground truth):
public void updateTable(int numberOfHeaderRows,List<RowColDesc> rowDescriptions,List<RowColDesc> columnDescriptions){
  boolean needsReconfiguration=needsReconfiguration(rowDescriptions,columnDescriptions);
  this.extColumnDescriptions=columnDescriptions;
  this.extRowDescriptions=rowDescriptions;
  this.rowDescriptions.clear();
  this.columnDescriptions.clear();
  for (  RowColDesc r : rowDescriptions) {
    this.rowDescriptions.add(new RowColDescInternal(r));
  }
  for (  RowColDesc c : columnDescriptions) {
    this.columnDescriptions.add(new RowColDescInternal(c));
  }
  if (columnSelectionStatus != null && !columnSelectionStatus.isEmpty()) {
    for (    RowColDescInternal desc : this.columnDescriptions) {
      columnSelectionStatus.set(desc.index,true);
    }
  }
  this.numberOfHeaderRows=numberOfHeaderRows;
  if (needsReconfiguration)   table.configure();
  table.refresh();
}
Program: 56702
Project: 56702
Buggy source:
private void updateTable(){
  page.previewTable.updateTable(dataSetDescription.getNumberOfHeaderLines(),Lists.newArrayList(new RowColDesc(dataSetDescription.getRowOfColumnIDs(),Color.GREEN,rowIDTypeParsingRules)),Lists.newArrayList(new RowColDesc(dataSetDescription.getColumnOfRowIds(),Color.GREEN,columnIDTypeParsingRules)));
}

Fixed version (ground truth):
private void updateTable(){
  page.previewTable.updateTable(dataSetDescription.getNumberOfHeaderLines(),Lists.newArrayList(new RowColDesc(dataSetDescription.getRowOfColumnIDs(),Color.GREEN,columnIDTypeParsingRules)),Lists.newArrayList(new RowColDesc(dataSetDescription.getColumnOfRowIds(),Color.GREEN,rowIDTypeParsingRules)));
}
Program: 56703
Project: 56703
Buggy source:
protected boolean checkIntegrity(){
  PathwayVertexRep prevVertex=null;
  for (  PathwayVertexRep v : this) {
    if (v == null || pathway != v.getPathway()) {
      return false;
    }
    if (prevVertex != null) {
      DefaultEdge edge1=pathway.getEdge(prevVertex,v);
      DefaultEdge edge2=pathway.getEdge(prevVertex,v);
      if (edge1 == null && edge2 == null)       return false;
    }
    prevVertex=v;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkIntegrity(){
  PathwayVertexRep prevVertex=null;
  for (  PathwayVertexRep v : this) {
    if (v == null || pathway != v.getPathway()) {
      return false;
    }
    if (prevVertex != null) {
      DefaultEdge edge1=pathway.getEdge(prevVertex,v);
      DefaultEdge edge2=pathway.getEdge(v,prevVertex);
      if (edge1 == null && edge2 == null)       return false;
    }
    prevVertex=v;
  }
  return true;
}
Program: 56704
Project: 56704
Buggy source:
@Override public boolean checkIntegrity(){
  if (path == null)   return false;
  boolean ok=path.checkIntegrity();
  if (!ok) {
    Logger.log(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str" + path.toString()));
  }
  return path.checkIntegrity();
}

Fixed version (ground truth):
@Override public boolean checkIntegrity(){
  if (path == null)   return false;
  boolean ok=path.checkIntegrity();
  if (!ok) {
    Logger.log(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str" + path.toString()));
  }
  return ok;
}
Program: 56707
Project: 56707
Buggy source:
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=a.iterator();
  double acc=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    final double d=Math.abs(a_it.nextPrimitive() - b_it.nextPrimitive());
    if (!isNaN(d) && d > acc)     acc=d;
  }
  return acc;
}

Fixed version (ground truth):
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=b.iterator();
  double acc=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    final double d=Math.abs(a_it.nextPrimitive() - b_it.nextPrimitive());
    if (!isNaN(d) && d > acc)     acc=d;
  }
  return acc;
}
Program: 56708
Project: 56708
Buggy source:
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=a.iterator();
  double acc=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    double d=a_it.nextPrimitive() - b_it.nextPrimitive();
    if (!isNaN(d))     acc+=d * d;
  }
  return Math.sqrt(acc);
}

Fixed version (ground truth):
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=b.iterator();
  double acc=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    double d=a_it.nextPrimitive() - b_it.nextPrimitive();
    if (!isNaN(d))     acc+=d * d;
  }
  return Math.sqrt(acc);
}
Program: 56709
Project: 56709
Buggy source:
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=a.iterator();
  double acc=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    double a_d=a_it.nextPrimitive();
    double b_d=b_it.nextPrimitive();
    if (!isNaN(a_d) && !isNaN(b_d))     acc+=Math.abs(a_d - b_d);
  }
  return acc;
}

Fixed version (ground truth):
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=b.iterator();
  double acc=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    double a_d=a_it.nextPrimitive();
    double b_d=b_it.nextPrimitive();
    if (!isNaN(a_d) && !isNaN(b_d))     acc+=Math.abs(a_d - b_d);
  }
  return acc;
}
Program: 56710
Project: 56710
Buggy source:
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final double a_mean=mean(a.iterator());
  final double b_mean=mean(b.iterator());
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=a.iterator();
  int n=0;
  double sum_sq_x=0;
  double sum_sq_y=0;
  double sum_coproduct=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    double a_d=a_it.nextPrimitive() - a_mean;
    double b_d=b_it.nextPrimitive() - b_mean;
    if (!isNaN(a_d) && !isNaN(b_d)) {
      sum_sq_x+=a_d * a_d;
      sum_sq_y+=b_d * b_d;
      sum_coproduct+=a_d * b_d;
      n++;
    }
  }
  if (n == 0)   return 0;
  final double pop_sd_x=Math.sqrt(sum_sq_x / n);
  final double pop_sd_y=Math.sqrt(sum_sq_y / n);
  final double cov_x_y=sum_coproduct / n;
  final double correlation=cov_x_y / (pop_sd_x * pop_sd_y);
  return 1 - correlation;
}

Fixed version (ground truth):
@Override public double apply(final IDoubleSizedIterable a,final IDoubleSizedIterable b){
  final double a_mean=mean(a.iterator());
  final double b_mean=mean(b.iterator());
  final IDoubleSizedIterator a_it=a.iterator();
  final IDoubleSizedIterator b_it=b.iterator();
  int n=0;
  double sum_sq_x=0;
  double sum_sq_y=0;
  double sum_coproduct=0;
  while (a_it.hasNext() && b_it.hasNext()) {
    double a_d=a_it.nextPrimitive() - a_mean;
    double b_d=b_it.nextPrimitive() - b_mean;
    if (!isNaN(a_d) && !isNaN(b_d)) {
      sum_sq_x+=a_d * a_d;
      sum_sq_y+=b_d * b_d;
      sum_coproduct+=a_d * b_d;
      n++;
    }
  }
  if (n == 0)   return 0;
  final double pop_sd_x=Math.sqrt(sum_sq_x / n);
  final double pop_sd_y=Math.sqrt(sum_sq_y / n);
  final double cov_x_y=sum_coproduct / n;
  final double correlation=cov_x_y / (pop_sd_x * pop_sd_y);
  return 1 - correlation;
}
Program: 56711
Project: 56711
Buggy source:
public void addTitleElement(GLElement element,boolean left){
  int index=left ? titleBar.indexOf(titleBar.spacingElement) : titleBar.indexOf(titleBar.spacingElement) + 1;
  titleBar.add(index,element);
}

Fixed version (ground truth):
public void addTitleElement(GLElement element,boolean left){
  int index=left ? titleBar.indexOf(titleBar.captionElement) : titleBar.indexOf(titleBar.captionElement) + 1;
  titleBar.add(index,element);
}
Program: 56712
Project: 56712
Buggy source:
public GLTitleBar(ILabeled labelProvider){
  super();
  this.labelProvider=labelProvider;
  setSize(Float.NaN,TITLE_BAR_HEIGHT);
  setLayout(new GLSizeRestrictiveFlowLayout(true,2,new GLPadding(3,2)));
  setRenderer(GLRenderers.drawText(labelProvider.getLabel(),VAlign.LEFT,new GLPadding(2,0,0,4)));
  spacingElement=new GLElement();
  add(spacingElement);
  closeButton=new GLButton(EButtonMode.BUTTON);
  closeButton.setSize(16,16);
  closeButton.setTooltip("String_Node_Str");
  closeButton.setRenderer(GLRenderers.fillImage("String_Node_Str"));
  add(closeButton);
}

Fixed version (ground truth):
public GLTitleBar(ILabeled labelProvider){
  super();
  this.labelProvider=labelProvider;
  setSize(Float.NaN,TITLE_BAR_HEIGHT);
  setLayout(new GLSizeRestrictiveFlowLayout(true,2,new GLPadding(3,2,3,1)));
  captionElement=new GLElement(GLRenderers.drawText(labelProvider.getLabel(),VAlign.LEFT,new GLPadding(2,0,0,3)));
  add(captionElement);
  closeButton=new GLButton(EButtonMode.BUTTON);
  closeButton.setSize(16,16);
  closeButton.setTooltip("String_Node_Str");
  closeButton.setRenderer(GLRenderers.fillImage("String_Node_Str"));
  add(closeButton);
}
Program: 56713
Project: 56713
Buggy source:
public void clearTitleElements(){
  for (  GLElement element : titleBar) {
    if (element != titleBar.spacingElement && element != titleBar.closeButton) {
      titleBar.remove(element);
    }
  }
}

Fixed version (ground truth):
public void clearTitleElements(){
  for (  GLElement element : titleBar) {
    if (element != titleBar.captionElement && element != titleBar.closeButton) {
      titleBar.remove(element);
    }
  }
}
Program: 56715
Project: 56715
Buggy source:
@Override public void run(NatTable natTable,MouseEvent event){
  int rowIndex=natTable.getRowPositionByY(event.y) - 1;
  if (rowIndex != -1 && rowIndex < getRowCount() - 1) {
    swapRows(rowIndex,rowIndex + 1);
    update();
    selectRow(rowIndex + 1);
  }
}

Fixed version (ground truth):
@Override public void run(NatTable natTable,MouseEvent event){
  int rowIndex=natTable.getRowIndexByPosition(natTable.getRowPositionByY(event.y));
  if (rowIndex != -1 && rowIndex < getRowCount() - 1) {
    swapRows(rowIndex,rowIndex + 1);
    update();
    selectRow(rowIndex + 1);
  }
}
Program: 56717
Project: 56717
Buggy source:
/** 
 */
public MyValueElement(){
  IDoubleList l=new ArrayDoubleList(new double[0]);
  content=new ListBoxAndWhiskersElement(l,EDetailLevel.LOW,EDimension.DIMENSION,false,false,d.getLabel(),Color.LIGHT_GRAY);
}

Fixed version (ground truth):
/** 
 */
public MyValueElement(){
  IDoubleList l=new ArrayDoubleList(new double[0]);
  content=new ListBoxAndWhiskersElement(l,EDetailLevel.LOW,EDimension.DIMENSION,false,false,d.getLabel(),Color.LIGHT_GRAY,GLPadding.ZERO);
}
Program: 56718
Project: 56718
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  SelectionManager manager=selections == null || selections.isEmpty() ? null : selections.get(0);
  int n=list.size();
  float o=dim.opposite().select(w,h) * (0.5f - ITEM_AXIS_WIDTH / 2f);
  if (dim.isHorizontal()) {
    g.color(Color.BLACK).drawLine(0,h * 0.5f,h,h * 0.5f);
  }
 else {
    g.color(Color.BLACK).drawLine(w * 0.5f,0,w * 0.5f,h);
  }
  for (int i=0; i < n; ++i) {
    double v=normalize.apply(list.getPrimitive(i));
    if (Double.isNaN(v))     v=nanReplacement;
    if (Double.isNaN(v))     continue;
    SelectionType t=data == null || manager == null ? null : manager.getHighestSelectionType(data.get(i));
    if (t == null) {
      g.color(0,0,0,0.5f);
    }
 else {
      final Color c=t.getColor();
      g.color(c.r,c.g,c.b,0.5f);
    }
    if (invertOrder)     v=1 - v;
    if (dim.isHorizontal()) {
      g.drawLine(w * (float)v,o,w * (float)v,h - o);
    }
 else {
      g.drawLine(o,h * (float)v,w - o,h * (float)v);
    }
  }
  if (isRenderMarkers()) {
    renderMarkers(g,w,h);
  }
  if (selectStart != Float.NaN && selectEnd != Float.NaN) {
    renderSelection(g,w,h);
  }
  super.renderImpl(g,w,h);
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  SelectionManager manager=selections == null || selections.isEmpty() ? null : selections.get(0);
  int n=list.size();
  float o=dim.opposite().select(w,h) * (0.5f - ITEM_AXIS_WIDTH / 2f);
  if (dim.isHorizontal()) {
    g.color(Color.BLACK).drawLine(0,h * 0.5f,w,h * 0.5f);
  }
 else {
    g.color(Color.BLACK).drawLine(w * 0.5f,0,w * 0.5f,h);
  }
  for (int i=0; i < n; ++i) {
    double v=normalize.apply(list.getPrimitive(i));
    if (Double.isNaN(v))     v=nanReplacement;
    if (Double.isNaN(v))     continue;
    SelectionType t=data == null || manager == null ? null : manager.getHighestSelectionType(data.get(i));
    if (t == null) {
      g.color(0,0,0,0.5f);
    }
 else {
      final Color c=t.getColor();
      g.color(c.r,c.g,c.b,0.5f);
    }
    if (invertOrder)     v=1 - v;
    if (dim.isHorizontal()) {
      g.drawLine(w * (float)v,o,w * (float)v,h - o);
    }
 else {
      g.drawLine(o,h * (float)v,w - o,h * (float)v);
    }
  }
  if (isRenderMarkers()) {
    renderMarkers(g,w,h);
  }
  if (selectStart != Float.NaN && selectEnd != Float.NaN) {
    renderSelection(g,w,h);
  }
  super.renderImpl(g,w,h);
}
Program: 56719
Project: 56719
Buggy source:
public Map<Integer,Float> toSignal2Noise(IIDTypeMapper<Integer,Integer> dim2primary){
  LinkedHashMap<Integer,Float> r=new LinkedHashMap<>();
  List<Entry<Integer,Float>> entrySet=new ArrayList<>(correlation.entrySet());
  Collections.sort(entrySet,new Comparator<Entry<Integer,Float>>(){
    @Override public int compare(    Entry<Integer,Float> o1,    Entry<Integer,Float> o2){
      return -Float.compare(o1.getValue(),o2.getValue());
    }
  }
);
  for (  Entry<Integer,Float> ri : entrySet) {
    Set<Integer> keys=dim2primary.apply(ri.getKey());
    if (keys == null) {
      continue;
    }
    for (    Integer key : keys)     r.put(key,ri.getValue());
  }
  return r;
}

Fixed version (ground truth):
public Map<Integer,Float> toSignal2Noise(IIDTypeMapper<Integer,Integer> dim2primary){
  LinkedHashMap<Integer,Float> r=new LinkedHashMap<>();
  List<Entry<Integer,Float>> entrySet=new ArrayList<>(correlation.entrySet());
  Collections.sort(entrySet,new Comparator<Entry<Integer,Float>>(){
    @Override public int compare(    Entry<Integer,Float> o1,    Entry<Integer,Float> o2){
      return -Float.compare(o1.getValue(),o2.getValue());
    }
  }
);
  for (  Entry<Integer,Float> ri : entrySet) {
    final Integer id=ri.getKey();
    Set<Integer> keys=dim2primary.apply(id);
    if (keys == null) {
      continue;
    }
    for (    Integer key : keys) {
      r.put(key,ri.getValue());
    }
  }
  return r;
}
Program: 56720
Project: 56720
Buggy source:
public void flush(int col){
  double m1=aTimesP / n1;
  double s1=aSquaredTimesP / n1 - m1 * m1;
  s1=sqrt(abs((n1 / (n1 - 1)) * s1));
  double m2=bTimesP / n2;
  double s2=bsquaredsum / n2 - m2 * m2;
  s2=sqrt(abs((n2 / (n2 - 1)) * s2));
  s1=(0.2 * abs(m1) < s1) ? s1 : 0.2 * abs(m1);
  s1=(s1 == 0.f) ? 0.2 : s1;
  s2=(0.2 * abs(m2) < s2) ? s2 : 0.2 * abs(m2);
  s2=(s2 == 0.f) ? 0.2 : s2;
  double s=s1 + s2;
  double m=m1 - m2;
  float s2n=(float)(m / s);
  correlation.put(col,s2n);
  aTimesP=aSquaredTimesP=n1=0;
  bTimesP=bsquaredsum=n2=0;
}

Fixed version (ground truth):
public void flush(int col){
  double m1=aTimesP / n1;
  double s1=aSquaredTimesP / n1 - m1 * m1;
  s1=sqrt(abs((n1 / (n1 - 1)) * s1));
  double m2=bTimesP / n2;
  double s2=bsquaredsum / n2 - m2 * m2;
  s2=sqrt(abs((n2 / (n2 - 1)) * s2));
  s2=(0.2 * abs(m2) < s2) ? s2 : 0.2 * abs(m2);
  s2=(s2 == 0.f) ? 0.2 : s2;
  s1=(0.2 * abs(m1) < s1) ? s1 : 0.2 * abs(m1);
  s1=(s1 == 0.f) ? 0.2 : s1;
  double s=s1 + s2;
  double m=m1 - m2;
  float s2n=(float)(m / s);
  correlation.put(col,s2n);
  aTimesP=aSquaredTimesP=n1=0;
  bTimesP=bsquaredsum=n2=0;
}
Program: 56721
Project: 56721
Buggy source:
private double enrichmentScore(Map<Integer,Float> correlation,Set<Integer> geneS){
  final int N=correlation.size();
  final int N_h=geneS.size();
  if (N_h == 0)   return Float.NaN;
  float N_R=0;
  int intersection=0;
  for (  Integer g : geneS)   if (correlation.containsKey(g)) {
    N_R+=Math.abs(powP(correlation.get(g)));
    intersection++;
  }
  if (intersection == 0)   return Float.NaN;
  final double norm_tag=1 / N_R;
  final double norm_no_tag=1. / (N - N_h);
  double p_hit=0;
  double p_miss=0;
  double es_max=Double.NEGATIVE_INFINITY;
  double es_min=Double.POSITIVE_INFINITY;
  for (  Integer r : correlation.keySet()) {
    if (geneS.contains(r))     p_hit+=Math.abs(powP(correlation.get(r))) * norm_tag;
 else     p_miss+=norm_no_tag;
    double esi=p_hit - p_miss;
    if (esi > es_max)     es_max=esi;
    if (esi < es_min)     es_min=esi;
  }
  if (es_max > -es_min)   return es_max;
 else   return es_min;
}

Fixed version (ground truth):
private double enrichmentScore(Map<Integer,Float> correlation,Set<Integer> geneS){
  final int N=correlation.size();
  if (geneS.isEmpty())   return Float.NaN;
  float N_R=0;
  int intersection=0;
  for (  Integer g : geneS)   if (correlation.containsKey(g)) {
    N_R+=Math.abs(powP(correlation.get(g)));
    intersection++;
  }
  if (intersection == 0)   return Float.NaN;
  final int N_h=intersection;
  final double norm_tag=1 / N_R;
  final double norm_no_tag=1. / (N - N_h);
  double p_hit=0;
  double p_miss=0;
  double es_max=Double.NEGATIVE_INFINITY;
  double es_min=Double.POSITIVE_INFINITY;
  for (  Integer r : correlation.keySet()) {
    if (geneS.contains(r))     p_hit+=Math.abs(powP(correlation.get(r))) * norm_tag;
 else     p_miss+=norm_no_tag;
    double esi=p_hit - p_miss;
    if (esi > es_max)     es_max=esi;
    if (esi < es_min)     es_min=esi;
  }
  if (es_max > -es_min)   return es_max;
 else   return es_min;
}
Program: 56722
Project: 56722
Buggy source:
@Override protected void set(String value){
  setValue(Float.parseFloat(value));
}

Fixed version (ground truth):
@Override protected void set(String value){
  EventPublisher.trigger(new SetValueEvent(value).to(GLSlider.this));
}
Program: 56723
Project: 56723
Buggy source:
@Override protected void set(String value){
  setValue(model.parse(value));
}

Fixed version (ground truth):
@Override protected void set(String value){
  EventPublisher.trigger(new SetValueEvent(value).to(GLSpinner.this));
}
Program: 56724
Project: 56724
Buggy source:
@Override public void removeDropTarget(IDropGLTarget dropTarget){
  this.dropTargets.remove(dropTarget);
  if (activeDropTarget == dropTarget) {
    activeDropTarget=null;
  }
}

Fixed version (ground truth):
@Override public void removeDropTarget(IDropGLTarget dropTarget){
  boolean had=this.dropTargets.remove(dropTarget);
  System.out.println("String_Node_Str" + had + "String_Node_Str"+ dropTarget);
  if (activeDropTarget == dropTarget) {
    activeDropTarget=null;
  }
}
Program: 56725
Project: 56725
Buggy source:
@Override protected void render(GLGraphics g,float w,float h,ISpacingLayout spacing){
  final EDimension dim=getDimension();
  List<Integer> ids=data.getData(dim);
  for (int i=0; i < ids.size(); ++i) {
    final Integer id=ids.get(i);
    Double v=id2double.apply(id);
    if (v == null || Double.isNaN(v))     continue;
    float pos=spacing.getPosition(i);
    float size=spacing.getSize(i);
    Vec2f bar=value2bar.apply(v);
    g.color(id2color.apply(id));
    if (dim.isVertical()) {
      g.fillRect(bar.x() * w,pos,(bar.x() + bar.y()) * w,size);
    }
 else {
      g.fillRect(pos,bar.x() * w,size,(bar.x() + bar.y()) * w);
    }
  }
}

Fixed version (ground truth):
@Override protected void render(GLGraphics g,float w,float h,ISpacingLayout spacing){
  final EDimension dim=getDimension();
  List<Integer> ids=data.getData(dim);
  for (int i=0; i < ids.size(); ++i) {
    final Integer id=ids.get(i);
    Double v=id2double.apply(id);
    if (v == null || Double.isNaN(v))     continue;
    float pos=spacing.getPosition(i);
    float size=spacing.getSize(i);
    Vec2f bar=value2bar.apply(v);
    g.color(id2color.apply(id));
    if (dim.isVertical()) {
      g.fillRect(bar.x() * w,pos,(bar.x() + bar.y()) * w,size);
    }
 else {
      g.fillRect(pos,bar.x() * h,size,(bar.x() + bar.y()) * h);
    }
  }
}
Program: 56726
Project: 56726
Buggy source:
public void addMapping(){
  IDCategory category=IDCategory.getIDCategory(idCategory);
  if (category == null) {
    IDCategory.registerCategory(idCategory);
  }
  IDMappingParser.loadMapping(fileName,parsingStartLine,parsingStopLine,getOrCreateIDType(fromIDType,fromDataType),getOrCreateIDType(toIDType,toDataType),delimiter,category,isMultiMapping,createReverseMapping,resolveCodeMappingUsingCodeToId_LUT,getOrCreateIDType(codeResolvedFromIDType,codeResolvedFromDataType),getOrCreateIDType(codeResolvedToIDType,codeResolvedToDataType));
}

Fixed version (ground truth):
public void addMapping(){
  IDCategory category=IDCategory.registerCategoryIfAbsent(idCategory);
  IDMappingParser.loadMapping(fileName,parsingStartLine,parsingStopLine,getOrCreateIDType(fromIDType,fromDataType),getOrCreateIDType(toIDType,toDataType),delimiter,category,isMultiMapping,createReverseMapping,resolveCodeMappingUsingCodeToId_LUT,getOrCreateIDType(codeResolvedFromIDType,codeResolvedFromDataType),getOrCreateIDType(codeResolvedToIDType,codeResolvedToDataType));
}
Program: 56727
Project: 56727
Buggy source:
public ASingleElement(IHeatMapDataProvider data,EDetailLevel detailLevel,boolean blurNotSelected,EDimension dim){
  this.data=data;
  this.dim=dim;
  this.blurNotSelected=blurNotSelected;
  this.data.setCallback(this);
  detailLevel=Objects.firstNonNull(detailLevel,EDetailLevel.LOW);
  this.renderer=new DimensionRenderer(data,dim);
switch (detailLevel) {
case HIGH:
case MEDIUM:
    setVisibility(EVisibility.PICKABLE);
  break;
default :
setVisibility(EVisibility.VISIBLE);
break;
}
}

Fixed version (ground truth):
public ASingleElement(IHeatMapDataProvider data,EDetailLevel detailLevel,EDimension dim){
  this.data=data;
  this.dim=dim;
  this.data.setCallback(this);
  detailLevel=Objects.firstNonNull(detailLevel,EDetailLevel.LOW);
  this.renderer=new DimensionRenderer(data,dim);
switch (detailLevel) {
case HIGH:
case MEDIUM:
    setVisibility(EVisibility.PICKABLE);
  break;
default :
setVisibility(EVisibility.VISIBLE);
break;
}
}
Program: 56728
Project: 56728
Buggy source:
@Override protected final void renderImpl(GLGraphics g,float w,float h){
  g.save();
  render(g,w,h,renderer.getSpacing());
  g.incZ();
  if (blurNotSelected) {
    renderBlurSelection(g,SelectionType.SELECTION,w,h);
    renderer.render(g,SelectionType.MOUSE_OVER,w,h);
  }
 else {
    renderer.render(g,SelectionType.SELECTION,w,h);
    renderer.render(g,SelectionType.MOUSE_OVER,w,h);
  }
  g.lineWidth(1);
  g.decZ();
  g.restore();
}

Fixed version (ground truth):
@Override protected final void renderImpl(GLGraphics g,float w,float h){
  g.save();
  render(g,w,h,renderer.getSpacing());
  g.incZ();
{
    renderer.renderSelectionRects(g,SelectionType.SELECTION,w,h,true);
    renderer.renderSelectionRects(g,SelectionType.MOUSE_OVER,w,h,true);
  }
  g.lineWidth(1);
  g.decZ();
  g.restore();
}
Program: 56730
Project: 56730
Buggy source:
public SingleBarPlotElement(IHeatMapDataProvider data,EDetailLevel detailLevel,boolean blurNotSelected,EDimension dim,Function<? super Integer,Double> id2double,Function<? super Double,Vec2f> value2bar,Function<? super Integer,Color> id2color){
  super(data,detailLevel,blurNotSelected,dim);
  this.id2double=id2double;
  this.value2bar=value2bar;
  this.id2color=id2color;
}

Fixed version (ground truth):
public SingleBarPlotElement(IHeatMapDataProvider data,EDetailLevel detailLevel,EDimension dim,Function<? super Integer,Double> id2double,Function<? super Double,Vec2f> value2bar,Function<? super Integer,Color> id2color){
  super(data,detailLevel,dim);
  this.id2double=id2double;
  this.value2bar=value2bar;
  this.id2color=id2color;
}
Program: 56731
Project: 56731
Buggy source:
public SingleHeatMapPlotElement(IHeatMapDataProvider data,EDetailLevel detailLevel,boolean blurNotSelected,EDimension dim,Function<? super Integer,Color> id2color){
  super(data,detailLevel,blurNotSelected,dim);
  this.id2color=id2color;
  this.hRenderer=new HeatMapRenderer(detailLevel,true,this);
}

Fixed version (ground truth):
public SingleHeatMapPlotElement(IHeatMapDataProvider data,EDetailLevel detailLevel,EDimension dim,Function<? super Integer,Color> id2color){
  super(data,detailLevel,dim);
  this.id2color=id2color;
  this.hRenderer=new HeatMapRenderer(detailLevel,true,this);
}
Program: 56732
Project: 56732
Buggy source:
private void renderSelectionRects(GLGraphics g,float w,float h,List<Integer> indices,SelectionType type,final boolean isDimension){
  g.color(type.getColor());
  g.lineWidth(3);
  int lastIndex=-1;
  float x=0;
  float wi=0;
  for (  int index : indices) {
    if (index != (lastIndex + 1)) {
      if (isDimension)       g.drawRect(x,0,wi,h);
 else       g.drawRect(0,x,w,wi);
      x=spacing.getPosition(index);
      wi=0;
    }
    wi+=spacing.getSize(index);
    lastIndex=index;
  }
  if (wi > 0)   if (isDimension)   g.drawRect(x,0,wi,h);
 else   g.drawRect(0,x,w,wi);
}

Fixed version (ground truth):
private void renderSelectionRects(GLGraphics g,float w,float h,List<Integer> indices,SelectionType type,final boolean isDimension,boolean fill){
  g.color(type.getColor());
  if (!fill)   g.lineWidth(3);
  int lastIndex=-1;
  float x=0;
  float wi=0;
  for (  int index : indices) {
    if (index != (lastIndex + 1)) {
      if (isDimension)       renderRect(fill,g,x,0,wi,h);
 else       renderRect(fill,g,0,x,w,wi);
      x=spacing.getPosition(index);
      wi=0;
    }
    wi+=spacing.getSize(index);
    lastIndex=index;
  }
  if (wi > 0)   if (isDimension)   renderRect(fill,g,x,0,wi,h);
 else   renderRect(fill,g,0,x,w,wi);
}
Program: 56734
Project: 56734
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public GLElement create(GLElementFactoryContext context){
  EDetailLevel detailLevel=context.get(EDetailLevel.class,EDetailLevel.LOW);
  boolean blurNotSelected=context.is("String_Node_Str");
  IHeatMapDataProvider data;
  EDimension dim;
  Function<? super Integer,Color> id2color;
  if (hasTablePerspective(context)) {
    final TablePerspectiveDataProvider d=new TablePerspectiveDataProvider(context.getData());
    data=d;
    dim=EDimension.get(context.getData().getNrRecords() == 1);
    final Integer id=d.getData(dim.opposite()).get(0);
    BasicBlockColorer c=new BasicBlockColorer(d.getDataDomain());
    final Function2<Integer,Integer,Color> getter=dim.isDimension() ? c : Functions2.swap(c);
    id2color=new Function<Integer,Color>(){
      @Override public Color apply(      Integer input){
        return getter.apply(input,id);
      }
    }
;
  }
 else {
    dim=context.get(EDimension.class,EDimension.RECORD);
    IDType idType=context.get(IDType.class,null);
    List<Integer> list=context.get(List.class,null);
    DimensionData d=new DimensionData(list,Functions.constant("String_Node_Str"),Collections.<Group>emptyList(),idType);
    data=new ListDataProvider(dim.select(null,d),dim.select(d,null));
    id2color=context.get("String_Node_Str",Function.class,null);
  }
  return new SingleHeatMapPlotElement(data,detailLevel,blurNotSelected,dim,id2color);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public GLElement create(GLElementFactoryContext context){
  EDetailLevel detailLevel=context.get(EDetailLevel.class,EDetailLevel.LOW);
  IHeatMapDataProvider data;
  EDimension dim;
  Function<? super Integer,Color> id2color;
  if (hasTablePerspective(context)) {
    final TablePerspectiveDataProvider d=new TablePerspectiveDataProvider(context.getData());
    data=d;
    dim=EDimension.get(context.getData().getNrRecords() == 1);
    final Integer id=d.getData(dim.opposite()).get(0);
    BasicBlockColorer c=new BasicBlockColorer(d.getDataDomain());
    final Function2<Integer,Integer,Color> getter=dim.isDimension() ? c : Functions2.swap(c);
    id2color=new Function<Integer,Color>(){
      @Override public Color apply(      Integer input){
        return getter.apply(input,id);
      }
    }
;
  }
 else {
    dim=context.get(EDimension.class,EDimension.RECORD);
    IDType idType=context.get(IDType.class,null);
    List<Integer> list=context.get(List.class,null);
    DimensionData d=new DimensionData(list,Functions.constant("String_Node_Str"),Collections.<Group>emptyList(),idType);
    data=new ListDataProvider(dim.select(null,d),dim.select(d,null));
    id2color=context.get("String_Node_Str",Function.class,null);
  }
  return new SingleHeatMapPlotElement(data,detailLevel,dim,id2color);
}
Program: 56735
Project: 56735
Buggy source:
Color getColor();

Fixed version (ground truth):
/** 
 * return the color of this object
 * @return
 */
Color getColor();
Program: 56736
Project: 56736
Buggy source:
@Override public void dragStart(DragSourceEvent event){
  DragEvent e=new DragEvent(toPoint(event.x,event.y,false));
  for (  IDragGLSource source : dragSources) {
    IDragInfo info=source.startSWTDrag(e);
    if (info != null) {
      activeShared=active=new DnDItem(info,source,true);
      active.setMousePos(e.getMousePos());
      EventPublisher.trigger(new DragItemEvent(readOnly(active),active.source,false).to(MouseLayer.this));
      return;
    }
  }
  event.doit=false;
}

Fixed version (ground truth):
@Override public void dragStart(DragSourceEvent event){
  DragEvent e=new DragEvent(toPoint(event.x,event.y,false));
  for (  IDragGLSource source : dragSources) {
    IDragInfo info=source.startSWTDrag(e);
    if (info != null) {
      active=new DnDItem(info,source,true);
      activeShared=new DnDItem(info,null,false);
      active.setMousePos(e.getMousePos());
      EventPublisher.trigger(new DragItemEvent(readOnly(active),active.source,false).to(MouseLayer.this));
      return;
    }
  }
  event.doit=false;
}
Program: 56737
Project: 56737
Buggy source:
@Override public Vec2f getMinSize(){
  return new Vec2f(130,size() * (20) + 4);
}

Fixed version (ground truth):
@Override public Vec2f getMinSize(){
  return new Vec2f(130,visibleSize() * (20) + 4);
}
Program: 56738
Project: 56738
Buggy source:
@Override public void doLayout(List<? extends IGLLayoutElement> children,float w,float h){
  float y=2;
  w-=4;
  for (  IGLLayoutElement child : children) {
    child.setBounds(2,y,w,18);
    y+=20;
  }
}

Fixed version (ground truth):
@Override public void doLayout(List<? extends IGLLayoutElement> children,float w,float h){
  float y=2;
  w-=4;
  for (  IGLLayoutElement child : children) {
    child.setBounds(2,y,w,18);
    y+=20;
  }
  relayoutParent();
}
Program: 56739
Project: 56739
Buggy source:
@Override public final ALayoutRenderer createRemoteView(AGLView remoteRenderingView,List<TablePerspective> tablePerspectives,String embeddingEventSpace){
  GLElement elem=create(tablePerspectives);
  if (elem == null)   return null;
  return new LayoutRendererAdapter(remoteRenderingView,ResourceLocators.DATA_CLASSLOADER,elem,embeddingEventSpace);
}

Fixed version (ground truth):
@Override public final ALayoutRenderer createRemoteView(AGLView remoteRenderingView,List<TablePerspective> tablePerspectives,String embeddingEventSpace){
  GLElement elem=create(remoteRenderingView,tablePerspectives,embeddingEventSpace);
  if (elem == null)   return null;
  return new LayoutRendererAdapter(remoteRenderingView,ResourceLocators.DATA_CLASSLOADER,elem,embeddingEventSpace);
}
Program: 56740
Project: 56740
Buggy source:
protected abstract GLElement create(List<TablePerspective> tablePerspectives);

Fixed version (ground truth):
protected abstract GLElement create(AGLView remoteRenderingView,List<TablePerspective> tablePerspectives,String embeddingEventSpace);
Program: 56741
Project: 56741
Buggy source:
protected void renderAdapter(GLGraphics g,float w,float h){
  float windowHeight=view.getViewFrustum().getHeight();
  Vec2f loc=getAbsoluteLocation();
  if (viewFrustum.getRight() != w || viewFrustum.getTop() != (windowHeight - loc.y())) {
    viewFrustum.setLeft(loc.x());
    viewFrustum.setBottom(windowHeight - loc.y() - h);
    viewFrustum.setRight(loc.x() + w);
    viewFrustum.setTop(windowHeight - loc.y());
    layout.updateLayout();
  }
  g.save();
  final GL2 gl=g.gl;
  gl.glTranslatef(0,h,g.z());
  gl.glScalef(1,-1,1);
  g.checkError();
  layout.render(gl);
  g.checkError();
  g.restore();
}

Fixed version (ground truth):
protected void renderAdapter(GLGraphics g,float w,float h){
  float windowHeight=view.getViewFrustum().getHeight();
  Vec2f loc=getAbsoluteLocation();
  if (Float.compare(viewFrustum.getLeft(),loc.x() + 140) != 0 || Float.compare(viewFrustum.getBottom(),windowHeight - loc.y() - h) != 0 || Float.compare(viewFrustum.getRight(),loc.x() + w) != 0 || Float.compare(viewFrustum.getTop(),windowHeight - loc.y()) != 0) {
    viewFrustum.setLeft(loc.x());
    viewFrustum.setBottom(windowHeight - loc.y() - h);
    viewFrustum.setRight(loc.x() + w);
    viewFrustum.setTop(windowHeight - loc.y());
    layout.updateLayout();
  }
  g.save();
  final GL2 gl=g.gl;
  gl.glTranslatef(0,h,g.z());
  gl.glScalef(1,-1,1);
  g.checkError();
  layout.render(gl);
  g.checkError();
  g.restore();
}