nus-yam/ex-repair huggingface dataset:
Program: 11086
Project: 11086
Buggy source:
/** 
 * Find a matching   {@link Style} string for the provided attributes.
 * @param attributeValues Attribute values to use when searching for matching cases
 * @return
 */
public String getMatchingStyle(AVList attributeValues){
  if (!attributeValues.hasKey(name))   return null;
  String stringValue=attributeValues.getValue(name).toString();
  if (switches.containsKey(stringValue))   return switches.get(stringValue);
  for (  Entry<String,String> regex : regexes.entrySet()) {
    if (Pattern.matches(regex.getKey(),stringValue))     return regex.getValue();
  }
  Double doubleValue=null;
  try {
    doubleValue=Double.valueOf(stringValue);
  }
 catch (  Exception e) {
  }
  if (doubleValue != null) {
    for (    Entry<Range,String> range : ranges.entrySet()) {
      if (range.getKey().contains(doubleValue))       return range.getValue();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Find a matching   {@link Style} string for the provided attributes.
 * @param attributeValues Attribute values to use when searching for matching cases
 * @return
 */
public String getMatchingStyle(AVList attributeValues){
  if (attributeValues.getValue(name) == null)   return null;
  String stringValue=attributeValues.getValue(name).toString();
  if (switches.containsKey(stringValue))   return switches.get(stringValue);
  for (  Entry<String,String> regex : regexes.entrySet()) {
    if (Pattern.matches(regex.getKey(),stringValue))     return regex.getValue();
  }
  Double doubleValue=null;
  try {
    doubleValue=Double.valueOf(stringValue);
  }
 catch (  Exception e) {
  }
  if (doubleValue != null) {
    for (    Entry<Range,String> range : ranges.entrySet()) {
      if (range.getKey().contains(doubleValue))       return range.getValue();
    }
  }
  return null;
}
Program: 11087
Project: 11087
Buggy source:
protected void loadData(InputStream is){
  try {
    List<Earthquake> quakes=new ArrayList<Earthquake>();
    ObjectInputStream ois=new ObjectInputStream(is);
    while (ois.available() > 0) {
      double lat=ois.readDouble();
      double lon=ois.readDouble();
      double elevation=ois.readDouble();
      double magnitude=ois.readDouble();
      long timeInMillis=ois.readLong();
      Position position=Position.fromDegrees(lat,lon,elevation);
      Earthquake quake=new Earthquake(position,magnitude,timeInMillis);
      quakes.add(quake);
    }
    ois.close();
    loadEarthquakes(quakes);
  }
 catch (  IOException e) {
    if (loadAttempts < MAX_DOWNLOAD_ATTEMPTS) {
      loaded=false;
      Downloader.removeCache(url);
      Logging.logger().warning("String_Node_Str" + url);
    }
 else {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
protected void loadData(InputStream is){
  try {
    boolean isZipFile=url.toExternalForm().toLowerCase().endsWith("String_Node_Str");
    if (isZipFile) {
      ZipInputStream zis=new ZipInputStream(is);
      zis.getNextEntry();
      is=zis;
    }
    List<Earthquake> quakes=new ArrayList<Earthquake>();
    ObjectInputStream ois=new ObjectInputStream(is);
    try {
      while (is.available() > 0) {
        double lat=ois.readDouble();
        double lon=ois.readDouble();
        double elevation=ois.readDouble();
        double magnitude=ois.readDouble();
        long timeInMillis=ois.readLong();
        Position position=Position.fromDegrees(lat,lon,elevation);
        Earthquake quake=new Earthquake(position,magnitude,timeInMillis);
        quakes.add(quake);
      }
    }
 catch (    EOFException e) {
    }
    ois.close();
    loadEarthquakes(quakes);
  }
 catch (  IOException e) {
    e.printStackTrace();
    if (loadAttempts < MAX_DOWNLOAD_ATTEMPTS) {
      loaded=false;
      Downloader.removeCache(url);
      Logging.logger().warning("String_Node_Str" + url);
    }
 else {
      e.printStackTrace();
    }
  }
}
Program: 11088
Project: 11088
Buggy source:
@Override protected void applyDrawProjection(DrawContext dc,OGLStackHandler ogsh){
  boolean loaded=false;
  if (dc.getView() instanceof StereoView) {
    StereoView stereo=(StereoView)dc.getView();
    double near=stereo.getEyePoint().getLength3();
    double far=this.radius + near;
    Matrix projection=stereo.calculateProjectionMatrix(near,far);
    if (projection != null) {
      double[] matrixArray=new double[16];
      GL gl=dc.getGL();
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glPushMatrix();
      projection.toArray(matrixArray,0,false);
      gl.glLoadMatrixd(matrixArray,0);
      loaded=true;
    }
  }
  if (!loaded) {
    super.applyDrawProjection(dc,ogsh);
  }
}

Fixed version (ground truth):
@Override protected void applyDrawProjection(DrawContext dc,OGLStackHandler ogsh){
  boolean loaded=false;
  if (dc.getView() instanceof StereoView && ((StereoView)dc.getView()).isStereo()) {
    StereoView stereo=(StereoView)dc.getView();
    double near=stereo.getEyePoint().getLength3();
    double far=this.radius + near;
    Matrix projection=stereo.calculateProjectionMatrix(near,far);
    if (projection != null) {
      double[] matrixArray=new double[16];
      GL gl=dc.getGL();
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glPushMatrix();
      projection.toArray(matrixArray,0,false);
      gl.glLoadMatrixd(matrixArray,0);
      loaded=true;
    }
  }
  if (!loaded) {
    super.applyDrawProjection(dc,ogsh);
  }
}
Program: 11090
Project: 11090
Buggy source:
/** 
 * Fill the params with the values in the   {@link GeometryLayer} specific XMLelements.
 */
public static AVList getParamsFromDocument(Element domElement,AVList params){
  if (params == null)   params=new AVListImpl();
  XPath xpath=WWXML.makeXPath();
  WWXML.checkAndSetStringParam(domElement,params,AVKey.URL,"String_Node_Str",xpath);
  WWXML.checkAndSetLongParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",xpath);
  WWXML.checkAndSetDateTimeParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",DATE_TIME_PATTERN,xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKey.DATA_CACHE_NAME,"String_Node_Str",xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKeyMore.RENDER_TYPE,"String_Node_Str",xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKeyMore.SHAPE_TYPE,"String_Node_Str",xpath);
  setupShapeProvider(domElement,xpath,params);
  Element styles=WWXML.getElement(domElement,"String_Node_Str",xpath);
  if (styles != null) {
    StyleAndAttributeFactory.addStyles(styles,xpath,AVKeyMore.SHAPE_STYLES,params);
  }
  Element attributes=WWXML.getElement(domElement,"String_Node_Str",xpath);
  if (attributes != null) {
    StyleAndAttributeFactory.addAttributes(attributes,xpath,AVKeyMore.SHAPE_ATTRIBUTES,params);
  }
  return params;
}

Fixed version (ground truth):
/** 
 * Fill the params with the values in the   {@link GeometryLayer} specific XMLelements.
 */
public static AVList getParamsFromDocument(Element domElement,AVList params){
  if (params == null)   params=new AVListImpl();
  XPath xpath=WWXML.makeXPath();
  WWXML.checkAndSetStringParam(domElement,params,AVKey.URL,"String_Node_Str",xpath);
  WWXML.checkAndSetLongParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",xpath);
  WWXML.checkAndSetDateTimeParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",DATE_TIME_PATTERN,xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKey.DATA_CACHE_NAME,"String_Node_Str",xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKeyMore.RENDER_TYPE,"String_Node_Str",xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKeyMore.SHAPE_TYPE,"String_Node_Str",xpath);
  setupShapeProvider(domElement,xpath,params);
  Element styles=WWXML.getElement(domElement,"String_Node_Str",xpath);
  StyleAndAttributeFactory.addStyles(styles,xpath,AVKeyMore.SHAPE_STYLES,params);
  Element attributes=WWXML.getElement(domElement,"String_Node_Str",xpath);
  StyleAndAttributeFactory.addAttributes(attributes,xpath,AVKeyMore.SHAPE_ATTRIBUTES,params);
  return params;
}
Program: 11091
Project: 11091
Buggy source:
/** 
 * Fill the params with the values in the   {@link PointLayer} specific XMLelements.
 */
public static AVList getParamsFromDocument(Element domElement,AVList params){
  if (params == null)   params=new AVListImpl();
  XPath xpath=WWXML.makeXPath();
  WWXML.checkAndSetStringParam(domElement,params,AVKey.URL,"String_Node_Str",xpath);
  WWXML.checkAndSetLongParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",xpath);
  WWXML.checkAndSetDateTimeParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",DATE_TIME_PATTERN,xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKey.DATA_CACHE_NAME,"String_Node_Str",xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKeyMore.POINT_TYPE,"String_Node_Str",xpath);
  setupPointProvider(domElement,xpath,params);
  Element styles=WWXML.getElement(domElement,"String_Node_Str",xpath);
  if (styles != null) {
    StyleAndAttributeFactory.addStyles(styles,xpath,AVKeyMore.POINT_STYLES,params);
  }
  Element attributes=WWXML.getElement(domElement,"String_Node_Str",xpath);
  if (attributes != null) {
    StyleAndAttributeFactory.addAttributes(attributes,xpath,AVKeyMore.POINT_ATTRIBUTES,params);
  }
  return params;
}

Fixed version (ground truth):
/** 
 * Fill the params with the values in the   {@link PointLayer} specific XMLelements.
 */
public static AVList getParamsFromDocument(Element domElement,AVList params){
  if (params == null)   params=new AVListImpl();
  XPath xpath=WWXML.makeXPath();
  WWXML.checkAndSetStringParam(domElement,params,AVKey.URL,"String_Node_Str",xpath);
  WWXML.checkAndSetLongParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",xpath);
  WWXML.checkAndSetDateTimeParam(domElement,params,AVKey.EXPIRY_TIME,"String_Node_Str",DATE_TIME_PATTERN,xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKey.DATA_CACHE_NAME,"String_Node_Str",xpath);
  WWXML.checkAndSetStringParam(domElement,params,AVKeyMore.POINT_TYPE,"String_Node_Str",xpath);
  setupPointProvider(domElement,xpath,params);
  Element styles=WWXML.getElement(domElement,"String_Node_Str",xpath);
  StyleAndAttributeFactory.addStyles(styles,xpath,AVKeyMore.POINT_STYLES,params);
  Element attributes=WWXML.getElement(domElement,"String_Node_Str",xpath);
  StyleAndAttributeFactory.addAttributes(attributes,xpath,AVKeyMore.POINT_ATTRIBUTES,params);
  return params;
}
Program: 11092
Project: 11092
Buggy source:
/** 
 * Read a list of   {@link Style}s from the provided XML element and add them to the  {@link AVList} under the provided parameter key.
 * @param element XML element under which to read styles from
 * @param xpath XPath object
 * @param paramKey Key to use when setting the list in the params
 * @param params Params in which to add the list of styles
 */
public static void addStyles(Element element,XPath xpath,String paramKey,AVList params){
  List<Style> styles=new ArrayList<Style>();
  Element[] styleElements=WWXML.getElements(element,"String_Node_Str",xpath);
  if (styleElements != null) {
    for (    Element s : styleElements) {
      String name=WWXML.getText(s,"String_Node_Str",xpath);
      boolean defalt=XMLUtil.getBoolean(s,"String_Node_Str",false);
      Style style=new Style(name,defalt);
      Element[] properties=WWXML.getElements(s,"String_Node_Str",xpath);
      if (properties != null) {
        for (        Element p : properties) {
          String pname=WWXML.getText(p,"String_Node_Str",xpath);
          String value=WWXML.getText(p,"String_Node_Str",xpath);
          String type=WWXML.getText(p,"String_Node_Str",xpath);
          style.addProperty(pname,value,type);
        }
      }
      styles.add(style);
    }
  }
  params.setValue(paramKey,styles);
}

Fixed version (ground truth):
/** 
 * Read a list of   {@link Style}s from the provided XML element and add them to the   {@link AVList} under the provided parameter key.
 * @param element XML element under which to read styles from
 * @param xpath XPath object
 * @param paramKey Key to use when setting the list in the params
 * @param params Params in which to add the list of styles
 */
public static void addStyles(Element element,XPath xpath,String paramKey,AVList params){
  List<Style> styles=new ArrayList<Style>();
  if (element != null) {
    Element[] styleElements=WWXML.getElements(element,"String_Node_Str",xpath);
    if (styleElements != null) {
      for (      Element s : styleElements) {
        String name=WWXML.getText(s,"String_Node_Str",xpath);
        boolean defalt=XMLUtil.getBoolean(s,"String_Node_Str",false);
        Style style=new Style(name,defalt);
        Element[] properties=WWXML.getElements(s,"String_Node_Str",xpath);
        if (properties != null) {
          for (          Element p : properties) {
            String pname=WWXML.getText(p,"String_Node_Str",xpath);
            String value=WWXML.getText(p,"String_Node_Str",xpath);
            String type=WWXML.getText(p,"String_Node_Str",xpath);
            style.addProperty(pname,value,type);
          }
        }
        styles.add(style);
      }
    }
  }
  params.setValue(paramKey,styles);
}
Program: 11094
Project: 11094
Buggy source:
public FolderNode(INode node){
  this(node.getName(),node.getInfoURL(),node.getIconURL(),node.isExpanded());
}

Fixed version (ground truth):
public FolderNode(String name,URL infoURL,URL iconURL,boolean expanded){
  super(name,infoURL,iconURL,expanded);
}
Program: 11095
Project: 11095
Buggy source:
private void refreshLists(){
  if (wwd == null) {
    return;
  }
  layerList.removeAllFromSection(this,layers);
  elevationModel.removeAllFromSection(this,elevationModels);
  layers.clear();
  elevationModels.clear();
  for (  Wrapper wrapper : wrappers) {
    if (wrapper.node.isEnabled()) {
      if (wrapper.hasLayer()) {
        Layer layer=wrapper.getLayer();
        layer.setEnabled(wrapper.node.isEnabled());
        layer.setOpacity(wrapper.node.getOpacity());
        layers.add(layer);
        layerMap.put(layer,wrapper.node);
      }
 else       if (wrapper.hasElevationModel()) {
        ElevationModel elevationModel=wrapper.getElevationModel();
        elevationModels.add(elevationModel);
        mapChildElevationModelsToNode(elevationModel,wrapper.node);
      }
    }
    if (wrapper.isLoaded()) {
      if (!layersSetup) {
        wrapper.getLoaded().setup(wwd);
      }
      wrapper.node.setLegendURL(wrapper.getLoaded().getLegendURL());
      wrapper.node.setQueryURL(wrapper.getLoaded().getQueryURL());
      wrapper.updateExpiryTime();
    }
  }
  layersSetup=true;
  layerList.addAllFromSection(this,layers);
  elevationModel.addAllFromSection(this,elevationModels);
  for (  RefreshListener listener : listeners) {
    listener.refreshed();
  }
  tree.getUI().relayout();
  tree.repaint();
}

Fixed version (ground truth):
private void refreshLists(){
  if (wwd == null) {
    return;
  }
  layerList.removeAllFromSection(this,layers);
  elevationModel.removeAllFromSection(this,elevationModels);
  layers.clear();
  elevationModels.clear();
  for (  Wrapper wrapper : wrappers) {
    if (wrapper.node.isEnabled()) {
      if (wrapper.hasLayer()) {
        Layer layer=wrapper.getLayer();
        layer.setEnabled(wrapper.node.isEnabled());
        layer.setOpacity(wrapper.node.getOpacity());
        layers.add(layer);
        layerMap.put(layer,wrapper.node);
      }
 else       if (wrapper.hasElevationModel()) {
        ElevationModel elevationModel=wrapper.getElevationModel();
        elevationModels.add(elevationModel);
        mapChildElevationModelsToNode(elevationModel,wrapper.node);
      }
    }
    if (wrapper.isLoaded()) {
      if (!layersSetup) {
        wrapper.getLoaded().setup(wwd);
      }
      wrapper.node.setLegendURL(wrapper.getLoaded().getLegendURL());
      wrapper.node.setQueryURL(wrapper.getLoaded().getQueryURL());
      wrapper.updateExpiryTime();
    }
  }
  layersSetup=true;
  layerList.addAllFromSection(this,layers);
  elevationModel.addAllFromSection(this,elevationModels);
  for (  RefreshListener listener : listeners) {
    listener.refreshed();
  }
  tree.relayoutOnEDT();
}
Program: 11096
Project: 11096
Buggy source:
private void setError(ILayerNode node,Exception error){
  node.setError(error);
  if (tree != null) {
    tree.getUI().relayout();
    tree.repaint();
  }
}

Fixed version (ground truth):
private void setError(ILayerNode node,Exception error){
  node.setError(error);
  if (tree != null) {
    tree.relayoutOnEDT();
  }
}
Program: 11097
Project: 11097
Buggy source:
private void setLayerLoading(ILayerNode node,boolean loading,boolean repaintTree){
  node.setLayerLoading(loading);
  if (repaintTree && tree != null) {
    tree.repaint();
  }
}

Fixed version (ground truth):
private void setLayerLoading(ILayerNode node,boolean loading,boolean repaintTree){
  node.setLayerLoading(loading);
  if (repaintTree && tree != null) {
    tree.relayoutOnEDT();
  }
}
Program: 11098
Project: 11098
Buggy source:
public LayerNode(ILayerNode node){
  this(node.getName(),node.getInfoURL(),node.getIconURL(),node.isExpanded(),node.getLayerURL(),node.isEnabled(),node.getOpacity(),node.getExpiryTime());
  setLegendURL(node.getLegendURL());
  setQueryURL(node.getQueryURL());
}

Fixed version (ground truth):
public LayerNode(String name,URL infoURL,URL iconURL,boolean expanded,URL layerURL,boolean enabled,double opacity,Long expiryTime){
  super(name,infoURL,iconURL,expanded);
  setLayerURL(layerURL);
  setEnabled(enabled);
  setOpacity(opacity);
  setExpiryTime(expiryTime);
}
Program: 11099
Project: 11099
Buggy source:
@Override protected void draw(DrawContext dc){
  Dimension dimensions=renderDimensions != null ? renderDimensions : new Dimension(dc.getDrawableWidth(),dc.getDrawableHeight());
  List<Effect> effects=animation.getEffects();
  if (effects == null || effects.isEmpty()) {
    super.draw(dc);
    return;
  }
  Effect firstEffect=effects.get(0);
  Effect lastEffect=effects.get(effects.size() - 1);
  firstEffect.preDraw(dc,dimensions);
  this.clearFrame(dc);
  super.draw(dc);
  for (int i=1; i < effects.size(); i++) {
    effects.get(i).preDraw(dc,dimensions);
    effects.get(i - 1).postDraw(dc,dimensions);
  }
  lastEffect.postDraw(dc,dimensions);
}

Fixed version (ground truth):
@Override protected void draw(DrawContext dc){
  Dimension dimensions=renderDimensions != null ? renderDimensions : new Dimension(dc.getDrawableWidth(),dc.getDrawableHeight());
  List<Effect> effects=new ArrayList<Effect>(animation.getEffects());
  for (int i=effects.size() - 1; i >= 0; i--) {
    Effect effect=effects.get(i);
    if (!effect.isEnabled()) {
      effect.releaseResources(dc);
      effects.remove(i);
    }
  }
  if (effects.isEmpty()) {
    super.draw(dc);
    return;
  }
  Effect firstEffect=effects.get(0);
  Effect lastEffect=effects.get(effects.size() - 1);
  try {
    firstEffect.bindFrameBuffer(dc,dimensions);
    this.clearFrame(dc);
    super.draw(dc);
  }
  finally {
    firstEffect.unbindFrameBuffer(dc,dimensions);
  }
  for (int i=1; i < effects.size(); i++) {
    try {
      effects.get(i).bindFrameBuffer(dc,dimensions);
      this.clearFrame(dc);
      effects.get(i - 1).drawFrameBufferWithEffect(dc,dimensions);
    }
  finally {
      effects.get(i).unbindFrameBuffer(dc,dimensions);
    }
  }
  lastEffect.drawFrameBufferWithEffect(dc,dimensions);
}
Program: 11100
Project: 11100
Buggy source:
public static Class<? extends Effect> collectEffect(Frame parent){
  EffectDialog dialog=new EffectDialog(parent);
  dialog.setVisible(true);
  if (dialog.getResponse() != JOptionPane.OK_OPTION) {
    return null;
  }
  return dialog.getEffect();
}

Fixed version (ground truth):
/** 
 * Show a new   {@link EffectDialog}, and block until the user has selected an effect.
 * @param parent Dialog's parent
 * @return The effect class selected, or null if the user cancelled.
 */
public static Class<? extends Effect> collectEffect(Frame parent){
  EffectDialog dialog=new EffectDialog(parent);
  dialog.setVisible(true);
  if (dialog.getResponse() != JOptionPane.OK_OPTION) {
    return null;
  }
  return dialog.getEffect();
}
Program: 11101
Project: 11101
Buggy source:
public SortedSet<Class<? extends Effect>> getEffects(){
  return Collections.unmodifiableSortedSet(effects);
}

Fixed version (ground truth):
/** 
 * @return The list of effects registered, sorted by name.
 */
public SortedSet<Class<? extends Effect>> getEffects(){
  return Collections.unmodifiableSortedSet(effects);
}
Program: 11102
Project: 11102
Buggy source:
public void registerEffect(Class<? extends Effect> effect){
  Effect effectInstance=AnimatableInstanciator.instantiate(effect);
  effects.add(effect);
  elementToEffectMap.put(effectInstance.getXmlElementName(AnimationFileVersion.VERSION020.getConstants()),effect);
}

Fixed version (ground truth):
/** 
 * Register an effect
 * @param effect Effect to register
 */
public void registerEffect(Class<? extends Effect> effect){
  Effect effectInstance=AnimatableInstanciator.instantiate(effect);
  effects.add(effect);
  elementToEffectMap.put(effectInstance.getXmlElementName(AnimationFileVersion.VERSION020.getConstants()),effect);
}
Program: 11103
Project: 11103
Buggy source:
public String getEffectName(Class<? extends Effect> effect){
  Effect effectInstance=AnimatableInstanciator.instantiate(effect);
  String name=effectInstance.getName();
  if (name == null) {
    name=effectInstance.getDefaultName();
  }
  if (name == null) {
    name=effect.getCanonicalName();
  }
  return name;
}

Fixed version (ground truth):
/** 
 * Helper method to get an effect's default name from it's class
 * @param effect Effect class to get the default name for
 * @return Default name of the given effect
 */
public String getEffectName(Class<? extends Effect> effect){
  Effect effectInstance=AnimatableInstanciator.instantiate(effect);
  String name=effectInstance.getName();
  if (name == null) {
    name=effectInstance.getDefaultName();
  }
  if (name == null) {
    name=effect.getCanonicalName();
  }
  return name;
}
Program: 11104
Project: 11104
Buggy source:
/** 
 * Draw a texture on a quad, covering the entire viewport
 */
public static void renderTexturedQuad(GL gl,int... textureIds){
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glPushMatrix();
  gl.glLoadIdentity();
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glPushMatrix();
  gl.glLoadIdentity();
  gl.glPushAttrib(GL.GL_ENABLE_BIT);
  try {
    gl.glEnable(GL.GL_TEXTURE_2D);
    for (int i=0; i < textureIds.length; i++) {
      gl.glActiveTexture(GL.GL_TEXTURE0 + i);
      gl.glBindTexture(GL.GL_TEXTURE_2D,textureIds[i]);
      gl.glBegin(GL.GL_QUADS);
{
        gl.glTexCoord2f(0,0);
        gl.glVertex3i(-1,-1,-1);
        gl.glTexCoord2f(1,0);
        gl.glVertex3i(1,-1,-1);
        gl.glTexCoord2f(1,1);
        gl.glVertex3i(1,1,-1);
        gl.glTexCoord2f(0,1);
        gl.glVertex3i(-1,1,-1);
      }
      gl.glEnd();
    }
  }
  finally {
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
    gl.glPopAttrib();
  }
}

Fixed version (ground truth):
/** 
 * Draw a texture on a quad, covering the entire viewport
 */
public static void renderTexturedQuad(GL gl,int... textureIds){
  gl.glMatrixMode(GL.GL_MODELVIEW);
  gl.glPushMatrix();
  gl.glLoadIdentity();
  gl.glMatrixMode(GL.GL_PROJECTION);
  gl.glPushMatrix();
  gl.glLoadIdentity();
  gl.glPushAttrib(GL.GL_ENABLE_BIT);
  try {
    gl.glEnable(GL.GL_TEXTURE_2D);
    for (int i=0; i < textureIds.length; i++) {
      gl.glActiveTexture(GL.GL_TEXTURE0 + i);
      gl.glBindTexture(GL.GL_TEXTURE_2D,textureIds[i]);
    }
    gl.glBegin(GL.GL_QUADS);
{
      gl.glTexCoord2f(0,0);
      gl.glVertex3i(-1,-1,-1);
      gl.glTexCoord2f(1,0);
      gl.glVertex3i(1,-1,-1);
      gl.glTexCoord2f(1,1);
      gl.glVertex3i(1,1,-1);
      gl.glTexCoord2f(0,1);
      gl.glVertex3i(-1,1,-1);
    }
    gl.glEnd();
  }
  finally {
    gl.glPopMatrix();
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
    gl.glPopAttrib();
  }
}
Program: 11105
Project: 11105
Buggy source:
/** 
 * @return The ID of the generated depth buffer
 */
private int generateDepthBuffer(GL gl,Dimension renderDimensions,boolean asTexture){
  int[] renderBuffers=new int[1];
  if (asTexture) {
    gl.glGenTextures(1,renderBuffers,0);
  }
 else {
    gl.glGenRenderbuffersEXT(1,renderBuffers,0);
  }
  if (renderBuffers[0] <= 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (asTexture) {
    gl.glBindTexture(GL.GL_TEXTURE_2D,renderBuffers[0]);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_DEPTH_TEXTURE_MODE,GL.GL_INTENSITY);
    gl.glTexImage2D(GL.GL_TEXTURE_2D,0,GL.GL_DEPTH_COMPONENT24,renderDimensions.width,renderDimensions.height,0,GL.GL_DEPTH_COMPONENT,GL.GL_UNSIGNED_BYTE,null);
    gl.glBindTexture(GL.GL_TEXTURE_2D,0);
  }
 else {
    gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT,renderBuffers[0]);
    gl.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER_EXT,GL.GL_DEPTH_COMPONENT24,renderDimensions.width,renderDimensions.height);
    gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT,0);
  }
  return renderBuffers[0];
}

Fixed version (ground truth):
/** 
 * @return The ID of the generated depth buffer
 */
private int generateDepthBuffer(GL gl,Dimension renderDimensions,boolean asTexture){
  int[] renderBuffers=new int[1];
  if (asTexture) {
    gl.glGenTextures(1,renderBuffers,0);
  }
 else {
    gl.glGenRenderbuffersEXT(1,renderBuffers,0);
  }
  if (renderBuffers[0] <= 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (asTexture) {
    gl.glBindTexture(GL.GL_TEXTURE_2D,renderBuffers[0]);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_DEPTH_TEXTURE_MODE,GL.GL_INTENSITY);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_COMPARE_MODE,GL.GL_NONE);
    gl.glTexImage2D(GL.GL_TEXTURE_2D,0,GL.GL_DEPTH_COMPONENT24,renderDimensions.width,renderDimensions.height,0,GL.GL_DEPTH_COMPONENT,GL.GL_UNSIGNED_BYTE,null);
    gl.glBindTexture(GL.GL_TEXTURE_2D,0);
  }
 else {
    gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT,renderBuffers[0]);
    gl.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER_EXT,GL.GL_DEPTH_COMPONENT24,renderDimensions.width,renderDimensions.height);
    gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT,0);
  }
  return renderBuffers[0];
}
Program: 11106
Project: 11106
Buggy source:
@Override protected void retrieveRemoteElevations(final Tile tile,gov.nasa.worldwind.terrain.BasicElevationModel.DownloadPostProcessor postProcessor){
  if (!this.isNetworkRetrievalEnabled()) {
    this.getLevels().markResourceAbsent(tile);
    return;
  }
  if (!WorldWind.getRetrievalService().isAvailable())   return;
  java.net.URL url=null;
  try {
    url=tile.getResourceURL();
    if (WorldWind.getNetworkStatus().isHostUnavailable(url)) {
      this.getLevels().markResourceAbsent(tile);
      return;
    }
  }
 catch (  java.net.MalformedURLException e) {
    Logging.logger().log(java.util.logging.Level.SEVERE,Logging.getMessage("String_Node_Str",url),e);
    return;
  }
  if (postProcessor == null)   postProcessor=new DownloadPostProcessor(tile,this);
  URLRetriever retriever=new HTTPRetriever(url,postProcessor);
  if (isExtractZipEntry()) {
    retriever.setValue(URLRetriever.EXTRACT_ZIP_ENTRY,"String_Node_Str");
  }
  if (WorldWind.getRetrievalService().contains(retriever))   return;
  WorldWind.getRetrievalService().runRetriever(retriever,0d);
}

Fixed version (ground truth):
@Override protected void retrieveRemoteElevations(final Tile tile,gov.nasa.worldwind.terrain.BasicElevationModel.DownloadPostProcessor postProcessor){
  if (!this.isNetworkRetrievalEnabled()) {
    this.getLevels().markResourceAbsent(tile);
    return;
  }
  if (!WorldWind.getRetrievalService().isAvailable())   return;
  java.net.URL url=null;
  try {
    url=tile.getResourceURL();
    if (WorldWind.getNetworkStatus().isHostUnavailable(url)) {
      this.getLevels().markResourceAbsent(tile);
      return;
    }
  }
 catch (  java.net.MalformedURLException e) {
    Logging.logger().log(java.util.logging.Level.SEVERE,Logging.getMessage("String_Node_Str",url),e);
    return;
  }
  if (postProcessor == null)   postProcessor=new DownloadPostProcessor(tile,this);
  URLRetriever retriever=new HTTPRetriever(url,postProcessor);
  boolean formatContainsZip=getLevels().getFirstLevel().getFormatSuffix().toLowerCase().contains("String_Node_Str");
  if (isExtractZipEntry() || !formatContainsZip) {
    retriever.setValue(URLRetriever.EXTRACT_ZIP_ENTRY,"String_Node_Str");
  }
  if (WorldWind.getRetrievalService().contains(retriever))   return;
  WorldWind.getRetrievalService().runRetriever(retriever,0d);
}
Program: 11107
Project: 11107
Buggy source:
@Override protected void retrieveRemoteElevations(final Tile tile,gov.nasa.worldwind.terrain.BasicElevationModel.DownloadPostProcessor postProcessor){
  if (!this.isNetworkRetrievalEnabled()) {
    this.getLevels().markResourceAbsent(tile);
    return;
  }
  if (!WorldWind.getRetrievalService().isAvailable())   return;
  java.net.URL url=null;
  try {
    url=tile.getResourceURL();
    if (WorldWind.getNetworkStatus().isHostUnavailable(url)) {
      this.getLevels().markResourceAbsent(tile);
      return;
    }
  }
 catch (  java.net.MalformedURLException e) {
    Logging.logger().log(java.util.logging.Level.SEVERE,Logging.getMessage("String_Node_Str",url),e);
    return;
  }
  if (postProcessor == null)   postProcessor=new DownloadPostProcessor(tile,this);
  URLRetriever retriever=new HTTPRetriever(url,postProcessor);
  if (isExtractZipEntry()) {
    retriever.setValue(URLRetriever.EXTRACT_ZIP_ENTRY,"String_Node_Str");
  }
  if (WorldWind.getRetrievalService().contains(retriever))   return;
  WorldWind.getRetrievalService().runRetriever(retriever,0d);
}

Fixed version (ground truth):
@Override protected void retrieveRemoteElevations(final Tile tile,gov.nasa.worldwind.terrain.BasicElevationModel.DownloadPostProcessor postProcessor){
  if (!this.isNetworkRetrievalEnabled()) {
    this.getLevels().markResourceAbsent(tile);
    return;
  }
  if (!WorldWind.getRetrievalService().isAvailable())   return;
  java.net.URL url=null;
  try {
    url=tile.getResourceURL();
    if (WorldWind.getNetworkStatus().isHostUnavailable(url)) {
      this.getLevels().markResourceAbsent(tile);
      return;
    }
  }
 catch (  java.net.MalformedURLException e) {
    Logging.logger().log(java.util.logging.Level.SEVERE,Logging.getMessage("String_Node_Str",url),e);
    return;
  }
  if (postProcessor == null)   postProcessor=new DownloadPostProcessor(tile,this);
  URLRetriever retriever=new HTTPRetriever(url,postProcessor);
  boolean formatContainsZip=getLevels().getFirstLevel().getFormatSuffix().toLowerCase().contains("String_Node_Str");
  if (isExtractZipEntry() || !formatContainsZip) {
    retriever.setValue(URLRetriever.EXTRACT_ZIP_ENTRY,"String_Node_Str");
  }
  if (WorldWind.getRetrievalService().contains(retriever))   return;
  WorldWind.getRetrievalService().runRetriever(retriever,0d);
}
Program: 11108
Project: 11108
Buggy source:
void promptToSetFrameCount(){
  int frames=slider.getLength() - 1;
  Object value=JOptionPane.showInputDialog(frame,getMessage(getSetFrameCountMessageKey()),getMessage(getSetFrameCountCaptionKey()),JOptionPane.QUESTION_MESSAGE,null,null,frames);
  try {
    frames=Integer.parseInt((String)value);
  }
 catch (  Exception ex) {
    ExceptionLogger.logException(ex);
  }
  getCurrentAnimation().setFrameCount(frames);
  updateSlider();
}

Fixed version (ground truth):
void promptToSetFrameCount(){
  int frames=slider.getLength() - 1;
  Object value=JOptionPane.showInputDialog(frame,getMessage(getSetFrameCountMessageKey()),getMessage(getSetFrameCountCaptionKey()),JOptionPane.QUESTION_MESSAGE,null,null,frames);
  if (value != null) {
    try {
      frames=Integer.parseInt((String)value);
    }
 catch (    Exception ex) {
      ExceptionLogger.logException(ex);
    }
    getCurrentAnimation().setFrameCount(frames);
    updateSlider();
  }
}
Program: 11109
Project: 11109
Buggy source:
@Override public void loaded(ILazyTreeObject object){
  addDefaultLayersFromDataset(lazy,new ArrayList<IData>());
  lazy.removeListener(this);
}

Fixed version (ground truth):
@Override public void loaded(ILazyTreeObject object){
  addDefaultLayersFromDataset(lazy,new ArrayList<IData>());
  lazy.removeListener(this);
  tree.relayoutOnEDT();
}
Program: 11110
Project: 11110
Buggy source:
@Override public ClearableBasicTreeUI getUI(){
  return (ClearableBasicTreeUI)super.getUI();
}

Fixed version (ground truth):
@Override public ClearableBasicTreeUI getUI(){
  if (super.getUI() != this.ui)   setUI(this.ui);
  return (ClearableBasicTreeUI)super.getUI();
}
Program: 11111
Project: 11111
Buggy source:
public LayerTree(WorldWindow wwd,INode root){
  super();
  setUI(new ClearableBasicTreeUI());
  enabler=new LayerEnabler(this,wwd);
  LayerTreeModel model=new LayerTreeModel(this,root,enabler);
  setModel(model);
  setCellRenderer(new LayerCellRenderer());
  setCellEditor(new LayerTreeCellEditor(this));
  setEditable(true);
  setShowsRootHandles(true);
  setRootVisible(false);
  setRowHeight(0);
  addTreeExpansionListener(model);
  model.expandNodes();
}

Fixed version (ground truth):
public LayerTree(WorldWindow wwd,INode root){
  super();
  ui=new ClearableBasicTreeUI();
  setUI(ui);
  enabler=new LayerEnabler(this,wwd);
  LayerTreeModel model=new LayerTreeModel(this,root,enabler);
  setModel(model);
  setCellRenderer(new LayerCellRenderer());
  setCellEditor(new LayerTreeCellEditor(this));
  setEditable(true);
  setShowsRootHandles(true);
  setRootVisible(false);
  setRowHeight(0);
  addTreeExpansionListener(model);
  model.expandNodes();
}
Program: 11112
Project: 11112
Buggy source:
private void addFrameRangePane(){
  frameRangePane=new DialogPane(getMessage(getRenderDialogFrameRangeLabelKey()));
  GroupLayout layout=new GroupLayout(frameRangePane);
  frameRangePane.setLayout(layout);
  JLabel frameStartLabel=new JLabel(getMessage(getRenderDialogFrameStartLabelKey()));
  frameStartField=new JIntegerField(true,null);
  frameStartField.setToolTipText(getMessage(getRenderDialogFrameStartTooltipKey()));
  JLabel frameEndLabel=new JLabel(getMessage(getRenderDialogFrameEndLabelKey()));
  frameEndField=new JIntegerField(true,null);
  frameEndField.setToolTipText(getMessage(getRenderDialogFrameEndTooltipKey()));
  Component hGlue=Box.createHorizontalGlue();
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
  layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(frameStartLabel).addComponent(frameStartField).addComponent(frameEndLabel).addComponent(frameEndField).addComponent(hGlue));
  layout.setVerticalGroup(layout.createParallelGroup().addComponent(frameStartLabel).addComponent(frameStartField).addComponent(frameEndLabel).addComponent(frameEndField).addComponent(hGlue));
  contentPane.add(frameRangePane);
}

Fixed version (ground truth):
private void addFrameRangePane(){
  frameRangePane=new DialogPane(getMessage(getRenderDialogFrameRangeLabelKey()));
  GroupLayout layout=new GroupLayout(frameRangePane);
  frameRangePane.setLayout(layout);
  JLabel frameStartLabel=new JLabel(getMessage(getRenderDialogFrameStartLabelKey()));
  frameStartField=new JIntegerField(true,null);
  frameStartField.setToolTipText(getMessage(getRenderDialogFrameStartTooltipKey()));
  frameStartField.addFocusListener(new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
      updateOutputExampleLabel();
    }
  }
);
  JLabel frameEndLabel=new JLabel(getMessage(getRenderDialogFrameEndLabelKey()));
  frameEndField=new JIntegerField(true,null);
  frameEndField.setToolTipText(getMessage(getRenderDialogFrameEndTooltipKey()));
  frameEndField.addFocusListener(new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
      updateOutputExampleLabel();
    }
  }
);
  Component hGlue=Box.createHorizontalGlue();
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
  layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(frameStartLabel).addComponent(frameStartField).addComponent(frameEndLabel).addComponent(frameEndField).addComponent(hGlue));
  layout.setVerticalGroup(layout.createParallelGroup().addComponent(frameStartLabel).addComponent(frameStartField).addComponent(frameEndLabel).addComponent(frameEndField).addComponent(hGlue));
  contentPane.add(frameRangePane);
}
Program: 11113
Project: 11113
Buggy source:
private void initialiseActions(){
  renderAction=new BasicAction(getMessage(getRenderDialogRenderLabelKey()),getMessage(getRenderDialogRenderTooltipKey()),Icons.render.getIcon());
  renderAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      bindToAnimation();
      hideDialog(JOptionPane.OK_OPTION);
    }
  }
);
  cancelAction=new BasicAction(getMessage(getTermCancelKey()),null);
  cancelAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      hideDialog(JOptionPane.CANCEL_OPTION);
    }
  }
);
}

Fixed version (ground truth):
private void initialiseActions(){
  renderAction=new BasicAction(getMessage(getRenderDialogRenderLabelKey()),getMessage(getRenderDialogRenderTooltipKey()),Icons.render.getIcon());
  renderAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      bindToAnimation();
      hideDialog(JOptionPane.OK_OPTION);
    }
  }
);
  cancelAction=new BasicAction(getMessage(getTermCancelKey()),null);
  cancelAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      hideDialog(JOptionPane.CANCEL_OPTION);
    }
  }
);
  resetAction=new BasicAction(getMessage(getRenderDialogResetLabelKey()),getMessage(getRenderDialogResetTooltipKey()),null);
  resetAction.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      updateFieldsFromAnimation();
    }
  }
);
}
Program: 11114
Project: 11114
Buggy source:
@Override public void run(){
  RenderParameters renderParameters=currentAnimation.getRenderParameters();
  widthField.setValue(renderParameters.getImageDimension().width);
  heightField.setValue(renderParameters.getImageDimension().height);
  lockedCheck.setSelected(renderParameters.isDimensionsLocked());
  scaleField.setValue(renderParameters.getImageScalePercent());
  aspectRatio=renderParameters.getImageAspectRatio();
  detailField.setValue(renderParameters.getDetailLevel());
  if (renderParameters.getRenderDestination() != null) {
    destinationField.setText(renderParameters.getRenderDestination().getAbsolutePath());
  }
  frameStartField.setValue(renderParameters.getStartFrame() == null ? 0 : renderParameters.getStartFrame());
  frameEndField.setValue(renderParameters.getEndFrame() == null ? currentAnimation.getFrameCount() : renderParameters.getStartFrame());
  updateRenderDimensions();
}

Fixed version (ground truth):
@Override public void run(){
  RenderParameters renderParameters=currentAnimation.getRenderParameters();
  widthField.setValue(renderParameters.getImageDimension().width);
  heightField.setValue(renderParameters.getImageDimension().height);
  lockedCheck.setSelected(renderParameters.isDimensionsLocked());
  scaleField.setValue(renderParameters.getImageScalePercent());
  aspectRatio=renderParameters.getImageAspectRatio();
  detailField.setValue(renderParameters.getDetailLevel());
  if (renderParameters.getRenderDestination() != null) {
    destinationField.setText(renderParameters.getRenderDestination().getAbsolutePath());
  }
  frameStartField.setValue(renderParameters.getStartFrame() == null ? 0 : renderParameters.getStartFrame());
  frameEndField.setValue(renderParameters.getEndFrame() == null ? currentAnimation.getFrameCount() : renderParameters.getEndFrame());
  updateRenderDimensions();
}
Program: 11115
Project: 11115
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if (!isBlank(destinationField.getText())) {
    fileChooser.setCurrentDirectory(new File(destinationField.getText()));
  }
 else {
    fileChooser.setCurrentDirectory(Settings.get().getLastUsedLocation());
  }
  fileChooser.showOpenDialog(RenderDialog.this);
  if (fileChooser.getSelectedFile() == null) {
    return;
  }
  destinationField.setText(fileChooser.getSelectedFile().getAbsolutePath());
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (!isBlank(destinationField.getText())) {
    File currentDir=new File(destinationField.getText());
    while (!currentDir.exists() && !currentDir.isDirectory()) {
      if (currentDir.getParentFile() == null) {
        break;
      }
      currentDir=currentDir.getParentFile();
    }
    fileChooser.setCurrentDirectory(currentDir);
  }
 else {
    fileChooser.setCurrentDirectory(Settings.get().getLastUsedLocation());
  }
  fileChooser.showOpenDialog(RenderDialog.this);
  if (fileChooser.getSelectedFile() == null) {
    return;
  }
  destinationField.setText(fileChooser.getSelectedFile().getAbsolutePath());
  updateOutputExampleLabel();
}
Program: 11116
Project: 11116
Buggy source:
private void addButtonPanel(){
  contentPane.add(Box.createVerticalGlue());
  JPanel buttonPanel=new JPanel(new FlowLayout(FlowLayout.CENTER));
  buttonPanel.add(new JButton(renderAction));
  buttonPanel.add(new JButton(cancelAction));
  buttonPanel.setAlignmentY(JPanel.BOTTOM_ALIGNMENT);
  buttonPanel.setMaximumSize(new Dimension(400,30));
  contentPane.add(buttonPanel);
}

Fixed version (ground truth):
private void addButtonPanel(){
  contentPane.add(Box.createVerticalGlue());
  JPanel buttonPanel=new JPanel(new FlowLayout(FlowLayout.CENTER));
  buttonPanel.add(new JButton(renderAction));
  buttonPanel.add(new JButton(cancelAction));
  buttonPanel.add(new JButton(resetAction));
  buttonPanel.setAlignmentY(JPanel.BOTTOM_ALIGNMENT);
  buttonPanel.setMaximumSize(new Dimension(400,30));
  contentPane.add(buttonPanel);
}
Program: 11117
Project: 11117
Buggy source:
private void initialiseDialog(){
  setModal(true);
  setTitle(getMessage(getRenderDialogTitleKey()));
  setIconImage(Icons.render.getIcon().getImage());
  contentPane=new JPanel();
  contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS));
  setContentPane(contentPane);
  setMinimumSize(new Dimension(300,370));
  setResizable(false);
}

Fixed version (ground truth):
private void initialiseDialog(){
  setModal(true);
  setTitle(getMessage(getRenderDialogTitleKey()));
  setIconImage(Icons.render.getIcon().getImage());
  contentPane=new JPanel();
  contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS));
  setContentPane(contentPane);
  setMinimumSize(new Dimension(DIALOG_WIDTH,DIALOG_HEIGHT));
  setResizable(false);
}
Program: 11118
Project: 11118
Buggy source:
@Override public void setVisible(boolean visible){
  if (visible) {
    updateFieldsFromAnimation();
  }
  super.setVisible(visible);
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  if (visible) {
    updateFieldsFromAnimation();
    updateOutputExampleLabel();
    response=JOptionPane.CANCEL_OPTION;
  }
  super.setVisible(visible);
}
Program: 11120
Project: 11120
Buggy source:
private void bindToAnimation(){
  if (currentAnimation == null) {
    return;
  }
  RenderParameters renderParameters=currentAnimation.getRenderParameters();
  renderParameters.setImageDimension(new Dimension(widthField.getValue(),heightField.getValue()));
  renderParameters.setDimensionsLocked(lockedCheck.isSelected());
  renderParameters.setImageScalePercent(scaleField.getValue());
  renderParameters.setDetailLevel(detailField.getValue());
  renderParameters.setRenderDestination(isBlank(destinationField.getText()) ? null : new File(destinationField.getText()));
  renderParameters.setStartFrame(Math.max(frameStartField.getValue(),0));
  renderParameters.setEndFrame(Math.min(frameStartField.getValue(),currentAnimation.getFrameCount()));
}

Fixed version (ground truth):
private void bindToAnimation(){
  if (currentAnimation == null) {
    return;
  }
  RenderParameters renderParameters=currentAnimation.getRenderParameters();
  renderParameters.setImageDimension(new Dimension(widthField.getValue(),heightField.getValue()));
  renderParameters.setDimensionsLocked(lockedCheck.isSelected());
  renderParameters.setImageScalePercent(scaleField.getValue());
  renderParameters.setDetailLevel(detailField.getValue());
  renderParameters.setRenderDestination(isBlank(destinationField.getText()) ? null : new File(destinationField.getText()));
  renderParameters.setStartFrame(Math.max(frameStartField.getValue(),0));
  renderParameters.setEndFrame(Math.min(frameEndField.getValue(),currentAnimation.getFrameCount()));
}
Program: 11121
Project: 11121
Buggy source:
private void updateFieldsFromAnimation(){
  if (currentAnimation == null) {
    return;
  }
  SwingUtil.invokeTaskOnEDT(new Runnable(){
    @Override public void run(){
      RenderParameters renderParameters=currentAnimation.getRenderParameters();
      widthField.setValue(renderParameters.getImageDimension().width);
      heightField.setValue(renderParameters.getImageDimension().height);
      lockedCheck.setSelected(renderParameters.isDimensionsLocked());
      scaleField.setValue(renderParameters.getImageScalePercent());
      aspectRatio=renderParameters.getImageAspectRatio();
      detailField.setValue(renderParameters.getDetailLevel());
      if (renderParameters.getRenderDestination() != null) {
        destinationField.setText(renderParameters.getRenderDestination().getAbsolutePath());
      }
      frameStartField.setValue(renderParameters.getStartFrame() == null ? 0 : renderParameters.getStartFrame());
      frameEndField.setValue(renderParameters.getEndFrame() == null ? currentAnimation.getFrameCount() : renderParameters.getStartFrame());
      updateRenderDimensions();
    }
  }
);
}

Fixed version (ground truth):
private void updateFieldsFromAnimation(){
  if (currentAnimation == null) {
    return;
  }
  SwingUtil.invokeTaskOnEDT(new Runnable(){
    @Override public void run(){
      RenderParameters renderParameters=currentAnimation.getRenderParameters();
      widthField.setValue(renderParameters.getImageDimension().width);
      heightField.setValue(renderParameters.getImageDimension().height);
      lockedCheck.setSelected(renderParameters.isDimensionsLocked());
      scaleField.setValue(renderParameters.getImageScalePercent());
      aspectRatio=renderParameters.getImageAspectRatio();
      detailField.setValue(renderParameters.getDetailLevel());
      if (renderParameters.getRenderDestination() != null) {
        destinationField.setText(renderParameters.getRenderDestination().getAbsolutePath());
      }
      frameStartField.setValue(renderParameters.getStartFrame() == null ? 0 : renderParameters.getStartFrame());
      frameEndField.setValue(renderParameters.getEndFrame() == null ? currentAnimation.getFrameCount() : renderParameters.getEndFrame());
      updateRenderDimensions();
    }
  }
);
}