nus-yam/ex-repair huggingface dataset:
Program: 56917
Project: 56917
Buggy source:
private void createUI(){
  Shell splash=getSplash();
  progressBar=new ProgressBar(splash,SWT.NONE);
  progressBar.setBounds(20,200,progressLabelX,progressLabelY);
  splash.setBackgroundMode(SWT.INHERIT_DEFAULT);
  progressLabelX=splash.getSize().x - 40;
  progressLabelY=25;
  final Display display=splash.getDisplay();
  gc=new GC(splash);
  gc.setFont(new Font(display,"String_Node_Str",10,SWT.NONE));
  gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
  updateProgessLabel("String_Node_Str");
  gc.drawString("String_Node_Str" + GeneralManager.VERSION,336,185,true);
  GeneralManager.get().setSplash(this);
  splash.setText("String_Node_Str");
}

Fixed version (ground truth):
private void createUI(){
  Shell splash=getSplash();
  progressBar=new ProgressBar(splash,SWT.NONE);
  progressBar.setBounds(20,200,progressLabelX,progressLabelY);
  splash.setBackgroundMode(SWT.INHERIT_DEFAULT);
  progressLabelX=splash.getSize().x - 40;
  progressLabelY=25;
  final Display display=splash.getDisplay();
  gc=new GC(splash);
  gc.setFont(new Font(display,"String_Node_Str",10,SWT.NONE));
  gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
  updateProgressLabel("String_Node_Str");
  gc.drawString("String_Node_Str" + GeneralManager.VERSION,336,185,true);
  GeneralManager.get().setSplash(this);
  splash.setText("String_Node_Str");
}
Program: 56918
Project: 56918
Buggy source:
/** 
 * Returns the 3-component color for the given table cell. This works independent of the data type. FIXME: inhomogeneous numerical is not implemented
 * @param dimensionID
 * @param recordID
 * @return
 */
public float[] getColor(Integer dimensionID,Integer recordID){
  if (isDataHomogeneous()) {
    return colorMapper.getColor(getNormalizedValue(dimensionID,recordID));
  }
 else {
    if (EDataClass.CATEGORICAL.equals(getDataClass(dimensionID,recordID))) {
      CategoricalClassDescription<?> specific=(CategoricalClassDescription<?>)getDataClassSpecificDescription(dimensionID,recordID);
      Object category=getRaw(dimensionID,recordID);
      return specific.getCategoryProperty(category).getColor().getRGBA();
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Returns the 3-component color for the given table cell. This works independent of the data type. FIXME: inhomogeneous numerical is not implemented
 * @param dimensionID
 * @param recordID
 * @return
 */
public float[] getColor(Integer dimensionID,Integer recordID){
  if (isDataHomogeneous()) {
    return getColorMapper().getColor(getNormalizedValue(dimensionID,recordID));
  }
 else {
    if (EDataClass.CATEGORICAL.equals(getDataClass(dimensionID,recordID))) {
      CategoricalClassDescription<?> specific=(CategoricalClassDescription<?>)getDataClassSpecificDescription(dimensionID,recordID);
      Object category=getRaw(dimensionID,recordID);
      return specific.getCategoryProperty(category).getColor().getRGBA();
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
  }
}
Program: 56919
Project: 56919
Buggy source:
@Override public void addUnknown(){
  add(unknownCategoryType);
  if (categoricalClassDescription != null && categoricalClassDescription.getUnknownCategory() == null) {
    categoricalClassDescription.setUnknownCategory(new CategoryProperty<CATEGORY_TYPE>(unknownCategoryType,"String_Node_Str",Color.NOT_A_NUMBER_COLOR));
  }
}

Fixed version (ground truth):
@Override public void addUnknown(){
  add(unknownCategoryType);
}
Program: 56921
Project: 56921
Buggy source:
@Override public AGLView createRemoteView(AGLView remoteRenderingView,List<TablePerspective> tablePerspectives,String embeddingEventSpace){
  GLHistogram histogramView=(GLHistogram)GeneralManager.get().getViewManager().createGLView(GLHistogram.class,remoteRenderingView.getParentGLCanvas(),remoteRenderingView.getParentComposite(),new ViewFrustum(CameraProjectionMode.ORTHOGRAPHIC,0,1,0,1,-1,1));
  histogramView.setRemoteRenderingGLView((IGLRemoteRenderingView)remoteRenderingView);
  TablePerspective tablePerspective=null;
  if (tablePerspectives.size() > 0) {
    tablePerspective=tablePerspectives.get(0);
    ATableBasedDataDomain dataDomain=tablePerspective.getDataDomain();
    Histogram histogram=null;
    histogram=tablePerspective.getContainerStatistics().getHistogram();
    histogramView.setDataDomain(dataDomain);
    histogramView.setHistogram(histogram);
  }
  histogramView.initialize();
  histogramView.setDetailLevel(EDetailLevel.LOW);
  return histogramView;
}

Fixed version (ground truth):
@Override public AGLView createRemoteView(AGLView remoteRenderingView,List<TablePerspective> tablePerspectives,String embeddingEventSpace){
  GLHistogram histogramView=(GLHistogram)GeneralManager.get().getViewManager().createGLView(GLHistogram.class,remoteRenderingView.getParentGLCanvas(),remoteRenderingView.getParentComposite(),new ViewFrustum(CameraProjectionMode.ORTHOGRAPHIC,0,1,0,1,-1,1));
  histogramView.setRemoteRenderingGLView((IGLRemoteRenderingView)remoteRenderingView);
  TablePerspective tablePerspective=null;
  if (tablePerspectives.size() > 0) {
    tablePerspective=tablePerspectives.get(0);
    ATableBasedDataDomain dataDomain=tablePerspective.getDataDomain();
    Histogram histogram=null;
    histogram=tablePerspective.getContainerStatistics().getHistogram();
    histogramView.setDataDomain(dataDomain);
    histogramView.setHistogram(histogram);
    histogramView.setTablePerspective(tablePerspective);
  }
  histogramView.initialize();
  histogramView.setDetailLevel(EDetailLevel.LOW);
  return histogramView;
}
Program: 56922
Project: 56922
Buggy source:
public void addButton(GLButton b){
  this.add(b.setSize(RenderStyle.BUTTON_WIDTH,-1));
}

Fixed version (ground truth):
public GLButton addButton(GLButton b){
  this.add(b.setSize(RenderStyle.BUTTON_WIDTH,-1));
  return b;
}
Program: 56923
Project: 56923
Buggy source:
@Override protected void init(ARankColumnModel model){
  super.init(model);
  model.addPropertyChangeListener(PROP_WIDTH,listener);
  float oldWidth=size() == 1 ? (getSpaces() - RenderStyle.COLUMN_SPACE) : width;
  super.setWidth(oldWidth + model.getWidth() + RenderStyle.COLUMN_SPACE);
}

Fixed version (ground truth):
@Override protected void init(ARankColumnModel model){
  super.init(model);
  model.addPropertyChangeListener(PROP_WIDTH,listener);
  model.addPropertyChangeListener(IFilterColumnMixin.PROP_FILTER,listener);
  model.addPropertyChangeListener(IMappedColumnMixin.PROP_MAPPING,listener);
  float oldWidth=size() == 1 ? (getSpaces() - RenderStyle.COLUMN_SPACE) : width;
  super.setWidth(oldWidth + model.getWidth() + RenderStyle.COLUMN_SPACE);
}
Program: 56924
Project: 56924
Buggy source:
@Override protected void takeDown(ARankColumnModel model){
  super.takeDown(model);
  model.removePropertyChangeListener(PROP_WIDTH,listener);
  super.setWidth(width - model.getWidth() - RenderStyle.COLUMN_SPACE);
}

Fixed version (ground truth):
@Override protected void takeDown(ARankColumnModel model){
  super.takeDown(model);
  model.removePropertyChangeListener(PROP_WIDTH,listener);
  model.removePropertyChangeListener(IFilterColumnMixin.PROP_FILTER,listener);
  model.removePropertyChangeListener(IMappedColumnMixin.PROP_MAPPING,listener);
  super.setWidth(width - model.getWidth() - RenderStyle.COLUMN_SPACE);
}
Program: 56925
Project: 56925
Buggy source:
@Override public void propertyChange(PropertyChangeEvent evt){
switch (evt.getPropertyName()) {
case PROP_WIDTH:
    onWeightChanged((ARankColumnModel)evt.getSource(),(float)evt.getOldValue(),(float)evt.getNewValue());
  break;
}
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
switch (evt.getPropertyName()) {
case PROP_WIDTH:
    onWeightChanged((ARankColumnModel)evt.getSource(),(float)evt.getOldValue(),(float)evt.getNewValue());
  break;
case IFilterColumnMixin.PROP_FILTER:
case IMappedColumnMixin.PROP_MAPPING:
propertySupport.firePropertyChange(evt);
break;
}
}
Program: 56926
Project: 56926
Buggy source:
/** 
 * @return
 */
private IColumnRenderInfo findRenderInfo(){
  IGLElementParent p=getParent();
  while (!(p instanceof IColumnRenderInfo) && p != null)   p=p.getParent();
  return (IColumnRenderInfo)p;
}

Fixed version (ground truth):
/** 
 * @return
 */
private IColumnRenderInfo findRenderInfo(){
  IGLElementParent p=summary.getParent();
  while (!(p instanceof IColumnRenderInfo) && p != null)   p=p.getParent();
  return (IColumnRenderInfo)p;
}
Program: 56927
Project: 56927
Buggy source:
@Override public boolean apply(TablePerspective tablePerspective){
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(TablePerspective tablePerspective){
  return PathwayOracle.canBeUnderlying(tablePerspective);
}
Program: 56928
Project: 56928
Buggy source:
@Override public int compare(IRow o1,IRow o2){
  applyPrimitive(o1);
  applyPrimitive(o2);
  CacheRow r1=getCacheRow(o1);
  CacheRow r2=getCacheRow(o2);
  if (codeOrder.equalsIgnoreCase(DEFAULT_ORDER_CODE)) {
    return Float.compare(r1.value,r2.value);
  }
 else   return runOrderScript(r1,r2);
}

Fixed version (ground truth):
@Override public int compare(IRow o1,IRow o2){
  applyPrimitive(o1);
  applyPrimitive(o2);
  CacheRow r1=getCacheRow(o1);
  CacheRow r2=getCacheRow(o2);
  if (codeOrder.equalsIgnoreCase(DEFAULT_ORDER_CODE)) {
    return -Float.compare(r1.value,r2.value);
  }
 else   return runOrderScript(r1,r2);
}
Program: 56929
Project: 56929
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  final boolean isCompressed=(model instanceof ICompressColumnMixin && ((ICompressColumnMixin)model).isCompressed());
  if (!isCompressed) {
    g.decZ().decZ();
    g.lineWidth(RenderStyle.COLOR_STACKED_BORDER_WIDTH);
    g.color(RenderStyle.COLOR_STACKED_BORDER);
    g.drawRect(RenderStyle.GROUP_COLUMN_PADDING - 1,0,w - RenderStyle.GROUP_COLUMN_PADDING + 1,h);
    g.lineWidth(1);
    g.incZ().incZ();
  }
  renderBaseImpl(g,w,h);
  if (model instanceof IRankableColumnMixin && !isCompressed) {
    g.incZ();
    config.renderIsOrderByGlyph(g,w,h,model.getMyRanker().getOrderBy() == model);
    g.decZ();
  }
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  final boolean isCompressed=(model instanceof ICompressColumnMixin && ((ICompressColumnMixin)model).isCompressed());
  if (!isCompressed) {
    g.decZ().decZ();
    g.move(-1,0);
    config.renderHeaderBackground(g,w + 1,h,LABEL_HEIGHT,model);
    g.move(+1,0);
    g.lineWidth(RenderStyle.COLOR_STACKED_BORDER_WIDTH);
    g.color(RenderStyle.COLOR_STACKED_BORDER);
    g.drawRect(-1,0,w + 1,h);
    g.lineWidth(1);
    g.incZ().incZ();
  }
  renderBaseImpl(g,w,h);
  if (model instanceof IRankableColumnMixin && !isCompressed) {
    g.incZ();
    config.renderIsOrderByGlyph(g,w,h,model.getMyRanker().getOrderBy() == model);
    g.decZ();
  }
}
Program: 56930
Project: 56930
Buggy source:
public static CategoricalPercentageRankColumnModel create(final Object category,final CategoricalTable<?> table){
  final CategoryProperty<?> property=table.getCategoryDescriptions().getCategoryProperty(category);
  String catName=property.getCategoryName();
  IFloatFunction<IRow> data=new AFloatFunction<IRow>(){
    @Override public float applyPrimitive(    IRow in){
      if (!(in instanceof CategoricalPerspectiveRow))       return Float.NaN;
      CategoricalPerspectiveRow r=(CategoricalPerspectiveRow)in;
      if (r.getDataDomain() != table.getDataDomain())       return Float.NaN;
      int have=table.getNumberOfMatches(category,r.getCategoryIDType(),r.getDimensionID());
      return have;
    }
  }
;
  Color col=property.getColor();
  Color bgColor=col.brighter().brighter();
  return new CategoricalPercentageRankColumnModel(data,catName,col,bgColor,table.getDataDomain(),table.depth());
}

Fixed version (ground truth):
public static CategoricalPercentageRankColumnModel create(final Object category,final CategoricalTable<?> table){
  final CategoryProperty<?> property=table.getCategoryDescriptions().getCategoryProperty(category);
  String catName=property.getCategoryName();
  IFloatFunction<IRow> data=new AFloatFunction<IRow>(){
    @Override public float applyPrimitive(    IRow in){
      if (!(in instanceof CategoricalPerspectiveRow))       return Float.NaN;
      CategoricalPerspectiveRow r=(CategoricalPerspectiveRow)in;
      if (r.getDataDomain() != table.getDataDomain())       return Float.NaN;
      int have=table.getNumberOfMatches(category,r.getCategoryIDType(),r.getDimensionID());
      return have;
    }
  }
;
  Color col=property.getColor();
  Color bgColor=col.brighter();
  return new CategoricalPercentageRankColumnModel(data,catName,col,bgColor,table.getDataDomain(),table.depth());
}
Program: 56931
Project: 56931
Buggy source:
protected void renderBackground(GLGraphics g,float w,float h){
  config.renderHeaderBackground(g,w,h,LABEL_HEIGHT,model);
  renderOrderGlyph(g,w,h);
  if (isCollapsed)   return;
  boolean small=isSmallHeader(h);
  if (hasTitle && !(armDropColum && small)) {
    g.move(2,2);
    model.getHeaderRenderer().render(g,w - 6,LABEL_HEIGHT - 6,this);
    g.move(-2,-2);
  }
  if (headerHovered) {
    g.drawRect(0,0,w,h);
  }
  if (this.armDropColum) {
    g.incZ(0.6f);
    if (small) {
      g.drawText(armDropHint,2,2,w - 6,LABEL_HEIGHT - 6,VAlign.CENTER,ETextStyle.BOLD);
    }
 else {
      float hi=Math.min(h - 4,18);
      g.drawText(armDropHint,2,2 + (h - hi) * .5f,w - 4,hi,VAlign.CENTER,ETextStyle.BOLD);
    }
    g.incZ(-0.6f);
  }
}

Fixed version (ground truth):
protected void renderBackground(GLGraphics g,float w,float h){
  config.renderHeaderBackground(g,w,h,LABEL_HEIGHT,model);
  renderOrderGlyph(g,w,h);
  if (isCollapsed)   return;
  boolean small=isSmallHeader(h);
  if (hasTitle && !(armDropColum && small)) {
    g.move(2,2);
    model.getHeaderRenderer().render(g,w - 6,LABEL_HEIGHT - 7,this);
    g.move(-2,-2);
  }
  if (headerHovered) {
    g.drawRect(0,0,w,h);
  }
  if (this.armDropColum) {
    g.incZ(0.6f);
    if (small) {
      g.drawText(armDropHint,2,2,w - 6,LABEL_HEIGHT - 6,VAlign.CENTER,ETextStyle.BOLD);
    }
 else {
      float hi=Math.min(h - 4,18);
      g.drawText(armDropHint,2,2 + (h - hi) * .5f,w - 4,hi,VAlign.CENTER,ETextStyle.BOLD);
    }
    g.incZ(-0.6f);
  }
}
Program: 56932
Project: 56932
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  final boolean isCompressed=(model instanceof ICompressColumnMixin && ((ICompressColumnMixin)model).isCompressed());
  if (!isCompressed) {
    g.decZ().decZ();
    g.move(RenderStyle.GROUP_COLUMN_PADDING - 1,0);
    config.renderHeaderBackground(g,w - RenderStyle.GROUP_COLUMN_PADDING + 1,h,LABEL_HEIGHT,model);
    g.move(-RenderStyle.GROUP_COLUMN_PADDING + 1,0);
    g.lineWidth(RenderStyle.COLOR_STACKED_BORDER_WIDTH);
    g.color(RenderStyle.COLOR_STACKED_BORDER);
    g.drawRect(RenderStyle.GROUP_COLUMN_PADDING - 1,0,w - RenderStyle.GROUP_COLUMN_PADDING + 1,h);
    g.lineWidth(1);
    g.incZ().incZ();
  }
  renderBaseImpl(g,w,h);
  if (model instanceof IRankableColumnMixin && !isCompressed) {
    g.incZ();
    config.renderIsOrderByGlyph(g,w,h,model.getMyRanker().getOrderBy() == model);
    g.decZ();
  }
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  final boolean isCompressed=(model instanceof ICompressColumnMixin && ((ICompressColumnMixin)model).isCompressed());
  if (!isCompressed) {
    g.decZ().decZ();
    g.lineWidth(RenderStyle.COLOR_STACKED_BORDER_WIDTH);
    g.color(RenderStyle.COLOR_STACKED_BORDER);
    g.drawRect(RenderStyle.GROUP_COLUMN_PADDING - 1,0,w - RenderStyle.GROUP_COLUMN_PADDING + 1,h);
    g.lineWidth(1);
    g.incZ().incZ();
  }
  renderBaseImpl(g,w,h);
  if (model instanceof IRankableColumnMixin && !isCompressed) {
    g.incZ();
    config.renderIsOrderByGlyph(g,w,h,model.getMyRanker().getOrderBy() == model);
    g.decZ();
  }
}
Program: 56933
Project: 56933
Buggy source:
@Override public float getTopPadding(boolean smallHeader){
  return LABEL_HEIGHT;
}

Fixed version (ground truth):
@Override public float getTopPadding(boolean smallHeader){
  return LABEL_HEIGHT + 2;
}
Program: 56934
Project: 56934
Buggy source:
/** 
 * @param strat
 * @param group
 * @param createGSEA
 * @return
 */
public static MultiScore createScore(TablePerspective strat,Group group,boolean createGSEA){
  AGSEAAlgorithm algorithm;
  if (createGSEA)   algorithm=new GSEAAlgorithm(strat.getRecordPerspective(),group,1.0f);
 else   algorithm=new PGSEAAlgorithm(strat.getRecordPerspective(),group);
  String label=String.format("String_Node_Str",strat.getRecordPerspective().getLabel());
  IScore gsea=new GeneSetScore("String_Node_Str" + label,algorithm,false);
  IScore pValue=new GeneSetScore("String_Node_Str" + label,algorithm.asPValue(),true);
  MultiScore s=new MultiScore(gsea.getLabel(),color,bgColor,1);
  s.add(gsea);
  s.add(pValue);
  return s;
}

Fixed version (ground truth):
/** 
 * @param strat
 * @param group
 * @param createGSEA
 * @return
 */
public static MultiScore createScore(TablePerspective strat,Group group,boolean createGSEA){
  AGSEAAlgorithm algorithm;
  if (createGSEA)   algorithm=new GSEAAlgorithm(strat.getRecordPerspective(),group,1.0f);
 else   algorithm=new PGSEAAlgorithm(strat.getRecordPerspective(),group);
  String label=String.format("String_Node_Str",strat.getRecordPerspective().getLabel());
  IScore gsea=new GeneSetScore("String_Node_Str",algorithm,false);
  IScore pValue=new GeneSetScore("String_Node_Str",algorithm.asPValue(),true);
  MultiScore s=new MultiScore(label,color,bgColor,1);
  s.add(gsea);
  s.add(pValue);
  return s;
}
Program: 56935
Project: 56935
Buggy source:
@Override protected List<AScoreRow> getAll(){
  ATableBasedDataDomain d=(ATableBasedDataDomain)dataDomain;
  List<AScoreRow> r=new ArrayList<>();
  this.snapshot=new HashSet<>(d.getDimensionPerspectiveIDs());
  for (  String dimPerspectiveID : d.getDimensionPerspectiveIDs()) {
    Perspective p=d.getTable().getDimensionPerspective(dimPerspectiveID);
    if (p.isDefault() || p.isPrivate())     continue;
    Integer dimensionID=p.getVirtualArray().get(0);
    if (dataClass != d.getTable().getDataClass(dimensionID,0))     continue;
    r.add(new InhomogenousPerspectiveRow(p,this));
  }
  return r;
}

Fixed version (ground truth):
@Override protected List<AScoreRow> getAll(){
  ATableBasedDataDomain d=(ATableBasedDataDomain)dataDomain;
  List<AScoreRow> r=new ArrayList<>();
  this.snapshot=new HashSet<>(d.getDimensionPerspectiveIDs());
  for (  String dimPerspectiveID : d.getDimensionPerspectiveIDs()) {
    Perspective p=d.getTable().getDimensionPerspective(dimPerspectiveID);
    if (p.isDefault() || p.isPrivate())     continue;
    Integer dimensionID=p.getVirtualArray().get(0);
    if (dataClass != d.getTable().getDataClass(dimensionID,0))     continue;
    r.add(new InhomogenousPerspectiveRow(asTablePerspective(p),this));
  }
  return r;
}
Program: 56936
Project: 56936
Buggy source:
@Override public List<AScoreRow> onDataDomainUpdated(){
  if (!isInitialized())   return null;
  ATableBasedDataDomain d=getDataDomain();
  Set<String> current=new TreeSet<>(d.getDimensionPerspectiveIDs());
  if (snapshot.equals(d.getDimensionPerspectiveIDs()))   return null;
  BitSet blackList=new BitSet();
{
    int i=0;
    for (    AScoreRow row : data) {
      InhomogenousPerspectiveRow r=(InhomogenousPerspectiveRow)row;
      Perspective perspective=r.getStratification();
      blackList.set(i++,!current.remove(perspective.getPerspectiveID()));
    }
  }
  for (int i=blackList.nextSetBit(0); i >= 0; i=blackList.nextSetBit(i + 1)) {
    data.set(i,null);
  }
  List<AScoreRow> added=new ArrayList<>(1);
  for (  String dimPerspectiveID : current) {
    Perspective p=d.getTable().getDimensionPerspective(dimPerspectiveID);
    if (p.isDefault() || p.isPrivate())     continue;
    added.add(new InhomogenousPerspectiveRow(p,this));
  }
  updateFilter();
  snapshot=new TreeSet<>(d.getDimensionPerspectiveIDs());
  return added;
}

Fixed version (ground truth):
@Override public List<AScoreRow> onDataDomainUpdated(){
  if (!isInitialized())   return null;
  ATableBasedDataDomain d=getDataDomain();
  Set<String> current=new TreeSet<>(d.getDimensionPerspectiveIDs());
  if (snapshot.equals(d.getDimensionPerspectiveIDs()))   return null;
  BitSet blackList=new BitSet();
{
    int i=0;
    for (    AScoreRow row : data) {
      InhomogenousPerspectiveRow r=(InhomogenousPerspectiveRow)row;
      Perspective perspective=r.getStratification();
      blackList.set(i++,!current.remove(perspective.getPerspectiveID()));
    }
  }
  for (int i=blackList.nextSetBit(0); i >= 0; i=blackList.nextSetBit(i + 1)) {
    data.set(i,null);
  }
  List<AScoreRow> added=new ArrayList<>(1);
  for (  String dimPerspectiveID : current) {
    Perspective p=d.getTable().getDimensionPerspective(dimPerspectiveID);
    if (p.isDefault() || p.isPrivate())     continue;
    added.add(new InhomogenousPerspectiveRow(asTablePerspective(p),this));
  }
  updateFilter();
  snapshot=new TreeSet<>(d.getDimensionPerspectiveIDs());
  return added;
}
Program: 56937
Project: 56937
Buggy source:
/** 
 * @return the stratification, see {@link #stratification}
 */
public Perspective getStratification(){
  return clinical;
}

Fixed version (ground truth):
/** 
 * @return the stratification, see {@link #stratification}
 */
public Perspective getStratification(){
  return clinical.getRecordPerspective();
}
Program: 56938
Project: 56938
Buggy source:
@Override public VirtualArray getVirtualArray(){
  return clinical.getVirtualArray();
}

Fixed version (ground truth):
@Override public VirtualArray getVirtualArray(){
  return clinical.getRecordPerspective().getVirtualArray();
}
Program: 56939
Project: 56939
Buggy source:
@Override public TablePerspective asTablePerspective(){
  return query.asTablePerspective(clinical);
}

Fixed version (ground truth):
@Override public TablePerspective asTablePerspective(){
  return clinical;
}
Program: 56940
Project: 56940
Buggy source:
public InhomogenousPerspectiveRow(Perspective clinical,InhomogenousDataDomainQuery query){
  this.clinical=clinical;
  this.query=query;
}

Fixed version (ground truth):
public InhomogenousPerspectiveRow(TablePerspective clinical,InhomogenousDataDomainQuery query){
  this.clinical=clinical;
  this.query=query;
}
Program: 56941
Project: 56941
Buggy source:
@Override public boolean is(TablePerspective tablePerspective){
  return clinical.equals(tablePerspective.getDimensionPerspective());
}

Fixed version (ground truth):
@Override public boolean is(TablePerspective tablePerspective){
  return clinical.equals(tablePerspective);
}
Program: 56942
Project: 56942
Buggy source:
@Override public String getPersistentID(){
  return clinical.getPerspectiveID();
}

Fixed version (ground truth):
@Override public String getPersistentID(){
  return clinical.getTablePerspectiveKey();
}
Program: 56947
Project: 56947
Buggy source:
/** 
 * Initialize the color mapping
 * @param markerPoints the marker points
 */
private void setUpMapping(){
  Collections.sort(markerPoints);
  List<ColorMarkerPoint> finalMarkerPoints=considerSpread();
  float srcValue, destValue;
  for (int count=0; count < finalMarkerPoints.size() - 1; count++) {
    srcValue=finalMarkerPoints.get(count).getMappingValue();
    destValue=finalMarkerPoints.get(count + 1).getMappingValue();
    if (destValue < srcValue)     throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
    Color srcColor=finalMarkerPoints.get(count).getColor();
    Color destColor=finalMarkerPoints.get(count + 1).getColor();
    int srcIndex=(int)(srcValue * (COLOR_DEPTH - 1));
    int destIndex=(int)(destValue * (COLOR_DEPTH - 1));
    int colorRange=destIndex - srcIndex;
    for (int innerCount=0; innerCount <= colorRange; innerCount++) {
      Color fColor=colorList.get(srcIndex + innerCount);
      float divisor=(float)colorRange / (float)innerCount;
      fColor.r=srcColor.r + (destColor.r - srcColor.r) / divisor;
      fColor.g=srcColor.g + (destColor.g - srcColor.g) / divisor;
      fColor.b=srcColor.b + (destColor.b - srcColor.b) / divisor;
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize the color mapping
 * @param markerPoints the marker points
 */
private void setUpMapping(){
  Collections.sort(markerPoints);
  List<ColorMarkerPoint> finalMarkerPoints=considerSpread();
  float srcValue, destValue;
  for (int count=0; count < finalMarkerPoints.size() - 1; count++) {
    srcValue=finalMarkerPoints.get(count).getMappingValue();
    destValue=finalMarkerPoints.get(count + 1).getMappingValue();
    if (destValue < srcValue)     throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
    Color srcColor=finalMarkerPoints.get(count).getColor();
    Color destColor=finalMarkerPoints.get(count + 1).getColor();
    int srcIndex=(int)(srcValue * (COLOR_DEPTH - 1));
    int destIndex=(int)(destValue * (COLOR_DEPTH - 1));
    int colorRange=destIndex - srcIndex;
    for (int innerCount=0; innerCount <= colorRange; innerCount++) {
      Color fColor=colorList.get(srcIndex + innerCount);
      float divisor=(float)colorRange / (float)innerCount;
      fColor.r=srcColor.r + (destColor.r - srcColor.r) / divisor;
      fColor.g=srcColor.g + (destColor.g - srcColor.g) / divisor;
      fColor.b=srcColor.b + (destColor.b - srcColor.b) / divisor;
      fColor.a=srcColor.a + (destColor.a - srcColor.a) / divisor;
    }
  }
}
Program: 56948
Project: 56948
Buggy source:
/** 
 * if we pick an brick
 * @param pick
 */
protected void onBrickPick(Pick pick){
  if (pick.getPickingMode() != PickingMode.CLICKED || selectionMode == null || wizard == null)   return;
  GLBrick brick=findBick(pick.getObjectID());
  if (brick == null)   return;
  boolean isHeader=brick.isHeaderBrick();
  if (isHeader != (selectionMode == ESelectionMode.STRATIFICATION))   return;
  if (this.selectionCurrent == brick)   return;
  selectBrick(brick);
}

Fixed version (ground truth):
/** 
 * if we pick an brick
 * @param pick
 */
protected void onBrickPick(Pick pick){
  if (pick.getPickingMode() != PickingMode.CLICKED || selectionMode == null || wizard == null)   return;
  GLBrick brick=findBick(pick.getObjectID());
  if (brick == null)   return;
  boolean isHeader=brick.isHeaderBrick();
  if (isHeader != (selectionMode == ESelectionMode.STRATIFICATION))   return;
  if (this.selectionCurrent == brick)   return;
  if (this.wizardPreviews.contains(brick.getBrickColumn()))   return;
  selectBrick(brick);
}
Program: 56949
Project: 56949
Buggy source:
@Override public void addScoreToTourGuide(EDataDomainQueryMode mode,IScore... scores){
  RcpGLTourGuideView tourGuide=OpenViewHandler.showTourGuide(mode);
  GLTourGuideView receiver=tourGuide.getView();
  AddScoreColumnEvent event=new AddScoreColumnEvent(scores);
  event.to(receiver).from(this);
  receiver.onAddColumn(event);
}

Fixed version (ground truth):
@Override public void addScoreToTourGuide(EDataDomainQueryMode mode,IScore... scores){
  RcpGLTourGuideView tourGuide=OpenViewHandler.showTourGuide(mode);
  GLTourGuideView receiver=tourGuide.getView();
  AddScoreColumnEvent event=new AddScoreColumnEvent(scores);
  event.to(receiver).from(this);
  receiver.onRemoveLeadingScoreColumns(new RemoveLeadingScoreColumnsEvent());
  receiver.onAddColumn(event);
}
Program: 56950
Project: 56950
Buggy source:
@ListenTo private void onRemoveLeadingScoreColumns(RemoveLeadingScoreColumnsEvent event){
  List<ARankColumnModel> columns=this.table.getColumns();
  boolean hasOne=false;
  Collection<ARankColumnModel> toremove=new ArrayList<>();
  for (  ARankColumnModel col : columns) {
    if (col instanceof ScoreRankColumnModel || col instanceof StackedRankColumnModel || col instanceof MaxRankColumnModel) {
      hasOne=true;
      toremove.add(col);
    }
 else     if (hasOne)     break;
  }
  for (  ARankColumnModel col : toremove) {
    table.remove(col);
  }
}

Fixed version (ground truth):
@ListenTo public void onRemoveLeadingScoreColumns(RemoveLeadingScoreColumnsEvent event){
  List<ARankColumnModel> columns=this.table.getColumns();
  boolean hasOne=false;
  Collection<ARankColumnModel> toremove=new ArrayList<>();
  for (  ARankColumnModel col : columns) {
    if (col instanceof ScoreRankColumnModel || col instanceof StackedRankColumnModel || col instanceof MaxRankColumnModel) {
      hasOne=true;
      toremove.add(col);
    }
 else     if (hasOne)     break;
  }
  for (  ARankColumnModel col : toremove) {
    table.remove(col);
  }
}
Program: 56951
Project: 56951
Buggy source:
public ColumnPoolUI(RankTableModel table,IRankTableUIConfig config){
  this.table=table;
  this.config=RankTableUIConfigs.nonInteractive(config);
  this.isSmallHeader=config.isSmallHeaderByDefault();
  table.addPropertyChangeListener(RankTableModel.PROP_POOL,listener);
  setLayout(this);
  setSize(-1,LABEL_HEIGHT + HIST_HEIGHT + 10);
  this.add(new PaperBasket(table).setSize(LABEL_HEIGHT + HIST_HEIGHT,-1));
{
    GLButton toggleSmallHeader=new GLButton(GLButton.EButtonMode.CHECKBOX);
    toggleSmallHeader.setSelected(isSmallHeader);
    toggleSmallHeader.setCallback(new GLButton.ISelectionCallback(){
      @Override public void onSelectionChanged(      GLButton button,      boolean selected){
        setSmallHeader(selected);
      }
    }
);
    toggleSmallHeader.setTooltip("String_Node_Str");
    toggleSmallHeader.setRenderer(GLRenderers.fillImage(RenderStyle.ICON_SMALL_HEADER_ON));
    toggleSmallHeader.setSelectedRenderer(GLRenderers.fillImage(RenderStyle.ICON_SMALL_HEADER_OFF));
    this.add(toggleSmallHeader);
  }
  for (  ARankColumnModel hidden : table.getPool()) {
    add(wrap(hidden));
  }
}

Fixed version (ground truth):
public ColumnPoolUI(RankTableModel table,IRankTableUIConfig config){
  this.table=table;
  this.config=RankTableUIConfigs.nonInteractive(config);
  this.isSmallHeader=config.isSmallHeaderByDefault();
  table.addPropertyChangeListener(RankTableModel.PROP_POOL,listener);
  setLayout(this);
  setSize(-1,LABEL_HEIGHT + HIST_HEIGHT);
  this.add(new PaperBasket(table).setSize(LABEL_HEIGHT + HIST_HEIGHT,-1));
{
    GLButton toggleSmallHeader=new GLButton(GLButton.EButtonMode.CHECKBOX);
    toggleSmallHeader.setSelected(isSmallHeader);
    toggleSmallHeader.setCallback(new GLButton.ISelectionCallback(){
      @Override public void onSelectionChanged(      GLButton button,      boolean selected){
        setSmallHeader(selected);
      }
    }
);
    toggleSmallHeader.setTooltip("String_Node_Str");
    toggleSmallHeader.setRenderer(GLRenderers.fillImage(RenderStyle.ICON_SMALL_HEADER_ON));
    toggleSmallHeader.setSelectedRenderer(GLRenderers.fillImage(RenderStyle.ICON_SMALL_HEADER_OFF));
    this.add(toggleSmallHeader);
  }
  for (  ARankColumnModel hidden : table.getPool()) {
    add(wrap(hidden));
  }
}
Program: 56952
Project: 56952
Buggy source:
public SimpleRankTableStatsElement(RankTableModel table){
  this.table=table;
  setSize(150,12);
}

Fixed version (ground truth):
public SimpleRankTableStatsElement(RankTableModel table){
  this.table=table;
  setSize(180,12);
}
Program: 56953
Project: 56953
Buggy source:
/** 
 * @param isCompact setter, see  {@link isCompact}
 */
public void setSmallHeader(boolean isCompact){
  if (this.isSmallHeader == isCompact)   return;
  this.isSmallHeader=isCompact;
  relayout();
  setSize(-1,((!isSmallHeader ? HIST_HEIGHT : 0) + LABEL_HEIGHT) * 1 + thickOffset);
  relayoutParent();
}

Fixed version (ground truth):
/** 
 * @param isCompact setter, see  {@link isCompact}
 */
public void setSmallHeader(boolean isCompact){
  if (this.isSmallHeader == isCompact)   return;
  this.isSmallHeader=isCompact;
  relayout();
  setHasThick(max(this,0));
  relayoutParent();
}
Program: 56954
Project: 56954
Buggy source:
private static boolean isSmallHeader(float h){
  return h < (LABEL_HEIGHT + HIST_HEIGHT);
}

Fixed version (ground truth):
private static boolean isSmallHeader(float h){
  return h < (LABEL_HEIGHT + HIST_HEIGHT * 0.5f);
}
Program: 56955
Project: 56955
Buggy source:
private float max(Iterable<?> its,float max){
  boolean smallHeader=isSmallHeader();
  for (  IThickHeader h : Iterables.filter(its,IThickHeader.class))   max=Math.max(h.getTopPadding(smallHeader),max);
  return max;
}

Fixed version (ground truth):
protected final float max(Iterable<?> its,float max){
  boolean smallHeader=isSmallHeader();
  for (  IThickHeader h : Iterables.filter(its,IThickHeader.class))   max=Math.max(h.getTopPadding(smallHeader),max);
  return max;
}
Program: 56957
Project: 56957
Buggy source:
public static GLElement createHeader(ARankColumnModel model,IRankTableUIConfig config,boolean allowComplex){
  if (allowComplex && model instanceof StackedRankColumnModel)   return new StackedColumnHeaderUI((StackedRankColumnModel)model,config);
  if (allowComplex && (model instanceof NestedRankColumnModel || (model instanceof GroupRankColumnModel)))   return new SimpleColumnHeaderUI((ACompositeRankColumnModel)model,config);
  if (model instanceof OrderColumn)   return new OrderColumnHeaderUI(model,config);
  if (allowComplex && (model instanceof MaxRankColumnModel || model instanceof ScriptedRankColumnModel))   return new VerticalColumnHeaderUI((ACompositeRankColumnModel)model,config);
  return new ColumnHeaderUI(model,config);
}

Fixed version (ground truth):
public static GLElement createHeader(ARankColumnModel model,IRankTableUIConfig config,boolean allowComplex){
  if (allowComplex && model instanceof StackedRankColumnModel)   return new StackedColumnHeaderUI((StackedRankColumnModel)model,config);
  if (allowComplex && (model instanceof NestedRankColumnModel || (model instanceof GroupRankColumnModel)))   return new SimpleColumnHeaderUI((ACompositeRankColumnModel)model,config);
  if (model instanceof OrderColumn)   return new OrderColumnHeaderUI(model,config);
  if (model instanceof MaxRankColumnModel || model instanceof ScriptedRankColumnModel)   return new VerticalColumnHeaderUI((ACompositeRankColumnModel)model,config);
  return new ColumnHeaderUI(model,config);
}
Program: 56958
Project: 56958
Buggy source:
@Override public void doLayout(List<? extends IGLLayoutElement> children,float w,float h){
  super.doLayout(children,w,h);
  List<? extends IGLLayoutElement> childs=children.subList(FIRST_CUSTOM,children.size());
  if (headerHovered)   childrenHovered=true;
  if (childrenHovered && !this.isCollapsed()) {
    float y=h;
    for (    IGLLayoutElement child : childs) {
      child.setBounds(0,y,w,h);
      y+=h;
    }
  }
 else {
    for (    IGLLayoutElement child : childs)     child.setBounds(0,h,w,0);
  }
}

Fixed version (ground truth):
@Override public void doLayout(List<? extends IGLLayoutElement> children,float w,float h){
  super.doLayout(children,w,h);
  List<? extends IGLLayoutElement> childs=children.subList(firstColumn(),children.size());
  if (headerHovered)   childrenHovered=true;
  boolean showChildren=childrenHovered && !this.isCollapsed();
  if (isDownAlignment()) {
    if (showChildren) {
      float y=h;
      for (      IGLLayoutElement child : childs) {
        child.setBounds(0,y,w,h);
        y+=h;
      }
    }
 else {
      for (      IGLLayoutElement child : childs)       child.setBounds(0,h,w,0);
    }
  }
 else {
    if (showChildren) {
      float x=w;
      for (      IGLLayoutElement child : childs) {
        child.setBounds(x,0,w,h);
        x+=w;
      }
    }
 else {
      for (      IGLLayoutElement child : childs)       child.setBounds(w,0,0,h);
    }
  }
}
Program: 56959
Project: 56959
Buggy source:
@SuppressWarnings("String_Node_Str") protected void onChildrenChanged(IndexedPropertyChangeEvent evt){
  int index=evt.getIndex();
  if (evt.getOldValue() instanceof Integer) {
    int movedFrom=(Integer)evt.getOldValue();
    add(index + FIRST_CUSTOM,get(movedFrom + FIRST_CUSTOM));
  }
 else   if (evt.getOldValue() == null) {
    Collection<GLElement> news=null;
    if (evt.getNewValue() instanceof ARankColumnModel) {
      news=Collections.singleton(wrap((ARankColumnModel)evt.getNewValue()));
    }
 else {
      news=new ArrayList<>();
      for (      ARankColumnModel c : (Collection<ARankColumnModel>)evt.getNewValue())       news.add(wrap(c));
    }
    for (    GLElement new_ : news)     add(index++ + FIRST_CUSTOM,new_);
  }
 else   if (evt.getNewValue() == null) {
    takeDown(get(index + FIRST_CUSTOM).getLayoutDataAs(ARankColumnModel.class,null));
    remove(index + FIRST_CUSTOM);
  }
 else {
    takeDown(get(index + FIRST_CUSTOM).getLayoutDataAs(ARankColumnModel.class,null));
    set(index + FIRST_CUSTOM,wrap((ARankColumnModel)evt.getNewValue()));
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void onChildrenChanged(IndexedPropertyChangeEvent evt){
  int index=evt.getIndex();
  final int firstColumn=firstColumn();
  if (evt.getOldValue() instanceof Integer) {
    int movedFrom=(Integer)evt.getOldValue();
    add(index + firstColumn,get(movedFrom + firstColumn));
  }
 else   if (evt.getOldValue() == null) {
    Collection<GLElement> news=null;
    if (evt.getNewValue() instanceof ARankColumnModel) {
      news=Collections.singleton(wrap((ARankColumnModel)evt.getNewValue()));
    }
 else {
      news=new ArrayList<>();
      for (      ARankColumnModel c : (Collection<ARankColumnModel>)evt.getNewValue())       news.add(wrap(c));
    }
    for (    GLElement new_ : news)     add(index++ + firstColumn,new_);
  }
 else   if (evt.getNewValue() == null) {
    takeDown(get(index + firstColumn).getLayoutDataAs(ARankColumnModel.class,null));
    remove(index + firstColumn);
  }
 else {
    takeDown(get(index + firstColumn).getLayoutDataAs(ARankColumnModel.class,null));
    set(index + firstColumn,wrap((ARankColumnModel)evt.getNewValue()));
  }
}
Program: 56961
Project: 56961
Buggy source:
@Override public int compare(IRow o1,IRow o2){
  final int size=children.size();
  MultiFloat f1=getSplittedValue(o1);
  MultiFloat f2=getSplittedValue(o2);
  for (int i=0; i < size; ++i) {
    float a=f1.values[i];
    float b=f2.values[i];
    int c=Float.compare(a,b);
    if (c != 0)     return c;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(IRow o1,IRow o2){
  final int size=children.size();
  MultiFloat f1=getSplittedValue(o1);
  MultiFloat f2=getSplittedValue(o2);
  for (int i=0; i < size; ++i) {
    float a=f1.values[i];
    float b=f2.values[i];
    int c=Float.compare(a,b);
    if (c != 0)     return -c;
  }
  return 0;
}
Program: 56962
Project: 56962
Buggy source:
@Override public String getTooltip(){
  StringBuilder b=new StringBuilder();
  int total=table.getDataMask() != null ? table.getDataMask().cardinality() : table.getDataSize();
  int filtered=table.getMyRanker(null).getFilter().cardinality();
  b.append(filtered).append("String_Node_Str").append(total).append(String.format("String_Node_Str",((float)filtered) / total));
  return b.toString();
}

Fixed version (ground truth):
@Override public String getTooltip(){
  StringBuilder b=new StringBuilder();
  int total=table.getDataMask() != null ? table.getDataMask().cardinality() : table.getDataSize();
  int filtered=table.getMyRanker(null).getFilter().cardinality();
  b.append(filtered).append("String_Node_Str").append(total).append(String.format("String_Node_Str",(filtered * 100.f) / total));
  return b.toString();
}
Program: 56964
Project: 56964
Buggy source:
public void pageActivated(){
  String columnIDCategoryString=dataSetDescription.getColumnIDSpecification().getIdCategory();
  columnIDCategory=IDCategory.getIDCategory(columnIDCategoryString);
  String rowIDCategoryString=dataSetDescription.getRowIDSpecification().getIdCategory();
  rowIDCategory=IDCategory.getIDCategory(rowIDCategoryString);
  if (dataSetDescription.getColumnGroupingSpecifications() != null) {
    columnGroupingSpecifications=dataSetDescription.getColumnGroupingSpecifications();
    page.columnGroupingsList.removeAll();
    for (    GroupingParseSpecification groupingParseSpecification : columnGroupingSpecifications) {
      page.columnGroupingsList.add(groupingParseSpecification.getGroupingName());
    }
  }
 else {
    dataSetDescription.setColumnGroupingSpecifications(columnGroupingSpecifications);
  }
  if (dataSetDescription.getRowGroupingSpecifications() != null) {
    rowGroupingSpecifications=dataSetDescription.getRowGroupingSpecifications();
    page.rowGroupingsList.removeAll();
    for (    GroupingParseSpecification groupingParseSpecification : rowGroupingSpecifications) {
      page.rowGroupingsList.add(groupingParseSpecification.getGroupingName());
    }
  }
 else {
    dataSetDescription.setRowGroupingSpecifications(rowGroupingSpecifications);
  }
  guiCreated();
}

Fixed version (ground truth):
public void pageActivated(){
  if (dataSetDescription.getColumnIDSpecification() == null) {
    enableColumnGrouping(false);
    page.columnGroupingsList.removeAll();
    columnGroupingSpecifications.clear();
  }
 else {
    String columnIDCategoryString=dataSetDescription.getColumnIDSpecification().getIdCategory();
    columnIDCategory=IDCategory.getIDCategory(columnIDCategoryString);
    enableColumnGrouping(true);
  }
  String rowIDCategoryString=dataSetDescription.getRowIDSpecification().getIdCategory();
  rowIDCategory=IDCategory.getIDCategory(rowIDCategoryString);
  if (dataSetDescription.getColumnGroupingSpecifications() != null) {
    columnGroupingSpecifications=dataSetDescription.getColumnGroupingSpecifications();
    page.columnGroupingsList.removeAll();
    for (    GroupingParseSpecification groupingParseSpecification : columnGroupingSpecifications) {
      page.columnGroupingsList.add(groupingParseSpecification.getGroupingName());
    }
  }
 else {
    dataSetDescription.setColumnGroupingSpecifications(columnGroupingSpecifications);
  }
  if (dataSetDescription.getRowGroupingSpecifications() != null) {
    rowGroupingSpecifications=dataSetDescription.getRowGroupingSpecifications();
    page.rowGroupingsList.removeAll();
    for (    GroupingParseSpecification groupingParseSpecification : rowGroupingSpecifications) {
      page.rowGroupingsList.add(groupingParseSpecification.getGroupingName());
    }
  }
 else {
    dataSetDescription.setRowGroupingSpecifications(rowGroupingSpecifications);
  }
  guiCreated();
}
Program: 56965
Project: 56965
Buggy source:
@Override public boolean canFinish(){
  if (!visitedPages.contains(dataSetTypePage) || chosenDataTypePage == null)   return false;
  return super.canFinish();
}

Fixed version (ground truth):
@Override public boolean canFinish(){
  if (chosenDataTypePage == null)   return false;
  return super.canFinish();
}
Program: 56966
Project: 56966
Buggy source:
@Override public void pageActivated(){
}

Fixed version (ground truth):
@Override public void pageActivated(){
  getWizard().setChosenDataTypePage(null);
  getWizard().getContainer().updateButtons();
}
Program: 56968
Project: 56968
Buggy source:
@Override public GLElement createSummary(boolean interactive){
  return null;
}

Fixed version (ground truth):
@Override public GLElement createSummary(boolean interactive){
  return new GLElement();
}
Program: 56969
Project: 56969
Buggy source:
@Override public ValueElement createValue(){
  return null;
}

Fixed version (ground truth):
@Override public ValueElement createValue(){
  return new ValueElement();
}
Program: 56970
Project: 56970
Buggy source:
private void invalidVisibleScores(){
  Deque<ARankColumnModel> cols=new LinkedList<>(table.getColumns());
  while (!cols.isEmpty()) {
    ARankColumnModel model=cols.pollFirst();
    if (model instanceof ScoreRankColumnModel) {
      ((ScoreRankColumnModel)model).dirty();
    }
 else     if (model instanceof StackedRankColumnModel) {
      cols.addAll(((StackedRankColumnModel)model).getChildren());
    }
 else     if (model instanceof MaxCompositeRankColumnModel) {
      MaxCompositeRankColumnModel max=(MaxCompositeRankColumnModel)model;
      cols.addAll(max.getChildren());
    }
  }
}

Fixed version (ground truth):
private void invalidVisibleScores(){
  Deque<ARankColumnModel> cols=new LinkedList<>(table.getColumns());
  while (!cols.isEmpty()) {
    ARankColumnModel model=cols.pollFirst();
    if (model instanceof ScoreRankColumnModel) {
      ((ScoreRankColumnModel)model).dirty();
    }
 else     if (model instanceof StackedRankColumnModel) {
      cols.addAll(((StackedRankColumnModel)model).getChildren());
    }
 else     if (model instanceof MaxRankColumnModel) {
      MaxRankColumnModel max=(MaxRankColumnModel)model;
      cols.addAll(max.getChildren());
    }
  }
}
Program: 56971
Project: 56971
Buggy source:
/** 
 * @return
 */
private Collection<IScore> getVisibleScores(AScoreRow row){
  Collection<IScore> r=new ArrayList<>();
  Deque<ARankColumnModel> cols=new LinkedList<>(table.getColumns());
  while (!cols.isEmpty()) {
    ARankColumnModel model=cols.pollFirst();
    if (model instanceof ScoreRankColumnModel) {
      r.add(((ScoreRankColumnModel)model).getScore());
    }
 else     if (model instanceof StackedRankColumnModel) {
      cols.addAll(((StackedRankColumnModel)model).getChildren());
    }
 else     if (model instanceof MaxCompositeRankColumnModel) {
      MaxCompositeRankColumnModel max=(MaxCompositeRankColumnModel)model;
      if (row != null) {
        int repr=max.getSplittedValue(row).getRepr();
        cols.add(max.get(repr));
      }
 else {
        cols.addAll(max.getChildren());
      }
    }
  }
  for (Iterator<IScore> it=r.iterator(); it.hasNext(); ) {
    if (!it.next().supports(mode))     it.remove();
  }
  return r;
}

Fixed version (ground truth):
/** 
 * @return
 */
private Collection<IScore> getVisibleScores(AScoreRow row){
  Collection<IScore> r=new ArrayList<>();
  Deque<ARankColumnModel> cols=new LinkedList<>(table.getColumns());
  while (!cols.isEmpty()) {
    ARankColumnModel model=cols.pollFirst();
    if (model instanceof ScoreRankColumnModel) {
      r.add(((ScoreRankColumnModel)model).getScore());
    }
 else     if (model instanceof StackedRankColumnModel) {
      cols.addAll(((StackedRankColumnModel)model).getChildren());
    }
 else     if (model instanceof MaxRankColumnModel) {
      MaxRankColumnModel max=(MaxRankColumnModel)model;
      if (row != null) {
        int repr=max.getSplittedValue(row).getRepr();
        cols.add(max.get(repr));
      }
 else {
        cols.addAll(max.getChildren());
      }
    }
  }
  for (Iterator<IScore> it=r.iterator(); it.hasNext(); ) {
    if (!it.next().supports(mode))     it.remove();
  }
  return r;
}
Program: 56972
Project: 56972
Buggy source:
@ListenTo private void onRemoveLeadingScoreColumns(RemoveLeadingScoreColumnsEvent event){
  List<ARankColumnModel> columns=this.table.getColumns();
  boolean hasOne=false;
  Collection<ARankColumnModel> toremove=new ArrayList<>();
  for (  ARankColumnModel col : columns) {
    if (col instanceof ScoreRankColumnModel || col instanceof StackedRankColumnModel || col instanceof MaxCompositeRankColumnModel) {
      hasOne=true;
      toremove.add(col);
    }
 else     if (hasOne)     break;
  }
  for (  ARankColumnModel col : toremove) {
    table.remove(col);
  }
}

Fixed version (ground truth):
@ListenTo private void onRemoveLeadingScoreColumns(RemoveLeadingScoreColumnsEvent event){
  List<ARankColumnModel> columns=this.table.getColumns();
  boolean hasOne=false;
  Collection<ARankColumnModel> toremove=new ArrayList<>();
  for (  ARankColumnModel col : columns) {
    if (col instanceof ScoreRankColumnModel || col instanceof StackedRankColumnModel || col instanceof MaxRankColumnModel) {
      hasOne=true;
      toremove.add(col);
    }
 else     if (hasOne)     break;
  }
  for (  ARankColumnModel col : toremove) {
    table.remove(col);
  }
}
Program: 56974
Project: 56974
Buggy source:
public PreviewTableWidget(Composite parent,IntegerCallback onColumnSelection){
  super(parent);
  this.onColumnSelection=onColumnSelection;
  List<List<String>> emptyMatrix=createEmptyDataMatrix(15,10);
  bodyDataProvider=new MatrixBasedBodyDataProvider(emptyMatrix,emptyMatrix.size());
  buildTable(bodyDataProvider,new ColumnHeaderDataProvider(10),new LineNumberRowHeaderDataProvider(emptyMatrix.size()));
}

Fixed version (ground truth):
public PreviewTableWidget(Composite parent,IntegerCallback onColumnSelection){
  super(parent);
  this.onColumnSelection=onColumnSelection;
  List<List<String>> emptyMatrix=createEmptyDataMatrix(15,10);
  bodyDataProvider=new MatrixBasedBodyDataProvider(emptyMatrix,10);
  columnHeaderDataProvider=new ColumnHeaderDataProvider(10);
  rowHeaderDataProvider=new LineNumberRowHeaderDataProvider(emptyMatrix.size());
  buildTable(bodyDataProvider,columnHeaderDataProvider,rowHeaderDataProvider);
}