nus-yam/ex-repair huggingface dataset:
Program: 57023
Project: 57023
Buggy source:
@ListenTo(sendToMe=true) private void onUpdatePreview(UpdatePathwayPreviewEvent event){
  if (wizard == null) {
    initIntermediateWizard();
    wizard=factory.createForPathway(this,stratomex);
    stratomex.registerEventListener(wizard);
  }
  wizard.onUpdate(event);
}

Fixed version (ground truth):
@ListenTo(sendToMe=true) private void onUpdatePreview(UpdatePathwayPreviewEvent event){
  if (wizard == null) {
    initIntermediateWizard();
    wizard=factory.createForPathway(this,stratomex);
    stratomex.registerEventListener(wizard);
    wizard.prepare();
  }
  wizard.onUpdate(event);
}
Program: 57024
Project: 57024
Buggy source:
@ListenTo(sendToMe=true) private void onUpdateNumerical(UpdateNumericalPreviewEvent event){
  if (wizard == null) {
    initIntermediateWizard();
    wizard=factory.createForOther(this,stratomex);
    stratomex.registerEventListener(wizard);
  }
  wizard.onUpdate(event);
}

Fixed version (ground truth):
@ListenTo(sendToMe=true) private void onUpdateNumerical(UpdateNumericalPreviewEvent event){
  if (wizard == null) {
    initIntermediateWizard();
    wizard=factory.createForOther(this,stratomex);
    stratomex.registerEventListener(wizard);
    wizard.prepare();
  }
  wizard.onUpdate(event);
}
Program: 57025
Project: 57025
Buggy source:
@Override public void on(IState target){
  stateMachine.getCurrent().onLeave();
  stateMachine.move(target);
  target.onEnter();
  Collection<ITransition> transitions=stateMachine.getTransitions(target);
  if (transitions.size() == 1) {
    transitions.iterator().next().apply(this);
    return;
  }
  if (target instanceof ISelectStratificationState)   adapter.selectStratification((ISelectStratificationState)target,((ISelectStratificationState)target).isAutoSelect());
 else   if (target instanceof ISelectGroupState)   adapter.selectGroup((ISelectGroupState)target);
}

Fixed version (ground truth):
@Override public void on(IState target){
  stateMachine.getCurrent().onLeave();
  stateMachine.move(target);
  target.onEnter();
  Collection<ITransition> transitions=stateMachine.getTransitions(target);
  if (transitions.size() == 1) {
    transitions.iterator().next().apply(this);
    return;
  }
  checkSelect();
}
Program: 57026
Project: 57026
Buggy source:
private void createLine(Composite parent,String label,String value){
  Label l=new Label(parent,SWT.NO_BACKGROUND);
  l.setText(label + "String_Node_Str");
  l.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false));
  try {
    final URL url=new URL(value);
    Link v=new Link(parent,SWT.NO_BACKGROUND);
    value=url.toExternalForm();
    if (value.length() > 20)     value=value.substring(0,20) + "String_Node_Str";
    v.setText("String_Node_Str" + value + "String_Node_Str");
    v.setToolTipText(url.toExternalForm());
    v.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,true,false));
    v.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        BrowserUtils.openURL(url.toExternalForm());
      }
    }
);
  }
 catch (  MalformedURLException e) {
    Label v=new Label(parent,SWT.NO_BACKGROUND);
    v.setText(value);
    v.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,true,false));
  }
}

Fixed version (ground truth):
private void createLine(Composite parent,String label,String value){
  if (label == null || label.trim().isEmpty() || value == null || value.trim().isEmpty())   return;
  Label l=new Label(parent,SWT.NO_BACKGROUND);
  l.setText(label + "String_Node_Str");
  l.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false));
  try {
    final URL url=new URL(value);
    Link v=new Link(parent,SWT.NO_BACKGROUND);
    value=url.toExternalForm();
    if (value.length() > 20)     value=value.substring(0,20) + "String_Node_Str";
    v.setText("String_Node_Str" + value + "String_Node_Str");
    v.setToolTipText(url.toExternalForm());
    v.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,true,false));
    v.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        BrowserUtils.openURL(url.toExternalForm());
      }
    }
);
  }
 catch (  MalformedURLException e) {
    Label v=new Label(parent,SWT.NO_BACKGROUND);
    v.setText(value);
    v.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,true,false));
  }
}
Program: 57027
Project: 57027
Buggy source:
private boolean createProjectInfos(){
  ProjectMetaData metaData=GeneralManager.get().getMetaData();
  if (metaData.keys().isEmpty())   return false;
  Group g=new Group(parentComposite,SWT.SHADOW_ETCHED_IN | SWT.H_SCROLL | SWT.V_SCROLL);
  g.setText("String_Node_Str");
  g.setLayout(new GridLayout(2,false));
  createLine(g,"String_Node_Str",metaData.getName());
  createLine(g,"String_Node_Str",DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT,Locale.ENGLISH).format(metaData.getCreationDate()));
  for (  String key : metaData.keys()) {
    createLine(g,key,metaData.get(key));
  }
  return true;
}

Fixed version (ground truth):
private boolean createProjectInfos(){
  ProjectMetaData metaData=GeneralManager.get().getMetaData();
  if (metaData.keys().isEmpty())   return false;
  Group g=new Group(parentComposite,SWT.SHADOW_ETCHED_IN | SWT.H_SCROLL | SWT.V_SCROLL);
  g.setText("String_Node_Str");
  g.setLayout(new GridLayout(2,false));
  if (metaData.getName() != null)   createLine(g,"String_Node_Str",metaData.getName());
  if (metaData.getCreationDate() != null)   createLine(g,"String_Node_Str",DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT,Locale.ENGLISH).format(metaData.getCreationDate()));
  for (  String key : metaData.keys()) {
    createLine(g,key,metaData.get(key));
  }
  return true;
}
Program: 57028
Project: 57028
Buggy source:
@Override public void display(GLAutoDrawable drawable){
  eventListeners.processEvents();
  if (!visible)   return;
  final int deltaTimeMs=local.getDeltaTimeMs();
  GL2 gl=drawable.getGL().getGL2();
  gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
  gl.glLoadIdentity();
  gl.glTranslatef(0.375f,0.375f,0);
  final GLGraphics g=new GLGraphics(gl,local,true,deltaTimeMs);
  g.clearError();
  float paddedWidth=getWidth();
  float paddedHeight=getHeight();
  if (dirtyLayout) {
    root.setBounds(0,0,paddedWidth,paddedHeight);
    root.relayout();
    dirtyLayout=false;
  }
  Point mousePos=pickingManager.getCurrentMousePos();
  if (mousePos != null) {
    root.getMouseLayer().setBounds(mousePos.x,mousePos.y,getWidth() - mousePos.x,getHeight() - mousePos.y);
    root.getMouseLayer().relayout();
  }
  pickingManager.doPicking(g.gl,new Runnable(){
    @Override public void run(){
      root.renderPick(g);
    }
  }
);
  g.checkError();
  root.layout(deltaTimeMs);
  root.render(g);
  g.checkError();
}

Fixed version (ground truth):
@Override public void display(GLAutoDrawable drawable){
  eventListeners.processEvents();
  if (!visible)   return;
  final int deltaTimeMs=local.getDeltaTimeMs();
  GL2 gl=drawable.getGL().getGL2();
  gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
  gl.glBindTexture(GL.GL_TEXTURE_2D,GL.GL_NONE);
  gl.glLoadIdentity();
  gl.glTranslatef(0.375f,0.375f,0);
  final GLGraphics g=new GLGraphics(gl,local,true,deltaTimeMs);
  g.clearError();
  float paddedWidth=getWidth();
  float paddedHeight=getHeight();
  if (dirtyLayout) {
    root.setBounds(0,0,paddedWidth,paddedHeight);
    root.relayout();
    dirtyLayout=false;
  }
  Point mousePos=pickingManager.getCurrentMousePos();
  if (mousePos != null) {
    root.getMouseLayer().setBounds(mousePos.x,mousePos.y,getWidth() - mousePos.x,getHeight() - mousePos.y);
    root.getMouseLayer().relayout();
  }
  pickingManager.doPicking(g.gl,new Runnable(){
    @Override public void run(){
      root.renderPick(g);
    }
  }
);
  g.checkError();
  root.layout(deltaTimeMs);
  root.render(g);
  g.checkError();
}
Program: 57029
Project: 57029
Buggy source:
public CaleydoTextRenderer(int size){
  super(new Font("String_Node_Str",Font.PLAIN,size),true,true,new DefaultRenderDelegate(),true);
  referenceBounds=super.getBounds(REFERENCE_TEXT);
}

Fixed version (ground truth):
public CaleydoTextRenderer(int size){
  super(new Font("String_Node_Str",Font.PLAIN,size),true,true,new DefaultRenderDelegate(),false);
  referenceBounds=super.getBounds(REFERENCE_TEXT);
}
Program: 57030
Project: 57030
Buggy source:
@ListenTo(sendToMe=true) private void onUpdatePreview(UpdatePathwayPreviewEvent event){
  if (wizard != null)   wizard.onUpdate(event);
 else {
    BrickColumn selected=stratomex.getBrickColumnManager().getActiveBrickColumn();
    if (selected == null) {
    }
 else {
      createWizard(selected.getTablePerspective(),false);
      replacePathwayTemplate(selected.getTablePerspective().getRecordPerspective(),event.getPathway());
    }
  }
}

Fixed version (ground truth):
@ListenTo(sendToMe=true) private void onUpdatePreview(UpdatePathwayPreviewEvent event){
  if (wizard != null)   wizard.onUpdate(event);
 else {
    BrickColumn selected=stratomex.getBrickColumnManager().getActiveBrickColumn();
    if (selected == null) {
    }
 else {
      replacePathwayTemplate(selected.getTablePerspective().getRecordPerspective(),event.getPathway());
    }
  }
}
Program: 57031
Project: 57031
Buggy source:
@ListenTo(sendToMe=true) private void onUpdateNumerical(UpdateNumericalPreviewEvent event){
  if (wizard != null)   wizard.onUpdate(event);
 else {
    BrickColumn selected=stratomex.getBrickColumnManager().getActiveBrickColumn();
    if (selected == null) {
    }
 else {
      createWizard(selected.getTablePerspective(),false);
      replaceClinicalTemplate(selected.getTablePerspective().getRecordPerspective(),event.getTablePerspective());
    }
  }
}

Fixed version (ground truth):
@ListenTo(sendToMe=true) private void onUpdateNumerical(UpdateNumericalPreviewEvent event){
  if (wizard != null)   wizard.onUpdate(event);
 else {
    BrickColumn selected=stratomex.getBrickColumnManager().getActiveBrickColumn();
    if (selected == null) {
    }
 else {
      replaceClinicalTemplate(selected.getTablePerspective().getRecordPerspective(),event.getTablePerspective());
    }
  }
}
Program: 57032
Project: 57032
Buggy source:
public LabelRenderer(AGLView view,ILabelProvider labelProvider){
  this.view=view;
  this.labelProvider=labelProvider;
  this.isPickable=false;
}

Fixed version (ground truth):
public LabelRenderer(AGLView view,ITextRenderer textRenderer,ILabelProvider labelProvider){
  this.view=view;
  this.textRenderer=textRenderer;
  this.labelProvider=labelProvider;
  this.isPickable=false;
}
Program: 57033
Project: 57033
Buggy source:
@Override protected void renderContent(GL2 gl){
  if (labelProvider != null)   label=labelProvider.getLabel();
  if (isPickable) {
    pushNames(gl);
    gl.glColor4f(1,1,1,0);
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(0,0,0.05f);
    gl.glVertex3f(x,0,0.05f);
    gl.glVertex3f(x,y,0.05f);
    gl.glVertex3f(0,y,0.05f);
    gl.glEnd();
    popNames(gl);
  }
  CaleydoTextRenderer textRenderer=view.getTextRenderer();
  float ySpacing=view.getPixelGLConverter().getGLHeightForPixelHeight(1);
  textRenderer.setColor(0,0,0,1);
  float textWidth=textRenderer.getRequiredTextWidthWithMax(label,y - 2 * ySpacing,x);
  float padding=0;
  if (usePaddingBottom)   padding=PADDING_BOTTOM;
switch (alignment) {
case CENTER:
    textRenderer.renderTextInBounds(gl,label,x / 2.0f - textWidth / 2.0f + ySpacing + padding,2 * ySpacing + padding,0.1f,x,y - 2 * ySpacing);
  break;
case RIGHT:
textRenderer.renderTextInBounds(gl,label,x - textWidth - 4 * ySpacing,ySpacing + padding,0.1f,x,y - 2 * ySpacing + padding);
break;
default :
textRenderer.renderTextInBounds(gl,label,0,ySpacing + padding,0.1f,x,y - 2 * ySpacing + padding);
}
}

Fixed version (ground truth):
@Override protected void renderContent(GL2 gl){
  if (labelProvider != null)   label=labelProvider.getLabel();
  if (isPickable) {
    pushNames(gl);
    gl.glColor4f(1,1,1,0);
    gl.glBegin(GL2.GL_POLYGON);
    gl.glVertex3f(0,0,0.05f);
    gl.glVertex3f(x,0,0.05f);
    gl.glVertex3f(x,y,0.05f);
    gl.glVertex3f(0,y,0.05f);
    gl.glEnd();
    popNames(gl);
  }
  float ySpacing=view.getPixelGLConverter().getGLHeightForPixelHeight(1);
  textRenderer.setColor(0,0,0,1);
  float textWidth=Math.min(textRenderer.getTextWidth(label,y - 2 * ySpacing),x);
  float padding=0;
  if (usePaddingBottom)   padding=PADDING_BOTTOM;
switch (alignment) {
case CENTER:
    textRenderer.renderTextInBounds(gl,label,x / 2.0f - textWidth / 2.0f + ySpacing + padding,2 * ySpacing + padding,0.1f,x,y - 2 * ySpacing);
  break;
case RIGHT:
textRenderer.renderTextInBounds(gl,label,x - textWidth - 4 * ySpacing,ySpacing + padding,0.1f,x,y - 2 * ySpacing + padding);
break;
default :
textRenderer.renderTextInBounds(gl,label,0,ySpacing + padding,0.1f,x,y - 2 * ySpacing + padding);
}
}
Program: 57034
Project: 57034
Buggy source:
public static LabelRenderer createLabel(ILabelProvider label,AGLView view){
  return new LabelRenderer(view,label);
}

Fixed version (ground truth):
public static LabelRenderer createLabel(ILabelProvider label,AGLView view){
  return new LabelRenderer(view,view.getTextRenderer(),label);
}
Program: 57035
Project: 57035
Buggy source:
private void upload(){
  GlyphVector gv=getGlyphVector();
  Rectangle2D origBBox=preNormalize(renderDelegate.getBounds(gv,getFontRenderContext()));
  Rectangle2D bbox=normalize(origBBox);
  Point origin=new Point((int)-bbox.getMinX(),(int)-bbox.getMinY());
  Rect rect=new Rect(0,0,(int)bbox.getWidth(),(int)bbox.getHeight(),new TextData(null,origin,origBBox,unicodeID));
  packer.add(rect);
  glyphRectForTextureMapping=rect;
  Graphics2D g=getGraphics2D();
  int strx=rect.x() + origin.x;
  int stry=rect.y() + origin.y;
  g.setComposite(AlphaComposite.Clear);
  g.fillRect(rect.x(),rect.y(),rect.w(),rect.h());
  g.setComposite(AlphaComposite.Src);
  renderDelegate.drawGlyphVector(g,gv,strx,stry);
  if (DRAW_BBOXES) {
    TextData data=(TextData)rect.getUserData();
    g.drawRect(strx - data.origOriginX(),stry - data.origOriginY(),(int)data.origRect().getWidth(),(int)data.origRect().getHeight());
    g.drawRect(strx - data.origin().x,stry - data.origin().y,rect.w(),rect.h());
  }
  getBackingStore().markDirty(rect.x(),rect.y(),rect.w(),rect.h());
  producer.register(this);
}

Fixed version (ground truth):
public void upload(){
  if (glyphRectForTextureMapping != null)   return;
  GlyphVector gv=getGlyphVector();
  Rectangle2D origBBox=preNormalize(renderDelegate.getBounds(gv,getFontRenderContext()));
  Rectangle2D bbox=normalize(origBBox);
  Point origin=new Point((int)-bbox.getMinX(),(int)-bbox.getMinY());
  Rect rect=new Rect(0,0,(int)bbox.getWidth(),(int)bbox.getHeight(),new TextData(null,origin,origBBox,unicodeID));
  packer.add(rect);
  glyphRectForTextureMapping=rect;
  Graphics2D g=getGraphics2D();
  int strx=rect.x() + origin.x;
  int stry=rect.y() + origin.y;
  g.setComposite(AlphaComposite.Clear);
  g.fillRect(rect.x(),rect.y(),rect.w(),rect.h());
  g.setComposite(AlphaComposite.Src);
  renderDelegate.drawGlyphVector(g,gv,strx,stry);
  if (DRAW_BBOXES) {
    TextData data=(TextData)rect.getUserData();
    g.drawRect(strx - data.origOriginX(),stry - data.origOriginY(),(int)data.origRect().getWidth(),(int)data.origRect().getHeight());
    g.drawRect(strx - data.origin().x,stry - data.origin().y,rect.w(),rect.h());
  }
  getBackingStore().markDirty(rect.x(),rect.y(),rect.w(),rect.h());
  producer.register(this);
}
Program: 57037
Project: 57037
Buggy source:
/** 
 * emzic: here the call to glBindBuffer crashes on certain graphicscard/driver combinations this is why the ugly try-catch block has been added, which falls back to the old textrenderer
 * @param ortho
 * @throws GLException
 */
private void endRendering(boolean ortho) throws GLException {
  flushGlyphPipeline();
  inBeginEndPair=false;
  GL2 gl=GLContext.getCurrentGL().getGL2();
  gl.glPopClientAttrib();
  if (getUseVertexArrays() && is15Available(gl)) {
    try {
      gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,0);
    }
 catch (    Exception e) {
      isExtensionAvailable_GL_VERSION_1_5=false;
    }
  }
  if (ortho) {
    getBackingStore().endOrthoRendering();
  }
 else {
    getBackingStore().end3DRendering();
  }
  if (++numRenderCycles >= 200) {
    numRenderCycles=0;
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    getBackingStore().markDirty(0,0,getBackingStore().getWidth(),getBackingStore().getHeight());
  }
}

Fixed version (ground truth):
/** 
 * emzic: here the call to glBindBuffer crashes on certain graphicscard/driver combinations this is why the ugly try-catch block has been added, which falls back to the old textrenderer
 * @param ortho
 * @throws GLException
 */
private void endRendering(boolean ortho) throws GLException {
  flushGlyphPipeline();
  inBeginEndPair=false;
  GL2 gl=GLContext.getCurrentGL().getGL2();
  gl.glPopClientAttrib();
  if (getUseVertexArrays() && is15Available(gl)) {
    try {
      gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,0);
    }
 catch (    Exception e) {
      isExtensionAvailable_GL_VERSION_1_5=false;
    }
  }
  if (ortho) {
    getBackingStore().endOrthoRendering();
  }
 else {
    getBackingStore().end3DRendering();
  }
}
Program: 57038
Project: 57038
Buggy source:
private void beginRendering(boolean ortho,int width,int height,boolean disableDepthTestForOrtho){
  GL2 gl=GLContext.getCurrentGL().getGL2();
  if (DEBUG && !debugged) {
    debug(gl);
  }
  inBeginEndPair=true;
  isOrthoMode=ortho;
  beginRenderingWidth=width;
  beginRenderingHeight=height;
  beginRenderingDepthTestDisabled=disableDepthTestForOrtho;
  if (ortho) {
    getBackingStore().beginOrthoRendering(width,height,disableDepthTestForOrtho);
  }
 else {
    getBackingStore().begin3DRendering();
  }
  gl.glPushClientAttrib((int)GL2.GL_ALL_CLIENT_ATTRIB_BITS);
  if (!haveMaxSize) {
    int[] sz=new int[1];
    gl.glGetIntegerv(GL2.GL_MAX_TEXTURE_SIZE,sz,0);
    packer.setMaxSize(sz[0],sz[0]);
    haveMaxSize=true;
  }
  if (needToResetColor && haveCachedColor) {
    if (cachedColor == null) {
      getBackingStore().setColor(cachedR,cachedG,cachedB,cachedA);
    }
 else {
      getBackingStore().setColor(cachedColor);
    }
    needToResetColor=false;
  }
  if (mipmap && !getBackingStore().isUsingAutoMipmapGeneration()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    mipmap=false;
  }
}

Fixed version (ground truth):
private void beginRendering(boolean ortho,int width,int height,boolean disableDepthTestForOrtho){
  GL2 gl=GLContext.getCurrentGL().getGL2();
  if (DEBUG && !debugged) {
    debug(gl);
  }
  inBeginEndPair=true;
  isOrthoMode=ortho;
  beginRenderingWidth=width;
  beginRenderingHeight=height;
  beginRenderingDepthTestDisabled=disableDepthTestForOrtho;
  if (ortho) {
    getBackingStore().beginOrthoRendering(width,height,disableDepthTestForOrtho);
  }
 else {
    getBackingStore().begin3DRendering();
  }
  gl.glPushClientAttrib((int)GL2.GL_ALL_CLIENT_ATTRIB_BITS);
  if (!haveMaxSize) {
    int[] sz=new int[1];
    gl.glGetIntegerv(GL2.GL_MAX_TEXTURE_SIZE,sz,0);
    packer.setMaxSize(sz[0],sz[0]);
    haveMaxSize=true;
    uploadBunchOfCharacter('!','~');
  }
  if (needToResetColor && haveCachedColor) {
    if (cachedColor == null) {
      getBackingStore().setColor(cachedR,cachedG,cachedB,cachedA);
    }
 else {
      getBackingStore().setColor(cachedColor);
    }
    needToResetColor=false;
  }
  if (mipmap && !getBackingStore().isUsingAutoMipmapGeneration()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    mipmap=false;
  }
}
Program: 57039
Project: 57039
Buggy source:
public Point2D getAbsolutPositionOfRelativeTablePerspectiveRendererCoordinates(Point2D coordinates){
  Point2D position=graphLayout.getNodePosition(this);
  float x=pixelGLConverter.getGLWidthForPixelWidth((int)position.getX());
  float y=pixelGLConverter.getGLHeightForPixelHeight((int)position.getY());
  float width=pixelGLConverter.getGLWidthForPixelWidth(getWidthPixels());
  float height=pixelGLConverter.getGLHeightForPixelHeight(getHeightPixels());
  float spacingX=pixelGLConverter.getGLWidthForPixelWidth(SPACING_PIXELS);
  float spacingY=pixelGLConverter.getGLHeightForPixelHeight(isUpsideDown ? (3 * SPACING_PIXELS + CAPTION_HEIGHT_PIXELS + LINE_SEPARATOR_HEIGHT_PIXELS) : (SPACING_PIXELS));
  return new Point2D.Float((float)coordinates.getX() + x + spacingX - width / 2.0f,(float)coordinates.getY() + y + spacingY - height / 2.0f);
}

Fixed version (ground truth):
@Override public Point2D getAbsolutPositionOfRelativeTablePerspectiveRendererCoordinates(Point2D coordinates){
  Point2D position=graphLayout.getNodePosition(this);
  float x=pixelGLConverter.getGLWidthForPixelWidth((int)position.getX());
  float y=pixelGLConverter.getGLHeightForPixelHeight((int)position.getY());
  float width=pixelGLConverter.getGLWidthForPixelWidth(getWidthPixels());
  float height=pixelGLConverter.getGLHeightForPixelHeight(getHeightPixels());
  float spacingX=pixelGLConverter.getGLWidthForPixelWidth(SPACING_PIXELS);
  float spacingY=pixelGLConverter.getGLHeightForPixelHeight(isUpsideDown ? (3 * SPACING_PIXELS + CAPTION_HEIGHT_PIXELS + LINE_SEPARATOR_HEIGHT_PIXELS) : (SPACING_PIXELS));
  return new Point2D.Float((float)coordinates.getX() + x + spacingX - width / 2.0f,(float)coordinates.getY() + y + spacingY - height / 2.0f);
}
Program: 57040
Project: 57040
Buggy source:
public float getSpacingY(IDVINode node){
  IDVINode topNode=null;
  IDVINode bottomNode=null;
  if (getPosition().getY() < node.getPosition().getY()) {
    topNode=this;
    bottomNode=node;
  }
 else {
    topNode=node;
    bottomNode=this;
  }
  return (float)((topNode.getPosition().getY() - topNode.getHeight() / 2.0f) - (bottomNode.getPosition().getY() + bottomNode.getHeight() / 2.0f));
}

Fixed version (ground truth):
@Override public float getSpacingY(IDVINode node){
  IDVINode topNode=null;
  IDVINode bottomNode=null;
  if (getPosition().getY() < node.getPosition().getY()) {
    topNode=this;
    bottomNode=node;
  }
 else {
    topNode=node;
    bottomNode=this;
  }
  return (float)((topNode.getPosition().getY() - topNode.getHeight() / 2.0f) - (bottomNode.getPosition().getY() + bottomNode.getHeight() / 2.0f));
}
Program: 57041
Project: 57041
Buggy source:
public float getSpacingX(IDVINode node){
  IDVINode leftNode=null;
  IDVINode rightNode=null;
  if (getPosition().getX() < node.getPosition().getX()) {
    leftNode=this;
    rightNode=node;
  }
 else {
    leftNode=node;
    rightNode=this;
  }
  return (float)((rightNode.getPosition().getX() - rightNode.getWidth() / 2.0f) - (leftNode.getPosition().getX() + leftNode.getWidth() / 2.0f));
}

Fixed version (ground truth):
@Override public float getSpacingX(IDVINode node){
  IDVINode leftNode=null;
  IDVINode rightNode=null;
  if (getPosition().getX() < node.getPosition().getX()) {
    leftNode=this;
    rightNode=node;
  }
 else {
    leftNode=node;
    rightNode=this;
  }
  return (float)((rightNode.getPosition().getX() - rightNode.getWidth() / 2.0f) - (leftNode.getPosition().getX() + leftNode.getWidth() / 2.0f));
}
Program: 57042
Project: 57042
Buggy source:
public void recalculateNodeSize(){
  heightPixels=4 * SPACING_PIXELS + CAPTION_HEIGHT_PIXELS + LINE_SEPARATOR_HEIGHT_PIXELS + Math.max(MIN_DATA_CONTAINER_HEIGHT_PIXELS,((getTablePerspectiveRenderer() == null) ? 0 : getTablePerspectiveRenderer().getMinHeightPixels()));
  widthPixels=2 * SPACING_PIXELS + Math.max(getMinTitleBarWidthPixels(),((getTablePerspectiveRenderer() == null) ? 0 : getTablePerspectiveRenderer().getMinWidthPixels()));
}

Fixed version (ground truth):
@Override public void recalculateNodeSize(){
  heightPixels=4 * SPACING_PIXELS + CAPTION_HEIGHT_PIXELS + LINE_SEPARATOR_HEIGHT_PIXELS + Math.max(MIN_DATA_CONTAINER_HEIGHT_PIXELS,((getTablePerspectiveRenderer() == null) ? 0 : getTablePerspectiveRenderer().getMinHeightPixels()));
  widthPixels=2 * SPACING_PIXELS + Math.max(getMinTitleBarWidthPixels(),((getTablePerspectiveRenderer() == null) ? 0 : getTablePerspectiveRenderer().getMinWidthPixels()));
}
Program: 57043
Project: 57043
Buggy source:
protected ElementLayout createDefaultCaptionLayout(int pickingID){
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  captionLayout.setRatioSizeX(1);
  captionLayout.setRenderer(new LabelRenderer(view,this,createNodePickingTypeList()));
  return captionLayout;
}

Fixed version (ground truth):
protected ElementLayout createDefaultCaptionLayout(int pickingID){
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  captionLayout.setRatioSizeX(1);
  captionLayout.setRenderer(new LabelRenderer(view,view.getTextRenderer(),this,createNodePickingTypeList()));
  return captionLayout;
}
Program: 57045
Project: 57045
Buggy source:
@Override public void apply(ALinearizableNode node){
  this.node=node;
  destroy();
  init();
  attributeRenderers.clear();
  Column baseColumn=new Column("String_Node_Str");
  Row baseRow=new Row("String_Node_Str");
  ColorRenderer colorRenderer=new ColorRenderer(new float[]{1,1,1,1});
  colorRenderer.setView(view);
  colorRenderer.setBorderColor(new float[]{0,0,0,1});
  colorRenderer.setDrawBorder(true);
  colorRenderer.addPickingID(EPickingType.LINEARIZABLE_NODE.name(),node.hashCode());
  baseColumn.addBackgroundRenderer(colorRenderer);
  ElementLayout labelLayout=new ElementLayout("String_Node_Str");
  LabelRenderer labelRenderer=new LabelRenderer(view,node);
  labelRenderer.setAlignment(LabelRenderer.LabelAlignment.CENTER);
  labelLayout.setRenderer(labelRenderer);
  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);
  for (  ALinearizableNode childNode : ((ComplexNode)node).getNodes()) {
    pathwayPathRenderer.setPreviewMode(childNode);
  }
}

Fixed version (ground truth):
@Override public void apply(ALinearizableNode node){
  this.node=node;
  destroy();
  init();
  attributeRenderers.clear();
  Column baseColumn=new Column("String_Node_Str");
  Row baseRow=new Row("String_Node_Str");
  ColorRenderer colorRenderer=new ColorRenderer(new float[]{1,1,1,1});
  colorRenderer.setView(view);
  colorRenderer.setBorderColor(new float[]{0,0,0,1});
  colorRenderer.setDrawBorder(true);
  colorRenderer.addPickingID(EPickingType.LINEARIZABLE_NODE.name(),node.hashCode());
  baseColumn.addBackgroundRenderer(colorRenderer);
  ElementLayout labelLayout=new ElementLayout("String_Node_Str");
  LabelRenderer labelRenderer=new LabelRenderer(view,view.getTextRenderer(),node);
  labelRenderer.setAlignment(LabelRenderer.LabelAlignment.CENTER);
  labelLayout.setRenderer(labelRenderer);
  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);
  for (  ALinearizableNode childNode : ((ComplexNode)node).getNodes()) {
    pathwayPathRenderer.setPreviewMode(childNode);
  }
}
Program: 57046
Project: 57046
Buggy source:
@Override public void init(GL2 gl){
  textRenderer=new CaleydoTextRenderer(24);
  baseDisplayListIndex=gl.glGenLists(1);
  layoutManager=new LayoutManager(viewFrustum,pixelGLConverter);
  layoutManager.setUseDisplayLists(true);
  setBrickLayoutTemplate(brickLayoutConfiguration);
  int rendererID=multiFormRenderer.getActiveRendererID();
  if (rendererID == -1) {
    multiFormRenderer.setActive(multiFormRenderer.getDefaultRendererID());
  }
  updateBrickSizeAccordingToRenderer(multiFormRenderer.getActiveRendererID());
  brickColumn.updateLayout();
  isInitialized=true;
}

Fixed version (ground truth):
@Override public void init(GL2 gl){
  baseDisplayListIndex=gl.glGenLists(1);
  layoutManager=new LayoutManager(viewFrustum,pixelGLConverter);
  layoutManager.setUseDisplayLists(true);
  setBrickLayoutTemplate(brickLayoutConfiguration);
  int rendererID=multiFormRenderer.getActiveRendererID();
  if (rendererID == -1) {
    multiFormRenderer.setActive(multiFormRenderer.getDefaultRendererID());
  }
  updateBrickSizeAccordingToRenderer(multiFormRenderer.getActiveRendererID());
  brickColumn.updateLayout();
  isInitialized=true;
}
Program: 57047
Project: 57047
Buggy source:
public GLBrick(IGLCanvas glCanvas,Composite parentComposite,ViewFrustum viewFrustum){
  super(glCanvas,parentComposite,viewFrustum,VIEW_TYPE,VIEW_NAME);
  contextMenuFactories=createContextMenuFactories();
}

Fixed version (ground truth):
public GLBrick(IGLCanvas glCanvas,Composite parentComposite,ViewFrustum viewFrustum){
  super(glCanvas,parentComposite,viewFrustum,VIEW_TYPE,VIEW_NAME);
  contextMenuFactories=createContextMenuFactories();
  textRenderer=new CaleydoTextRenderer(24);
}
Program: 57048
Project: 57048
Buggy source:
/** 
 * Create the elements which should be shown in the heading of cluster bricks.
 * @param layoutTemplate
 * @return Returns null if no header bar should be shown, else the elements for the layout
 */
protected ArrayList<ElementLayout> createHeaderBarElements(DefaultBrickLayoutTemplate layoutTemplate){
  ArrayList<ElementLayout> headerBarElements=new ArrayList<ElementLayout>();
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  List<Pair<String,Integer>> pickingIDs=new ArrayList<>();
  pickingIDs.add(new Pair<String,Integer>(EPickingType.BRICK.name(),layoutTemplate.getBrick().getID()));
  pickingIDs.add(new Pair<String,Integer>(EPickingType.BRICK_TITLE.name(),layoutTemplate.getBrick().getID()));
  LabelRenderer captionRenderer=new LabelRenderer(layoutTemplate.getDimensionGroup().getStratomexView(),layoutTemplate.getBrick(),pickingIDs);
  captionLayout.setRenderer(captionRenderer);
  headerBarElements.add(captionLayout);
  return headerBarElements;
}

Fixed version (ground truth):
/** 
 * Create the elements which should be shown in the heading of cluster bricks.
 * @param layoutTemplate
 * @return Returns null if no header bar should be shown, else the elements for the layout
 */
protected ArrayList<ElementLayout> createHeaderBarElements(DefaultBrickLayoutTemplate layoutTemplate){
  ArrayList<ElementLayout> headerBarElements=new ArrayList<ElementLayout>();
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  List<Pair<String,Integer>> pickingIDs=new ArrayList<>();
  pickingIDs.add(new Pair<String,Integer>(EPickingType.BRICK.name(),layoutTemplate.getBrick().getID()));
  pickingIDs.add(new Pair<String,Integer>(EPickingType.BRICK_TITLE.name(),layoutTemplate.getBrick().getID()));
  ITextRenderer textRenderer=layoutTemplate.getBrick().getTextRenderer();
  LabelRenderer captionRenderer=new LabelRenderer(layoutTemplate.getDimensionGroup().getStratomexView(),textRenderer,layoutTemplate.getBrick(),pickingIDs);
  captionLayout.setRenderer(captionRenderer);
  headerBarElements.add(captionLayout);
  return headerBarElements;
}
Program: 57049
Project: 57049
Buggy source:
private ElementLayout createCaptionLayout(ABrickLayoutConfiguration layoutTemplate,AGLView labelProvider,List<Pair<String,Integer>> pickingIDs,AGLView view){
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  captionLayout.setFrameColor(0,0,1,1);
  LabelRenderer captionRenderer=new LabelRenderer(view,layoutTemplate.getBrick(),pickingIDs);
  captionLayout.setRenderer(captionRenderer);
  return captionLayout;
}

Fixed version (ground truth):
private ElementLayout createCaptionLayout(ABrickLayoutConfiguration layoutTemplate,AGLView labelProvider,List<Pair<String,Integer>> pickingIDs,AGLView view){
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  captionLayout.setFrameColor(0,0,1,1);
  LabelRenderer captionRenderer=new LabelRenderer(view,layoutTemplate.getBrick().getTextRenderer(),layoutTemplate.getBrick(),pickingIDs);
  captionLayout.setRenderer(captionRenderer);
  return captionLayout;
}
Program: 57050
Project: 57050
Buggy source:
private ElementLayout createCaptionLayout(ABrickLayoutConfiguration layoutTemplate,AGLView labelProvider,List<Pair<String,Integer>> pickingIDs,AGLView view){
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  captionLayout.setFrameColor(0,0,1,1);
  LabelRenderer captionRenderer=new LabelRenderer(view,labelProvider,pickingIDs);
  captionLayout.setRenderer(captionRenderer);
  return captionLayout;
}

Fixed version (ground truth):
private ElementLayout createCaptionLayout(ABrickLayoutConfiguration layoutTemplate,AGLView labelProvider,List<Pair<String,Integer>> pickingIDs,AGLView view){
  ElementLayout captionLayout=new ElementLayout("String_Node_Str");
  captionLayout.setPixelSizeY(CAPTION_HEIGHT_PIXELS);
  captionLayout.setFrameColor(0,0,1,1);
  ITextRenderer textRenderer=layoutTemplate.getBrick().getTextRenderer();
  LabelRenderer captionRenderer=new LabelRenderer(view,textRenderer,labelProvider,pickingIDs);
  captionLayout.setRenderer(captionRenderer);
  return captionLayout;
}
Program: 57051
Project: 57051
Buggy source:
public DataTranspositionWidget(Composite parent,DataImportWizard wizard){
  this.parentComposite=parent;
  this.wizard=wizard;
  dataTranspositionGroup=new Group(parent,SWT.SHADOW_ETCHED_IN);
  dataTranspositionGroup.setText("String_Node_Str");
  dataTranspositionGroup.setLayout(new GridLayout(2,false));
  dataTranspositionGroup.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
  Label transpositionExplanationLabel=new Label(dataTranspositionGroup,SWT.WRAP);
  transpositionExplanationLabel.setText("String_Node_Str");
  GridData gridData=new GridData(SWT.FILL,SWT.FILL,true,true,2,1);
  gridData.widthHint=600;
  transpositionExplanationLabel.setLayoutData(gridData);
  swapRowsWithColumnsButton=new Button(dataTranspositionGroup,SWT.CHECK);
  swapRowsWithColumnsButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
  swapRowsWithColumnsButton.setText("String_Node_Str");
  swapRowsWithColumnsButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      update();
    }
  }
);
}

Fixed version (ground truth):
public DataTranspositionWidget(Composite parent,DataImportWizard wizard,boolean transposeByDefault){
  this.parentComposite=parent;
  this.wizard=wizard;
  dataTranspositionGroup=new Group(parent,SWT.SHADOW_ETCHED_IN);
  dataTranspositionGroup.setText("String_Node_Str");
  dataTranspositionGroup.setLayout(new GridLayout(2,false));
  dataTranspositionGroup.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
  Label transpositionExplanationLabel=new Label(dataTranspositionGroup,SWT.WRAP);
  transpositionExplanationLabel.setText("String_Node_Str");
  GridData gridData=new GridData(SWT.FILL,SWT.FILL,true,true,2,1);
  gridData.widthHint=600;
  transpositionExplanationLabel.setLayoutData(gridData);
  swapRowsWithColumnsButton=new Button(dataTranspositionGroup,SWT.CHECK);
  swapRowsWithColumnsButton.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,2,1));
  swapRowsWithColumnsButton.setText("String_Node_Str");
  swapRowsWithColumnsButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      update();
    }
  }
);
  swapRowsWithColumnsButton.setSelection(transposeByDefault);
}
Program: 57052
Project: 57052
Buggy source:
public void update(){
  int totalNumberOfRows=wizard.getTotalNumberOfRows();
  int numColumns=swapRowsWithColumnsButton.getSelection() ? totalNumberOfRows : (wizard.getSelectedColumns().size() + 1);
  if (warningIconLabel1 != null && !warningIconLabel1.isDisposed()) {
    warningIconLabel1.dispose();
    warningDescriptionLabel1.dispose();
  }
  if (warningIconLabel2 != null && !warningIconLabel2.isDisposed()) {
    warningIconLabel2.dispose();
    warningDescriptionLabel2.dispose();
  }
  parentComposite.layout(true);
  if (numColumns > 50) {
    String warningText1="String_Node_Str" + numColumns + "String_Node_Str";
    if (warningIconLabel1 == null || warningIconLabel1.isDisposed()) {
      warningIconLabel1=createWarningIconLabel(dataTranspositionGroup);
      warningDescriptionLabel1=createWarningDescriptionLabel(dataTranspositionGroup,warningText1);
    }
  }
  if (totalNumberOfRows > 50 && numColumns > 50) {
    if (warningIconLabel2 == null || warningIconLabel2.isDisposed()) {
      warningIconLabel2=createWarningIconLabel(dataTranspositionGroup);
      warningDescriptionLabel2=createWarningDescriptionLabel(dataTranspositionGroup,"String_Node_Str");
    }
  }
  parentComposite.layout(true);
}

Fixed version (ground truth):
public void update(){
  int numRows=swapRowsWithColumnsButton.getSelection() ? wizard.getSelectedColumns().size() + 1 : wizard.getFilteredDataMatrix().size() + 1;
  int numColumns=swapRowsWithColumnsButton.getSelection() ? wizard.getFilteredDataMatrix().size() + 1 : wizard.getSelectedColumns().size() + 1;
  if (warningIconLabel1 != null && !warningIconLabel1.isDisposed()) {
    warningIconLabel1.dispose();
    warningDescriptionLabel1.dispose();
  }
  if (warningIconLabel2 != null && !warningIconLabel2.isDisposed()) {
    warningIconLabel2.dispose();
    warningDescriptionLabel2.dispose();
  }
  parentComposite.layout(true);
  if (numColumns > 50) {
    String warningText1="String_Node_Str" + numColumns + "String_Node_Str";
    if (warningIconLabel1 == null || warningIconLabel1.isDisposed()) {
      warningIconLabel1=createWarningIconLabel(dataTranspositionGroup);
      warningDescriptionLabel1=createWarningDescriptionLabel(dataTranspositionGroup,warningText1);
    }
  }
  if (numRows > 50 && numColumns > 50) {
    if (warningIconLabel2 == null || warningIconLabel2.isDisposed()) {
      warningIconLabel2=createWarningIconLabel(dataTranspositionGroup);
      warningDescriptionLabel2=createWarningDescriptionLabel(dataTranspositionGroup,"String_Node_Str");
    }
  }
  parentComposite.layout(true);
}
Program: 57053
Project: 57053
Buggy source:
@Override public void createControl(Composite parent){
  Composite parentComposite=new Composite(parent,SWT.NONE);
  parentComposite.setLayout(new GridLayout(1,true));
  Group categoryTypeGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  categoryTypeGroup.setText("String_Node_Str");
  categoryTypeGroup.setLayout(new GridLayout(1,true));
  ordinalButton=new Button(categoryTypeGroup,SWT.RADIO);
  ordinalButton.setText("String_Node_Str");
  ordinalButton.setSelection(true);
  nominalButton=new Button(categoryTypeGroup,SWT.RADIO);
  nominalButton.setText("String_Node_Str");
  Group categoriesGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  categoriesGroup.setText("String_Node_Str");
  categoriesGroup.setLayout(new GridLayout(1,true));
  categoriesGroup.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  categoryTable=new CategoryTable(categoriesGroup);
  dataTranspositionWidget=new DataTranspositionWidget(parentComposite,(DataImportWizard)getWizard());
  setControl(parentComposite);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  Composite parentComposite=new Composite(parent,SWT.NONE);
  parentComposite.setLayout(new GridLayout(1,true));
  Group categoryTypeGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  categoryTypeGroup.setText("String_Node_Str");
  categoryTypeGroup.setLayout(new GridLayout(1,true));
  ordinalButton=new Button(categoryTypeGroup,SWT.RADIO);
  ordinalButton.setText("String_Node_Str");
  ordinalButton.setSelection(true);
  nominalButton=new Button(categoryTypeGroup,SWT.RADIO);
  nominalButton.setText("String_Node_Str");
  Group categoriesGroup=new Group(parentComposite,SWT.SHADOW_ETCHED_IN);
  categoriesGroup.setText("String_Node_Str");
  categoriesGroup.setLayout(new GridLayout(1,true));
  categoriesGroup.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  categoryTable=new CategoryTable(categoriesGroup);
  dataTranspositionWidget=new DataTranspositionWidget(parentComposite,(DataImportWizard)getWizard(),dataSetDescription.isTransposeMatrix());
  setControl(parentComposite);
}
Program: 57054
Project: 57054
Buggy source:
public void createDataPreviewTableFromFile(){
  parser.parse(dataSetDescription.getDataSourcePath(),dataSetDescription.getDelimiter(),true,MAX_PREVIEW_TABLE_ROWS);
  dataMatrix=parser.getDataMatrix();
  totalNumberOfColumns=parser.getTotalNumberOfColumns();
  totalNumberOfRows=parser.getTotalNumberOfRows();
  DataImportWizard wizard=(DataImportWizard)page.getWizard();
  wizard.setTotalNumberOfColumns(totalNumberOfColumns);
  wizard.setTotalNumberOfRows(totalNumberOfRows);
  page.previewTable.createTableFromMatrix(dataMatrix,totalNumberOfColumns);
  updateWidgetsAccordingToTableChanges();
  determineIDTypes();
  guessNumberOfHeaderRows();
  page.previewTable.updateTableColors(dataSetDescription.getNumberOfHeaderLines(),dataSetDescription.getRowOfColumnIDs(),dataSetDescription.getColumnOfRowIds());
  page.parentComposite.pack();
}

Fixed version (ground truth):
public void createDataPreviewTableFromFile(){
  parser.parse(dataSetDescription.getDataSourcePath(),dataSetDescription.getDelimiter(),true,MAX_PREVIEW_TABLE_ROWS);
  dataMatrix=parser.getDataMatrix();
  totalNumberOfColumns=parser.getTotalNumberOfColumns();
  totalNumberOfRows=parser.getTotalNumberOfRows();
  page.previewTable.createTableFromMatrix(dataMatrix,totalNumberOfColumns);
  updateWidgetsAccordingToTableChanges();
  determineIDTypes();
  guessNumberOfHeaderRows();
  page.previewTable.updateTableColors(dataSetDescription.getNumberOfHeaderLines(),dataSetDescription.getRowOfColumnIDs(),dataSetDescription.getColumnOfRowIds());
  page.parentComposite.pack();
}
Program: 57055
Project: 57055
Buggy source:
@Override public void createControl(Composite parent){
  parentComposite=new Composite(parent,SWT.NONE);
  parentComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  parentComposite.setLayout(new GridLayout(1,true));
  createScalingGroup(parentComposite);
  createClippingGroup(parentComposite);
  createTranspositionGroup(parentComposite);
  createDataCenterGroup(parentComposite);
  setControl(parentComposite);
}

Fixed version (ground truth):
@Override public void createControl(Composite parent){
  parentComposite=new Composite(parent,SWT.NONE);
  parentComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  parentComposite.setLayout(new GridLayout(1,true));
  createScalingGroup(parentComposite);
  createClippingGroup(parentComposite);
  createDataCenterGroup(parentComposite);
  dataTranspositionWidget=new DataTranspositionWidget(parentComposite,(DataImportWizard)getWizard(),dataSetDescription.isTransposeMatrix());
  setControl(parentComposite);
}
Program: 57056
Project: 57056
Buggy source:
/** 
 * Reinitializes all widgets according to the   {@link #dataSetDescription}.
 */
public void pageActivated(){
  if (!dataSourcePath.equals(dataSetDescription.getDataSourcePath())) {
    guiCreated();
    DataImportWizard wizard=(DataImportWizard)page.getWizard();
    int totalNumberOfColumns=wizard.getTotalNumberOfColumns();
    int totalNumberOfRows=wizard.getTotalNumberOfRows();
    IDCategory tcgaSampleCategory=IDCategory.getIDCategory("String_Node_Str");
    if (totalNumberOfColumns > 100 && totalNumberOfColumns > totalNumberOfRows || (tcgaSampleCategory != null && (dataSetDescription.getColumnIDSpecification().getIdCategory().equals(tcgaSampleCategory.getCategoryName())))) {
      page.swapRowsWithColumnsButton.setSelection(true);
    }
 else {
      page.swapRowsWithColumnsButton.setSelection(false);
    }
    updateColumnCountWarning();
  }
  dataSourcePath=dataSetDescription.getDataSourcePath();
}

Fixed version (ground truth):
/** 
 * Reinitializes all widgets according to the   {@link #dataSetDescription}.
 */
public void pageActivated(){
  if (!dataSourcePath.equals(dataSetDescription.getDataSourcePath())) {
    guiCreated();
  }
  page.dataTranspositionWidget.update();
  dataSourcePath=dataSetDescription.getDataSourcePath();
}
Program: 57058
Project: 57058
Buggy source:
/** 
 * Fills the   {@link #dataSetDescription} according to the widgets.
 */
public void fillDataSetDescription(){
  NumericalProperties numericalProperties=dataSetDescription.getDataDescription().getNumericalProperties();
  if (page.minTextField.getEnabled() && !page.minTextField.getText().isEmpty()) {
    float min=Float.parseFloat(page.minTextField.getText());
    if (!Float.isNaN(min)) {
      numericalProperties.setMin(min);
    }
  }
  if (page.maxTextField.getEnabled() && !page.maxTextField.getText().isEmpty()) {
    float max=Float.parseFloat(page.maxTextField.getText());
    if (!Float.isNaN(max)) {
      numericalProperties.setMax(max);
    }
  }
  if (page.useDataCenterButton.getSelection()) {
    numericalProperties.setDataCenter(Double.parseDouble(page.dataCenterTextField.getText()));
  }
  numericalProperties.setDataTransformation(dataTransformation);
  dataSetDescription.setTransposeMatrix(page.swapRowsWithColumnsButton.getSelection());
  ArrayList<ColumnDescription> inputPattern=new ArrayList<ColumnDescription>();
  DataImportWizard wizard=(DataImportWizard)page.getWizard();
  for (  Integer selected : wizard.getSelectedColumns()) {
    int columnIndex=selected.intValue();
    if (columnIndex == dataSetDescription.getColumnOfRowIds())     continue;
    inputPattern.add(new ColumnDescription(columnIndex,dataSetDescription.getDataDescription()));
  }
  dataSetDescription.setParsingPattern(inputPattern);
}

Fixed version (ground truth):
/** 
 * Fills the   {@link #dataSetDescription} according to the widgets.
 */
public void fillDataSetDescription(){
  NumericalProperties numericalProperties=dataSetDescription.getDataDescription().getNumericalProperties();
  if (page.minTextField.getEnabled() && !page.minTextField.getText().isEmpty()) {
    float min=Float.parseFloat(page.minTextField.getText());
    if (!Float.isNaN(min)) {
      numericalProperties.setMin(min);
    }
  }
  if (page.maxTextField.getEnabled() && !page.maxTextField.getText().isEmpty()) {
    float max=Float.parseFloat(page.maxTextField.getText());
    if (!Float.isNaN(max)) {
      numericalProperties.setMax(max);
    }
  }
  if (page.useDataCenterButton.getSelection()) {
    numericalProperties.setDataCenter(Double.parseDouble(page.dataCenterTextField.getText()));
  }
  numericalProperties.setDataTransformation(dataTransformation);
  dataSetDescription.setTransposeMatrix(page.dataTranspositionWidget.isTransposition());
  ArrayList<ColumnDescription> inputPattern=new ArrayList<ColumnDescription>();
  DataImportWizard wizard=(DataImportWizard)page.getWizard();
  for (  Integer selected : wizard.getSelectedColumns()) {
    int columnIndex=selected.intValue();
    if (columnIndex == dataSetDescription.getColumnOfRowIds())     continue;
    inputPattern.add(new ColumnDescription(columnIndex,dataSetDescription.getDataDescription()));
  }
  dataSetDescription.setParsingPattern(inputPattern);
}
Program: 57059
Project: 57059
Buggy source:
@ListenTo(sendToMe=true) private void onUpdatePreview(UpdatePathwayPreviewEvent event){
  if (wizard != null)   wizard.onUpdate(event);
 else {
    BrickColumn selected=stratomex.getBrickColumnManager().getActiveBrickColumn();
    if (selected == null) {
    }
 else {
      replacePathwayTemplate(selected.getTablePerspective().getRecordPerspective(),event.getPathway());
    }
  }
}

Fixed version (ground truth):
@ListenTo(sendToMe=true) private void onUpdatePreview(UpdatePathwayPreviewEvent event){
  if (wizard != null)   wizard.onUpdate(event);
 else {
    BrickColumn selected=stratomex.getBrickColumnManager().getActiveBrickColumn();
    if (selected == null) {
    }
 else {
      createWizard(selected.getTablePerspective());
      replacePathwayTemplate(selected.getTablePerspective().getRecordPerspective(),event.getPathway());
    }
  }
}