nus-yam/ex-repair huggingface dataset:
Program: 56849
Project: 56849
Buggy source:
/** 
 * returns a list a element suppliers that can be created using the given parameters
 * @param context the context with all the parameters set
 * @param callerId the id of the caller (for including excluding)
 * @param filter a additional filter to include / exclude from the caller side
 * @return
 */
public static ImmutableList<GLElementSupplier> getExtensions(GLElementFactoryContext context,String callerId,Predicate<? super String> filter){
  ImmutableList.Builder<GLElementSupplier> builder=ImmutableList.builder();
  for (  ElementExtension elem : extensions) {
    if (!filter.apply(elem.getId()) || !elem.canCreate(callerId,context))     continue;
    builder.add(new GLElementSupplier(elem,context));
  }
  return builder.build();
}

Fixed version (ground truth):
/** 
 * returns a list a element suppliers that can be created using the given parameters
 * @param context the context with all the parameters set
 * @param callerId the id of the caller (for including excluding)
 * @param filter a additional filter to include / exclude from the caller side
 * @return
 */
public static ImmutableList<GLElementSupplier> getExtensions(GLElementFactoryContext context,String callerId,Predicate<? super String> filter){
  ImmutableList.Builder<GLElementSupplier> builder=ImmutableList.builder();
  for (  ElementExtension elem : extensions) {
    if ((filter != null && !filter.apply(elem.getId())) || !elem.canCreate(callerId,context))     continue;
    builder.add(new GLElementSupplier(elem,context));
  }
  return builder.build();
}
Program: 56850
Project: 56850
Buggy source:
@Override protected void renderPickImpl(GLGraphics g,float w,float h){
  super.renderPickImpl(g,w,h);
  GLElement selected=getSelected();
  if (selected != null)   selected.renderPick(g);
}

Fixed version (ground truth):
@Override protected void renderPickImpl(GLGraphics g,float w,float h){
  super.renderPickImpl(g,w,h);
  GLElement selected=getActiveElement();
  if (selected != null)   selected.renderPick(g);
}
Program: 56851
Project: 56851
Buggy source:
/** 
 * @param children
 * @param instances
 * @param active
 */
public GLElementFactorySwitcher(List<GLElementSupplier> children,ELazyiness lazy){
  this.children=children;
  this.instances=new GLElement[children.size()];
  this.lazy=lazy;
  if (lazy != ELazyiness.DESTROY) {
    for (int i=0; i < instances.length; ++i) {
      instances[i]=children.get(i).get();
      setup(instances[i]);
      instances[i].setLayoutData(children.get(i));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param children
 * @param instances
 * @param active
 */
public GLElementFactorySwitcher(List<GLElementSupplier> children,ELazyiness lazy){
  this.children=children;
  this.instances=new GLElement[children.size()];
  this.lazy=lazy;
  if (lazy != ELazyiness.DESTROY) {
    for (int i=0; i < instances.length; ++i) {
      instances[i]=children.get(i).get();
      setup(instances[i]);
      instances[i].setLayoutData(children.get(i));
    }
  }
  setActive(instances.length == 0 ? -1 : 0);
}
Program: 56852
Project: 56852
Buggy source:
@Override public void layout(int deltaTimeMs){
  super.layout(deltaTimeMs);
  if (lazy == ELazyiness.NONE) {
    for (    GLElement instance : instances) {
      instance.layout(deltaTimeMs);
    }
  }
 else {
    GLElement selected=getSelected();
    if (selected != null)     selected.layout(deltaTimeMs);
  }
}

Fixed version (ground truth):
@Override public void layout(int deltaTimeMs){
  super.layout(deltaTimeMs);
  if (lazy == ELazyiness.NONE) {
    for (    GLElement instance : instances) {
      instance.layout(deltaTimeMs);
    }
  }
 else {
    GLElement selected=getActiveElement();
    if (selected != null)     selected.layout(deltaTimeMs);
  }
}
Program: 56853
Project: 56853
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  super.renderImpl(g,w,h);
  GLElement selected=getSelected();
  if (selected != null)   selected.render(g);
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  super.renderImpl(g,w,h);
  GLElement selected=getActiveElement();
  if (selected != null)   selected.render(g);
}
Program: 56854
Project: 56854
Buggy source:
@Override protected final void layoutImpl(){
  super.layoutImpl();
  Vec2f size=getSize();
  if (lazy == ELazyiness.NONE) {
    for (    GLElement instance : instances) {
      GLElementAccessor.asLayoutElement(instance).setBounds(0,0,size.x(),size.y());
    }
  }
 else {
    GLElement selected=getSelected();
    if (selected != null)     GLElementAccessor.asLayoutElement(selected).setBounds(0,0,size.x(),size.y());
  }
}

Fixed version (ground truth):
@Override protected final void layoutImpl(){
  super.layoutImpl();
  Vec2f size=getSize();
  if (lazy == ELazyiness.NONE) {
    for (    GLElement instance : instances) {
      GLElementAccessor.asLayoutElement(instance).setBounds(0,0,size.x(),size.y());
    }
  }
 else {
    GLElement selected=getActiveElement();
    if (selected != null)     GLElementAccessor.asLayoutElement(selected).setBounds(0,0,size.x(),size.y());
  }
}
Program: 56855
Project: 56855
Buggy source:
@Override public void repaintPick(){
  super.repaintPick();
  GLElement s=getSelected();
  if (s != null)   GLElementAccessor.repaintPickDown(s);
}

Fixed version (ground truth):
@Override public void repaintPick(){
  super.repaintPick();
  GLElement s=getActiveElement();
  if (s != null)   GLElementAccessor.repaintPickDown(s);
}
Program: 56856
Project: 56856
Buggy source:
/** 
 * @param active setter, see  {@link active}
 */
public void setActive(int active){
  if (this.active == active)   return;
  int old=this.active;
  int new_=active;
  GLElement oldv=getSelected();
switch (lazy) {
case NONE:
    break;
case DESTROY:
  if (context != null && oldv != null)   GLElementAccessor.takeDown(oldv);
instances[old]=null;
if (new_ >= 0) {
instances[new_]=children.get(new_).get();
instances[new_].setLayoutData(children.get(new_));
if (context != null) setup(instances[new_]);
}
break;
case UNINITIALIZE:
if (context != null) {
if (oldv != null) GLElementAccessor.takeDown(oldv);
if (new_ >= 0) setup(instances[new_]);
}
break;
}
this.active=active;
fireActiveChanged(active);
relayout();
}

Fixed version (ground truth):
/** 
 * @param active setter, see  {@link active}
 */
public void setActive(int active){
  if (this.active == active)   return;
  int old=this.active;
  int new_=active;
  GLElement oldv=getActiveElement();
switch (lazy) {
case NONE:
    break;
case DESTROY:
  if (context != null && oldv != null)   GLElementAccessor.takeDown(oldv);
if (old >= 0) instances[old]=null;
if (new_ >= 0) {
instances[new_]=children.get(new_).get();
instances[new_].setLayoutData(children.get(new_));
setup(instances[new_]);
}
break;
case UNINITIALIZE:
if (context != null) {
if (oldv != null) GLElementAccessor.takeDown(oldv);
if (new_ >= 0) setup(instances[new_]);
}
break;
}
this.active=active;
fireActiveChanged(active);
relayout();
}
Program: 56857
Project: 56857
Buggy source:
@Override public void repaint(){
  super.repaint();
  GLElement s=getSelected();
  if (s != null) {
    GLElementAccessor.repaintDown(s);
  }
}

Fixed version (ground truth):
@Override public void repaint(){
  super.repaint();
  GLElement s=getActiveElement();
  if (s != null) {
    GLElementAccessor.repaintDown(s);
  }
}
Program: 56858
Project: 56858
Buggy source:
@Override public <T>T getLayoutDataAs(Class<T> clazz,T default_){
  GLElement s=getSelected();
  if (s != null) {
    T v=s.getLayoutDataAs(clazz,null);
    if (v != null)     return v;
  }
  return super.getLayoutDataAs(clazz,default_);
}

Fixed version (ground truth):
@Override public <T>T getLayoutDataAs(Class<T> clazz,T default_){
  GLElement s=getActiveElement();
  if (s != null) {
    T v=s.getLayoutDataAs(clazz,null);
    if (v != null)     return v;
  }
  return super.getLayoutDataAs(clazz,default_);
}
Program: 56859
Project: 56859
Buggy source:
@Override protected final GLElementDecorator createRoot(){
  return new GLElementDecorator();
}

Fixed version (ground truth):
@Override protected final GLElementDecorator createRoot(){
  GLElementDecorator g=new GLElementDecorator();
  g.setContent(createContent());
  return g;
}
Program: 56860
Project: 56860
Buggy source:
@Override public Color darker(){
  List<Color> set=getSet();
  if (index >= set.size())   return super.darker();
  return set.get(index + 1);
}

Fixed version (ground truth):
@Override public Color darker(){
  List<Color> set=getSet();
  if (index >= set.size() - 1)   return super.darker();
  return set.get(index + 1);
}
Program: 56861
Project: 56861
Buggy source:
/** 
 * shortcut for setting if a named boolean argument is set
 * @param key
 * @return
 */
public boolean is(String key){
  Boolean r=get(key,Boolean.class,Boolean.FALSE);
  return r == null ? false : r.booleanValue();
}

Fixed version (ground truth):
public boolean is(String key,boolean default_){
  Boolean r=get(key,Boolean.class,default_);
  return r == null ? false : r.booleanValue();
}
Program: 56862
Project: 56862
Buggy source:
public float getFloat(String key){
  Float r=get(key,Float.class,Float.NaN);
  return r == null ? Float.NaN : r.floatValue();
}

Fixed version (ground truth):
public float getFloat(String key,float default_){
  Float r=get(key,Float.class,default_);
  return r == null ? default_ : r.floatValue();
}
Program: 56863
Project: 56863
Buggy source:
public int getInt(String key){
  Integer r=get(key,Integer.class,Integer.valueOf(-1));
  return r == null ? -1 : r.intValue();
}

Fixed version (ground truth):
public int getInt(String key,int default_){
  Integer r=get(key,Integer.class,Integer.valueOf(default_));
  return r == null ? default_ : r.intValue();
}
Program: 56864
Project: 56864
Buggy source:
@Override protected void renderImpl(GLGraphics g,float w,float h){
  float padding=getPadding();
  ATableBasedDataDomain dataDomain=getDataDomain();
  g.save();
  g.move(padding,padding);
  Histogram hist=getTablePerspective().getContainerStatistics().getHistogram();
  renderHist(g,hist,w - padding * 2,h - padding * 2,dataDomain.getTable().getColorMapper());
  if (hist instanceof CategoricalHistogram)   showColorMapper=false;
  g.restore();
  if (showColorMapper)   renderColorMapper(g,w,h,dataDomain.getTable().getColorMapper());
}

Fixed version (ground truth):
@Override protected void renderImpl(GLGraphics g,float w,float h){
  if (renderBackground)   g.color(Color.WHITE).fillRect(0,0,w,h);
  float padding=getPadding();
  ATableBasedDataDomain dataDomain=getDataDomain();
  g.save();
  g.move(padding,padding);
  Histogram hist=getTablePerspective().getContainerStatistics().getHistogram();
  renderHist(g,hist,w - padding * 2,h - padding * 2,dataDomain.getTable().getColorMapper());
  if (hist instanceof CategoricalHistogram)   showColorMapper=false;
  g.restore();
  if (showColorMapper)   renderColorMapper(g,w,h,dataDomain.getTable().getColorMapper());
}
Program: 56865
Project: 56865
Buggy source:
@Override public GLElement create(GLElementFactoryContext context){
  TablePerspective data=context.getData();
  EDetailLevel detailLevel=context.get(EDetailLevel.class,EDetailLevel.LOW);
  HistogramElement elem=new HistogramElement(data,detailLevel);
  elem.setShowColorMapper(context.is("String_Node_Str"));
  return elem;
}

Fixed version (ground truth):
@Override public GLElement create(GLElementFactoryContext context){
  TablePerspective data=context.getData();
  EDetailLevel detailLevel=context.get(EDetailLevel.class,EDetailLevel.LOW);
  HistogramElement elem=new HistogramElement(data,detailLevel);
  elem.setShowColorMapper(context.is("String_Node_Str"));
  elem.setRenderBackground(context.is("String_Node_Str",true));
  return elem;
}
Program: 56866
Project: 56866
Buggy source:
/** 
 * @param children
 * @param instances
 * @param active
 */
public GLElementFactorySwitcher(List<GLElementSupplier> children,ELazyiness lazy){
  this.children=children;
  this.instances=new GLElement[children.size()];
  this.lazy=lazy;
  if (lazy != ELazyiness.DESTROY) {
    for (int i=0; i < instances.length; ++i) {
      instances[i]=children.get(i).get();
      instances[i].setLayoutData(children.get(i));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param children
 * @param instances
 * @param active
 */
public GLElementFactorySwitcher(List<GLElementSupplier> children,ELazyiness lazy){
  this.children=children;
  this.instances=new GLElement[children.size()];
  this.lazy=lazy;
  if (lazy != ELazyiness.DESTROY) {
    for (int i=0; i < instances.length; ++i) {
      instances[i]=children.get(i).get();
      setup(instances[i]);
      instances[i].setLayoutData(children.get(i));
    }
  }
}
Program: 56867
Project: 56867
Buggy source:
@Override protected void onMouseOut(Pick pick){
  createSelection(mixin.getDimensionSelectionManager(),SelectionType.MOUSE_OVER,-1);
  createSelection(mixin.getRecordSelectionManager(),SelectionType.MOUSE_OVER,-1);
}

Fixed version (ground truth):
@Override protected void onMouseOut(Pick pick){
  createSelection(mixin.getDimensionSelectionManager(),SelectionType.MOUSE_OVER,-1);
  createSelection(mixin.getRecordSelectionManager(),SelectionType.MOUSE_OVER,-1);
  repaint();
}
Program: 56868
Project: 56868
Buggy source:
/** 
 * @return
 */
private boolean isVisible(){
  if (!visible)   return false;
  Display d=Display.getCurrent();
  final Composite p=canvas.asComposite();
  boolean v;
  try {
    v=DisplayUtils.syncExec(d,new Callable<Boolean>(){
      @Override public Boolean call() throws Exception {
        return !p.isDisposed() && p.isVisible();
      }
    }
);
  }
 catch (  Exception e) {
    v=true;
  }
  return v;
}

Fixed version (ground truth):
/** 
 * @return
 */
private boolean isVisible(){
  if (!visible)   return false;
  Display d=Display.getDefault();
  final Composite p=canvas.asComposite();
  boolean v;
  try {
    v=DisplayUtils.syncExec(d,new Callable<Boolean>(){
      @Override public Boolean call() throws Exception {
        return !p.isDisposed() && p.isVisible();
      }
    }
);
  }
 catch (  Exception e) {
    v=true;
  }
  return v;
}
Program: 56869
Project: 56869
Buggy source:
@Override public final void addTablePerspectives(List<TablePerspective> newTablePerspectives){
  this.tablePerspectives.addAll(newTablePerspectives);
  updateTablePerspectives(newTablePerspectives,NONE);
}

Fixed version (ground truth):
@Override public final void addTablePerspectives(List<TablePerspective> newTablePerspectives){
  newTablePerspectives.removeAll(this.tablePerspectives);
  if (newTablePerspectives.isEmpty())   return;
  this.tablePerspectives.addAll(newTablePerspectives);
  updateTablePerspectives(newTablePerspectives,NONE);
}
Program: 56870
Project: 56870
Buggy source:
@ListenTo private void onAddTablePerspective(AddTablePerspectivesEvent event){
  List<TablePerspective> validTablePerspectives=getDataSupportDefinition().filter(event.getTablePerspectives());
  if (validTablePerspectives.isEmpty()) {
    fireTablePerspectiveChanged();
  }
 else {
    addTablePerspectives(validTablePerspectives);
  }
}

Fixed version (ground truth):
@ListenTo private void onAddTablePerspective(AddTablePerspectivesEvent event){
  List<TablePerspective> validTablePerspectives=getDataSupportDefinition().filter(event.getTablePerspectives());
  validTablePerspectives.removeAll(tablePerspectives);
  if (validTablePerspectives.isEmpty()) {
    fireTablePerspectiveChanged();
  }
 else {
    addTablePerspectives(validTablePerspectives);
  }
}
Program: 56871
Project: 56871
Buggy source:
@Override public final void setTablePerspective(TablePerspective tablePerspective){
  this.tablePerspective=tablePerspective;
  fireTablePerspectiveChanged();
  GLElementDecorator root=getRootDecorator();
  if (root != null) {
    applyTablePerspective(root,tablePerspective);
  }
}

Fixed version (ground truth):
@Override public final void setTablePerspective(TablePerspective tablePerspective){
  if (Objects.equal(this.tablePerspective,tablePerspective))   return;
  this.tablePerspective=tablePerspective;
  fireTablePerspectiveChanged();
  GLElementDecorator root=getRootDecorator();
  if (root != null) {
    applyTablePerspective(root,tablePerspective);
  }
}
Program: 56872
Project: 56872
Buggy source:
@ListenTo(sendToMe=true) private void onRemoveTablePerspective(RemoveTablePerspectiveEvent event){
  if (tablePerspective == event.getTablePerspective())   setTablePerspective(null);
}

Fixed version (ground truth):
@ListenTo(sendToMe=true) private void onRemoveTablePerspective(RemoveTablePerspectiveEvent event){
  if (Objects.equal(tablePerspective,event.getTablePerspective()))   setTablePerspective(null);
}
Program: 56873
Project: 56873
Buggy source:
protected final void fillToolBar(){
  addToolBarContent(getViewSite().getActionBars().getToolBarManager());
}

Fixed version (ground truth):
protected final void fillToolBar(){
  IViewSite s=getViewSite();
  if (s == null)   return;
  addToolBarContent(getViewSite().getActionBars().getToolBarManager());
}
Program: 56874
Project: 56874
Buggy source:
/** 
 * Check whether the view is visible. If not, it should not be rendered. Note that events should be processed anyway.
 * @return true if it is visible
 */
protected boolean isVisible(){
  return isVisible && parentGLCanvas.isVisible();
}

Fixed version (ground truth):
/** 
 * Check whether the view is visible. If not, it should not be rendered. Note that events should be processed anyway.
 * @return true if it is visible
 */
protected boolean isVisible(){
  if (!isVisible)   return false;
  if (!parentGLCanvas.isVisible())   return false;
  return true;
}
Program: 56875
Project: 56875
Buggy source:
AWTGLCanvas(GLCanvas canvas,Composite composite){
  super(canvas);
  this.canvas=canvas;
  this.composite=composite;
}

Fixed version (ground truth):
AWTGLCanvas(GLCanvas canvas,Composite composite){
  super(canvas);
  this.canvas=canvas;
  this.composite=composite;
  init(composite);
}
Program: 56876
Project: 56876
Buggy source:
NEWTGLCanvas(GLWindow window,NewtCanvasSWT canvas){
  super(window);
  this.canvas=window;
  this.composite=canvas;
}

Fixed version (ground truth):
NEWTGLCanvas(GLWindow window,NewtCanvasSWT canvas){
  super(window);
  this.canvas=window;
  this.composite=canvas;
  init(canvas);
}
Program: 56877
Project: 56877
Buggy source:
SWTGLCanvas(final GLCanvas canvas){
  super(canvas);
  this.canvas=canvas;
  Composite c=canvas;
  while (c != null) {
    c.addListener(SWT.Show,showHide);
    c.addListener(SWT.Hide,showHide);
    c=c.getParent();
  }
  this.canvas.addDisposeListener(new DisposeListener(){
    @Override public void widgetDisposed(    DisposeEvent e){
      Composite c=canvas;
      while (c != null) {
        c.removeListener(SWT.Show,showHide);
        c.removeListener(SWT.Hide,showHide);
        c=c.getParent();
      }
    }
  }
);
}

Fixed version (ground truth):
SWTGLCanvas(final GLCanvas canvas){
  super(canvas);
  this.canvas=canvas;
  init(canvas);
}
Program: 56878
Project: 56878
Buggy source:
@Override public void init(IViewSite site) throws PartInitException {
  super.init(site);
  this.mode=EDataDomainQueryMode.valueOfSafe(site.getSecondaryId());
  this.setPartName(this.mode.getLabel() + "String_Node_Str");
  site.getPage().addPartListener(stratomexListener);
}

Fixed version (ground truth):
@Override public void init(IViewSite site) throws PartInitException {
  super.init(site);
  this.mode=EDataDomainQueryMode.valueOfSafe(site.getSecondaryId());
  site.getPage().addPartListener(stratomexListener);
}
Program: 56879
Project: 56879
Buggy source:
@Override public void createDefaultSerializedView(){
  serializedView=new SerializedTourGuideView();
  determineDataConfiguration(serializedView,false);
}

Fixed version (ground truth):
@Override public void createDefaultSerializedView(){
  serializedView=new SerializedTourGuideView();
  serializedView.setLabelDefault(false);
  serializedView.setViewLabel(this.mode.getLabel() + "String_Node_Str");
  determineDataConfiguration(serializedView,false);
}
Program: 56880
Project: 56880
Buggy source:
@Override public void beginMovement(Object oldBackingStore,Object newBackingStore){
  if (inBeginEndPair) {
    flush();
    GL2 gl=GLContext.getCurrentGL().getGL2();
    gl.glPopClientAttrib();
    if (getUseVertexArrays() && is15Available(gl)) {
      try {
        gl.glBindBuffer(GL.GL_ARRAY_BUFFER,0);
      }
 catch (      Exception e) {
        isExtensionAvailable_GL_VERSION_1_5=false;
      }
    }
    if (isOrthoMode) {
      ((TextureRenderer)oldBackingStore).endOrthoRendering();
    }
 else {
      ((TextureRenderer)oldBackingStore).end3DRendering();
    }
  }
  TextureRenderer newRenderer=(TextureRenderer)newBackingStore;
  g=newRenderer.createGraphics();
}

Fixed version (ground truth):
@Override public void beginMovement(Object oldBackingStore,Object newBackingStore){
  if (inBeginEndPair) {
    flush();
    GL2 gl=GLContext.getCurrentGL().getGL2();
    if (getUseVertexArrays() && is15Available(gl)) {
      try {
        gl.glBindBuffer(GL.GL_ARRAY_BUFFER,0);
      }
 catch (      Exception e) {
        isExtensionAvailable_GL_VERSION_1_5=false;
      }
    }
    if (isOrthoMode) {
      ((TextureRenderer)oldBackingStore).endOrthoRendering();
    }
 else {
      ((TextureRenderer)oldBackingStore).end3DRendering();
    }
  }
  TextureRenderer newRenderer=(TextureRenderer)newBackingStore;
  g=newRenderer.createGraphics();
}
Program: 56881
Project: 56881
Buggy source:
@Override public void endMovement(Object oldBackingStore,Object newBackingStore){
  g.dispose();
  TextureRenderer newRenderer=(TextureRenderer)newBackingStore;
  newRenderer.markDirty(0,0,newRenderer.getWidth(),newRenderer.getHeight());
  if (inBeginEndPair) {
    if (isOrthoMode) {
      ((TextureRenderer)newBackingStore).beginOrthoRendering(beginRenderingWidth,beginRenderingHeight,beginRenderingDepthTestDisabled);
    }
 else {
      ((TextureRenderer)newBackingStore).begin3DRendering();
    }
    GL2 gl=GLContext.getCurrentGL().getGL2();
    gl.glPushClientAttrib((int)GL2.GL_ALL_CLIENT_ATTRIB_BITS);
    if (haveCachedColor) {
      if (cachedColor == null) {
        ((TextureRenderer)newBackingStore).setColor(cachedR,cachedG,cachedB,cachedA);
      }
 else {
        ((TextureRenderer)newBackingStore).setColor(cachedColor.getAWTColor());
      }
    }
  }
 else {
    needToResetColor=true;
  }
}

Fixed version (ground truth):
@Override public void endMovement(Object oldBackingStore,Object newBackingStore){
  g.dispose();
  TextureRenderer newRenderer=(TextureRenderer)newBackingStore;
  newRenderer.markDirty(0,0,newRenderer.getWidth(),newRenderer.getHeight());
  if (inBeginEndPair) {
    if (isOrthoMode) {
      ((TextureRenderer)newBackingStore).beginOrthoRendering(beginRenderingWidth,beginRenderingHeight,beginRenderingDepthTestDisabled);
    }
 else {
      ((TextureRenderer)newBackingStore).begin3DRendering();
    }
    GL2 gl=GLContext.getCurrentGL().getGL2();
    if (haveCachedColor) {
      if (cachedColor == null) {
        ((TextureRenderer)newBackingStore).setColor(cachedR,cachedG,cachedB,cachedA);
      }
 else {
        ((TextureRenderer)newBackingStore).setColor(cachedColor.getAWTColor());
      }
    }
  }
 else {
    needToResetColor=true;
  }
}
Program: 56882
Project: 56882
Buggy source:
/** 
 * Convert method. TODO: only DAVID_2_EXPRESSION_INDEX is supported ATM
 * @param < T > the type of the delta, an implementation of  {@link IDelta}
 * @param idMappingManager the id mapping manager that should be used for the conversion
 * @param targetType the target type of the id conversion
 * @param delta the src delta containing the src type
 * @return the new delta, which can be longer than the original
 */
@SuppressWarnings("String_Node_Str") public static <T extends IDelta>T convertDelta(IDMappingManager idMappingManager,IDType targetType,T delta){
  T newDelta=null;
  if (delta instanceof SelectionDelta) {
    newDelta=(T)new SelectionDelta(targetType);
  }
 else   if (delta instanceof VirtualArrayDelta) {
    VirtualArrayDelta vaDelta=(VirtualArrayDelta)delta;
    VirtualArrayDelta newVADelta=new VirtualArrayDelta();
    newVADelta.setIDType(targetType);
    newVADelta.setPerspectiveID(vaDelta.getPerspectiveID());
    newDelta=(T)newVADelta;
  }
 else   throw new IllegalStateException("String_Node_Str");
  for (  Object tempItem : delta) {
    IDeltaItem item=(IDeltaItem)tempItem;
    Set<Integer> tableIDs=idMappingManager.getIDAsSet(delta.getIDType(),targetType,item.getID());
    if (tableIDs == null) {
      continue;
    }
    for (    Integer id : tableIDs) {
      IDeltaItem clonedItem=item.clone();
      clonedItem.setID(id);
      newDelta.add(clonedItem);
    }
  }
  return newDelta;
}

Fixed version (ground truth):
/** 
 * Convert method. TODO: only DAVID_2_EXPRESSION_INDEX is supported ATM
 * @param < T > the type of the delta, an implementation of  {@link IDelta}
 * @param idMappingManager the id mapping manager that should be used for the conversion
 * @param targetType the target type of the id conversion
 * @param delta the src delta containing the src type
 * @return the new delta, which can be longer than the original
 */
@SuppressWarnings("String_Node_Str") public static <T extends IDelta>T convertDelta(IDMappingManager idMappingManager,IDType targetType,T delta){
  T newDelta=null;
  if (delta instanceof SelectionDelta) {
    newDelta=(T)new SelectionDelta(targetType);
  }
 else   if (delta instanceof VirtualArrayDelta) {
    VirtualArrayDelta vaDelta=(VirtualArrayDelta)delta;
    VirtualArrayDelta newVADelta=new VirtualArrayDelta();
    newVADelta.setIDType(targetType);
    newVADelta.setPerspectiveID(vaDelta.getPerspectiveID());
    newDelta=(T)newVADelta;
  }
 else   throw new IllegalStateException("String_Node_Str");
  IIDTypeMapper<Integer,Integer> idTypeMapper=idMappingManager.getIDTypeMapper(delta.getIDType(),targetType);
  if (idTypeMapper == null)   return newDelta;
  for (  Object tempItem : delta) {
    IDeltaItem item=(IDeltaItem)tempItem;
    Set<Integer> tableIDs=idTypeMapper.apply(item.getID());
    if (tableIDs == null) {
      continue;
    }
    for (    Integer id : tableIDs) {
      IDeltaItem clonedItem=item.clone();
      clonedItem.setID(id);
      newDelta.add(clonedItem);
    }
  }
  return newDelta;
}
Program: 56883
Project: 56883
Buggy source:
@Override public void dispose(){
  super.dispose();
  ((TableView)view).dispose();
  GeneralManager.get().getViewManager().unregisterRCPView(this,view);
  view=null;
}

Fixed version (ground truth):
@Override public void dispose(){
  ((TableView)view).dispose();
  GeneralManager.get().getViewManager().unregisterRCPView(this,view);
  super.dispose();
  view=null;
}
Program: 56884
Project: 56884
Buggy source:
private double enrichmentScore(Map<Integer,Float> correlation,Set<Integer> geneS){
  final int N=correlation.size();
  final int N_h=geneS.size();
  if (N_h == 0)   return Float.NaN;
  float N_R=0;
  for (  Integer g : geneS)   if (correlation.containsKey(g))   N_R+=Math.abs(Math.pow(correlation.get(g),p));
  final double norm_tag=1 / N_R;
  final double norm_no_tag=1. / (N - N_h);
  double p_hit=0;
  double p_miss=0;
  double es_max=Double.NEGATIVE_INFINITY;
  double es_min=Double.POSITIVE_INFINITY;
  for (  Integer r : correlation.keySet()) {
    if (geneS.contains(r))     p_hit+=Math.abs(Math.pow(correlation.get(r),p)) * norm_tag;
 else     p_miss+=norm_no_tag;
    double esi=p_hit - p_miss;
    if (esi > es_max)     es_max=esi;
    if (esi < es_min)     es_min=esi;
  }
  if (es_max > -es_min)   return es_max;
 else   return es_min;
}

Fixed version (ground truth):
private double enrichmentScore(Map<Integer,Float> correlation,Set<Integer> geneS){
  final int N=correlation.size();
  final int N_h=geneS.size();
  if (N_h == 0)   return Float.NaN;
  float N_R=0;
  int intersection=0;
  for (  Integer g : geneS)   if (correlation.containsKey(g)) {
    N_R+=Math.abs(Math.pow(correlation.get(g),p));
    intersection++;
  }
  if (intersection == 0)   return Float.NaN;
  final double norm_tag=1 / N_R;
  final double norm_no_tag=1. / (N - N_h);
  double p_hit=0;
  double p_miss=0;
  double es_max=Double.NEGATIVE_INFINITY;
  double es_min=Double.POSITIVE_INFINITY;
  for (  Integer r : correlation.keySet()) {
    if (geneS.contains(r))     p_hit+=Math.abs(Math.pow(correlation.get(r),p)) * norm_tag;
 else     p_miss+=norm_no_tag;
    double esi=p_hit - p_miss;
    if (esi > es_max)     es_max=esi;
    if (esi < es_min)     es_min=esi;
  }
  if (es_max > -es_min)   return es_max;
 else   return es_min;
}
Program: 56885
Project: 56885
Buggy source:
@Override public void init(IProgressMonitor monitor){
  if (!foldChanges.isEmpty())   return;
  final Set<Integer> inA=new HashSet<>(perspective.getVirtualArray().getIDsOfGroup(group.getGroupIndex()));
  ATableBasedDataDomain dataDomain=(ATableBasedDataDomain)perspective.getDataDomain();
  Table table=dataDomain.getTable();
  List<Integer> rows=perspective.getVirtualArray().getIDs();
  List<Integer> cols=table.getDefaultDimensionPerspective().getVirtualArray().getIDs();
  Stopwatch w=new Stopwatch().start();
  float sum=0;
  float squaredSum=0;
  for (  Integer col : cols) {
    float asum=0;
    int acount=0;
    float bsum=0;
    int bcount=0;
    for (    Integer row : rows) {
      Float v=table.getNormalizedValue(col,row);
      if (v == null || v.isNaN() || v.isInfinite())       continue;
      if (inA.contains(row)) {
        asum+=v;
        acount++;
      }
 else {
        bsum+=v;
        bcount++;
      }
    }
    if (monitor.isCanceled()) {
      foldChanges.clear();
      return;
    }
    float foldChange=Statistics.foldChange((asum / acount),(bsum / bcount));
    Set<Integer> davids=dim2primary.apply(col);
    sum+=foldChange * davids.size();
    squaredSum+=(foldChange * foldChange) * davids.size();
    for (    Integer david : davids)     foldChanges.put(david,foldChange);
  }
  foldChangesMean=sum / foldChanges.size();
  foldChangesSD=(float)Math.sqrt(squaredSum / foldChanges.size() - foldChangesMean * foldChangesMean);
  System.out.println(w);
}

Fixed version (ground truth):
@Override public void init(IProgressMonitor monitor){
  if (!foldChanges.isEmpty())   return;
  final Set<Integer> inA=new HashSet<>(perspective.getVirtualArray().getIDsOfGroup(group.getGroupIndex()));
  ATableBasedDataDomain dataDomain=(ATableBasedDataDomain)perspective.getDataDomain();
  Table table=dataDomain.getTable();
  List<Integer> rows=perspective.getVirtualArray().getIDs();
  List<Integer> cols=table.getDefaultDimensionPerspective().getVirtualArray().getIDs();
  Stopwatch w=new Stopwatch().start();
  float sum=0;
  float squaredSum=0;
  for (  Integer col : cols) {
    float asum=0;
    int acount=0;
    float bsum=0;
    int bcount=0;
    for (    Integer row : rows) {
      Float v=table.getNormalizedValue(col,row);
      if (v == null || v.isNaN() || v.isInfinite())       continue;
      if (inA.contains(row)) {
        asum+=v;
        acount++;
      }
 else {
        bsum+=v;
        bcount++;
      }
    }
    if (monitor.isCanceled()) {
      foldChanges.clear();
      return;
    }
    float foldChange=Statistics.foldChange((asum / acount),(bsum / bcount));
    Set<Integer> davids=dim2primary.apply(col);
    if (davids == null)     continue;
    sum+=foldChange * davids.size();
    squaredSum+=(foldChange * foldChange) * davids.size();
    for (    Integer david : davids)     foldChanges.put(david,foldChange);
  }
  foldChangesMean=sum / foldChanges.size();
  foldChangesSD=(float)Math.sqrt(squaredSum / foldChanges.size() - foldChangesMean * foldChangesMean);
  System.out.println(w);
}
Program: 56886
Project: 56886
Buggy source:
/** 
 * Changing the workspace location in order to be able to store and restore the workbench state (also in combination with serialized projects).
 */
private static void changeWorkspaceLocation(){
  final Location instanceLoc=Platform.getInstanceLocation();
  String workspacePath="String_Node_Str" + GeneralManager.CALEYDO_HOME_PATH;
  try {
    URL workspaceURL=new URL(workspacePath);
    instanceLoc.set(workspaceURL,false);
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + workspacePath);
  }
}

Fixed version (ground truth):
/** 
 * Changing the workspace location in order to be able to store and restore the workbench state (also in combination with serialized projects).
 */
private static void changeWorkspaceLocation(){
  final Location instanceLoc=Platform.getInstanceLocation();
  File workspacePath=new File(GeneralManager.CALEYDO_HOME_PATH);
  try {
    URL workspaceURL=workspacePath.toURI().toURL();
    instanceLoc.set(workspaceURL,false);
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + workspacePath);
  }
}
Program: 56889
Project: 56889
Buggy source:
@ListenTo public void onMapTablePerspective(PathwayMappingEvent event){
  if (event.getReceiver() != this)   return;
  augmentationRenderer.setMappingPerspective(event.getTablePerspective());
  setDisplayListDirty();
}

Fixed version (ground truth):
@ListenTo public void onMapTablePerspective(PathwayMappingEvent event){
  if (event.getReceiver() != this && event.getEventSpace() != pathwayPathEventSpace)   return;
  augmentationRenderer.setMappingPerspective(event.getTablePerspective());
  setDisplayListDirty();
}
Program: 56892
Project: 56892
Buggy source:
@Override public void mouseMoved(IMouseEvent mouseEvent){
  Point mousePosition=mouseEvent.getRAWPoint();
  if (pathwayRow.getVisibility() != EVisibility.NONE) {
    for (    PathwayMultiFormInfo info : pathwayInfos) {
      if (setWindowActive(mousePosition,info.window))       return;
    }
  }
  if (pathInfo != null && pathInfo.window != null && setWindowActive(mousePosition,pathInfo.window))   return;
  if (setWindowActive(mousePosition,rankingWindow))   return;
  if (setWindowActive(mousePosition,dataMappingWindow))   return;
}

Fixed version (ground truth):
@Override public void mouseMoved(IMouseEvent mouseEvent){
  Vec2f mousePosition=mouseEvent.getDIPPoint();
  if (pathwayRow.getVisibility() != EVisibility.NONE) {
    for (    PathwayMultiFormInfo info : pathwayInfos) {
      if (setWindowActive(mousePosition,info.window))       return;
    }
  }
  if (pathInfo != null && pathInfo.window != null && setWindowActive(mousePosition,pathInfo.window))   return;
  if (setWindowActive(mousePosition,rankingWindow))   return;
  if (setWindowActive(mousePosition,dataMappingWindow))   return;
}
Program: 56893
Project: 56893
Buggy source:
private boolean setWindowActive(Point mousePosition,GLWindow window){
  Vec2f location=window.getAbsoluteLocation();
  Vec2f size=window.getSize();
  if ((mousePosition.x >= location.x() && mousePosition.x <= location.x() + size.x()) && (mousePosition.y >= location.y() && mousePosition.y <= location.y() + size.y())) {
    windowToSetActive=window;
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean setWindowActive(Vec2f mousePosition,GLWindow window){
  Vec2f location=window.getAbsoluteLocation();
  Vec2f size=window.getSize();
  if ((mousePosition.x() >= location.x() && mousePosition.x() <= location.x() + size.x()) && (mousePosition.y() >= location.y() && mousePosition.y() <= location.y() + size.y())) {
    windowToSetActive=window;
    return true;
  }
  return false;
}
Program: 56895
Project: 56895
Buggy source:
@Override public String getLabel(Pick pick){
  if (hovered < 0)   return null;
  IState current=stateMachine.getCurrent();
  List<ITransition> transitions=stateMachine.getTransitions(current);
  ITransition transition=transitions.get(pick.getObjectID());
  return transition.getDisabledReason();
}

Fixed version (ground truth):
@Override public String getLabel(Pick pick){
  if (pick.getObjectID() < 0)   return null;
  IState current=stateMachine.getCurrent();
  List<ITransition> transitions=stateMachine.getTransitions(current);
  ITransition transition=transitions.get(pick.getObjectID());
  return transition.getDisabledReason();
}
Program: 56897
Project: 56897
Buggy source:
/** 
 * <p> Initializes the Description as nominal with automatic qualitative colors. Sorts categories based on the comparable implementation of CategoryType. </p> <p> The number of categories auto initialization can handle is limited to the number of qualitative colors available. Typically this is around 10. More doesn't make sense. </p>
 * @param unsortedCategories
 */
public void autoInitialize(Collection<CATEGORY_TYPE> unsortedCategories){
  List<CATEGORY_TYPE> categories=new ArrayList<>(unsortedCategories);
  Collections.sort(categories);
  ColorBrewer cb=categoryType == ECategoryType.NOMINAL ? DEFAULT_QUALITATIVE_COLOR_SCHEME : DEFAULT_SEQUENTIAL_COLOR_SCHEME;
  Color default_=Color.NEUTRAL_GREY;
  for (int i=0; i < categories.size(); i++) {
    addCategoryProperty(new CategoryProperty<>(categories.get(i),default_));
  }
  if (this.size() > cb.getSizes().last()) {
    Logger.create(CategoricalClassDescription.class).error("String_Node_Str",unsortedCategories,cb.getSizes().last());
  }
 else {
    CategoryProperty<CATEGORY_TYPE> unknown=getUnknownCategory();
    applyColorScheme(cb,unknown == null ? null : unknown.getCategory(),false);
  }
}

Fixed version (ground truth):
/** 
 * <p> Initializes the Description as nominal with automatic qualitative colors. Sorts categories based on the comparable implementation of CategoryType. </p> <p> The number of categories auto initialization can handle is limited to the number of qualitative colors available. Typically this is around 10. More doesn't make sense. </p>
 * @param unsortedCategories
 */
public void autoInitialize(Collection<CATEGORY_TYPE> unsortedCategories){
  List<CATEGORY_TYPE> categories=new ArrayList<>(unsortedCategories);
  Collections.sort(categories);
  ColorBrewer cb=categoryType == ECategoryType.NOMINAL ? DEFAULT_QUALITATIVE_COLOR_SCHEME : DEFAULT_SEQUENTIAL_COLOR_SCHEME;
  Color default_=new Color(200,200,200);
  for (int i=0; i < categories.size(); i++) {
    addCategoryProperty(new CategoryProperty<>(categories.get(i),default_));
  }
  if (this.size() > cb.getSizes().last()) {
    Logger.create(CategoricalClassDescription.class).error("String_Node_Str",unsortedCategories,cb.getSizes().last());
  }
 else {
    CategoryProperty<CATEGORY_TYPE> unknown=getUnknownCategory();
    applyColorScheme(cb,unknown == null ? null : unknown.getCategory(),false);
  }
}
Program: 56898
Project: 56898
Buggy source:
@Override public void onRowClick(RankTableModel table,PickingMode pickingMode,IRow row,boolean isSelected){
  if (!isSelected && pickingMode == PickingMode.CLICKED) {
    table.setSelectedRow(row);
  }
 else   if ((isSelected && pickingMode == PickingMode.CLICKED) || (pickingMode == PickingMode.DOUBLE_CLICKED && !stratomex.isWizardVisible())) {
    updatePreview(null,(AScoreRow)row);
  }
}

Fixed version (ground truth):
@Override public void onRowClick(RankTableModel table,PickingMode pickingMode,IRow row,boolean isSelected){
  if (!isSelected && pickingMode == PickingMode.CLICKED) {
    table.setSelectedRow(row);
  }
 else   if ((isSelected && pickingMode == PickingMode.CLICKED && stratomex.isWizardVisible()) || (pickingMode == PickingMode.DOUBLE_CLICKED && !stratomex.isWizardVisible())) {
    updatePreview(null,(AScoreRow)row);
  }
}
Program: 56899
Project: 56899
Buggy source:
public void updateMinWindowSize(boolean waitForMinSizeApplication){
  int minWidth=graphLayout.getMinWidthPixels() + 2 * BOUNDS_SPACING_PIXELS;
  int minHeight=graphLayout.getMinHeightPixels() + 2 * BOUNDS_SPACING_PIXELS;
  if (minWidth > minViewWidthPixels + 2 || minWidth < minViewWidthPixels - 2 || minHeight > minViewHeightPixels + 2 || minHeight < minViewHeightPixels - 2) {
    minViewWidthPixels=minWidth;
    minViewHeightPixels=minHeight;
    this.waitForMinSizeApplication=waitForMinSizeApplication;
    isMinSizeApplied=false;
    EventPublisher eventPublisher=GeneralManager.get().getEventPublisher();
    SetMinViewSizeEvent event=new SetMinViewSizeEvent(this);
    event.setMinViewSize(minViewWidthPixels,minViewHeightPixels);
    eventPublisher.triggerEvent(event);
  }
}

Fixed version (ground truth):
public void updateMinWindowSize(boolean waitForMinSizeApplication){
  int minWidth=graphLayout.getMinWidthPixels() + 2 * BOUNDS_SPACING_PIXELS;
  int minHeight=graphLayout.getMinHeightPixels() + 2 * BOUNDS_SPACING_PIXELS;
  if (minWidth > minViewWidthPixels + 2 || minWidth < minViewWidthPixels - 2 || minHeight > minViewHeightPixels + 2 || minHeight < minViewHeightPixels - 2) {
    minViewWidthPixels=minWidth;
    minViewHeightPixels=minHeight;
    this.waitForMinSizeApplication=waitForMinSizeApplication;
    isMinSizeApplied=false;
    SetMinViewSizeEvent event=new SetMinViewSizeEvent(this);
    event.setMinViewSize(minViewWidthPixels,minViewHeightPixels);
    EventPublisher.trigger(event);
  }
}
Program: 56900
Project: 56900
Buggy source:
@Override public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  super.reshape(drawable,x,y,width,height);
  if (!waitForMinSizeApplication && isRendered) {
    Rectangle2D drawingArea=calculateGraphDrawingArea();
    graphLayout.applyIncrementalLayout(drawingArea);
  }
}

Fixed version (ground truth):
@Override public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  super.reshape(drawable,x,y,width,height);
  if (!waitForMinSizeApplication && isRendered) {
    Rectangle2D drawingArea=calculateGraphDrawingArea();
    graphLayout.applyIncrementalLayout(drawingArea);
    SetMinViewSizeEvent event=new SetMinViewSizeEvent(this);
    event.setMinViewSize(minViewWidthPixels,minViewHeightPixels);
    EventPublisher.trigger(event);
  }
}
Program: 56901
Project: 56901
Buggy source:
@Override public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  super.reshape(drawable,x,y,width,height);
  setLayoutDirty();
}

Fixed version (ground truth):
@Override public void reshape(GLAutoDrawable drawable,int x,int y,int width,int height){
  super.reshape(drawable,x,y,width,height);
  setLayoutDirty();
  if (minWidth > 0 && minHeight > 0)   setMinViewSize(minWidth,minHeight);
}
Program: 56903
Project: 56903
Buggy source:
@Override public void run(){
  minSizeComposite.setMinSize(pathway.getWidth(),pathway.getHeight());
}

Fixed version (ground truth):
@Override public void run(){
  int w=glCanvas.toRawPixel(pathway.getWidth());
  int h=glCanvas.toRawPixel(pathway.getHeight());
  minSizeComposite.setMinSize(w,h);
}
Program: 56904
Project: 56904
Buggy source:
@Override public void addPathwayView(int pathwayID,String dataDomainID){
  if (view == null)   return;
  ((GLPathway)view).setPathway(pathwayID);
  final PathwayGraph pathway=PathwayManager.get().getItem(pathwayID);
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      minSizeComposite.setMinSize(pathway.getWidth(),pathway.getHeight());
    }
  }
);
}

Fixed version (ground truth):
@Override public void addPathwayView(int pathwayID,String dataDomainID){
  if (view == null)   return;
  ((GLPathway)view).setPathway(pathwayID);
  final PathwayGraph pathway=PathwayManager.get().getItem(pathwayID);
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      int w=glCanvas.toRawPixel(pathway.getWidth());
      int h=glCanvas.toRawPixel(pathway.getHeight());
      minSizeComposite.setMinSize(w,h);
    }
  }
);
}
Program: 56905
Project: 56905
Buggy source:
public Vec2f getDIPPickedPoint(){
  return this.pickedPoint;
}

Fixed version (ground truth):
public Vec2f getDIPPickedPoint(){
  return new Vec2f(this.pickedPoint);
}
Program: 56906
Project: 56906
Buggy source:
protected OpenViewHandler(){
  super(GLKaplanMeier.VIEW_TYPE);
}

Fixed version (ground truth):
public OpenViewHandler(){
  super(GLKaplanMeier.VIEW_TYPE);
}
Program: 56907
Project: 56907
Buggy source:
@Override public void run(){
  DataImportWizard dataImportWizard=createDataImportWizard();
  HelpButtonWizardDialog dialog=new HelpButtonWizardDialog(Display.getCurrent().getActiveShell(),dataImportWizard);
  dialog.open();
  return;
}

Fixed version (ground truth):
@Override public void run(){
  DataImportWizard dataImportWizard=createDataImportWizard();
  HelpButtonWizardDialog dialog=new HelpButtonWizardDialog(Display.getCurrent().getActiveShell(),dataImportWizard);
  dialog.open();
}
Program: 56908
Project: 56908
Buggy source:
/** 
 * @param startups
 * @param display
 * @return
 */
private IStartupProcedure selectStartupProcedure(Map<String,IStartupAddon> startups,Display display){
  for (  IStartupAddon startup : startups.values()) {
    if (startup.init())     return startup.create();
  }
  Shell shell=new Shell(display);
  shell.moveAbove(null);
  CaleydoProjectWizard wizardImpl=new CaleydoProjectWizard(startups);
  WizardDialog wizard=new WizardDialog(shell,wizardImpl);
  wizard.setMinimumPageSize(750,500);
  shell.forceActive();
  boolean ok=wizard.open() == Window.CANCEL;
  if (!shell.isDisposed())   shell.dispose();
  return ok ? wizardImpl.getResult() : null;
}

Fixed version (ground truth):
/** 
 * @param startups
 * @param display
 * @return
 */
private IStartupProcedure selectStartupProcedure(Map<String,IStartupAddon> startups,Display display){
  for (  IStartupAddon startup : startups.values()) {
    if (startup.init())     return startup.create();
  }
  Shell shell=new Shell(display);
  shell.moveAbove(null);
  CaleydoProjectWizard wizardImpl=new CaleydoProjectWizard(startups);
  WizardDialog wizard=new WizardDialog(shell,wizardImpl);
  wizard.setMinimumPageSize(750,500);
  shell.forceActive();
  boolean ok=wizard.open() == Window.OK;
  if (!shell.isDisposed())   shell.dispose();
  return ok ? wizardImpl.getResult() : null;
}
Program: 56909
Project: 56909
Buggy source:
@Override public void removeGLEventListener(GLEventListener listener){
  glEventListeners.remove(listener);
}

Fixed version (ground truth):
@Override public void removeGLEventListener(GLEventListener listener){
  canvas.removeGLEventListener(listener);
}
Program: 56910
Project: 56910
Buggy source:
@Override public void addGLEventListener(GLEventListener listener){
  glEventListeners.add(listener);
}

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

Fixed version (ground truth):
SWTGLCanvas(GLCanvas canvas){
  this.canvas=canvas;
}
Program: 56916
Project: 56916
Buggy source:
@Override public void init(Shell splash){
  super.init(splash);
  createUI();
}

Fixed version (ground truth):
@Override public void init(Shell splash){
  super.init(splash);
  createUI();
  splash.layout(true);
}