nus-yam/ex-repair huggingface dataset:
Program: 57406
Project: 57406
Buggy source:
@Override public void apply(ALinearizableNode node){
  this.node=node;
  destroy();
  init();
  attributeRenderers.clear();
  if (node.getParentNode() == null) {
    RemoveNodeButtonAttributeRenderer attributeRenderer=new RemoveNodeButtonAttributeRenderer(view,node,pathwayPathRenderer);
    attributeRenderer.addNodeId(node.getNodeId());
    addAttributeRenderer(attributeRenderer);
    attributeRenderer.registerPickingListeners();
  }
  Column baseColumn=new Column("String_Node_Str");
  Row baseRow=new Row("String_Node_Str");
  colorRenderer=new ColorRenderer(this);
  colorRenderer.setView(view);
  colorRenderer.setBorderColor(new float[]{0,0,0,1});
  colorRenderer.addPickingID(EPickingType.LINEARIZABLE_NODE.name(),node.getNodeId());
  baseColumn.addBackgroundRenderer(colorRenderer);
  ElementLayout labelLayout=new ElementLayout("String_Node_Str");
  labelLayout.setRenderer(Renderers.createLabel(node,view).setAlignment(LabelAlignment.CENTER));
  labelLayout.setPixelSizeY(16);
  ElementLayout horizontalSpacing=new ElementLayout();
  horizontalSpacing.setPixelSizeX(2);
  baseRow.append(labelLayout);
  ElementLayout verticalSpacing=new ElementLayout();
  verticalSpacing.setPixelSizeY(2);
  baseColumn.append(verticalSpacing);
  baseColumn.append(baseRow);
  baseColumn.append(verticalSpacing);
  layoutManager.setBaseElementLayout(baseColumn);
}

Fixed version (ground truth):
@Override public void apply(ALinearizableNode node){
  this.node=node;
  destroy();
  init();
  attributeRenderers.clear();
  if (node.getParentNode() == null) {
    RemoveNodeButtonAttributeRenderer attributeRenderer=new RemoveNodeButtonAttributeRenderer(view,node,pathwayPathRenderer);
    attributeRenderer.addNodeId(node.getNodeId());
    addAttributeRenderer(attributeRenderer);
    attributeRenderer.registerPickingListeners();
  }
  Column baseColumn=new Column("String_Node_Str");
  Row baseRow=new Row("String_Node_Str");
  colorRenderer=new ColorRenderer(this);
  colorRenderer.setView(view);
  colorRenderer.setBorderColor(new float[]{0,0,0,1});
  colorRenderer.setDrawBorder(true);
  colorRenderer.addPickingID(EPickingType.LINEARIZABLE_NODE.name(),node.getNodeId());
  baseColumn.addBackgroundRenderer(colorRenderer);
  ElementLayout labelLayout=new ElementLayout("String_Node_Str");
  labelLayout.setRenderer(Renderers.createLabel(node,view).setAlignment(LabelAlignment.CENTER));
  labelLayout.setPixelSizeY(16);
  ElementLayout horizontalSpacing=new ElementLayout();
  horizontalSpacing.setPixelSizeX(2);
  baseRow.append(labelLayout);
  ElementLayout verticalSpacing=new ElementLayout();
  verticalSpacing.setPixelSizeY(2);
  baseColumn.append(verticalSpacing);
  baseColumn.append(baseRow);
  baseColumn.append(verticalSpacing);
  layoutManager.setBaseElementLayout(baseColumn);
}
Program: 57407
Project: 57407
Buggy source:
@Override public void apply(ALinearizableNode node){
  this.node=node;
  destroy();
  init();
  attributeRenderers.clear();
  Column baseColumn=new Column("String_Node_Str");
  baseColumn.setBottomUp(false);
  Row titleRow=new Row("String_Node_Str");
  titleRow.setFrameColor(0,1,0,1);
  titleRow.setYDynamic(true);
  colorRenderer=new ColorRenderer(this);
  colorRenderer.setView(view);
  colorRenderer.setBorderColor(new float[]{0,0,0,1});
  colorRenderer.addPickingID(EPickingType.LINEARIZABLE_NODE.name(),node.getNodeId());
  baseColumn.addBackgroundRenderer(colorRenderer);
  ElementLayout labelLayout=new ElementLayout("String_Node_Str");
  labelLayout.setRenderer(Renderers.createLabel(node,view).setAlignment(LabelAlignment.CENTER));
  labelLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  ElementLayout horizontalSpacing=new ElementLayout();
  horizontalSpacing.setPixelSizeX(SPACING_PIXELS);
  ElementLayout verticalSpacing=new ElementLayout();
  verticalSpacing.setPixelSizeY(SPACING_PIXELS);
  heightPixels=0;
  Column previewRow=null;
  if (node.getMappedDavidIDs().size() > 0) {
    previewRow=createPreviewRow(horizontalSpacing,verticalSpacing);
  }
  titleRow.append(labelLayout);
  baseColumn.append(verticalSpacing);
  baseColumn.append(titleRow);
  baseColumn.append(verticalSpacing);
  heightPixels+=2 * SPACING_PIXELS + CAPTION_HEIGHT_PIXELS;
  if (previewRow != null) {
    baseColumn.append(previewRow);
  }
  layoutManager.setBaseElementLayout(baseColumn);
}

Fixed version (ground truth):
@Override public void apply(ALinearizableNode node){
  this.node=node;
  destroy();
  init();
  attributeRenderers.clear();
  Column baseColumn=new Column("String_Node_Str");
  baseColumn.setBottomUp(false);
  Row titleRow=new Row("String_Node_Str");
  titleRow.setFrameColor(0,1,0,1);
  titleRow.setYDynamic(true);
  colorRenderer=new ColorRenderer(this);
  colorRenderer.setView(view);
  colorRenderer.setBorderColor(new float[]{0,0,0,1});
  colorRenderer.setDrawBorder(true);
  colorRenderer.addPickingID(EPickingType.LINEARIZABLE_NODE.name(),node.getNodeId());
  baseColumn.addBackgroundRenderer(colorRenderer);
  ElementLayout labelLayout=new ElementLayout("String_Node_Str");
  labelLayout.setRenderer(Renderers.createLabel(node,view).setAlignment(LabelAlignment.CENTER));
  labelLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  ElementLayout horizontalSpacing=new ElementLayout();
  horizontalSpacing.setPixelSizeX(SPACING_PIXELS);
  ElementLayout verticalSpacing=new ElementLayout();
  verticalSpacing.setPixelSizeY(SPACING_PIXELS);
  heightPixels=0;
  Column previewRow=null;
  if (node.getMappedDavidIDs().size() > 0) {
    previewRow=createPreviewRow(horizontalSpacing,verticalSpacing);
  }
  titleRow.append(labelLayout);
  baseColumn.append(verticalSpacing);
  baseColumn.append(titleRow);
  baseColumn.append(verticalSpacing);
  heightPixels+=2 * SPACING_PIXELS + CAPTION_HEIGHT_PIXELS;
  if (previewRow != null) {
    baseColumn.append(previewRow);
  }
  layoutManager.setBaseElementLayout(baseColumn);
}
Program: 57410
Project: 57410
Buggy source:
@Override public void registerEventListeners(){
  super.registerEventListeners();
  addTablePerspectivesListener=new AddTablePerspectivesListener();
  addTablePerspectivesListener.setHandler(this);
  eventPublisher.addListener(AddTablePerspectivesEvent.class,addTablePerspectivesListener);
}

Fixed version (ground truth):
@Override public void registerEventListeners(){
  super.registerEventListeners();
  eventListeners.register(AddTablePerspectivesEvent.class,new AddTablePerspectivesListener().setHandler(this));
}
Program: 57411
Project: 57411
Buggy source:
@Override protected void renderContent(GL2 gl){
  if (colorProvider != null) {
    color=colorProvider.getColor();
    useGradient=colorProvider.useGradient();
    gradientColor=colorProvider.getGradientColor();
    isHorizontalGradient=colorProvider.isHorizontalGradient();
  }
  pushNames(gl);
  gl.glBegin(GL2.GL_QUADS);
  gl.glColor4fv(color,0);
  gl.glVertex3f(0,0,0);
  if (useGradient && isHorizontalGradient)   gl.glColor4fv(gradientColor,0);
  gl.glVertex3f(x,0,0);
  if (useGradient)   gl.glColor4fv(gradientColor,0);
  gl.glVertex3f(x,y,0);
  if (useGradient && !isHorizontalGradient)   gl.glColor4fv(gradientColor,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  gl.glPushAttrib(GL2.GL_LINE_BIT);
  gl.glLineWidth(borderWidth);
  gl.glColor4fv(borderColor,0);
  gl.glBegin(GL.GL_LINES);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(0,y,0);
  gl.glVertex3f(0,y,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glEnd();
  gl.glPopAttrib();
  popNames(gl);
}

Fixed version (ground truth):
@Override protected void renderContent(GL2 gl){
  if (colorProvider != null) {
    color=colorProvider.getColor();
    useGradient=colorProvider.useGradient();
    gradientColor=colorProvider.getGradientColor();
    isHorizontalGradient=colorProvider.isHorizontalGradient();
  }
  pushNames(gl);
  gl.glBegin(GL2.GL_QUADS);
  gl.glColor4fv(color,0);
  gl.glVertex3f(0,0,0);
  if (useGradient && isHorizontalGradient)   gl.glColor4fv(gradientColor,0);
  gl.glVertex3f(x,0,0);
  if (useGradient)   gl.glColor4fv(gradientColor,0);
  gl.glVertex3f(x,y,0);
  if (useGradient && !isHorizontalGradient)   gl.glColor4fv(gradientColor,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  if (drawBorder) {
    if (borderWidth > 0) {
      gl.glPushAttrib(GL2.GL_LINE_BIT);
      gl.glLineWidth(borderWidth);
    }
    gl.glColor4fv(borderColor,0);
    gl.glBegin(GL.GL_LINES);
    gl.glVertex3f(0,0,0);
    gl.glVertex3f(x,0,0);
    gl.glVertex3f(0,0,0);
    gl.glVertex3f(0,y,0);
    gl.glVertex3f(0,y,0);
    gl.glVertex3f(x,y,0);
    gl.glVertex3f(x,0,0);
    gl.glVertex3f(x,y,0);
    gl.glEnd();
    if (borderWidth > 0) {
      gl.glPopAttrib();
    }
  }
  popNames(gl);
}
Program: 57413
Project: 57413
Buggy source:
/** 
 * renders the current element
 * @param g
 */
public final void render(GLGraphics g){
  if (dirtyLayout)   layout();
  if (!needToRender()) {
    cache.invalidate(context);
    return;
  }
  float x=x_layout + padding.left;
  float y=y_layout + padding.top;
  float w=w_layout - padding.left - padding.right;
  float h=w_layout - padding.top - padding.bottom;
  g.move(x,y);
  if (!cache.render(context,g)) {
    cache.begin(context,g,w,h);
    renderImpl(g,w,h);
    cache.end(context,g);
  }
  g.move(-x,-y);
}

Fixed version (ground truth):
/** 
 * renders the current element
 * @param g
 */
public final void render(GLGraphics g){
  if (dirtyLayout)   layout();
  if (!needToRender()) {
    cache.invalidate(context);
    return;
  }
  float x=x_layout + padding.left;
  float y=y_layout + padding.top;
  float w=w_layout - padding.left - padding.right;
  float h=h_layout - padding.top - padding.bottom;
  g.move(x,y);
  if (!cache.render(context,g)) {
    cache.begin(context,g,w,h);
    renderImpl(g,w,h);
    cache.end(context,g);
  }
  g.move(-x,-y);
}
Program: 57414
Project: 57414
Buggy source:
/** 
 * triggers that the parent should be relayouted
 */
protected void relayout(){
  cache.invalidate(context);
  pickCache.invalidate(context);
  this.dirtyLayout=true;
}

Fixed version (ground truth):
/** 
 * triggers that I should be relayouted before the next run
 */
protected void relayout(){
  cache.invalidate(context);
  pickCache.invalidate(context);
  this.dirtyLayout=true;
}
Program: 57415
Project: 57415
Buggy source:
/** 
 * see   {@link #fillImage(String,float,float,float,float)} for a texture object
 */
private GLGraphics fillImage(Texture texture,float x,float y,float w,float h){
  Vec3f lowerLeftCorner=new Vec3f(x,y,z);
  Vec3f lowerRightCorner=new Vec3f(x + w,y,z);
  Vec3f upperRightCorner=new Vec3f(x + w,y + h,z);
  Vec3f upperLeftCorner=new Vec3f(x,y + h,z);
  if (originInTopLeft)   textures.renderTexture(gl,texture,upperLeftCorner,upperRightCorner,lowerRightCorner,lowerLeftCorner,1,1,1,1);
 else   textures.renderTexture(gl,texture,lowerLeftCorner,lowerRightCorner,upperRightCorner,upperLeftCorner,1,1,1,1);
  return this;
}

Fixed version (ground truth):
/** 
 * see   {@link #fillImage(Texture,float,float,float,float)} but with a dedicated static color to use
 * @param color
 * @return
 */
public GLGraphics fillImage(Texture texture,float x,float y,float w,float h,Color color){
  Vec3f lowerLeftCorner=new Vec3f(x,y,z);
  Vec3f lowerRightCorner=new Vec3f(x + w,y,z);
  Vec3f upperRightCorner=new Vec3f(x + w,y + h,z);
  Vec3f upperLeftCorner=new Vec3f(x,y + h,z);
  org.caleydo.core.util.color.Color tmp=new org.caleydo.core.util.color.Color(color.getRed(),color.getGreen(),color.getBlue(),color.getAlpha());
  if (originInTopLeft)   textures.renderTexture(gl,texture,upperLeftCorner,upperRightCorner,lowerRightCorner,lowerLeftCorner,tmp.r,tmp.g,tmp.b,tmp.a);
 else   textures.renderTexture(gl,texture,lowerLeftCorner,lowerRightCorner,upperRightCorner,upperLeftCorner,tmp.r,tmp.g,tmp.b,tmp.a);
  return this;
}
Program: 57416
Project: 57416
Buggy source:
/** 
 * returns a set of points as lines
 * @param points
 * @param closed close the path?
 * @return
 */
public GLGraphics drawPath(Iterable<Vec2f> points,boolean closed){
  return render(closed ? GL.GL_LINE_LOOP : GL.GL_LINE_STRIP,points);
}

Fixed version (ground truth):
public GLGraphics drawPath(boolean closed,Vec2f... points){
  return render(closed ? GL.GL_LINE_LOOP : GL.GL_LINE_STRIP,Arrays.asList(points));
}
Program: 57417
Project: 57417
Buggy source:
@Override public final Object start(IApplicationContext context) throws Exception {
  S settings=parseArgs(context);
  generateTCGAProjectFiles(settings);
  return context;
}

Fixed version (ground truth):
@Override public final Object start(IApplicationContext context) throws Exception {
  S settings=parseArgs(context);
  GeneralManager.get();
  generateTCGAProjectFiles(settings);
  return context;
}
Program: 57418
Project: 57418
Buggy source:
private File parseMAF(File maf){
  final String TAB="String_Node_Str";
  try {
    List<String> lines=Files.readAllLines(maf.toPath(),Charset.defaultCharset());
    List<String> header=Arrays.asList(lines.get(0).split(TAB));
    lines=lines.subList(1,lines.size());
    int geneIndex=header.indexOf("String_Node_Str");
    int sampleIndex=header.indexOf("String_Node_Str");
    Table<String,String,Boolean> mutated=TreeBasedTable.create();
    for (    String line : lines) {
      String[] columns=line.split(TAB);
      mutated.put(columns[geneIndex],columns[sampleIndex],Boolean.TRUE);
    }
    File out=new File(maf.getParentFile(),"String_Node_Str" + maf.getName());
    PrintWriter w=new PrintWriter(out);
    w.append("String_Node_Str");
    for (    String sample : mutated.columnKeySet()) {
      w.append(TAB).append(sample);
    }
    w.println();
    for (    String gene : mutated.rowKeySet()) {
      w.append(gene);
      for (      String sample : mutated.columnKeySet()) {
        w.append(TAB).append(mutated.contains(gene,sample) ? "String_Node_Str" : "String_Node_Str");
      }
      w.println();
    }
    w.close();
    return out;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
private File parseMAF(File maf){
  File out=new File(maf.getParentFile(),"String_Node_Str" + maf.getName());
  if (out.exists())   return out;
  final String TAB="String_Node_Str";
  try {
    List<String> lines=Files.readAllLines(maf.toPath(),Charset.defaultCharset());
    List<String> header=Arrays.asList(lines.get(0).split(TAB));
    lines=lines.subList(1,lines.size());
    int geneIndex=header.indexOf("String_Node_Str");
    int sampleIndex=header.indexOf("String_Node_Str");
    Table<String,String,Boolean> mutated=TreeBasedTable.create();
    for (    String line : lines) {
      String[] columns=line.split(TAB);
      mutated.put(columns[geneIndex],columns[sampleIndex],Boolean.TRUE);
    }
    PrintWriter w=new PrintWriter(out);
    w.append("String_Node_Str");
    for (    String sample : mutated.columnKeySet()) {
      w.append(TAB).append(sample);
    }
    w.println();
    for (    String gene : mutated.rowKeySet()) {
      w.append(gene);
      for (      String sample : mutated.columnKeySet()) {
        w.append(TAB).append(mutated.contains(gene,sample) ? "String_Node_Str" : "String_Node_Str");
      }
      w.println();
    }
    w.close();
    return out;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 57419
Project: 57419
Buggy source:
private static void transposeCSV(String fileName,String fileNameOut){
  File in=new File(fileName);
  List<String> data;
  try {
    data=Files.readAllLines(in.toPath(),Charset.defaultCharset());
  }
 catch (  IOException e2) {
    e2.printStackTrace();
    return;
  }
  String[][] parts=new String[data.size()][];
  int maxCol=-1;
  for (int i=0; i < data.size(); ++i) {
    parts[i]=data.get(i).split("String_Node_Str");
    if (parts[i].length > maxCol)     maxCol=parts[i].length;
  }
  data=null;
  try (BufferedWriter writer=Files.newBufferedWriter(new File(fileNameOut).toPath(),Charset.defaultCharset())){
    for (int c=0; c < maxCol; ++c) {
      for (int i=0; i < parts.length; ++i) {
        if (i > 0)         writer.append('\t');
        String[] p=parts[i];
        if (p.length >= c)         writer.append(p[c]);
      }
      writer.newLine();
    }
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
private static void transposeCSV(String fileName,String fileNameOut){
  File in=new File(fileName);
  File out=new File(fileNameOut);
  if (out.exists())   return;
  List<String> data;
  try {
    data=Files.readAllLines(in.toPath(),Charset.defaultCharset());
  }
 catch (  IOException e2) {
    e2.printStackTrace();
    return;
  }
  String[][] parts=new String[data.size()][];
  int maxCol=-1;
  for (int i=0; i < data.size(); ++i) {
    parts[i]=data.get(i).split("String_Node_Str");
    if (parts[i].length > maxCol)     maxCol=parts[i].length;
  }
  data=null;
  try (BufferedWriter writer=Files.newBufferedWriter(new File(fileNameOut).toPath(),Charset.defaultCharset())){
    for (int c=0; c < maxCol; ++c) {
      for (int i=0; i < parts.length; ++i) {
        if (i > 0)         writer.append('\t');
        String[] p=parts[i];
        if (p.length >= c)         writer.append(p[c]);
      }
      writer.newLine();
    }
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
}
Program: 57420
Project: 57420
Buggy source:
private static boolean fireListeners(Iterable<? extends APickingEntry> entries,BitSet picked,float depth,PickingMode mode,Point mousePos,boolean anyWaiting){
  if (picked.isEmpty() && !(anyWaiting || mode == PickingMode.MOUSE_OUT))   return anyWaiting;
  anyWaiting=false;
  for (  APickingEntry entry : Lists.newArrayList(entries)) {
    if (picked.get(entry.pickingId)) {
      if (!entry.isHovered()) {
        entry.fire(PickingMode.MOUSE_OVER,mousePos,depth);
      }
      anyWaiting=true;
      entry.fire(mode,mousePos,depth);
    }
 else     if (entry.isHovered()) {
      entry.fire(PickingMode.MOUSE_OUT,mousePos,depth);
    }
 else     if (entry.isDragging() && (mode == PickingMode.MOUSE_RELEASED || mode == PickingMode.DRAGGED)) {
      entry.fire(mode,mousePos,depth);
      anyWaiting=anyWaiting || (mode == PickingMode.DRAGGED);
    }
  }
  return anyWaiting;
}

Fixed version (ground truth):
private static boolean fireListeners(Iterable<? extends APickingEntry> entries,BitSet picked,float depth,PickingMode mode,Point mousePos,boolean anyWaiting){
  if (picked.isEmpty() && !(anyWaiting || mode == PickingMode.MOUSE_OUT))   return anyWaiting;
  anyWaiting=false;
  for (  APickingEntry entry : Lists.newArrayList(entries)) {
    if (picked.get(entry.pickingId)) {
      if (!entry.isHovered()) {
        entry.fire(PickingMode.MOUSE_OVER,mousePos,depth);
      }
      anyWaiting=true;
      entry.fire(mode,mousePos,depth);
    }
 else     if (entry.isDragging() && (mode == PickingMode.MOUSE_RELEASED || mode == PickingMode.DRAGGED)) {
      entry.fire(mode,mousePos,depth);
      anyWaiting=anyWaiting || (mode == PickingMode.DRAGGED);
    }
 else     if (entry.isHovered()) {
      entry.fire(PickingMode.MOUSE_OUT,mousePos,depth);
    }
  }
  return anyWaiting;
}
Program: 57421
Project: 57421
Buggy source:
/** 
 * renders the picking part of this element
 * @param g
 */
public final void renderPick(GLGraphics g){
  if (dirtyLayout)   layout();
  if (!needToRender()) {
    pickCache.invalidate(context);
    return;
  }
  float x=x_layout;
  float y=y_layout;
  float w=w_layout;
  float h=w_layout;
  g.move(x,y);
  if (!pickCache.render(context,g)) {
    pickCache.begin(context,g,w,h);
    boolean pushed=pickingID >= 0;
    if (pushed)     g.pushName(this.pickingID);
    renderPickImpl(g,w,h);
    if (pushed)     g.popName();
    pickCache.end(context,g);
  }
  g.move(-x,-y);
}

Fixed version (ground truth):
/** 
 * renders the picking part of this element
 * @param g
 */
public final void renderPick(GLGraphics g){
  if (dirtyLayout)   layout();
  if (!needToRender()) {
    pickCache.invalidate(context);
    return;
  }
  float x=x_layout;
  float y=y_layout;
  float w=w_layout;
  float h=h_layout;
  g.move(x,y);
  if (!pickCache.render(context,g)) {
    pickCache.begin(context,g,w,h);
    boolean pushed=pickingID >= 0;
    if (pushed)     g.pushName(this.pickingID);
    renderPickImpl(g,w,h);
    if (pushed)     g.popName();
    pickCache.end(context,g);
  }
  g.move(-x,-y);
}
Program: 57422
Project: 57422
Buggy source:
private static PickingMode convert(IMouseEvent event,PickingMode type){
  if (type == PickingMode.CLICKED && event.getClickCount() > 1)   return PickingMode.DOUBLE_CLICKED;
  if (type == PickingMode.DRAGGED)   return PickingMode.DRAGGED;
  if (type == PickingMode.CLICKED && event.getButton() == 1)   return PickingMode.CLICKED;
  if (type == PickingMode.CLICKED && event.getButton() == 2)   return PickingMode.RIGHT_CLICKED;
  if (type == PickingMode.MOUSE_MOVED)   return PickingMode.MOUSE_MOVED;
  if (type == PickingMode.MOUSE_RELEASED)   return type;
  return null;
}

Fixed version (ground truth):
private static PickingMode convert(IMouseEvent event,PickingMode type){
  if (type == PickingMode.CLICKED && event.getClickCount() > 1)   return PickingMode.DOUBLE_CLICKED;
  if (type == PickingMode.DRAGGED)   return PickingMode.DRAGGED;
  if (type == PickingMode.CLICKED && event.getButton() == LEFT_MOUSE_BUTTON)   return PickingMode.CLICKED;
  if (type == PickingMode.CLICKED && event.getButton() == RIGHT_MOUSE_BUTTON)   return PickingMode.RIGHT_CLICKED;
  if (type == PickingMode.MOUSE_MOVED)   return PickingMode.MOUSE_MOVED;
  if (type == PickingMode.MOUSE_RELEASED)   return type;
  return null;
}
Program: 57423
Project: 57423
Buggy source:
@Override public void setData(List<ScoringElement> data,ScoreQuery query){
  this.clearBody();
  boolean isGroupQuery=query.isGroupQuery() || (!data.isEmpty() && data.get(0).getGroup() != null);
  if ((invalidWidth && !data.isEmpty()) || wasGroupQuery != isGroupQuery) {
    recomputeWidth(data);
    updateHeader(isGroupQuery);
  }
 else   if (wasGroupQuery != isGroupQuery) {
    updateHeader(isGroupQuery);
  }
  for (int i=0; i < data.size(); ++i) {
    ScoringElement elem=data.get(i);
    Group g=elem.getGroup();
    Row r=new Row();
    r.setXDynamic(true);
    AdvancedTextureRenderer cAdd=new AdvancedTextureRenderer(null,view.getTextureManager());
    if (!this.stratomex.contains(elem.getPerspective()))     cAdd.setImagePath(TourGuideRenderStyle.ICON_ADD_TO_STRATOMEX);
    ElementLayout l=wrap(cAdd,DATADOMAIN_TYPE_WIDTH);
    PickingRenderer pick=new PickingRenderer(ScoreQueryUI.ADD_TO_STRATOMEX,i,view);
    pick.setColor(elem.getDataDomain().getColor());
    l.addBackgroundRenderer(pick);
    r.add(l);
    r.add(colSpacing);
    if (isGroupQuery) {
      r.add(createLabel(elem.getStratification(),stratWidth));
      r.add(colSpacing);
      r.add(createLabel(g,-1));
    }
 else {
      r.add(createLabel(elem.getStratification(),-1));
    }
    this.addTd(r,i);
  }
}

Fixed version (ground truth):
@Override public void setData(List<ScoringElement> data,ScoreQuery query){
  this.clearBody();
  boolean isGroupQuery=query.isGroupQuery() || (!data.isEmpty() && data.get(0).getGroup() != null);
  if ((invalidWidth && !data.isEmpty()) || wasGroupQuery != isGroupQuery) {
    recomputeWidth(data);
    updateHeader(isGroupQuery);
  }
 else   if (wasGroupQuery != isGroupQuery) {
    updateHeader(isGroupQuery);
  }
  for (int i=0; i < data.size(); ++i) {
    ScoringElement elem=data.get(i);
    Group g=elem.getGroup();
    Row r=new Row();
    r.setXDynamic(false);
    AdvancedTextureRenderer cAdd=new AdvancedTextureRenderer(null,view.getTextureManager());
    if (!this.stratomex.contains(elem.getPerspective()))     cAdd.setImagePath(TourGuideRenderStyle.ICON_ADD_TO_STRATOMEX);
    ElementLayout l=wrap(cAdd,DATADOMAIN_TYPE_WIDTH);
    PickingRenderer pick=new PickingRenderer(ScoreQueryUI.ADD_TO_STRATOMEX,i,view);
    pick.setColor(elem.getDataDomain().getColor());
    l.addBackgroundRenderer(pick);
    r.add(l);
    r.add(colSpacing);
    if (isGroupQuery) {
      r.add(createLabel(elem.getStratification(),stratWidth));
      r.add(colSpacing);
      r.add(createLabel(g,-1));
    }
 else {
      r.add(createLabel(elem.getStratification(),-1));
    }
    this.addTd(r,i);
  }
}
Program: 57424
Project: 57424
Buggy source:
/** 
 * Reads the file and counts the numbers of lines to be read.
 */
protected final int calculateNumberOfLinesInFile(){
  try {
    LineNumberReader lnr=new LineNumberReader(GeneralManager.get().getResourceLoader().getResource(filePath));
    lnr.skip(Long.MAX_VALUE);
    numberOfLinesInFile=lnr.getLineNumber();
    lnr.close();
  }
 catch (  IOException ioe) {
    throw new IllegalStateException("String_Node_Str" + filePath);
  }
  return numberOfLinesInFile;
}

Fixed version (ground truth):
/** 
 * Reads the file and counts the numbers of lines to be read.
 */
protected final int calculateNumberOfLinesInFile(){
  try {
    LineNumberReader lnr=new LineNumberReader(loader.getResource(filePath));
    lnr.skip(Long.MAX_VALUE);
    numberOfLinesInFile=lnr.getLineNumber();
    lnr.close();
  }
 catch (  IOException ioe) {
    throw new IllegalStateException("String_Node_Str" + filePath);
  }
  return numberOfLinesInFile;
}
Program: 57425
Project: 57425
Buggy source:
/** 
 * Constructor.
 */
public ATextParser(final String fileName){
  this.filePath=fileName;
  this.swtGuiManager=GeneralManager.get().getSWTGUIManager();
}

Fixed version (ground truth):
public ATextParser(final String fileName,ResourceLoader loader){
  this.filePath=fileName;
  this.loader=loader;
  this.swtGuiManager=GeneralManager.get().getSWTGUIManager();
}
Program: 57426
Project: 57426
Buggy source:
/** 
 * Triggers the actual loading and parsing of the data specified.
 * @return
 */
public boolean loadData(){
  try {
    Logger.log(new Status(IStatus.INFO,GeneralManager.PLUGIN_ID,"String_Node_Str" + filePath + "String_Node_Str"));
    BufferedReader reader=GeneralManager.get().getResourceLoader().getResource(filePath);
    this.parseFile(reader);
    if (reader != null) {
      reader.close();
    }
  }
 catch (  Exception e) {
    Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str",e));
    throw new IllegalStateException("String_Node_Str" + filePath + "String_Node_Str",e);
  }
  Logger.log(new Status(IStatus.INFO,toString(),"String_Node_Str" + filePath + "String_Node_Str"));
  return true;
}

Fixed version (ground truth):
/** 
 * Triggers the actual loading and parsing of the data specified.
 * @return
 */
public boolean loadData(){
  try {
    Logger.log(new Status(IStatus.INFO,GeneralManager.PLUGIN_ID,"String_Node_Str" + filePath + "String_Node_Str"));
    BufferedReader reader=loader.getResource(filePath);
    this.parseFile(reader);
    if (reader != null) {
      reader.close();
    }
  }
 catch (  Exception e) {
    Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str",e));
    throw new IllegalStateException("String_Node_Str" + filePath + "String_Node_Str",e);
  }
  Logger.log(new Status(IStatus.INFO,toString(),"String_Node_Str" + filePath + "String_Node_Str"));
  return true;
}
Program: 57428
Project: 57428
Buggy source:
public static float calculateMaxAxisTime(TablePerspective tablePerspective){
  RecordVirtualArray recordVA=tablePerspective.getRecordPerspective().getVirtualArray();
  DimensionVirtualArray dimensionVA=tablePerspective.getDimensionPerspective().getVirtualArray();
  float maxAxisTime=0;
  boolean containsNegativeValues=false;
  boolean containsPositiveValues=false;
  for (  Group group : recordVA.getGroupList()) {
    List<Integer> recordIDs=recordVA.getIDsOfGroup(group.getGroupIndex());
    for (int recordID=0; recordID < recordIDs.size(); recordID++) {
      float rawValue=tablePerspective.getDataDomain().getTable().getRaw(recordIDs.get(recordID),dimensionVA.get(0));
      if (rawValue > 0)       containsPositiveValues=true;
      if (rawValue < 0)       containsNegativeValues=true;
      if (containsPositiveValues && containsNegativeValues) {
        throw new IllegalStateException("String_Node_Str");
      }
      if (rawValue != Float.NaN && Math.abs(rawValue) > Math.abs(maxAxisTime))       maxAxisTime=rawValue;
    }
  }
  return maxAxisTime;
}

Fixed version (ground truth):
public static float calculateMaxAxisTime(TablePerspective tablePerspective){
  RecordVirtualArray recordVA=tablePerspective.getRecordPerspective().getVirtualArray();
  DimensionVirtualArray dimensionVA=tablePerspective.getDimensionPerspective().getVirtualArray();
  float maxAxisTime=0;
  boolean containsNegativeValues=false;
  boolean containsPositiveValues=false;
  final DataTable table=tablePerspective.getDataDomain().getTable();
  final Integer dimensionID=dimensionVA.get(0);
  for (  Integer recordID : recordVA) {
    float rawValue=table.getRawDxR(dimensionID,recordID);
    if (rawValue > 0)     containsPositiveValues=true;
    if (rawValue < 0)     containsNegativeValues=true;
    if (containsPositiveValues && containsNegativeValues) {
      throw new IllegalStateException("String_Node_Str");
    }
    if (rawValue != Float.NaN && Math.abs(rawValue) > Math.abs(maxAxisTime))     maxAxisTime=rawValue;
  }
  return maxAxisTime;
}
Program: 57429
Project: 57429
Buggy source:
private void renderSingleKaplanMeierCurve(GL2 gl,List<Integer> recordIDs,Color color,boolean fillCurve,int groupID){
  DimensionVirtualArray dimensionVA=tablePerspective.getDimensionPerspective().getVirtualArray();
  ArrayList<Float> dataVector=new ArrayList<Float>();
  for (int recordID=0; recordID < recordIDs.size(); recordID++) {
    float normalizedValue=tablePerspective.getDataDomain().getTable().getRaw(recordIDs.get(recordID),dimensionVA.get(0));
    dataVector.add(normalizedValue);
  }
  Float[] sortedDataVector=new Float[dataVector.size()];
  dataVector.toArray(sortedDataVector);
  Arrays.sort(sortedDataVector);
  dataVector.clear();
  for (int index=0; index < recordIDs.size(); index++) {
    dataVector.add(sortedDataVector[index]);
  }
  if (fillCurve) {
    gl.glColor3f(color.r * 1.3f,color.g * 1.3f,color.b * 1.3f);
    drawFilledCurve(gl,dataVector);
    dataVector.clear();
    for (int index=0; index < recordIDs.size(); index++) {
      dataVector.add(sortedDataVector[index]);
    }
  }
  if (!fillCurve && detailLevel == EDetailLevel.HIGH) {
    gl.glPushName(pickingManager.getPickingID(getID(),EPickingType.KM_CURVE.name(),groupID));
  }
  gl.glColor3fv(color.getRGB(),0);
  drawCurve(gl,dataVector);
  if (!fillCurve && detailLevel == EDetailLevel.HIGH) {
    gl.glPopName();
  }
}

Fixed version (ground truth):
private void renderSingleKaplanMeierCurve(GL2 gl,List<Integer> recordIDs,Color color,boolean fillCurve,int groupID){
  DimensionVirtualArray dimensionVA=tablePerspective.getDimensionPerspective().getVirtualArray();
  ArrayList<Float> dataVector=new ArrayList<Float>();
  final DataTable table=tablePerspective.getDataDomain().getTable();
  final Integer dimensionID=dimensionVA.get(0);
  for (  Integer recordID : recordIDs) {
    float normalizedValue=table.getNormalizedValue(recordID,dimensionID);
    dataVector.add(normalizedValue);
  }
  Float[] sortedDataVector=new Float[dataVector.size()];
  dataVector.toArray(sortedDataVector);
  Arrays.sort(sortedDataVector);
  dataVector.clear();
  for (int index=0; index < recordIDs.size(); index++) {
    dataVector.add(sortedDataVector[index]);
  }
  if (fillCurve) {
    gl.glColor3f(color.r * 1.3f,color.g * 1.3f,color.b * 1.3f);
    drawFilledCurve(gl,dataVector);
    dataVector.clear();
    for (int index=0; index < recordIDs.size(); index++) {
      dataVector.add(sortedDataVector[index]);
    }
  }
  if (!fillCurve && detailLevel == EDetailLevel.HIGH) {
    gl.glPushName(pickingManager.getPickingID(getID(),EPickingType.KM_CURVE.name(),groupID));
  }
  gl.glColor3fv(color.getRGB(),0);
  drawCurve(gl,dataVector);
  if (!fillCurve && detailLevel == EDetailLevel.HIGH) {
    gl.glPopName();
  }
}
Program: 57430
Project: 57430
Buggy source:
public void addSelection(Collection<IScore> scores){
  scores=Collections2.filter(scores,query.getMode().isSupportedBy());
  if (scores.isEmpty())   return;
  this.selection.addAll(scores);
  IScore last=Iterables.getLast(scores);
  sortByImpl(last,last.getDefaultSorting());
  submitComputation(scores,null);
  listeners.fireIndexedPropertyChange(PROP_SELECTION,selection.size() - 1,null,last);
}

Fixed version (ground truth):
public void addSelection(Collection<IScore> scores){
  scores=Collections2.filter(scores,query.getMode().isSupportedBy());
  if (scores.isEmpty())   return;
  this.selection.addAll(0,scores);
  IScore last=Iterables.getLast(scores);
  sortByImpl(last,last.getDefaultSorting());
  submitComputation(scores,null);
  listeners.fireIndexedPropertyChange(PROP_SELECTION,selection.size() - 1,null,last);
}
Program: 57431
Project: 57431
Buggy source:
private Pair<List<Float>,Integer> getValues(Iterable<Integer> a,Integer col){
  int survived=0;
  List<Float> r=new ArrayList<>();
  for (  Integer row : a) {
    Float v=clinical.getTable().getRaw(row,col);
    if (v == null || v.isNaN()) {
      survived++;
      continue;
    }
    r.add(v);
  }
  Collections.sort(r);
  return Pair.make(r,survived);
}

Fixed version (ground truth):
private Pair<List<Float>,Integer> getValues(Iterable<Integer> a,Integer col){
  int survived=0;
  List<Float> r=new ArrayList<>();
  for (  Integer row : a) {
    Float v=clinical.getTable().getRawDxR(col,row);
    if (v == null || v.isNaN()) {
      survived++;
      continue;
    }
    r.add(v);
  }
  Collections.sort(r);
  return Pair.make(r,survived);
}
Program: 57432
Project: 57432
Buggy source:
private void createColumns(ScoreQuery query){
  this.clear();
  this.columns.clear();
  this.columns.add(new RankColumn(view));
  this.columns.add(new MatchColumn(view,stratomex));
  int i=0;
  this.queryColumns.clear();
  for (  IScore column : query.getSelection()) {
    QueryColumn col=QueryColumn.create(column,i++,query.getSorting(column),view);
    this.columns.add(col);
    this.queryColumns.add(col);
  }
  this.columns.add(new AddQueryColumn(view));
  final ElementLayout colSpace=createXSpacer(1);
  this.add(colSpace);
  this.add(columns.get(0));
  this.add(colSpace);
  this.add(columns.get(1));
  this.add(colSpace);
  this.add(columns.get(2));
  for (  QueryColumn col : this.queryColumns) {
    final ElementLayout s=createXSeparator(5);
    s.setGrabY(true);
    this.add(s).add(col);
  }
  this.add(columns.get(columns.size() - 1));
  invalidate();
  this.setPixelSizeY(columns.get(1).getPixelSizeY());
}

Fixed version (ground truth):
private void createColumns(ScoreQuery query){
  this.clear();
  this.columns.clear();
  this.columns.add(new RankColumn(view));
  this.columns.add(new MatchColumn(view,stratomex));
  int i=0;
  this.queryColumns.clear();
  for (  IScore column : query.getSelection()) {
    QueryColumn col=QueryColumn.create(column,i++,query.getSorting(column),view);
    this.columns.add(col);
    this.queryColumns.add(col);
  }
  this.columns.add(new AddQueryColumn(view));
  final ElementLayout colSpace=createXSpacer(1);
  this.add(colSpace);
  this.add(columns.get(0));
  this.add(colSpace);
  this.add(columns.get(1));
  for (  QueryColumn col : this.queryColumns) {
    final ElementLayout s=createXSeparator(5);
    s.setGrabY(true);
    this.add(s).add(col);
  }
  this.add(columns.get(columns.size() - 1));
  invalidate();
  this.setPixelSizeY(columns.get(1).getPixelSizeY());
}
Program: 57433
Project: 57433
Buggy source:
/** 
 * filter all methods of the listener object for <code>
 * @ListenTo void xxx(<? extends AEvent> event); </code>and register an event listener for calling this method
 * @param owner
 * @param listener
 */
public final void register(IListenerOwner owner,Object listener){
  Class<?> clazz=listener.getClass();
  while (clazz != null) {
    for (    Method m : listener.getClass().getDeclaredMethods()) {
      if (!matches(m))       continue;
      Class<? extends AEvent> event=m.getParameterTypes()[0].asSubclass(AEvent.class);
      boolean toMe=m.getAnnotation(ListenTo.class).sendToMe() && ADirectedEvent.class.isAssignableFrom(event);
      register(event,new AnnotationBasedEventListener(owner,listener,m,toMe));
    }
    clazz=clazz.getSuperclass();
  }
}

Fixed version (ground truth):
/** 
 * filter all methods of the listener object for <code>
 * @ListenTo void xxx(<? extends AEvent> event); </code>and register an event listener for calling this method
 * @param owner
 * @param listener
 */
public final void register(IListenerOwner owner,Object listener){
  Class<?> clazz=listener.getClass();
  while (clazz != null) {
    for (    Method m : clazz.getDeclaredMethods()) {
      if (!matches(m))       continue;
      Class<? extends AEvent> event=m.getParameterTypes()[0].asSubclass(AEvent.class);
      boolean toMe=m.getAnnotation(ListenTo.class).sendToMe() && ADirectedEvent.class.isAssignableFrom(event);
      register(event,new AnnotationBasedEventListener(owner,listener,m,toMe));
    }
    clazz=clazz.getSuperclass();
  }
}
Program: 57434
Project: 57434
Buggy source:
private static float computeJaccardIndex(Group a,BitSet aBits,Group b,BitSet bBits){
  BitSet tmp=(BitSet)bBits.clone();
  tmp.and(aBits);
  int intersection=tmp.cardinality();
  int union=a.getSize() + b.getSize() - intersection;
  float score=union == 0 ? 0.f : (float)intersection / union;
  return score;
}

Fixed version (ground truth):
private static float computeJaccardIndex(Group a,BitSet aBits,Group b,BitSet bBits){
  BitSet tmp=(BitSet)bBits.clone();
  tmp.and(aBits);
  int intersection=tmp.cardinality();
  int union=aBits.cardinality() + aBits.cardinality() - intersection;
  float score=union == 0 ? 0.f : (float)intersection / union;
  return score;
}
Program: 57435
Project: 57435
Buggy source:
private static void applyImpl(Collection<IBatchComputedGroupScore> batch,Multimap<TablePerspective,Group> stratNGroups){
  Multimap<IDType,JaccardIndexScore> byIDCat=ArrayListMultimap.create();
  for (  IBatchComputedGroupScore b : batch) {
    JaccardIndexScore s=(JaccardIndexScore)b;
    byIDCat.put(s.stratification.getRecordPerspective().getVirtualArray().getIdType(),s);
  }
  Set<TablePerspective> stratifications=stratNGroups.keySet();
  log.info("String_Node_Str" + stratifications.size() + "String_Node_Str"+ stratNGroups.size()+ "String_Node_Str"+ batch.size());
  int i=0;
  for (  TablePerspective strat : stratifications) {
    RecordVirtualArray va=strat.getRecordPerspective().getVirtualArray();
    for (    Group g : stratNGroups.get(strat)) {
      for (      IDType targetType : byIDCat.keySet()) {
        IDMappingManager idMappingManager=IDMappingManagerRegistry.get().getIDMappingManager(targetType.getIDCategory());
        Collection<JaccardIndexScore> todo=new ArrayList<>();
        for (        JaccardIndexScore idElem : byIDCat.get(targetType)) {
          todo.add(idElem);
        }
        if (todo.isEmpty())         continue;
        boolean doMapIds=!targetType.equals(va.getIdType());
        BitSet s=doMapIds ? createMappedIds(va,g,idMappingManager,targetType) : createIds(va,g);
        for (        JaccardIndexScore idElem : todo) {
          idElem.put(g,computeJaccardIndex(idElem.group,idElem.bitSet,g,s));
        }
      }
    }
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
private static void applyImpl(Collection<IBatchComputedGroupScore> batch,Multimap<TablePerspective,Group> stratNGroups){
  Multimap<IDType,JaccardIndexScore> byIDCat=ArrayListMultimap.create();
  for (  IBatchComputedGroupScore b : batch) {
    JaccardIndexScore s=(JaccardIndexScore)b;
    byIDCat.put(s.stratification.getRecordPerspective().getVirtualArray().getIdType(),s);
  }
  Set<TablePerspective> stratifications=stratNGroups.keySet();
  log.info("String_Node_Str" + stratifications.size() + "String_Node_Str"+ stratNGroups.size()+ "String_Node_Str"+ batch.size());
  int i=0;
  for (  TablePerspective strat : stratifications) {
    RecordVirtualArray va=strat.getRecordPerspective().getVirtualArray();
    for (    Group g : stratNGroups.get(strat)) {
      for (      IDType targetType : byIDCat.keySet()) {
        IDMappingManager idMappingManager=IDMappingManagerRegistry.get().getIDMappingManager(targetType.getIDCategory());
        Collection<JaccardIndexScore> todo=new ArrayList<>();
        for (        JaccardIndexScore idElem : byIDCat.get(targetType)) {
          if (!idElem.contains(strat,g))           todo.add(idElem);
        }
        if (todo.isEmpty())         continue;
        boolean doMapIds=!targetType.equals(va.getIdType());
        BitSet s=doMapIds ? createMappedIds(va,g,idMappingManager,targetType) : createIds(va,g);
        for (        JaccardIndexScore idElem : todo) {
          idElem.put(g,computeJaccardIndex(idElem.group,idElem.bitSet,g,s));
        }
      }
    }
  }
  log.info("String_Node_Str");
}
Program: 57436
Project: 57436
Buggy source:
private static float computeJaccardIndex(Group a,BitSet aBits,Group b,BitSet bBits){
  BitSet tmp=(BitSet)bBits.clone();
  tmp.and(aBits);
  int intersection=tmp.cardinality();
  int union=aBits.cardinality() + aBits.cardinality() - intersection;
  float score=union == 0 ? 0.f : (float)intersection / union;
  return score;
}

Fixed version (ground truth):
private static float computeJaccardIndex(Group a,BitSet aBits,Group b,BitSet bBits){
  BitSet tmp=(BitSet)bBits.clone();
  tmp.and(aBits);
  int intersection=tmp.cardinality();
  int union=aBits.cardinality() + bBits.cardinality() - intersection;
  float score=union == 0 ? 0.f : (float)intersection / union;
  return score;
}
Program: 57437
Project: 57437
Buggy source:
public void apply(ALinearizableNode node){
  this.node=node;
  unregisterPickingListeners();
  registerPickingListeners();
  attributeRenderers.clear();
  RemoveNodeButtonAttributeRenderer attributeRenderer=new RemoveNodeButtonAttributeRenderer(view,node);
  ComplexNode complexNode=(ComplexNode)node;
  if (complexNode.getNodes() != null) {
    List<Integer> nodeIds=new ArrayList<Integer>();
    for (    ALinearizableNode n : complexNode.getNodes()) {
      nodeIds.add(n.getNodeId());
    }
    attributeRenderer.setNodeIds(nodeIds);
    attributeRenderer.registerPickingListeners();
  }
  addAttributeRenderer(attributeRenderer);
}

Fixed version (ground truth):
@Override public void apply(ALinearizableNode node){
  this.node=node;
  unregisterPickingListeners();
  registerPickingListeners();
  attributeRenderers.clear();
  RemoveNodeButtonAttributeRenderer attributeRenderer=new RemoveNodeButtonAttributeRenderer(view,node);
  ComplexNode complexNode=(ComplexNode)node;
  if (complexNode.getNodes() != null) {
    List<Integer> nodeIds=new ArrayList<Integer>();
    for (    ALinearizableNode n : complexNode.getNodes()) {
      nodeIds.add(n.getNodeId());
    }
    attributeRenderer.setNodeIds(nodeIds);
    attributeRenderer.registerPickingListeners();
  }
  addAttributeRenderer(attributeRenderer);
}
Program: 57438
Project: 57438
Buggy source:
@Override public void render(GL2 gl,GLU glu){
  ComplexNode complexNode=(ComplexNode)node;
  Vec3f position=complexNode.getPosition();
  float currentPositionY=position.y() + complexNode.getHeight() / 2.0f;
  for (  ALinearizableNode node : complexNode.getNodes()) {
    float nodeHeight=node.getHeight();
    currentPositionY-=nodeHeight / 2.0f;
    node.setPosition(new Vec3f(position.x(),currentPositionY,position.z()));
    node.render(gl,glu);
    currentPositionY-=nodeHeight / 2.0f;
  }
  for (  ANodeAttributeRenderer attributeRenderer : attributeRenderers) {
    attributeRenderer.render(gl);
  }
}

Fixed version (ground truth):
@Override public void render(GL2 gl,GLU glu){
  ComplexNode complexNode=(ComplexNode)node;
  for (  ALinearizableNode node : complexNode.getNodes()) {
    node.render(gl,glu);
  }
  for (  ANodeAttributeRenderer attributeRenderer : attributeRenderers) {
    attributeRenderer.render(gl);
  }
}
Program: 57439
Project: 57439
Buggy source:
@Override public void widgetDisposed(DisposeEvent e){
  if (!PlatformUI.getWorkbench().isClosing())   e.widget.dispose();
}

Fixed version (ground truth):
@Override public void widgetDisposed(DisposeEvent e){
  if (!PlatformUI.getWorkbench().isClosing()) {
    fireDispose(SWTGLCanvas.this.canvas);
    SWTGLCanvas.this.canvas.getContext().destroy();
    SWTGLCanvas.this.canvas.setRealized(false);
  }
}
Program: 57440
Project: 57440
Buggy source:
SWTGLCanvas(GLCanvas canvas){
  this.canvas=canvas;
  canvas.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      if (!PlatformUI.getWorkbench().isClosing())       e.widget.dispose();
    }
  }
);
  canvas.addGLEventListener(new GLEventListener(){
    int w=-1, h=-1;
    @Override public void reshape(    GLAutoDrawable drawable,    int x,    int y,    int width,    int height){
      this.w=width;
      this.h=height;
      fireReshape(drawable,x,y,width,height);
    }
    @Override public void init(    GLAutoDrawable drawable){
      this.w=drawable.getWidth();
      this.h=drawable.getHeight();
      fireInit(drawable);
    }
    @Override public void dispose(    GLAutoDrawable drawable){
      fireDispose(drawable);
    }
    @Override public void display(    GLAutoDrawable drawable){
      if (w != drawable.getWidth() || h != drawable.getHeight() && w != -1) {
        w=drawable.getWidth();
        h=drawable.getHeight();
        fireReshape(drawable,0,0,drawable.getWidth(),drawable.getHeight());
      }
      fireDisplay(drawable);
    }
  }
);
}

Fixed version (ground truth):
SWTGLCanvas(GLCanvas canvas){
  this.canvas=canvas;
  canvas.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      if (!PlatformUI.getWorkbench().isClosing()) {
        fireDispose(SWTGLCanvas.this.canvas);
        SWTGLCanvas.this.canvas.getContext().destroy();
        SWTGLCanvas.this.canvas.setRealized(false);
      }
    }
  }
);
  canvas.addGLEventListener(new GLEventListener(){
    int w=-1, h=-1;
    @Override public void reshape(    GLAutoDrawable drawable,    int x,    int y,    int width,    int height){
      this.w=width;
      this.h=height;
      fireReshape(drawable,x,y,width,height);
    }
    @Override public void init(    GLAutoDrawable drawable){
      this.w=drawable.getWidth();
      this.h=drawable.getHeight();
      fireInit(drawable);
    }
    @Override public void dispose(    GLAutoDrawable drawable){
      fireDispose(drawable);
    }
    @Override public void display(    GLAutoDrawable drawable){
      if (w != drawable.getWidth() || h != drawable.getHeight() && w != -1) {
        w=drawable.getWidth();
        h=drawable.getHeight();
        fireReshape(drawable,0,0,drawable.getWidth(),drawable.getHeight());
      }
      fireDisplay(drawable);
    }
  }
);
}
Program: 57441
Project: 57441
Buggy source:
/** 
 * Constructor
 * @param dataOKListener see  {@link #dataOKListener}
 * @param parent the parent composite
 * @param supportedDataDomains All datadomains that shall be chosen from. If null, all tablebased datadomains are available.
 * @param style the SWT style
 */
public DataChooserComposite(IDataOKListener dataOKListener,Composite parent,List<ATableBasedDataDomain> supportedDataDomains,int style){
  super(parent,style);
  if (supportedDataDomains == null) {
    supportedDataDomains=DataDomainManager.get().getDataDomainsByType(ATableBasedDataDomain.class);
  }
 else {
    this.supportedDataDomains=supportedDataDomains;
  }
  this.dataOKListener=dataOKListener;
  this.parent=parent;
  initGui();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param dataOKListener see  {@link #dataOKListener}
 * @param parent the parent composite
 * @param supportedDataDomains All datadomains that shall be chosen from. If null, all tablebased datadomains are available.
 * @param style the SWT style
 */
public DataChooserComposite(IDataOKListener dataOKListener,Composite parent,List<ATableBasedDataDomain> supportedDataDomains,int style){
  super(parent,style);
  if (supportedDataDomains == null) {
    this.supportedDataDomains=DataDomainManager.get().getDataDomainsByType(ATableBasedDataDomain.class);
  }
 else {
    this.supportedDataDomains=supportedDataDomains;
  }
  this.dataOKListener=dataOKListener;
  this.parent=parent;
  initGui();
}