nus-yam/ex-repair huggingface dataset:
Program: 56794
Project: 56794
Buggy source:
@Override public void cleanup(GLElementContainer lineUp){
  lineUp.remove(0);
  lineUp.remove(lineUp.size() - 2);
  final GLElementContainer body=(GLElementContainer)lineUp.get(0);
  GLElementContainer c=(GLElementContainer)body.get(1);
  lineUp.add(0,((GLElementContainer)c.get(0)).get(1));
  lineUp.add(1,c.get(1));
  lineUp.remove(2);
}

Fixed version (ground truth):
@Override public void cleanup(GLElementContainer lineUp){
  lineUp.remove(0);
  lineUp.remove(lineUp.size() - 2);
  final GLElementContainer body=(GLElementContainer)lineUp.get(0);
  if (!(body.get(1) instanceof GLElementContainer))   return;
  GLElementContainer c=(GLElementContainer)body.get(1);
  lineUp.add(0,((GLElementContainer)c.get(0)).get(1));
  lineUp.add(1,c.get(1));
  lineUp.remove(2);
}
Program: 56795
Project: 56795
Buggy source:
@Override public void render(GL2 gl){
  Vec3f nodePos=node.getPosition();
  float nodeHeight=node.getHeight();
  float nodeWidth=node.getWidth();
  float size=pixelGLConverter.getGLHeightForGLWidth(GLYPH_SIZE);
  gl.glColor4f(0.3f,0.3f,0.3f,1f);
  gl.glBegin(GL.GL_TRIANGLES);
  gl.glVertex3f(nodePos.x() - nodeWidth / 2.0f,nodePos.y() + nodeHeight / 2.0f,nodePos.z() + 0.1f);
  gl.glVertex3f(nodePos.x() - (nodeWidth / 2.0f) + size,nodePos.y() + nodeHeight / 2.0f,nodePos.z() + 0.1f);
  gl.glVertex3f(nodePos.x() - nodeWidth / 2.0f,nodePos.y() + nodeHeight / 2.0f - size,nodePos.z() + 0.1f);
  gl.glEnd();
}

Fixed version (ground truth):
@Override public void render(GL2 gl){
  Vec3f nodePos=node.getPosition();
  float nodeHeight=node.getHeight();
  float nodeWidth=node.getWidth();
  float size=pixelGLConverter.getGLHeightForPixelHeight(GLYPH_SIZE);
  gl.glColor4f(0.3f,0.3f,0.3f,1f);
  gl.glBegin(GL.GL_TRIANGLES);
  gl.glVertex3f(nodePos.x() - nodeWidth / 2.0f,nodePos.y() + nodeHeight / 2.0f,nodePos.z() + 0.1f);
  gl.glVertex3f(nodePos.x() - (nodeWidth / 2.0f) + size,nodePos.y() + nodeHeight / 2.0f,nodePos.z() + 0.1f);
  gl.glVertex3f(nodePos.x() - nodeWidth / 2.0f,nodePos.y() + nodeHeight / 2.0f - size,nodePos.z() + 0.1f);
  gl.glEnd();
}
Program: 56797
Project: 56797
Buggy source:
@Override public double apply(double in){
{
    Double r=EStandardMappings.apply(code,in,this);
    if (r != null)     return JavaScriptFunctions.clamp01(r.doubleValue());
  }
  try {
    Bindings bindings=engine.createBindings();
    bindings.put("String_Node_Str",in);
    addBindings(bindings);
    CompiledScript c=compileScript();
    if (c == null)     return Double.NaN;
    Object r=compileScript().eval(bindings);
    if (r instanceof Number)     return ((Number)r).doubleValue();
  }
 catch (  MappedValueException e) {
    return e.getValue();
  }
catch (  ScriptException e) {
    log.warn("String_Node_Str" + fullCode(code),e);
  }
  return Double.NaN;
}

Fixed version (ground truth):
@Override public double apply(double in){
{
    filter.use(getActMin(),getActMax());
    Double r=EStandardMappings.apply(code,in,this);
    if (r != null)     return JavaScriptFunctions.clamp01(r.doubleValue());
  }
  try {
    Bindings bindings=engine.createBindings();
    bindings.put("String_Node_Str",in);
    addBindings(bindings);
    CompiledScript c=compileScript();
    if (c == null)     return Double.NaN;
    Object r=compileScript().eval(bindings);
    if (r instanceof Number)     return ((Number)r).doubleValue();
  }
 catch (  MappedValueException e) {
    return e.getValue();
  }
catch (  ScriptException e) {
    log.warn("String_Node_Str" + fullCode(code),e);
  }
  return Double.NaN;
}
Program: 56798
Project: 56798
Buggy source:
public void render(GLGraphics g){
  texture.bind(g.gl);
  g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_CLAMP_TO_EDGE);
  g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_CLAMP_TO_EDGE);
  g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_NEAREST);
  g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_NEAREST);
  g.fillImage(texture,tile.x,tile.y,tile.width,tile.height);
}

Fixed version (ground truth):
public void render(GLGraphics g){
  texture.bind(g.gl);
  if (g.gl.isExtensionAvailable("String_Node_Str")) {
    g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_CLAMP_TO_EDGE);
    g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_CLAMP_TO_EDGE);
  }
  g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_NEAREST);
  g.gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_NEAREST);
  g.fillImage(texture,tile.x,tile.y,tile.width,tile.height);
}
Program: 56799
Project: 56799
Buggy source:
public boolean filterRaw(double raw){
  return raw >= raw_min || raw <= raw_max;
}

Fixed version (ground truth):
public boolean filterRaw(double raw){
  return raw >= raw_min && raw <= raw_max;
}
Program: 56800
Project: 56800
Buggy source:
public boolean filterNormalized(double n){
  return n >= normalized_min || n <= normalized_max;
}

Fixed version (ground truth):
public boolean filterNormalized(double n){
  return n >= normalized_min && n <= normalized_max;
}
Program: 56801
Project: 56801
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  super.renderImpl(g,w,h);
  if (isSelected())   g.color(model.getDataDomain().getColor()).fillRect(2,2,14,14);
  g.fillImage(getStandardIcon("String_Node_Str",false),0,0,18,18);
  float tw=Math.min(g.text.getTextWidth(getLabel(),14),w - 18 - 18);
  g.drawText(getLabel(),18,1,w - 18 - 18,14);
  if (model.isFilteringPossible())   g.fillImage(hasFilter ? ICON_FILTER : ICON_FILTER_DISABLED,18 + tw + 2,2,12,12);
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  super.renderImpl(g,w,h);
  if (isSelected())   g.color(model.getDataDomain().getColor()).fillRect(2,2,14,14);
  g.fillImage(EButtonIcon.CHECKBOX.get(false),0,0,18,18);
  float tw=Math.min(g.text.getTextWidth(getLabel(),14),w - 18 - 18);
  g.drawText(getLabel(),18,1,w - 18 - 18,14);
  if (model.isFilteringPossible())   g.fillImage(hasFilter ? ICON_FILTER : ICON_FILTER_DISABLED,18 + tw + 2,2,12,12);
}
Program: 56802
Project: 56802
Buggy source:
/** 
 * explodes the given composite model into its components, i.e children
 */
@Override public void explode(ACompositeRankColumnModel model){
  int index=this.columns.indexOf(model);
  List<ARankColumnModel> children=model.getChildren();
  for (  ARankColumnModel child : children) {
    child.init(this);
    child.setWidth(100);
  }
  this.columns.set(index,children.get(0));
  propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index,model,children.get(0));
  if (children.size() > 1) {
    this.columns.addAll(index + 1,children.subList(1,children.size()));
    propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index + 1,null,children.subList(1,children.size()));
  }
  findCorrespondingRanker(index).checkOrderChanges(model,children.get(0));
}

Fixed version (ground truth):
/** 
 * explodes the given composite model into its components, i.e children
 */
@Override public void explode(ACompositeRankColumnModel model){
  int index=this.columns.indexOf(model);
  List<ARankColumnModel> children=model.getChildren();
  float w=model instanceof ICompressColumnMixin ? 100 : model.getWidth();
  for (  ARankColumnModel child : children) {
    child.init(this);
    child.setWidth(w);
  }
  this.columns.set(index,children.get(0));
  propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index,model,children.get(0));
  if (children.size() > 1) {
    this.columns.addAll(index + 1,children.subList(1,children.size()));
    propertySupport.fireIndexedPropertyChange(PROP_COLUMNS,index + 1,null,children.subList(1,children.size()));
  }
  findCorrespondingRanker(index).checkOrderChanges(model,children.get(0));
}
Program: 56803
Project: 56803
Buggy source:
public static double linear(double start,double end,double in,double startTo,double endTo){
  boolean special=start > 0;
  start=0;
  if (Double.isNaN(in))   return in;
  if (in < start)   return Double.NaN;
  if (in > end)   return Double.NaN;
  double v=(in - start) / (end - start);
  double r=startTo + v * (endTo - startTo);
  if (special)   System.out.println(in + "String_Node_Str" + r);
  return clamp01(r);
}

Fixed version (ground truth):
public static double linear(double start,double end,double in,double startTo,double endTo){
  if (Double.isNaN(in))   return in;
  if (in < start)   return Double.NaN;
  if (in > end)   return Double.NaN;
  double v=(in - start) / (end - start);
  double r=startTo + v * (endTo - startTo);
  return clamp01(r);
}
Program: 56804
Project: 56804
Buggy source:
@Override public double apply(double in){
  if (Double.isNaN(in))   return in;
  if (!isDefinedMapping)   return super.apply(in);
  if (mapping.size() < 2) {
    double[] m0=getMappedMin();
    double[] m1=getMappedMax();
    return JavaScriptFunctions.linear(m0[0],m1[0],in,m0[1],m1[1]);
  }
  if (mapping.containsKey(in))   return mapping.get(in);
  Double first=mapping.firstKey();
  Double last=mapping.lastKey();
  if (in < first || in > last)   return Double.NaN;
  if (mapping.size() == 2) {
    return JavaScriptFunctions.linear(first,last,in,mapping.get(first),mapping.get(last));
  }
 else {
    SortedMap<Double,Double> before=mapping.headMap(in);
    if (before.isEmpty())     return Double.NaN;
    Double start=before.lastKey();
    Double startTo=before.get(start);
    SortedMap<Double,Double> after=mapping.tailMap(in);
    if (after.isEmpty())     return Double.NaN;
    Double end=after.firstKey();
    Double endTo=after.get(end);
    return JavaScriptFunctions.linear(start,end,in,startTo,endTo);
  }
}

Fixed version (ground truth):
@Override public double apply(double in){
  if (Double.isNaN(in))   return in;
  if (!isDefinedMapping)   return super.apply(in);
  if (mapping.size() < 2) {
    double[] m0=getMappedMin();
    double[] m1=getMappedMax();
    return JavaScriptFunctions.linear(m0[0],m1[0],in,m0[1],m1[1]);
  }
  if (mapping.containsKey(in))   return mapping.get(in);
  Double first=mapping.firstKey();
  Double last=mapping.lastKey();
  if (in < first || in > last)   return Double.NaN;
  if (mapping.size() == 2) {
    return JavaScriptFunctions.linear(first,last,in,mapping.get(first),mapping.get(last));
  }
 else {
    SortedMap<Double,Double> before=mapping.headMap(in);
    if (before.isEmpty())     return Double.NaN;
    Double start=before.lastKey();
    Double startTo=before.get(start);
    SortedMap<Double,Double> after=mapping.tailMap(in);
    if (after.isEmpty())     return Double.NaN;
    Double end=after.firstKey();
    Double endTo=after.get(end);
    double v=JavaScriptFunctions.linear(start,end,in,startTo,endTo);
    return v;
  }
}
Program: 56805
Project: 56805
Buggy source:
private List<Integer> sampleMostVariableDimensions(int sampleSize,List<Integer> recordIDs,List<Integer> dimensionIDs){
  if (dimensionIDs.size() <= sampleSize)   return dimensionIDs;
  List<Pair<Double,Integer>> allDimVar=new ArrayList<Pair<Double,Integer>>();
  for (  Integer dimID : dimensionIDs) {
    double[] allDimsPerRecordArray=new double[recordIDs.size()];
    for (int i=0; i < recordIDs.size(); i++) {
      allDimsPerRecordArray[i]=getRaw(dimID,recordIDs.get(i));
    }
    AdvancedDoubleStatistics stats=AdvancedDoubleStatistics.of(allDimsPerRecordArray);
    if (stats.getNaNs() < stats.getN() * NAN_THRESHOLD) {
      allDimVar.add(new Pair<Double,Integer>(stats.getMedianAbsoluteDeviation(),dimID));
    }
  }
  Collections.sort(allDimVar,Collections.reverseOrder(Pair.<Double>compareFirst()));
  allDimVar=allDimVar.subList(0,sampleSize);
  List<Integer> sampledDimensionIDs=new ArrayList<>();
  for (  Pair<Double,Integer> recordVar : allDimVar) {
    sampledDimensionIDs.add(recordVar.getSecond());
  }
  return sampledDimensionIDs;
}

Fixed version (ground truth):
private List<Integer> sampleMostVariableDimensions(int sampleSize,List<Integer> recordIDs,List<Integer> dimensionIDs){
  if (dimensionIDs.size() <= sampleSize)   return dimensionIDs;
  List<Pair<Double,Integer>> allDimVar=new ArrayList<Pair<Double,Integer>>();
  for (  Integer dimID : dimensionIDs) {
    double[] allDimsPerRecordArray=new double[recordIDs.size()];
    for (int i=0; i < recordIDs.size(); i++) {
      allDimsPerRecordArray[i]=(Float)getRaw(dimID,recordIDs.get(i));
    }
    AdvancedDoubleStatistics stats=AdvancedDoubleStatistics.of(allDimsPerRecordArray);
    if (stats.getNaNs() < stats.getN() * NAN_THRESHOLD) {
      allDimVar.add(new Pair<Double,Integer>(stats.getMedianAbsoluteDeviation(),dimID));
    }
  }
  Collections.sort(allDimVar,Collections.reverseOrder(Pair.<Double>compareFirst()));
  allDimVar=allDimVar.subList(0,sampleSize);
  List<Integer> sampledDimensionIDs=new ArrayList<>();
  for (  Pair<Double,Integer> recordVar : allDimVar) {
    sampledDimensionIDs.add(recordVar.getSecond());
  }
  return sampledDimensionIDs;
}
Program: 56807
Project: 56807
Buggy source:
@Override protected PerspectiveInitializationData cluster(){
  int r=0;
  Stopwatch w=new Stopwatch().start();
  r=determineSimilarities();
  System.out.println("String_Node_Str" + w);
  w.stop().reset();
  if (r < 0) {
    progress(100);
    return null;
  }
  TreeClusterConfiguration tConfig=(TreeClusterConfiguration)config.getClusterAlgorithmConfiguration();
  Node[] result;
  w.start();
switch (tConfig.getTreeClustererAlgo()) {
case COMPLETE_LINKAGE:
    result=pmlcluster();
  System.out.println("String_Node_Str" + w);
break;
case AVERAGE_LINKAGE:
result=palcluster();
System.out.println("String_Node_Str" + w);
break;
case SINGLE_LINKAGE:
result=pslcluster();
System.out.println("String_Node_Str" + w);
break;
default :
throw new IllegalStateException("String_Node_Str" + tConfig.getTreeClustererAlgo());
}
w.reset().start();
PerspectiveInitializationData p=convert(result);
System.out.println("String_Node_Str" + w);
return p;
}

Fixed version (ground truth):
@Override protected PerspectiveInitializationData cluster(){
  int r=0;
  Stopwatch w=new Stopwatch().start();
  r=determineSimilarities();
  System.out.println("String_Node_Str" + w);
  w.stop().reset();
  if (r < 0) {
    progress(100);
    return null;
  }
  TreeClusterConfiguration tConfig=(TreeClusterConfiguration)config.getClusterAlgorithmConfiguration();
  Node[] result;
  w.start();
switch (tConfig.getTreeClustererAlgo()) {
case COMPLETE_LINKAGE:
    result=pmlcluster();
  System.out.println("String_Node_Str" + w);
break;
case AVERAGE_LINKAGE:
result=palcluster();
System.out.println("String_Node_Str" + w);
break;
case SINGLE_LINKAGE:
result=pslcluster();
System.out.println("String_Node_Str" + w);
break;
default :
throw new IllegalStateException("String_Node_Str" + tConfig.getTreeClustererAlgo());
}
if (result == null) return null;
w.reset().start();
PerspectiveInitializationData p=convert(result);
System.out.println("String_Node_Str" + w);
return p;
}
Program: 56808
Project: 56808
Buggy source:
public boolean isSampleGenes(){
  return !fullGenes || Boolean.parseBoolean(sampleGenes);
}

Fixed version (ground truth):
public boolean isSampleGenes(){
  return Boolean.parseBoolean(sampleGenes) && !fullGenes;
}
Program: 56809
Project: 56809
Buggy source:
/** 
 * @param in
 * @return
 */
protected static EDataClass getSingleColumnDataClass(TablePerspective in){
  if (in.getDimensionPerspective().getVirtualArray().size() > 1)   return null;
  int dimensionId=in.getDimensionPerspective().getVirtualArray().get(0);
  int recordId=in.getRecordPerspective().getVirtualArray().get(0);
  return in.getDataDomain().getTable().getDataClass(dimensionId,recordId);
}

Fixed version (ground truth):
/** 
 * @param in
 * @return
 */
protected static EDataClass getSingleColumnDataClass(TablePerspective in){
  if (in.getDimensionPerspective().getVirtualArray().size() != 1)   return null;
  int dimensionId=in.getDimensionPerspective().getVirtualArray().get(0);
  int recordId=in.getRecordPerspective().getVirtualArray().get(0);
  return in.getDataDomain().getTable().getDataClass(dimensionId,recordId);
}
Program: 56811
Project: 56811
Buggy source:
protected void distributeBricksUniformly(){
  float totalUsedHeightByBricks=0;
  for (  GLBrick brick : clusterBricks) {
    totalUsedHeightByBricks+=pixelGLConverter.getGLHeightForPixelHeight(brick.getWrappingLayout().getPixelSizeY());
  }
  float heightForSpacings=clusterBrickColumn.getSizeScaledY() - totalUsedHeightByBricks;
  int brickSpacing=Math.max(pixelGLConverter.getPixelHeightForGLHeight(heightForSpacings / (clusterBricks.size() + 1)),BETWEEN_BRICKS_SPACING);
  if (heightForSpacings <= 0)   return;
  for (int i=0; i < clusterBrickColumn.size(); i++) {
    ElementLayout layout=clusterBrickColumn.get(i);
    if (layout.toString().equals("String_Node_Str")) {
      layout.setPixelSizeY(brickSpacing);
    }
  }
}

Fixed version (ground truth):
protected void distributeBricksUniformly(){
  float totalUsedHeightByBricks=0;
  for (  GLBrick brick : clusterBricks) {
    totalUsedHeightByBricks+=pixelGLConverter.getGLHeightForPixelHeight(brick.getWrappingLayout().getPixelSizeY());
  }
  float heightForSpacings=clusterBrickColumn.getSizeScaledY() - totalUsedHeightByBricks;
  int brickSpacing=Math.max(pixelGLConverter.getPixelHeightForGLHeight(heightForSpacings / (clusterBricks.size() + 1)),BETWEEN_BRICKS_SPACING);
  if (heightForSpacings <= 0)   return;
  for (int i=0; i < clusterBrickColumn.size(); i++) {
    ElementLayout layout=clusterBrickColumn.get(i);
    if (layout.toString().equals("String_Node_Str")) {
      layout.setPixelSizeY(brickSpacing);
    }
  }
  stratomex.setLayoutDirty();
  stratomex.updateConnectionLinesBetweenColumns();
}
Program: 56812
Project: 56812
Buggy source:
/** 
 * Check whether we had a picking hit somewhere during the previous run
 * @param gl
 */
protected final void checkForHits(final GL2 gl){
  contextMenuCreator.clear();
  Set<String> hitTypes=pickingManager.getHitTypes(uniqueID);
  if (hitTypes == null)   return;
  for (  String pickingType : hitTypes) {
    ArrayList<Pick> alHits=null;
    alHits=pickingManager.getHits(uniqueID,pickingType);
    if (alHits != null && alHits.size() != 0) {
      for (int iCount=0; iCount < alHits.size(); iCount++) {
        Pick tempPick=alHits.get(iCount);
        int pickedObjectID=tempPick.getObjectID();
        if (pickedObjectID == -1) {
          continue;
        }
        PickingMode ePickingMode=tempPick.getPickingMode();
        handlePicking(pickingType,ePickingMode,pickedObjectID,tempPick);
        try {
          PickingType type=PickingType.valueOf(pickingType);
          try {
            handlePickingEvents(type,ePickingMode,pickedObjectID,tempPick);
          }
 catch (          Exception e) {
            Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str",e));
          }
        }
 catch (        IllegalArgumentException e) {
        }
      }
      pickingManager.flushHits(uniqueID,pickingType);
    }
  }
  if (contextMenuCreator.hasMenuItems())   contextMenuCreator.open(this);
}

Fixed version (ground truth):
/** 
 * Check whether we had a picking hit somewhere during the previous run
 * @param gl
 */
protected final void checkForHits(final GL2 gl){
  contextMenuCreator.clear();
  Set<String> hTs=pickingManager.getHitTypes(uniqueID);
  if (hTs == null)   return;
  Set<String> hitTypes=new HashSet<String>(hTs);
  for (  String pickingType : hitTypes) {
    ArrayList<Pick> alHits=null;
    alHits=pickingManager.getHits(uniqueID,pickingType);
    if (alHits != null && alHits.size() != 0) {
      for (int iCount=0; iCount < alHits.size(); iCount++) {
        Pick tempPick=alHits.get(iCount);
        int pickedObjectID=tempPick.getObjectID();
        if (pickedObjectID == -1) {
          continue;
        }
        PickingMode ePickingMode=tempPick.getPickingMode();
        handlePicking(pickingType,ePickingMode,pickedObjectID,tempPick);
        try {
          PickingType type=PickingType.valueOf(pickingType);
          try {
            handlePickingEvents(type,ePickingMode,pickedObjectID,tempPick);
          }
 catch (          Exception e) {
            Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str",e));
          }
        }
 catch (        IllegalArgumentException e) {
        }
      }
      pickingManager.flushHits(uniqueID,pickingType);
    }
  }
  if (contextMenuCreator.hasMenuItems())   contextMenuCreator.open(this);
}
Program: 56814
Project: 56814
Buggy source:
@Override public void init(GL2 gl){
  baseDisplayListIndex=gl.glGenLists(1);
  layoutManager=new LayoutManager(viewFrustum,pixelGLConverter);
  layoutManager.setUseDisplayLists(true);
  setBrickLayoutTemplate(brickLayoutConfiguration);
  int rendererID=multiFormRenderer.getActiveRendererID();
  if (rendererID == -1) {
    multiFormRenderer.setActive(multiFormRenderer.getDefaultRendererID());
  }
  updateBrickSizeAccordingToRenderer(multiFormRenderer.getActiveRendererID());
  brickColumn.updateLayout();
  isInitialized=true;
}

Fixed version (ground truth):
@Override public void init(GL2 gl){
  layoutManager=new LayoutManager(viewFrustum,pixelGLConverter);
  layoutManager.setUseDisplayLists(true);
  setBrickLayoutTemplate(brickLayoutConfiguration);
  int rendererID=multiFormRenderer.getActiveRendererID();
  if (rendererID == -1) {
    multiFormRenderer.setActive(multiFormRenderer.getDefaultRendererID());
  }
  updateBrickSizeAccordingToRenderer(multiFormRenderer.getActiveRendererID());
  brickColumn.updateLayout();
  isInitialized=true;
}
Program: 56815
Project: 56815
Buggy source:
@Override public void display(GL2 gl){
  checkForHits(gl);
  processEvents();
  handleBrickResize(gl);
  if (isBaseDisplayListDirty)   buildBaseDisplayList(gl);
  GLStratomex stratomex=getBrickColumn().getStratomexView();
  gl.glPushName(stratomex.getPickingManager().getPickingID(stratomex.getID(),EPickingType.BRICK.name(),getID()));
  gl.glPushName(stratomex.getPickingManager().getPickingID(stratomex.getID(),EPickingType.BRICK_PENETRATING.name(),getID()));
  gl.glColor4f(1.0f,0.0f,0.0f,0.5f);
  gl.glTranslatef(0,0,0.1f);
  gl.glBegin(GL2.GL_QUADS);
  float zpos=0f;
  gl.glVertex3f(0,0,zpos);
  gl.glVertex3f(wrappingLayout.getSizeScaledX(),0,zpos);
  gl.glVertex3f(wrappingLayout.getSizeScaledX(),wrappingLayout.getSizeScaledY(),zpos);
  gl.glVertex3f(0,wrappingLayout.getSizeScaledY(),zpos);
  gl.glEnd();
  gl.glPopName();
  gl.glPopName();
  if (brickColumn.getDetailLevel() != EDetailLevel.LOW || isHeaderBrick)   layoutManager.render(gl);
  gl.glCallList(baseDisplayListIndex);
  gl.glTranslatef(0,0,-0.1f);
}

Fixed version (ground truth):
@Override public void display(GL2 gl){
  checkForHits(gl);
  processEvents();
  handleBrickResize(gl);
  GLStratomex stratomex=getBrickColumn().getStratomexView();
  gl.glPushName(stratomex.getPickingManager().getPickingID(stratomex.getID(),EPickingType.BRICK_PENETRATING.name(),getID()));
  gl.glPushName(stratomex.getPickingManager().getPickingID(stratomex.getID(),EPickingType.BRICK.name(),getID()));
  gl.glColor4f(1.0f,0.0f,0.0f,0.5f);
  gl.glTranslatef(0,0,0.1f);
  gl.glBegin(GL2.GL_QUADS);
  float zpos=0f;
  gl.glVertex3f(0,0,zpos);
  gl.glVertex3f(wrappingLayout.getSizeScaledX(),0,zpos);
  gl.glVertex3f(wrappingLayout.getSizeScaledX(),wrappingLayout.getSizeScaledY(),zpos);
  gl.glVertex3f(0,wrappingLayout.getSizeScaledY(),zpos);
  gl.glEnd();
  gl.glPopName();
  if (brickColumn.getDetailLevel() != EDetailLevel.LOW || isHeaderBrick)   layoutManager.render(gl);
  gl.glPopName();
  gl.glTranslatef(0,0,-0.1f);
}
Program: 56816
Project: 56816
Buggy source:
public AddAttachedLayoutRenderer(BrickColumn view,TourguideAdapter tourguide,boolean left){
  this.view=view;
  this.id=view.getID();
  this.tourguide=tourguide;
  this.left=left;
  view.getStratomexView().addTypePickingListener(this,EPickingType.BRICK.name());
}

Fixed version (ground truth):
public AddAttachedLayoutRenderer(BrickColumn view,TourguideAdapter tourguide,boolean left){
  this.view=view;
  this.id=view.getID();
  this.tourguide=tourguide;
  this.left=left;
  view.getStratomexView().addTypePickingListener(this,EPickingType.BRICK_PENETRATING.name());
}
Program: 56817
Project: 56817
Buggy source:
@Override public IFloatIterator iterator(){
  return new Itr();
}

Fixed version (ground truth):
@Override public IFloatIterator iterator(){
  if (isEmpty())   return Utils.EMPTY;
  if (this.dim.size() == 1)   return new SingleItr(this.rec,this.dim.get(0));
  if (this.rec.size() == 1)   return new SingleItr(this.rec.get(0),this.dim);
  return new Itr();
}
Program: 56818
Project: 56818
Buggy source:
@Override public boolean hasNext(){
  return recItr.hasNext() && dimItr != null && dimItr.hasNext();
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return recItr.hasNext() || (dimItr != null && dimItr.hasNext());
}
Program: 56819
Project: 56819
Buggy source:
/** 
 * <p> Returns the ColorMapper for this dataset. Warning: this only works properly for homogeneous numerical datasets. </p> <p> Use   {@link Table#getColor(Integer,Integer)} instead if you want access to a cell's color - which works for alldata types. </p> TODO: move this to Table and provide separate interfaces for homogeneous and inhomogeneous datasets.
 * @return the colorMapper, see {@link #colorMapper}
 */
public ColorMapper getColorMapper(){
  if (colorMapper == null) {
    if (this instanceof NumericalTable && ((NumericalTable)this).getDataCenter() != null) {
      colorMapper=ColorMapper.createDefaultThreeColorMapper();
    }
 else     if (this instanceof CategoricalTable<?>) {
      colorMapper=((CategoricalTable<?>)this).createColorMapper();
    }
 else {
      colorMapper=ColorMapper.createDefaultTwoColorMapper();
    }
  }
  colorMapper.update();
  return colorMapper;
}

Fixed version (ground truth):
/** 
 * <p> Returns the ColorMapper for this dataset. Warning: this only works properly for homogeneous numerical datasets. </p> <p> Use   {@link Table#getColor(Integer,Integer)} instead if you want access to a cell's color - which works for alldata types. </p> TODO: move this to Table and provide separate interfaces for homogeneous and inhomogeneous datasets.
 * @return the colorMapper, see {@link #colorMapper}
 */
public ColorMapper getColorMapper(){
  if (colorMapper == null) {
    if (this instanceof NumericalTable && ((NumericalTable)this).getDataCenter() != null) {
      colorMapper=ColorMapper.createDefaultThreeColorMapper();
    }
 else     if (this instanceof CategoricalTable<?>) {
      colorMapper=((CategoricalTable<?>)this).createColorMapper();
    }
 else {
      colorMapper=ColorMapper.createDefaultTwoColorMapper();
    }
  }
  return colorMapper;
}
Program: 56821
Project: 56821
Buggy source:
private void setup(GLElement child){
  IGLElementParent ex=child.getParent();
  boolean doInit=ex == null;
  if (ex == this) {
    children.remove(child);
  }
 else   if (ex != null) {
    doInit=ex.moved(child);
  }
  child.setParent(this);
  if (doInit && context != null)   child.init(context);
}

Fixed version (ground truth):
private void setup(GLElement child){
  IGLElementParent ex=child.getParent();
  boolean doInit=ex == null;
  if (ex == this) {
    children.remove(child);
  }
 else   if (ex != null) {
    doInit=!ex.moved(child);
  }
  child.setParent(this);
  if (doInit && context != null)   child.init(context);
}
Program: 56822
Project: 56822
Buggy source:
private void setup(GLElement child){
  IGLElementParent ex=child.getParent();
  boolean doInit=ex == null;
  if (ex == this) {
    children.remove(child);
  }
 else   if (ex != null) {
    doInit=ex.moved(child);
  }
  GLElementAccessor.setParent(child,this);
  if (doInit && context != null)   GLElementAccessor.init(child,context);
}

Fixed version (ground truth):
private void setup(GLElement child){
  IGLElementParent ex=child.getParent();
  boolean doInit=ex == null;
  if (ex == this) {
    children.remove(child);
  }
 else   if (ex != null) {
    doInit=!ex.moved(child);
  }
  GLElementAccessor.setParent(child,this);
  if (doInit && context != null)   GLElementAccessor.init(child,context);
}
Program: 56823
Project: 56823
Buggy source:
private void fireTablePerspectiveChanged(){
  EventPublisher.trigger(new TablePerspectivesChangedEvent(this).from(this));
}

Fixed version (ground truth):
protected final void fireTablePerspectiveChanged(){
  EventPublisher.trigger(new TablePerspectivesChangedEvent(this).from(this));
}
Program: 56824
Project: 56824
Buggy source:
@Override public void handleForeignSelectionUpdate(String dataDomainType,SelectionDelta delta){
  if (delta.getIDType() == dimensionIDType) {
    SelectionUpdateEvent resendEvent=new SelectionUpdateEvent();
    resendEvent.setEventSpace(this.dataDomainID);
    SelectionDelta convertedDelta=new SelectionDelta(delta.getIDType());
    for (    SelectionDeltaItem item : delta) {
      SelectionDeltaItem convertedItem=new SelectionDeltaItem();
      convertedItem.setSelectionType(item.getSelectionType());
      Integer converteID=convertClinicalExperimentToGeneticExperiment(item.getID());
      if (converteID == null)       continue;
      convertedItem.setID(converteID);
      convertedItem.setConnectionIDs(item.getConnectionIDs());
      convertedItem.setRemove(item.isRemove());
      convertedDelta.add(convertedItem);
    }
    resendEvent.setSelectionDelta(convertedDelta);
    eventPublisher.triggerEvent(resendEvent);
  }
 else   return;
}

Fixed version (ground truth):
@Override public void handleForeignSelectionUpdate(String dataDomainType,SelectionDelta delta){
  if (dimensionIDType.equals(delta.getIDType())) {
    SelectionUpdateEvent resendEvent=new SelectionUpdateEvent();
    resendEvent.setEventSpace(this.dataDomainID);
    SelectionDelta convertedDelta=new SelectionDelta(delta.getIDType());
    for (    SelectionDeltaItem item : delta) {
      SelectionDeltaItem convertedItem=new SelectionDeltaItem();
      convertedItem.setSelectionType(item.getSelectionType());
      Integer converteID=convertClinicalExperimentToGeneticExperiment(item.getID());
      if (converteID == null)       continue;
      convertedItem.setID(converteID);
      convertedItem.setConnectionIDs(item.getConnectionIDs());
      convertedItem.setRemove(item.isRemove());
      convertedDelta.add(convertedItem);
    }
    resendEvent.setSelectionDelta(convertedDelta);
    eventPublisher.triggerEvent(resendEvent);
  }
 else   return;
}
Program: 56825
Project: 56825
Buggy source:
@Override public void handleForeignSelectionCommand(String dataDomainType,IDCategory idCategory,SelectionCommand selectionCommand){
  if (dataDomainType == CLINICAL_DATADOMAIN_TYPE && idCategory == dimensionIDCategory) {
    SelectionCommandEvent newCommandEvent=new SelectionCommandEvent();
    newCommandEvent.setSelectionCommand(selectionCommand);
    newCommandEvent.setIDCategory(idCategory);
    newCommandEvent.setEventSpace(dataDomainType);
    eventPublisher.triggerEvent(newCommandEvent);
  }
}

Fixed version (ground truth):
@Override public void handleForeignSelectionCommand(String dataDomainType,IDCategory idCategory,SelectionCommand selectionCommand){
  if (CLINICAL_DATADOMAIN_TYPE.equals(dataDomainType) && dimensionIDCategory.equals(idCategory)) {
    SelectionCommandEvent newCommandEvent=new SelectionCommandEvent();
    newCommandEvent.setSelectionCommand(selectionCommand);
    newCommandEvent.setIDCategory(idCategory);
    newCommandEvent.setEventSpace(dataDomainType);
    eventPublisher.triggerEvent(newCommandEvent);
  }
}
Program: 56826
Project: 56826
Buggy source:
@Override public void keyPressed(KeyEvent event){
switch (event.keyCode) {
case SWT.CR:
{
      if (searchButton.isEnabled())       search(searchText.getText(),caseSensitive.getSelection(),regexSearch.getSelection());
      break;
    }
}
}

Fixed version (ground truth):
@Override public void keyPressed(KeyEvent event){
switch (event.keyCode) {
case SWT.CR:
    if (searchButton.isEnabled())     search(searchText.getText(),caseSensitive.getSelection(),regexSearch.getSelection());
  break;
default :
break;
}
}
Program: 56828
Project: 56828
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(r2.value,r1.value);
  }
 else   return runOrderScript(r1,r2);
}
Program: 56829
Project: 56829
Buggy source:
public CacheRow(float[] values,String[] raws,boolean[] inferred){
  this.raws=raws;
  this.values=values;
  this.inferred=inferred;
}

Fixed version (ground truth):
public CacheRow(float[] values){
  this.values=values;
}
Program: 56830
Project: 56830
Buggy source:
private CacheRow getCacheRow(IRow row){
  if (cacheMulti.containsKey(row.getIndex()))   return ((CacheRow)cacheMulti.get(row.getIndex()));
  float[] s=new float[this.size()];
  String[] raws=new String[s.length];
  boolean[] inferred=new boolean[s.length];
  for (int i=0; i < s.length; ++i) {
    ARankColumnModel child=get(i);
    if (child instanceof IFloatRankableColumnMixin) {
      s[i]=((IFloatRankableColumnMixin)child).applyPrimitive(row);
      inferred[i]=((IFloatRankableColumnMixin)child).isValueInferred(row);
    }
 else {
      s[i]=Float.NaN;
      inferred[i]=false;
    }
    raws[i]=get(i).getValue(row);
  }
  CacheRow cacheRow=new CacheRow(s,raws,inferred);
  cacheMulti.put(row.getIndex(),cacheRow);
  return cacheRow;
}

Fixed version (ground truth):
private CacheRow getCacheRow(IRow row){
  if (cacheMulti.containsKey(row.getIndex()))   return ((CacheRow)cacheMulti.get(row.getIndex()));
  float[] s=new float[this.size()];
  for (int i=0; i < s.length; ++i) {
    ARankColumnModel child=get(i);
    if (child instanceof IFloatRankableColumnMixin) {
      s[i]=((IFloatRankableColumnMixin)child).applyPrimitive(row);
    }
 else {
      s[i]=Float.NaN;
    }
  }
  CacheRow cacheRow=new CacheRow(s);
  cacheMulti.put(row.getIndex(),cacheRow);
  return cacheRow;
}
Program: 56831
Project: 56831
Buggy source:
@Override public int compare(ARankColumnModel o1,ARankColumnModel o2){
  return -Float.compare((float)o1.getParentData(),(float)o2.getParentData());
}

Fixed version (ground truth):
@Override public int compare(ARankColumnModel o1,ARankColumnModel o2){
  return Float.compare((float)o2.getParentData(),(float)o1.getParentData());
}
Program: 56832
Project: 56832
Buggy source:
/** 
 * sorts the children decreasing by their weight
 */
public void sortByWeights(){
  cacheMulti.clear();
  sortBy(new Comparator<ARankColumnModel>(){
    @Override public int compare(    ARankColumnModel o1,    ARankColumnModel o2){
      return -Float.compare((float)o1.getParentData(),(float)o2.getParentData());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * sorts the children decreasing by their weight
 */
public void sortByWeights(){
  cacheMulti.clear();
  sortBy(new Comparator<ARankColumnModel>(){
    @Override public int compare(    ARankColumnModel o1,    ARankColumnModel o2){
      return Float.compare((float)o2.getParentData(),(float)o1.getParentData());
    }
  }
);
}
Program: 56833
Project: 56833
Buggy source:
/** 
 * Calculates a normalized value based on min and max.
 * @param raw the raw value
 * @return a value between 0 and 1
 */
public double getNormalizedForRaw(String dataTransformation,double raw){
  double result;
  if (dataTransformation == org.caleydo.core.data.collection.table.Table.Transformation.LINEAR) {
    result=raw;
  }
 else   if (dataTransformation == Transformation.LOG2) {
    result=Math.log(raw) / Math.log(2);
  }
 else   if (dataTransformation == Transformation.LOG10) {
    result=Math.log10(raw);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + dataTransformation);
  }
  result=(result - getMin()) / (getMax() - getMin());
  return result;
}

Fixed version (ground truth):
/** 
 * Calculates a normalized value based on min and max.
 * @param raw the raw value
 * @return a value between 0 and 1
 */
public double getNormalizedForRaw(String dataTransformation,double raw){
  double result;
switch (dataTransformation) {
case org.caleydo.core.data.collection.table.Table.Transformation.LINEAR:
    result=raw;
  break;
case Transformation.LOG2:
result=Math.log(raw) / Math.log(2);
break;
case Transformation.LOG10:
result=Math.log10(raw);
break;
default :
throw new IllegalStateException("String_Node_Str" + dataTransformation);
}
result=(result - getMin()) / (getMax() - getMin());
return result;
}
Program: 56834
Project: 56834
Buggy source:
/** 
 * @return
 */
private static Version readVersion(){
  if (Activator.version != null)   return Activator.version;
  Properties p=new Properties();
  try {
    p.load(GeneralManager.class.getResourceAsStream("String_Node_Str"));
  }
 catch (  IOException e) {
    Logger.log(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str"));
  }
  String v=p.getProperty("String_Node_Str","String_Node_Str");
  return Version.parseVersion(v);
}

Fixed version (ground truth):
/** 
 * @return
 */
private static Version readVersion(){
  if (Activator.version != null)   return Activator.version;
  Properties p=new Properties();
  try (InputStream in=GeneralManager.class.getResourceAsStream("String_Node_Str")){
    if (in != null)     p.load(in);
  }
 catch (  IOException e) {
    Logger.log(new Status(IStatus.ERROR,"String_Node_Str","String_Node_Str"));
  }
  String v=p.getProperty("String_Node_Str","String_Node_Str");
  return Version.parseVersion(v);
}
Program: 56836
Project: 56836
Buggy source:
@Override protected void init(IGLElementContext context){
  super.init(context);
  leftSpreadPickingIds=new PickingPool(context,new IPickingListener(){
    @Override public void pick(    Pick pick){
      onLinePicked(pick,getDataDomain(),true);
    }
  }
);
  rightSpreadPickingIds=new PickingPool(context,new IPickingListener(){
    @Override public void pick(    Pick pick){
      onLinePicked(pick,getDataDomain(),false);
    }
  }
);
  int points=getDataDomain().getTable().getColorMapper().getMarkerPoints().size();
  leftSpreadPickingIds.ensure(0,points);
  rightSpreadPickingIds.ensure(0,points);
}

Fixed version (ground truth):
@Override protected void init(IGLElementContext context){
  super.init(context);
  final IPickingListener leftToolTip=context.getSWTLayer().createTooltip(new IPickingLabelProvider(){
    @Override public String getLabel(    Pick pick){
      return HistogramElement.this.getLabel(pick,true);
    }
  }
);
  leftSpreadPickingIds=new PickingPool(context,new IPickingListener(){
    @Override public void pick(    Pick pick){
      leftToolTip.pick(pick);
      onLinePicked(pick,true);
    }
  }
);
  final IPickingListener rightToolTip=context.getSWTLayer().createTooltip(new IPickingLabelProvider(){
    @Override public String getLabel(    Pick pick){
      return HistogramElement.this.getLabel(pick,false);
    }
  }
);
  rightSpreadPickingIds=new PickingPool(context,new IPickingListener(){
    @Override public void pick(    Pick pick){
      rightToolTip.pick(pick);
      onLinePicked(pick,false);
    }
  }
);
  int points=getDataDomain().getTable().getColorMapper().getMarkerPoints().size();
  leftSpreadPickingIds.ensure(0,points);
  rightSpreadPickingIds.ensure(0,points);
}
Program: 56837
Project: 56837
Buggy source:
private void onLinePicked(Pick pick,ATableBasedDataDomain dataDomain,boolean isLeftSpread){
switch (pick.getPickingMode()) {
case MOUSE_RELEASED:
    EventPublisher.trigger(new UpdateColorMappingEvent().from(this));
  break;
case MOUSE_OVER:
hoveredSpread=pick.getObjectID();
hoveredLeft=isLeftSpread;
repaint();
break;
case MOUSE_OUT:
hoveredSpread=-1;
hoveredLeft=isLeftSpread;
repaint();
break;
case CLICKED:
pick.setDoDragging(true);
break;
case DRAGGED:
List<ColorMarkerPoint> markers=dataDomain.getTable().getColorMapper().getMarkerPoints();
final int selected=pick.getObjectID();
ColorMarkerPoint point=markers.get(selected);
final float dv=pick.getDx() / (getSize().x() - getPadding() * 2);
if (dv == 0) break;
float v=dv;
if (isLeftSpread) {
v=-v + point.getLeftSpread();
if (v < 0.01f) v=0.01f;
if (selected > 0) {
ColorMarkerPoint prev=markers.get(selected - 1);
float maxv=(prev.getMappingValue() + prev.getRightSpread() + 0.01f);
v=Math.min(v,point.getMappingValue() - maxv);
}
if (v != point.getLeftSpread()) {
point.setLeftSpread(v);
updateMapping(dataDomain);
}
}
 else {
v+=point.getRightSpread();
if (v < 0.01f) v=0.01f;
if (selected < markers.size() - 1) {
ColorMarkerPoint next=markers.get(selected + 1);
v=Math.min(v,-point.getMappingValue() + (next.getMappingValue() - next.getLeftSpread() - 0.01f));
}
if (v != point.getRightSpread()) {
point.setRightSpread(v);
updateMapping(dataDomain);
}
}
break;
default :
break;
}
}

Fixed version (ground truth):
final void onLinePicked(Pick pick,boolean isLeftSpread){
  ATableBasedDataDomain dataDomain=getDataDomain();
switch (pick.getPickingMode()) {
case MOUSE_RELEASED:
    EventPublisher.trigger(new UpdateColorMappingEvent().from(this));
  break;
case MOUSE_OVER:
hoveredSpread=pick.getObjectID();
hoveredLeft=isLeftSpread;
repaint();
break;
case MOUSE_OUT:
hoveredSpread=-1;
hoveredLeft=isLeftSpread;
repaint();
break;
case CLICKED:
pick.setDoDragging(true);
break;
case DRAGGED:
List<ColorMarkerPoint> markers=dataDomain.getTable().getColorMapper().getMarkerPoints();
final int selected=pick.getObjectID();
ColorMarkerPoint point=markers.get(selected);
final float dv=pick.getDx() / (getSize().x() - getPadding() * 2);
if (dv == 0) break;
float v=dv;
if (isLeftSpread) {
v=-v + point.getLeftSpread();
if (v < 0.01f) v=0.01f;
if (selected > 0) {
ColorMarkerPoint prev=markers.get(selected - 1);
float maxv=(prev.getMappingValue() + prev.getRightSpread() + 0.01f);
v=Math.min(v,point.getMappingValue() - maxv);
}
if (v != point.getLeftSpread()) {
point.setLeftSpread(v);
updateMapping(dataDomain);
}
}
 else {
v+=point.getRightSpread();
if (v < 0.01f) v=0.01f;
if (selected < markers.size() - 1) {
ColorMarkerPoint next=markers.get(selected + 1);
v=Math.min(v,-point.getMappingValue() + (next.getMappingValue() - next.getLeftSpread() - 0.01f));
}
if (v != point.getRightSpread()) {
point.setRightSpread(v);
updateMapping(dataDomain);
}
}
break;
default :
break;
}
}
Program: 56838
Project: 56838
Buggy source:
/** 
 * @param showColorMapper setter, see  {@link showColorMapper}
 */
public void setShowColorMapper(boolean showColorMapper){
  this.showColorMapper=showColorMapper;
}

Fixed version (ground truth):
/** 
 * @param showColorMapper setter, see  {@link showColorMapper}
 */
public HistogramElement setShowColorMapper(boolean showColorMapper){
  this.showColorMapper=showColorMapper;
  repaintAll();
  return this;
}
Program: 56839
Project: 56839
Buggy source:
@Override public void pick(Pick pick){
  onLinePicked(pick,getDataDomain(),false);
}

Fixed version (ground truth):
@Override public void pick(Pick pick){
  rightToolTip.pick(pick);
  onLinePicked(pick,false);
}
Program: 56841
Project: 56841
Buggy source:
@Override public GLElement create(GLElementFactoryContext context){
  TablePerspective data=context.getData();
  EDetailLevel detailLevel=context.get(EDetailLevel.class,EDetailLevel.LOW);
  HistogramElement elem=new HistogramElement(data,detailLevel);
  elem.setShowColorMapper(context.is("String_Node_Str"));
  return elem;
}

Fixed version (ground truth):
@Override public GLElement create(GLElementFactoryContext context){
  TablePerspective data=context.getData();
  EDetailLevel detailLevel=context.get(EDetailLevel.class,EDetailLevel.LOW);
  HistogramElement elem=new HistogramElement(data,detailLevel);
  elem.setShowColorMapper(context.is("String_Node_Str"));
  elem.setShowMarkerLabels(context.is("String_Node_Str"));
  return elem;
}
Program: 56842
Project: 56842
Buggy source:
private RunOverview[] createModel(File file){
  Gson gson=new Gson();
  RunOverview[] fromJson;
  try (Reader r=new FileReader(file)){
    fromJson=gson.fromJson(r,RunOverview[].class);
    Arrays.sort(fromJson,Collections.reverseOrder());
    return fromJson;
  }
 catch (  JsonSyntaxException|JsonIOException|IOException e) {
    log.error("String_Node_Str" + file.getAbsolutePath(),e);
    return new RunOverview[0];
  }
}

Fixed version (ground truth):
private RunOverview[] createModel(File file){
  Gson gson=new Gson();
  RunOverview[] fromJson;
  try (Reader r=Files.newReader(file,Charset.defaultCharset())){
    fromJson=gson.fromJson(r,RunOverview[].class);
    Arrays.sort(fromJson,Collections.reverseOrder());
    return fromJson;
  }
 catch (  JsonSyntaxException|JsonIOException|IOException e) {
    log.error("String_Node_Str" + file.getAbsolutePath(),e);
    return new RunOverview[0];
  }
}
Program: 56843
Project: 56843
Buggy source:
public boolean resolve(Gson gson,String prefix) throws JsonSyntaxException, JsonIOException, IOException {
  if (data != null)   return true;
  File file=RemoteFile.of(new URL(prefix + json)).getOrLoad(true,new NullProgressMonitor());
  if (file == null)   return false;
  try (Reader r=new FileReader(file)){
    JsonElement parse=new JsonParser().parse(r);
    this.data=gson.fromJson(parse,Run.class);
  }
   Collections.sort(this.data.details);
  return true;
}

Fixed version (ground truth):
public boolean resolve(Gson gson,String prefix) throws JsonSyntaxException, JsonIOException, IOException {
  if (data != null)   return true;
  File file=RemoteFile.of(new URL(prefix + json)).getOrLoad(true,new NullProgressMonitor());
  if (file == null)   return false;
  try (Reader r=Files.newBufferedReader(file.toPath(),Charset.defaultCharset())){
    JsonElement parse=new JsonParser().parse(r);
    this.data=gson.fromJson(parse,Run.class);
  }
   Collections.sort(this.data.details);
  return true;
}
Program: 56844
Project: 56844
Buggy source:
@ListenTo private void onSelectionCommand(SelectionCommandEvent event){
  IDCategory idCategory=event.getIdCategory();
  SelectionCommand cmd=event.getSelectionCommand();
  for (  SelectionManager selectionManager : selectionManagers) {
    final IDType sidType=selectionManager.getIDType();
    if ((idCategory == null || idCategory.isOfCategory(sidType)) && !(event.getSender() == selectionManager)) {
      selectionManager.executeSelectionCommand(cmd);
      callback.onSelectionUpdate(selectionManager);
    }
  }
}

Fixed version (ground truth):
@ListenTo private void onSelectionCommand(SelectionCommandEvent event){
  if (event.getSender() == this)   return;
  IDCategory idCategory=event.getIdCategory();
  SelectionCommand cmd=event.getSelectionCommand();
  for (  SelectionManager selectionManager : selectionManagers) {
    final IDType sidType=selectionManager.getIDType();
    if ((idCategory == null || idCategory.isOfCategory(sidType)) && (event.getSender() != selectionManager)) {
      selectionManager.executeSelectionCommand(cmd);
      callback.onSelectionUpdate(selectionManager);
    }
  }
}
Program: 56848
Project: 56848
Buggy source:
@Override protected void onMouseWheel(Pick pick){
  setValue(unmapValue(mapValue(value) + ((IMouseEvent)(pick)).getWheelRotation() * wheelInc));
  repaintAll();
}

Fixed version (ground truth):
@Override protected void onMouseWheel(Pick pick){
  setValue(unmapValue(mapValue(getSize().x()) + ((IMouseEvent)(pick)).getWheelRotation() * wheelInc));
  repaintAll();
}