nus-yam/ex-repair huggingface dataset:
Program: 57994
Project: 57994
Buggy source:
private void calculateWidthAndHeight(){
  String sCurrent;
  Rectangle2D box;
  float fTemp;
  Iterator<String> contentIterator=sContent.iterator();
  int iCount=0;
  float fFontScalingFactor=renderStyle.getHeadingFontScalingFactor();
  while (contentIterator.hasNext()) {
    sCurrent=contentIterator.next();
    if (iCount == 1) {
      fFontScalingFactor=renderStyle.getSmallFontScalingFactor();
    }
    box=textRenderer.getBounds(sCurrent).getBounds2D();
    fHeight+=box.getHeight() * fFontScalingFactor;
    fTemp=(float)box.getWidth() * fFontScalingFactor;
    if (fTemp > fWidth) {
      fWidth=fTemp;
    }
    fHeight+=fSpacing;
    iCount++;
  }
  fWidth+=2 * fSpacing;
  fHeight+=2 * fSpacing;
  fTextWidth=fWidth;
  if (miniView != null) {
    fWidth+=miniView.getWidth() + fSpacing * 2;
    if (fHeight < miniView.getHeight()) {
      fHeight=miniView.getHeight();
    }
    fHeight+=fSpacing * 2;
  }
  vecSize.set(fWidth,fHeight);
}

Fixed version (ground truth):
private void calculateWidthAndHeight(){
  String sCurrent;
  Rectangle2D box;
  float fTemp;
  Iterator<String> contentIterator=sContent.iterator();
  int iCount=0;
  float fFontScalingFactor=0.01f;
  while (contentIterator.hasNext()) {
    sCurrent=contentIterator.next();
    if (iCount == 1) {
      fFontScalingFactor=0.005f;
    }
    box=textRenderer.getBounds(sCurrent).getBounds2D();
    fHeight+=box.getHeight() * fFontScalingFactor;
    fTemp=(float)box.getWidth() * fFontScalingFactor;
    if (fTemp > fWidth) {
      fWidth=fTemp;
    }
    fHeight+=fSpacing;
    iCount++;
  }
  fWidth+=2 * fSpacing;
  fHeight+=2 * fSpacing;
  fTextWidth=fWidth;
  if (miniView != null) {
    fWidth+=miniView.getWidth() + fSpacing * 2;
    if (fHeight < miniView.getHeight()) {
      fHeight=miniView.getHeight();
    }
    fHeight+=fSpacing * 2;
  }
  vecSize.set(fWidth,fHeight);
}
Program: 57996
Project: 57996
Buggy source:
public void setColor(float[] color){
  setColor(color[0],color[1],color[2],1);
}

Fixed version (ground truth):
/** 
 * Set the color of the text
 * @param color
 */
public void setColor(float[] color){
  setColor(color[0],color[1],color[2],1);
}
Program: 57997
Project: 57997
Buggy source:
/** 
 * Renders a text with specified pixel height.
 * @param gl GL2 context.
 * @param text Text to render
 * @param x X coordinate of the text.
 * @param y Y coordinate of the text.
 * @param z Z coordinate of the text.
 * @param scaling Factor the text is scaled with.
 * @param minSize Minimum size of the text. Note that the minimum size is scaled with the specified scaling vector.
 * @param pixelHeight Height of the text in pixels.
 * @param pixelGLConverter
 */
public void renderText(GL2 gl,String text,float x,float y,float z,int pixelHeight,PixelGLConverter pixelGLConverter){
  int fontSize=getFont().getSize();
  float glFontHeight=pixelGLConverter.getGLHeightForPixelHeight(fontSize);
  float scaling=(float)(glFontHeight * (float)((float)pixelHeight / (float)fontSize)) / (float)fontSize;
  begin3DRendering();
  draw3D(text,x,y,z,scaling);
  flush();
  end3DRendering();
}

Fixed version (ground truth):
/** 
 * Convenience method to render text with a specified minimum size without having to call begin3DRendering and end3DRendering.
 * @param gl GL2 context.
 * @param text Text to render
 * @param x X coordinate of the text.
 * @param y Y coordinate of the text.
 * @param z Z coordinate of the text.
 * @param scaling Factor the text is scaled with.
 * @param minSize Minimum size of the text. Note that the minimum size is scaled with the specified scaling vector.
 */
public void renderText(GL2 gl,String text,float x,float y,float z,float scaling,int minSize){
  scaling=calculateScaling(gl,scaling,minSize);
  begin3DRendering();
  draw3D(text,x,y,z,scaling);
  flush();
  end3DRendering();
}
Program: 57998
Project: 57998
Buggy source:
/** 
 * The constructor takes a TextRenderer which is used to render all text
 * @param textRenderer
 */
public ABookmark(GLBookmarkView manager,ABookmarkContainer<?> parentContainer,IDType idType,CaleydoTextRenderer textRenderer){
  this.textRenderer=textRenderer;
  this.manager=manager;
  this.idType=idType;
  this.parentContainer=parentContainer;
}

Fixed version (ground truth):
/** 
 * The constructor takes a TextRenderer which is used to render all text
 * @param textRenderer
 */
public ABookmark(GLBookmarkView manager,ABookmarkContainer<?> parentContainer,IDType idType,CaleydoTextRenderer textRenderer){
  this.textRenderer=textRenderer;
  this.manager=manager;
  this.idType=idType;
  this.parentContainer=parentContainer;
  pixelGLConverter=manager.getParentGLCanvas().getPixelGLConverter();
}
Program: 57999
Project: 57999
Buggy source:
public void render(GL2 gl){
  super.render(gl);
  float[] highlightColor=null;
  ArrayList<SelectionType> selectionTypes=parentContainer.selectionManager.getSelectionTypes(this.id);
  if (selectionTypes == null)   return;
  SelectionType topLevelType=null;
  for (  SelectionType selectionType : selectionTypes) {
    if (!selectionType.isVisible())     continue;
    if (selectionType == SelectionType.NORMAL)     continue;
    if (topLevelType == null)     topLevelType=selectionType;
 else     if (topLevelType.getPriority() < selectionType.getPriority())     topLevelType=selectionType;
  }
  if (topLevelType == null)   return;
  highlightColor=topLevelType.getColor();
  ElementLayout layout=getLayout();
  if (highlightColor != null) {
    float xOrigin=0;
    float yOrigin=0;
    float width=layout.getSizeScaledX();
    float height=layout.getSizeScaledY();
    gl.glColor3fv(highlightColor,0);
    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glVertex3f(xOrigin,yOrigin,0);
    gl.glVertex3f(xOrigin + width,yOrigin,0);
    gl.glVertex3f(xOrigin + width,yOrigin + height,0);
    gl.glVertex3f(xOrigin,yOrigin + height,0);
    gl.glEnd();
  }
}

Fixed version (ground truth):
public void render(GL2 gl){
  super.render(gl);
  ySpacing=pixelGLConverter.getGLHeightForPixelHeight(Y_SPACING_PIXEL);
  xSpacing=pixelGLConverter.getGLWidthForPixelWidth(X_SPACING_PIXEL);
  float[] highlightColor=null;
  ArrayList<SelectionType> selectionTypes=parentContainer.selectionManager.getSelectionTypes(this.id);
  if (selectionTypes == null)   return;
  SelectionType topLevelType=null;
  for (  SelectionType selectionType : selectionTypes) {
    if (!selectionType.isVisible())     continue;
    if (selectionType == SelectionType.NORMAL)     continue;
    if (topLevelType == null)     topLevelType=selectionType;
 else     if (topLevelType.getPriority() < selectionType.getPriority())     topLevelType=selectionType;
  }
  if (topLevelType == null)   return;
  highlightColor=topLevelType.getColor();
  ElementLayout layout=getLayout();
  if (highlightColor != null) {
    float xOrigin=0;
    float yOrigin=0;
    float width=layout.getSizeScaledX();
    float height=layout.getSizeScaledY();
    gl.glLineWidth(1);
    gl.glColor3fv(highlightColor,0);
    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glVertex3f(xOrigin,yOrigin,0);
    gl.glVertex3f(xOrigin + width,yOrigin,0);
    gl.glVertex3f(xOrigin + width,yOrigin + height,0);
    gl.glVertex3f(xOrigin,yOrigin + height,0);
    gl.glEnd();
  }
}
Program: 58000
Project: 58000
Buggy source:
/** 
 * Constructor
 * @param manager The gl view managing the container.
 * @param category Every category in  {@link EIDCategory} can have one bookmarkcontainer, therefore you need to specify the concrete category. The category should be specified by the concrete subclass and therefore not be part of its constructor.
 * @param internalIDType the id type the container uses to internally store the bookmarks
 */
ABookmarkContainer(GLBookmarkView manager,IDCategory category,IDType internalIDType){
  this.internalIDType=internalIDType;
  this.manager=manager;
  this.category=category;
  this.categoryName=category.getCategoryName();
  this.pickingIDManager=manager.getPickingIDManager();
  this.containerLayout=new Column();
  containerLayout.setYDynamic(true);
  containerLayout.setRatioSizeX(1);
  containerLayout.setBottomUp(false);
  ContainerHeading heading=new ContainerHeading(manager);
  heading.setCaption(category.getCategoryName());
  containerLayout.append(heading.getLayout());
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param manager The gl view managing the container.
 * @param category Every category in  {@link EIDCategory} can have one bookmarkcontainer, therefore you need to specify the concrete category. The category should be specified by the concrete subclass and therefore not be part of its constructor.
 * @param internalIDType the id type the container uses to internally store the bookmarks
 */
ABookmarkContainer(GLBookmarkView manager,IDCategory category,IDType internalIDType){
  this.internalIDType=internalIDType;
  this.manager=manager;
  this.category=category;
  this.categoryName=category.getCategoryName();
  this.pickingIDManager=manager.getPickingIDManager();
  this.containerLayout=new Column("String_Node_Str");
  containerLayout.setYDynamic(true);
  containerLayout.setRatioSizeX(1);
  containerLayout.setBottomUp(false);
  ContainerHeading heading=new ContainerHeading(manager);
  heading.setCaption(category.getCategoryName());
  containerLayout.append(heading.getLayout());
}
Program: 58001
Project: 58001
Buggy source:
@Override public ElementLayout getLayout(){
  return layoutElement;
}

Fixed version (ground truth):
@Override public ElementLayout getLayout(){
  return layout;
}
Program: 58002
Project: 58002
Buggy source:
public ContainerHeading(GLBookmarkView manager){
  this.manager=manager;
  layoutElement=new ElementLayout();
  layoutElement.setPixelGLConverter(manager.getParentGLCanvas().getPixelGLConverter());
  layoutElement.setRatioSizeX(1);
  layoutElement.setPixelSizeY(20);
  layoutElement.setRenderer(this);
}

Fixed version (ground truth):
public ContainerHeading(GLBookmarkView manager){
  this.manager=manager;
  layout=new ElementLayout("String_Node_Str");
  layout.setPixelGLConverter(manager.getParentGLCanvas().getPixelGLConverter());
  layout.setRatioSizeX(1);
  layout.setPixelSizeY(20);
  layout.setRenderer(this);
}
Program: 58003
Project: 58003
Buggy source:
@Override public void render(GL2 gl){
  super.render(gl);
  float height=(layoutElement.getSizeScaledY() - (float)manager.getMinSizeTextRenderer().getBounds("String_Node_Str").getHeight()) / 2;
  RenderingHelpers.renderText(gl,manager.getMinSizeTextRenderer(),caption,0 + BookmarkRenderStyle.SIDE_SPACING,height,GeneralRenderStyle.SMALL_FONT_SCALING_FACTOR);
}

Fixed version (ground truth):
@Override public void render(GL2 gl){
  super.render(gl);
  PixelGLConverter pixelGLConverter=manager.getParentGLCanvas().getPixelGLConverter();
  float ySpacing=pixelGLConverter.getGLHeightForPixelHeight(Y_SPACING_PIXEL);
  float xSpacing=pixelGLConverter.getGLWidthForPixelWidth(X_SPACING_PIXEL);
  manager.getTextRenderer().setColor(0,0,0,1);
  manager.getTextRenderer().renderTextInBounds(gl,caption,0 + xSpacing,0 + ySpacing,0,x - xSpacing,y - 2 * ySpacing);
}
Program: 58004
Project: 58004
Buggy source:
public void setGlobalViewSwitching(boolean isGlobalViewSwitching){
  this.isGlobalViewSwitching=isGlobalViewSwitching;
  for (  GLBrick brick : topBricks) {
    brick.setGlobalViewSwitching(isGlobalViewSwitching);
  }
  for (  GLBrick brick : bottomBricks) {
    brick.setGlobalViewSwitching(isGlobalViewSwitching);
  }
}

Fixed version (ground truth):
public void setGlobalViewSwitching(boolean isGlobalViewSwitching){
  this.isGlobalViewSwitching=isGlobalViewSwitching;
  for (  GLBrick brick : topBricks) {
    brick.setGlobalViewSwitching(isGlobalViewSwitching);
  }
  for (  GLBrick brick : bottomBricks) {
    brick.setGlobalViewSwitching(isGlobalViewSwitching);
  }
  if (detailBrick != null) {
    detailBrick.setGlobalViewSwitching(isGlobalViewSwitching);
  }
}
Program: 58005
Project: 58005
Buggy source:
/** 
 * Switch all bricks to the specified view type
 * @param viewType
 */
public void switchBrickViews(EContainedViewType viewType){
  for (  GLBrick brick : topBricks) {
    brick.setContainedView(viewType);
  }
  for (  GLBrick brick : bottomBricks) {
    brick.setContainedView(viewType);
  }
  detailRow.updateSubLayout();
}

Fixed version (ground truth):
/** 
 * Switch all bricks to the specified view type
 * @param viewType
 */
public void switchBrickViews(EContainedViewType viewType){
  for (  GLBrick brick : topBricks) {
    brick.setContainedView(viewType);
  }
  for (  GLBrick brick : bottomBricks) {
    brick.setContainedView(viewType);
  }
  if (detailBrick != null) {
    detailBrick.setContainedView(viewType);
  }
  detailRow.updateSubLayout();
}
Program: 58007
Project: 58007
Buggy source:
private void renderCaption(GL2 gl,float normalizedValue){
  if (getParentGLCanvas().getSize().getWidth() < 500)   return;
  textRenderer.begin3DRendering();
  textRenderer.setColor(0,0,0,1);
  gl.glDisable(GL2.GL_DEPTH_TEST);
  double correspondingValue=dataDomain.getSet().getRawForNormalized(normalizedValue);
  String text=Formatter.formatNumber(correspondingValue);
  textRenderer.draw3D(text,sideSpacing + normalizedValue * fRenderWidth + HistogramRenderStyle.CAPTION_SPACING,HistogramRenderStyle.CAPTION_SPACING,0.001f,GeneralRenderStyle.HEADING_FONT_SCALING_FACTOR);
  textRenderer.end3DRendering();
}

Fixed version (ground truth):
private void renderCaption(GL2 gl,float normalizedValue){
  if (getParentGLCanvas().getSize().getWidth() < 500 || dataDomain.getSet().getSetType() != ESetDataType.NUMERIC)   return;
  textRenderer.begin3DRendering();
  textRenderer.setColor(0,0,0,1);
  gl.glDisable(GL2.GL_DEPTH_TEST);
  double correspondingValue=dataDomain.getSet().getRawForNormalized(normalizedValue);
  String text=Formatter.formatNumber(correspondingValue);
  textRenderer.draw3D(text,sideSpacing + normalizedValue * fRenderWidth + HistogramRenderStyle.CAPTION_SPACING,HistogramRenderStyle.CAPTION_SPACING,0.001f,GeneralRenderStyle.HEADING_FONT_SCALING_FACTOR);
  textRenderer.end3DRendering();
}
Program: 58008
Project: 58008
Buggy source:
public void expand(){
  ABrickLayoutTemplate layoutTemplate=brickLayout.getExpandedLayoutTemplate();
  if (expandedBrickState != null) {
    setBrickLayoutTemplate(layoutTemplate,expandedBrickState.getViewType());
    wrappingLayout.setAbsoluteSizeX(expandedBrickState.getWidth());
    wrappingLayout.setAbsoluteSizeY(expandedBrickState.getHeight());
  }
 else {
    setBrickLayoutTemplate(layoutTemplate,currentViewType);
    float defaultHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getDefaultHeightPixels());
    float defaultWidth=getParentGLCanvas().getPixelGLConverter().getGLWidthForPixelWidth(layoutTemplate.getDefaultWidthPixels());
    wrappingLayout.setAbsoluteSizeY(defaultHeight);
    wrappingLayout.setAbsoluteSizeX(defaultWidth);
  }
  isInOverviewMode=false;
}

Fixed version (ground truth):
public void expand(){
  ABrickLayoutTemplate layoutTemplate=brickLayout.getExpandedLayoutTemplate();
  if (expandedBrickState != null) {
    setBrickLayoutTemplate(layoutTemplate,expandedBrickState.getViewType());
    wrappingLayout.setAbsoluteSizeX(expandedBrickState.getWidth());
    wrappingLayout.setAbsoluteSizeY(expandedBrickState.getHeight());
  }
 else {
    setBrickLayoutTemplate(layoutTemplate,currentViewType);
    float defaultHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getDefaultHeightPixels());
    float defaultWidth=getParentGLCanvas().getPixelGLConverter().getGLWidthForPixelWidth(layoutTemplate.getDefaultWidthPixels());
    wrappingLayout.setAbsoluteSizeY(defaultHeight);
    wrappingLayout.setAbsoluteSizeX(defaultWidth);
  }
  isInOverviewMode=false;
  isSizeFixed=true;
  brickLayout.setLockResizing(true);
}
Program: 58009
Project: 58009
Buggy source:
@Override public int getMinWidthPixels(){
  return 3 * SPACING_PIXELS + viewRenderer.getMinWidthPixels() + BUTTON_WIDTH_PIXELS;
}

Fixed version (ground truth):
@Override public int getMinWidthPixels(){
  if (viewRenderer == null)   return 3 * SPACING_PIXELS + 60 + BUTTON_WIDTH_PIXELS;
  return 3 * SPACING_PIXELS + viewRenderer.getMinWidthPixels() + BUTTON_WIDTH_PIXELS;
}
Program: 58011
Project: 58011
Buggy source:
@Override public void handleLayoutSizeCollision(int managingClassID,int layoutID,float toBigBy){
  if (managingClassID != uniqueID)   return;
  System.out.println("String_Node_Str");
  if (layoutID == TOP_COLUMN_ID) {
    boolean changeMade=false;
    for (int count=topBricks.size() - 1; count >= 0; count--) {
      GLBrick brick=topBricks.get(count);
      if (toBigBy < 0)       break;
      if (!brick.isInOverviewMode() && !brick.isSizeFixed()) {
      }
    }
    if (changeMade)     topCol.updateSubLayout();
  }
  if (layoutID == BOTTOM_COLUMN_ID) {
    boolean changeMade=false;
    for (int count=bottomBricks.size() - 1; count >= 0; count--) {
      GLBrick brick=bottomBricks.get(count);
      if (toBigBy < 0)       break;
      if (!brick.isInOverviewMode() && !brick.isSizeFixed()) {
      }
    }
    if (changeMade)     bottomCol.updateSubLayout();
  }
}

Fixed version (ground truth):
@Override public void handleLayoutSizeCollision(int managingClassID,int layoutID,float toBigBy){
  if (managingClassID != uniqueID)   return;
  System.out.println("String_Node_Str");
  if (layoutID == TOP_COLUMN_ID) {
    boolean changeMade=false;
    for (int count=topBricks.size() - 1; count >= 0; count--) {
      GLBrick brick=topBricks.get(count);
      if (toBigBy < 0)       break;
      if (!brick.isInOverviewMode() && !brick.isSizeFixed()) {
        toBigBy-=brick.collapse();
        changeMade=true;
      }
    }
    if (changeMade)     topCol.updateSubLayout();
  }
  if (layoutID == BOTTOM_COLUMN_ID) {
    boolean changeMade=false;
    for (int count=bottomBricks.size() - 1; count >= 0; count--) {
      GLBrick brick=bottomBricks.get(count);
      if (toBigBy < 0)       break;
      if (!brick.isInOverviewMode() && !brick.isSizeFixed()) {
        toBigBy-=brick.collapse();
        changeMade=true;
      }
    }
    if (changeMade)     bottomCol.updateSubLayout();
  }
}
Program: 58013
Project: 58013
Buggy source:
/** 
 * Sets this brick collapsed
 * @return how much this has affected the height of the brick.
 */
public float collapse(){
  if (!isInOverviewMode) {
    expandedBrickState=new BrickState(currentViewType,wrappingLayout.getSizeScaledY(),wrappingLayout.getSizeScaledX());
  }
  ABrickLayoutTemplate layoutTemplate=brickLayout.getCollapsedLayoutTemplate();
  setBrickLayoutTemplate(layoutTemplate,layoutTemplate.getDefaultViewType());
  float minHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinHeightPixels());
  float minWidth=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinWidthPixels());
  float currentSize=wrappingLayout.getSizeScaledY();
  wrappingLayout.setAbsoluteSizeY(minHeight);
  wrappingLayout.setAbsoluteSizeX(minWidth);
  return currentSize - minHeight;
}

Fixed version (ground truth):
/** 
 * Sets this brick collapsed
 * @return how much this has affected the height of the brick.
 */
public float collapse(){
  if (!isInOverviewMode && isInitialized) {
    expandedBrickState=new BrickState(currentViewType,wrappingLayout.getSizeScaledY(),wrappingLayout.getSizeScaledX());
  }
  ABrickLayoutTemplate layoutTemplate=brickLayout.getCollapsedLayoutTemplate();
  setBrickLayoutTemplate(layoutTemplate,layoutTemplate.getDefaultViewType());
  float minHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinHeightPixels());
  float minWidth=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinWidthPixels());
  float currentSize=wrappingLayout.getSizeScaledY();
  wrappingLayout.setAbsoluteSizeY(minHeight);
  wrappingLayout.setAbsoluteSizeX(minWidth);
  return currentSize - minHeight;
}
Program: 58014
Project: 58014
Buggy source:
public void expand(){
  ABrickLayoutTemplate layoutTemplate=brickLayout.getExpandedLayoutTemplate();
  if (expandedBrickState != null) {
    setBrickLayoutTemplate(layoutTemplate,expandedBrickState.getViewType());
    wrappingLayout.setAbsoluteSizeX(expandedBrickState.getWidth());
    wrappingLayout.setAbsoluteSizeY(expandedBrickState.getHeight());
  }
 else {
    setBrickLayoutTemplate(layoutTemplate,currentViewType);
    float defaultHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getDefaultHeightPixels());
    float defaultWidth=getParentGLCanvas().getPixelGLConverter().getGLWidthForPixelWidth(layoutTemplate.getDefaultWidthPixels());
    wrappingLayout.setAbsoluteSizeY(defaultHeight);
    wrappingLayout.setAbsoluteSizeX(defaultWidth);
  }
  isInOverviewMode=false;
  isSizeFixed=true;
  brickLayout.setLockResizing(true);
}

Fixed version (ground truth):
public void expand(){
  ABrickLayoutTemplate layoutTemplate=brickLayout.getExpandedLayoutTemplate();
  if (expandedBrickState != null) {
    setBrickLayoutTemplate(layoutTemplate,expandedBrickState.getViewType());
    wrappingLayout.setAbsoluteSizeX(expandedBrickState.getWidth());
    wrappingLayout.setAbsoluteSizeY(expandedBrickState.getHeight());
  }
 else {
    setBrickLayoutTemplate(layoutTemplate,currentViewType);
    float defaultHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getDefaultHeightPixels());
    float defaultWidth=getParentGLCanvas().getPixelGLConverter().getGLWidthForPixelWidth(layoutTemplate.getDefaultWidthPixels());
    wrappingLayout.setAbsoluteSizeY(defaultHeight);
    wrappingLayout.setAbsoluteSizeX(defaultWidth);
  }
  isInOverviewMode=false;
  isSizeFixed=true;
  brickLayout.setLockResizing(true);
  visBricks.updateLayout();
  visBricks.updateConnectionLinesBetweenDimensionGroups();
}
Program: 58015
Project: 58015
Buggy source:
/** 
 * Sets this brick collapsed
 * @return how much this has affected the height of the brick.
 */
public float collapse(){
  if (!isInOverviewMode && isInitialized) {
    expandedBrickState=new BrickState(currentViewType,wrappingLayout.getSizeScaledY(),wrappingLayout.getSizeScaledX());
  }
  ABrickLayoutTemplate layoutTemplate=brickLayout.getCollapsedLayoutTemplate();
  setBrickLayoutTemplate(layoutTemplate,layoutTemplate.getDefaultViewType());
  float minHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinHeightPixels());
  float minWidth=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinWidthPixels());
  float currentSize=wrappingLayout.getSizeScaledY();
  wrappingLayout.setAbsoluteSizeY(minHeight);
  wrappingLayout.setAbsoluteSizeX(minWidth);
  return currentSize - minHeight;
}

Fixed version (ground truth):
/** 
 * Sets this brick collapsed
 * @return how much this has affected the height of the brick.
 */
public float collapse(){
  if (!isInOverviewMode && isInitialized) {
    expandedBrickState=new BrickState(currentViewType,wrappingLayout.getSizeScaledY(),wrappingLayout.getSizeScaledX());
  }
  ABrickLayoutTemplate layoutTemplate=brickLayout.getCollapsedLayoutTemplate();
  setBrickLayoutTemplate(layoutTemplate,layoutTemplate.getDefaultViewType());
  float minHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinHeightPixels());
  float minWidth=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(layoutTemplate.getMinWidthPixels());
  float currentSize=wrappingLayout.getSizeScaledY();
  wrappingLayout.setAbsoluteSizeY(minHeight);
  wrappingLayout.setAbsoluteSizeX(minWidth);
  visBricks.updateLayout();
  visBricks.updateConnectionLinesBetweenDimensionGroups();
  return currentSize - minHeight;
}
Program: 58017
Project: 58017
Buggy source:
public void updateConnectionLinesBetweenDimensionGroups(){
  if (centerRowLayout != null) {
    for (    ElementLayout elementLayout : centerRowLayout.getElements()) {
      if (elementLayout.getRenderer() instanceof DimensionGroupSpacingRenderer) {
        ((DimensionGroupSpacingRenderer)elementLayout.getRenderer()).init();
      }
    }
  }
}

Fixed version (ground truth):
public void updateConnectionLinesBetweenDimensionGroups(){
  connectionBandIDCounter=0;
  if (centerRowLayout != null) {
    for (    ElementLayout elementLayout : centerRowLayout.getElements()) {
      if (elementLayout.getRenderer() instanceof DimensionGroupSpacingRenderer) {
        ((DimensionGroupSpacingRenderer)elementLayout.getRenderer()).init();
      }
    }
  }
}
Program: 58019
Project: 58019
Buggy source:
public void switchToOverviewModeRight(){
  isRightDetailShown=false;
}

Fixed version (ground truth):
public void switchToOverviewModeRight(){
  isRightDetailShown=false;
  initLeftLayout();
  initCenterLayout();
  initRightLayout();
}
Program: 58020
Project: 58020
Buggy source:
public void switchToOverviewModeLeft(){
  isLeftDetailShown=false;
}

Fixed version (ground truth):
public void switchToOverviewModeLeft(){
  isLeftDetailShown=false;
  initLeftLayout();
  initCenterLayout();
  initRightLayout();
}
Program: 58022
Project: 58022
Buggy source:
@Override public void render(GL2 gl){
  ISet set=brick.getSet();
  ContentVirtualArray contentVA=brick.getContentVA();
  if (set == null || contentVA == null)   return;
  ContentVirtualArray setContentVA=set.getContentData(Set.CONTENT).getContentVA();
  if (setContentVA == null)   return;
  int totalNumElements=setContentVA.size();
  int currentNumElements=contentVA.size();
  float fuelWidth=(float)x / totalNumElements * currentNumElements;
  gl.glPushName(brick.getPickingManager().getPickingID(brick.getID(),EPickingType.BRICK,brick.getID()));
  gl.glBegin(GL2.GL_QUADS);
  if (selectionManager.checkStatus(SelectionType.SELECTION,brick.getGroup().getID()))   gl.glColor3f(1,0,0);
 else   gl.glColor3f(0.3f,0.3f,0.3f);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glColor3f(0.1f,0.1f,0.1f);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glColor3f(0,0,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(fuelWidth,0,0);
  gl.glColor3f(1,1f,1);
  gl.glVertex3f(fuelWidth,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  gl.glPopName();
}

Fixed version (ground truth):
@Override public void render(GL2 gl){
  ISet set=brick.getSet();
  ContentVirtualArray contentVA=brick.getContentVA();
  if (set == null || contentVA == null)   return;
  ContentVirtualArray setContentVA=set.getContentData(Set.CONTENT).getContentVA();
  if (setContentVA == null)   return;
  int totalNumElements=setContentVA.size();
  int currentNumElements=contentVA.size();
  float fuelWidth=(float)x / totalNumElements * currentNumElements;
  gl.glPushName(brick.getPickingManager().getPickingID(brick.getID(),EPickingType.BRICK,brick.getID()));
  gl.glBegin(GL2.GL_QUADS);
  if (selectionManager.checkStatus(SelectionType.SELECTION,brick.getGroup().getID()))   gl.glColor4fv(SelectionType.SELECTION.getColor(),0);
 else   gl.glColor3f(0.3f,0.3f,0.3f);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glColor3f(0.1f,0.1f,0.1f);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glColor3f(0,0,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(fuelWidth,0,0);
  gl.glColor3f(1,1f,1);
  gl.glVertex3f(fuelWidth,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  gl.glPopName();
}
Program: 58023
Project: 58023
Buggy source:
@Override public synchronized void render(GL2 gl){
  if (neighborSetID == -1 || similarities == null)   return;
  float yOffset=0;
  for (  GLBrick brick : neighborBrickOrder) {
    int foreignGroupID=brick.getGroup().getGroupID();
    float similarity=similarities[foreignGroupID];
    float height=similarity * y;
    gl.glBegin(GL2.GL_POLYGON);
    gl.glColor3f(0,0,0);
    gl.glVertex3f(0,yOffset,0);
    gl.glVertex3f(x,yOffset,0);
    if (brick.getContentGroupSelectionManager().checkStatus(SelectionType.SELECTION,brick.getGroup().getID()))     gl.glColor3f(1,0,0);
 else     gl.glColor3f(1,1,1);
    gl.glVertex3f(x,yOffset + height,0);
    gl.glVertex3f(0,yOffset + height,0);
    gl.glEnd();
    yOffset+=height;
    if (yOffset > y + 0.001f)     GLHelperFunctions.drawSmallPointAt(gl,x,yOffset,0);
  }
}

Fixed version (ground truth):
@Override public synchronized void render(GL2 gl){
  if (neighborSetID == -1 || similarities == null)   return;
  float yOffset=0;
  for (  GLBrick brick : neighborBrickOrder) {
    int foreignGroupID=brick.getGroup().getGroupID();
    float similarity=similarities[foreignGroupID];
    float height=similarity * y;
    gl.glBegin(GL2.GL_POLYGON);
    gl.glColor3f(0,0,0);
    gl.glVertex3f(0,yOffset,0);
    gl.glVertex3f(x,yOffset,0);
    if (brick.getContentGroupSelectionManager().checkStatus(SelectionType.SELECTION,brick.getGroup().getID()))     gl.glColor4fv(SelectionType.SELECTION.getColor(),0);
 else     gl.glColor3f(1,1,1);
    gl.glVertex3f(x,yOffset + height,0);
    gl.glVertex3f(0,yOffset + height,0);
    gl.glEnd();
    yOffset+=height;
    if (yOffset > y + 0.001f)     GLHelperFunctions.drawSmallPointAt(gl,x,yOffset,0);
  }
}
Program: 58024
Project: 58024
Buggy source:
public int getDetailBrickWidthPixels(){
  return 200;
}

Fixed version (ground truth):
public int getDetailBrickWidthPixels(){
  DimensionGroupManager dimensionGroupManager=visBricks.getDimensionGroupManager();
  ArrayList<DimensionGroup> dimensionGroups=dimensionGroupManager.getDimensionGroups();
  int dimensionGroupIndex=dimensionGroups.indexOf(this);
  int otherDimensionGroupColumnWidth=0;
  if (isLeftmost()) {
    DimensionGroup dimensionGroupRight=dimensionGroups.get(dimensionGroupIndex + 1);
    otherDimensionGroupColumnWidth+=dimensionGroupRight.getGroupColumnWidthPixels();
  }
  if (isRightmost()) {
    DimensionGroup dimensionGroupLeftt=dimensionGroups.get(dimensionGroupIndex - 1);
    otherDimensionGroupColumnWidth+=dimensionGroupLeftt.getGroupColumnWidthPixels();
  }
  int detailAreaWidth=parentGLCanvas.getWidth() - 2 * OVERVIEW_DETAIL_GAP_PIXEL - 100 - getGroupColumnWidthPixels() - otherDimensionGroupColumnWidth;
  int detailGapWidth=(int)(DETAIL_GAP_PORTION * detailAreaWidth);
  detailGapWidth=(detailGapWidth < MIN_DETAIL_GAP_PIXEL) ? MIN_DETAIL_GAP_PIXEL : detailGapWidth;
  int detailWidth=(int)((detailAreaWidth - detailGapWidth) / 2.0f);
  return detailWidth;
}
Program: 58028
Project: 58028
Buggy source:
/** 
 * Sets the type of view that should be rendered in the brick. The view type is not set, if it is not valid for the current brick layout.
 * @param viewType
 */
public void setContainedView(EContainedViewType viewType){
  AContainedViewRenderer viewRenderer=containedViewRenderers.get(viewType);
  if (viewRenderer == null)   return;
  if (!brickLayout.isViewTypeValid(viewType))   return;
  currentRemoteView=views.get(viewType);
  brickLayout.setViewRenderer(viewRenderer);
  brickLayout.viewTypeChanged(viewType);
  int minHeightPixels=brickLayout.getMinHeightPixels();
  float minHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(minHeightPixels);
  if (isSizeFixed) {
    float currentHeight=wrappingLayout.getSizeScaledY();
    if (currentHeight < minHeight) {
      wrappingLayout.setAbsoluteSizeY(minHeight);
    }
  }
 else {
    wrappingLayout.setAbsoluteSizeY(minHeight);
  }
  templateRenderer.updateLayout();
  currentViewType=viewType;
}

Fixed version (ground truth):
/** 
 * Sets the type of view that should be rendered in the brick. The view type is not set, if it is not valid for the current brick layout.
 * @param viewType
 */
public void setContainedView(EContainedViewType viewType){
  AContainedViewRenderer viewRenderer=containedViewRenderers.get(viewType);
  if (viewRenderer == null)   return;
  if (!brickLayout.isViewTypeValid(viewType))   return;
  currentRemoteView=views.get(viewType);
  brickLayout.setViewRenderer(viewRenderer);
  brickLayout.viewTypeChanged(viewType);
  int minHeightPixels=brickLayout.getMinHeightPixels();
  int minWidthPixels=brickLayout.getMinWidthPixels();
  float minHeight=getParentGLCanvas().getPixelGLConverter().getGLHeightForPixelHeight(minHeightPixels);
  float minWidth=getParentGLCanvas().getPixelGLConverter().getGLWidthForPixelWidth(minWidthPixels);
  if (isSizeFixed) {
    float currentHeight=wrappingLayout.getSizeScaledY();
    float currentWidth=wrappingLayout.getSizeScaledX();
    if (currentHeight < minHeight) {
      wrappingLayout.setAbsoluteSizeY(minHeight);
    }
    if (currentWidth < minWidth) {
      wrappingLayout.setAbsoluteSizeX(minWidth);
    }
  }
 else {
    wrappingLayout.setAbsoluteSizeY(minHeight);
    wrappingLayout.setAbsoluteSizeX(minWidth);
  }
  templateRenderer.updateLayout();
  visBricks.updateLayout();
  visBricks.updateConnectionLinesBetweenDimensionGroups();
  currentViewType=viewType;
}
Program: 58029
Project: 58029
Buggy source:
@Override public int getMinWidthPixels(){
  return 2 * SPACING_PIXELS + viewRenderer.getMinWidthPixels();
}

Fixed version (ground truth):
@Override public int getMinWidthPixels(){
  return pixelGLConverter.getPixelWidthForGLWidth(dimensionGroup.getMinWidth());
}
Program: 58030
Project: 58030
Buggy source:
@Override public int getMinWidthPixels(){
  return pixelGLConverter.getPixelWidthForGLWidth(brick.getWrappingLayout().getSizeScaledX());
}

Fixed version (ground truth):
@Override public int getMinWidthPixels(){
  return pixelGLConverter.getPixelWidthForGLWidth(dimensionGroup.getMinWidth());
}
Program: 58031
Project: 58031
Buggy source:
@Override public int getMinWidthPixels(){
  return 2 * SPACING_PIXELS + viewRenderer.getMinWidthPixels();
}

Fixed version (ground truth):
@Override public int getMinWidthPixels(){
  return pixelGLConverter.getPixelWidthForGLWidth(dimensionGroup.getMinWidth());
}
Program: 58034
Project: 58034
Buggy source:
public SubGroupMatch(GLBrick glBrick){
  this.glBrick=glBrick;
  connectionID=GeneralManager.get().getIDCreator().createID(EManagedObjectType.BRICK_CONNECTIONS);
}

Fixed version (ground truth):
public SubGroupMatch(int connectionBandID,GLBrick glBrick){
  this.glBrick=glBrick;
  this.connectionBandID=connectionBandID;
}
Program: 58035
Project: 58035
Buggy source:
public int getConnectionBandID(){
  return connectionID;
}

Fixed version (ground truth):
public int getConnectionBandID(){
  return connectionBandID;
}
Program: 58036
Project: 58036
Buggy source:
/** 
 * resize of a brick 
 */
private void handleBrickResize(GL2 gl){
  if (!isBrickResizeActive)   return;
  isSizeFixed=true;
  brickLayout.setLockResizing(true);
  if (glMouseListener.wasMouseReleased()) {
    isBrickResizeActive=false;
    previousXCoordinate=Float.NaN;
    return;
  }
  Point currentPoint=glMouseListener.getPickedPoint();
  float[] pointCordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,currentPoint.x,currentPoint.y);
  if (Float.isNaN(previousXCoordinate)) {
    previousXCoordinate=pointCordinates[0];
    return;
  }
  float changeX=pointCordinates[0] - previousXCoordinate;
  float width=wrappingLayout.getSizeScaledX();
  float changePercentage=changeX / width;
  float newWidth=width + changeX;
  if (newWidth < dimensionGroup.getMinWidth())   return;
  previousXCoordinate=pointCordinates[0];
  wrappingLayout.setAbsoluteSizeX(newWidth);
  float height=wrappingLayout.getSizeScaledY();
  wrappingLayout.setAbsoluteSizeY(height * (1 + changePercentage));
  visBricks.setLastResizeDirectionWasToLeft(false);
  visBricks.updateLayout();
  visBricks.updateConnectionLinesBetweenDimensionGroups();
}

Fixed version (ground truth):
/** 
 * resize of a brick 
 */
private void handleBrickResize(GL2 gl){
  if (!isBrickResizeActive)   return;
  isSizeFixed=true;
  brickLayout.setLockResizing(true);
  if (glMouseListener.wasMouseReleased()) {
    isBrickResizeActive=false;
    previousXCoordinate=Float.NaN;
    return;
  }
  Point currentPoint=glMouseListener.getPickedPoint();
  float[] pointCordinates=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,currentPoint.x,currentPoint.y);
  if (Float.isNaN(previousXCoordinate)) {
    previousXCoordinate=pointCordinates[0];
    return;
  }
  float changeX=pointCordinates[0] - previousXCoordinate;
  float width=wrappingLayout.getSizeScaledX();
  float changePercentage=changeX / width;
  float newWidth=width + changeX;
  if (newWidth < dimensionGroup.getMinWidth() - 0.001f)   return;
  previousXCoordinate=pointCordinates[0];
  wrappingLayout.setAbsoluteSizeX(newWidth);
  float height=wrappingLayout.getSizeScaledY();
  wrappingLayout.setAbsoluteSizeY(height * (1 + changePercentage));
  visBricks.setLastResizeDirectionWasToLeft(false);
  visBricks.updateLayout();
  visBricks.updateConnectionLinesBetweenDimensionGroups();
}
Program: 58038
Project: 58038
Buggy source:
@Override void calculateScales(float totalWidth,float totalHeight){
  super.calculateScales(totalWidth,totalHeight);
  float availableWidth=getSizeScaledX();
  float availableHeight=getSizeScaledY();
  if (isXDynamic)   availableWidth=totalWidth;
  if (isYDynamic)   availableHeight=totalHeight;
  float widestElement=0;
  for (  ElementLayout element : elements) {
    float tempWidth=element.getUnscalableElementWidth();
    if (tempWidth > widestElement)     widestElement=tempWidth;
    float unscalabelElementHeight=element.getUnscalableElementHeight();
    availableHeight-=unscalabelElementHeight;
  }
  availableWidth-=widestElement;
  if (availableHeight < -0.0001) {
    if (managingClassID != -1 && layoutID != -1) {
      LayoutSizeCollisionEvent event=new LayoutSizeCollisionEvent();
      event.setToBigBy(Math.abs(availableHeight));
      event.setIDs(managingClassID,layoutID);
      GeneralManager.get().getEventPublisher().triggerEvent(event);
    }
  }
  calculateSubElementScales(availableWidth,availableHeight);
}

Fixed version (ground truth):
@Override void calculateScales(float totalWidth,float totalHeight){
  super.calculateScales(totalWidth,totalHeight);
  float availableWidth=getSizeScaledX();
  float availableHeight=getSizeScaledY();
  if (isXDynamic)   availableWidth=totalWidth;
  if (isYDynamic)   availableHeight=totalHeight;
  float widestElement=0;
  for (  ElementLayout element : elements) {
    float tempWidth=element.getUnscalableElementWidth();
    if (tempWidth > widestElement)     widestElement=tempWidth;
    float unscalabelElementHeight=element.getUnscalableElementHeight();
    availableHeight-=unscalabelElementHeight;
  }
  if (availableHeight < -0.0001) {
    if (managingClassID != -1 && layoutID != -1) {
      LayoutSizeCollisionEvent event=new LayoutSizeCollisionEvent();
      event.setToBigBy(Math.abs(availableHeight));
      event.setIDs(managingClassID,layoutID);
      GeneralManager.get().getEventPublisher().triggerEvent(event);
    }
  }
  calculateSubElementScales(availableWidth,availableHeight);
}
Program: 58039
Project: 58039
Buggy source:
private void initLayouts(){
  dimensionGroupManager.getDimensionGroupSpacers().clear();
  initCenterLayout();
  leftColumnLayout=new Column("String_Node_Str");
  leftLayout=new LayoutTemplate();
  ViewFrustum archFrustum=new ViewFrustum(viewFrustum.getProjectionMode(),0,archSideThickness,0,archBottomY,0,1);
  leftLayoutManager=new LayoutManager(archFrustum);
  initSideLayout(leftColumnLayout,leftLayout,leftLayoutManager,0,dimensionGroupManager.getCenterGroupStartIndex());
  rightColumnLayout=new Column("String_Node_Str");
  rightLayout=new LayoutTemplate();
  rightLayoutManager=new LayoutManager(archFrustum);
  initSideLayout(rightColumnLayout,rightLayout,rightLayoutManager,dimensionGroupManager.getRightGroupStartIndex(),dimensionGroupManager.getDimensionGroups().size());
  updateConnectionLinesBetweenDimensionGroups();
}

Fixed version (ground truth):
private void initLayouts(){
  dimensionGroupManager.getDimensionGroupSpacers().clear();
  initCenterLayout();
  ViewFrustum leftArchFrustum=new ViewFrustum(viewFrustum.getProjectionMode(),0,archSideThickness,0,archBottomY,0,1);
  leftLayoutManager=new LayoutManager(leftArchFrustum);
  leftColumnLayout=new Column("String_Node_Str");
  leftLayoutTemplate=new LayoutTemplate();
  initSideLayout(leftColumnLayout,leftLayoutTemplate,leftLayoutManager,0,dimensionGroupManager.getCenterGroupStartIndex());
  ViewFrustum rightArchFrustum=new ViewFrustum(viewFrustum.getProjectionMode(),0,archSideThickness,0,archBottomY,0,1);
  rightColumnLayout=new Column("String_Node_Str");
  rightLayout=new LayoutTemplate();
  rightLayoutManager=new LayoutManager(rightArchFrustum);
  initSideLayout(rightColumnLayout,rightLayout,rightLayoutManager,dimensionGroupManager.getRightGroupStartIndex(),dimensionGroupManager.getDimensionGroups().size());
  updateConnectionLinesBetweenDimensionGroups();
}
Program: 58041
Project: 58041
Buggy source:
@Override public void handleDrop(GL2 gl,java.util.Set<IDraggable> draggables,float mouseCoordinateX,float mouseCoordinateY,DragAndDropController dragAndDropController){
  glVisBricks.clearDimensionGroupSpacerHighlight();
  for (  IDraggable draggable : draggables) {
    if (draggable == this)     break;
    glVisBricks.moveGroupDimension(this,(DimensionGroup)draggable,leftDimGroup);
  }
  draggables.clear();
}

Fixed version (ground truth):
@Override public void handleDrop(GL2 gl,java.util.Set<IDraggable> draggables,float mouseCoordinateX,float mouseCoordinateY,DragAndDropController dragAndDropController){
  glVisBricks.clearDimensionGroupSpacerHighlight();
  for (  IDraggable draggable : draggables) {
    if (draggable == this)     break;
    glVisBricks.moveDimensionGroup(this,(DimensionGroup)draggable,leftDimGroup);
  }
  draggables.clear();
}
Program: 58042
Project: 58042
Buggy source:
private void renderBackground(GL2 gl){
  int pickingID=glVisBricks.getPickingManager().getPickingID(glVisBricks.getID(),EPickingType.DIMENSION_GROUP_SPACER,ID);
  float avoidDragHandle=0;
  gl.glPushName(pickingID);
  gl.glColor4f(1,1,0,0.3f);
  gl.glBegin(GL2.GL_POLYGON);
  gl.glVertex2f(0,0);
  gl.glVertex2f(x - avoidDragHandle,0);
  gl.glVertex2f(x - avoidDragHandle,y);
  gl.glVertex2f(0,y);
  gl.glEnd();
  gl.glPopName();
}

Fixed version (ground truth):
private void renderBackground(GL2 gl){
  int pickingID=glVisBricks.getPickingManager().getPickingID(glVisBricks.getID(),EPickingType.DIMENSION_GROUP_SPACER,ID);
  float avoidDragHandle=0;
  gl.glPushName(pickingID);
  gl.glColor4f(1,1,0,0f);
  gl.glBegin(GL2.GL_POLYGON);
  gl.glVertex2f(0,0);
  gl.glVertex2f(x - avoidDragHandle,0);
  gl.glVertex2f(x - avoidDragHandle,y);
  gl.glVertex2f(0,y);
  gl.glEnd();
  gl.glPopName();
}
Program: 58043
Project: 58043
Buggy source:
public void calculateContentSpacing(int contentElements,int storageElements,float x,float y,float minSelectedFieldHeight){
  fieldWidth=x / storageElements;
  if (y / contentElements > minSelectedFieldHeight || heatMap.getZoomedElements().size() == 0) {
    spacingCalculator=new NormalSpacingCalculator(heatMap,y,contentElements);
    useFishEye=false;
  }
 else {
    useFishEye=true;
    spacingCalculator=new FishEyeSpacingCalculator(heatMap,y,contentElements,minSelectedFieldHeight);
  }
  spacingCalculator.calculateFieldHeights();
}

Fixed version (ground truth):
public void calculateContentSpacing(int contentElements,int storageElements,float x,float y,float minSelectedFieldHeight){
  fieldWidth=x / storageElements;
  spacingCalculator=new NormalSpacingCalculator(heatMap,y,contentElements);
  useFishEye=false;
  spacingCalculator.calculateFieldHeights();
}
Program: 58044
Project: 58044
Buggy source:
private void renderSelectedPolylines(GL2 gl,SelectionType selectionType){
  int nrVisibleLines=contentSelectionManager.getNumberOfElements(selectionType);
  Iterable<Integer> lines=contentSelectionManager.getElements(selectionType);
  PolyLineState renderState=renderStyle.getPolyLineState(selectionType,nrVisibleLines / displayEveryNthPolyline);
  renderState.updateOcclusionPrev(nrVisibleLines);
  for (  Integer contentID : lines) {
    if (contentVA.contains(contentID))     renderSingleLine(gl,contentID,selectionType,renderState,true);
  }
}

Fixed version (ground truth):
private void renderSelectedPolylines(GL2 gl,SelectionType selectionType){
  int nrVisibleLines=contentSelectionManager.getNumberOfElements(selectionType);
  Set<Integer> lines=contentSelectionManager.getElements(selectionType);
  PolyLineState renderState=renderStyle.getPolyLineState(selectionType,nrVisibleLines / displayEveryNthPolyline);
  renderState.updateOcclusionPrev(nrVisibleLines);
  for (  Integer contentID : lines) {
    boolean renderAsSelection=true;
    if (lines.size() > 1)     renderAsSelection=false;
    if (contentVA.contains(contentID))     renderSingleLine(gl,contentID,selectionType,renderState,renderAsSelection);
  }
}
Program: 58045
Project: 58045
Buggy source:
public void renderStraightBand(GL2 gl,float[] leftTopPos,float[] leftBottomPos,float[] rightTopPos,float[] rightBottomPos,boolean highlight,float xOffset,int bandID,boolean bandDetailAdaption,float[] color,float opacity){
  if (leftTopPos == null || leftBottomPos == null || rightTopPos == null || rightBottomPos == null)   return;
  gl.glLineWidth(1);
  if (highlight)   gl.glColor4f(color[0],color[1],color[2],1);
 else   gl.glColor4f(color[0],color[1],color[2],opacity * 2);
  gl.glBegin(GL2.GL_LINES);
  gl.glVertex3f(leftTopPos[0],leftTopPos[1],0);
  gl.glVertex3f(rightTopPos[0],rightTopPos[1],0);
  gl.glEnd();
  gl.glBegin(GL2.GL_LINES);
  gl.glVertex3f(rightBottomPos[0],rightBottomPos[1],0);
  gl.glVertex3f(leftBottomPos[0],leftBottomPos[1],0);
  gl.glEnd();
  if (highlight)   gl.glColor4f(color[0],color[1],color[2],0.8f);
 else   gl.glColor4f(color[0],color[1],color[2],opacity);
  gl.glBegin(GL2.GL_POLYGON);
  gl.glVertex3f(leftTopPos[0],leftTopPos[1],0);
  gl.glVertex3f(rightTopPos[0],rightTopPos[1],0);
  gl.glVertex3f(rightBottomPos[0],rightBottomPos[1],0);
  gl.glVertex3f(leftBottomPos[0],leftBottomPos[1],0);
  gl.glEnd();
}

Fixed version (ground truth):
public void renderStraightBand(GL2 gl,float[] leftTopPos,float[] leftBottomPos,float[] rightTopPos,float[] rightBottomPos,boolean highlight,float xOffset,int bandID,boolean bandDetailAdaption,float[] color,float opacity){
  if (leftTopPos == null || leftBottomPos == null || rightTopPos == null || rightBottomPos == null)   return;
  gl.glLineWidth(1);
  if (highlight)   gl.glColor4f(color[0],color[1],color[2],0.8f);
 else   gl.glColor4f(color[0],color[1],color[2],opacity * 2);
  gl.glBegin(GL2.GL_LINES);
  gl.glVertex3f(leftTopPos[0],leftTopPos[1],0);
  gl.glVertex3f(rightTopPos[0],rightTopPos[1],0);
  gl.glEnd();
  gl.glBegin(GL2.GL_LINES);
  gl.glVertex3f(rightBottomPos[0],rightBottomPos[1],0);
  gl.glVertex3f(leftBottomPos[0],leftBottomPos[1],0);
  gl.glEnd();
  if (highlight)   gl.glColor4f(color[0],color[1],color[2],0.5f);
 else   gl.glColor4f(color[0],color[1],color[2],opacity);
  gl.glBegin(GL2.GL_POLYGON);
  gl.glVertex3f(leftTopPos[0],leftTopPos[1],0);
  gl.glVertex3f(rightTopPos[0],rightTopPos[1],0);
  gl.glVertex3f(rightBottomPos[0],rightBottomPos[1],0);
  gl.glVertex3f(leftBottomPos[0],leftBottomPos[1],0);
  gl.glEnd();
}
Program: 58047
Project: 58047
Buggy source:
@Override public void render(GL2 gl){
  gl.glColor3f(1,1,1);
  gl.glBegin(GL2.GL_QUADS);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
}

Fixed version (ground truth):
@Override public void render(GL2 gl){
  gl.glPushName(view.getPickingManager().getPickingID(view.getID(),EPickingType.BRICK,view.getID()));
  gl.glColor3f(1,1,1);
  gl.glBegin(GL2.GL_QUADS);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  gl.glPopName();
}
Program: 58048
Project: 58048
Buggy source:
/** 
 * Calls the displayRemote of the view to be rendered plus pushes the ID of the Brick.
 */
@Override public void render(GL2 gl){
  view.displayRemote(gl);
}

Fixed version (ground truth):
/** 
 * Calls the displayRemote of the view to be rendered plus pushes the ID of the Brick.
 */
@Override public void render(GL2 gl){
  gl.glPushName(brick.getPickingManager().getPickingID(brick.getID(),EPickingType.BRICK,brick.getID()));
  view.displayRemote(gl);
  gl.glPopName();
}
Program: 58049
Project: 58049
Buggy source:
private void renderBackground(GL2 gl){
  int pickingID=glVisBricks.getPickingManager().getPickingID(glVisBricks.getID(),EPickingType.DIMENSION_GROUP_SPACER,ID);
  gl.glPushName(pickingID);
  gl.glColor4f(1,1,1,1);
  gl.glBegin(GL2.GL_POLYGON);
  gl.glVertex2f(0,0);
  gl.glVertex2f(x,0);
  gl.glVertex2f(x,y);
  gl.glVertex2f(0,y);
  gl.glEnd();
  gl.glPopName();
}

Fixed version (ground truth):
private void renderBackground(GL2 gl){
}