nus-yam/ex-repair huggingface dataset:
Program: 11122
Project: 11122
Buggy source:
private void updateOutputExampleLabel(){
  if (isBlank(destinationField.getText())) {
    outputExampleLabel.setText(getMessage(getRenderDialogOutputExampleLabelKey()));
  }
  File destinationFile=new File(destinationField.getText());
  String name=stripSequenceNumber(stripExtension(destinationFile.getName()));
  int firstFrame=getCurrentAnimation().getFrameOfFirstKeyFrame();
  int lastFrame=getCurrentAnimation().getFrameOfLastKeyFrame();
  int filenameLength=String.valueOf(lastFrame).length();
  final String example=createSequenceFileName(name,firstFrame,filenameLength,"String_Node_Str") + "String_Node_Str" + createSequenceFileName(name,lastFrame,filenameLength,"String_Node_Str");
  SwingUtil.invokeTaskOnEDT(new Runnable(){
    @Override public void run(){
      outputExampleLabel.setText(getMessage(getRenderDialogOutputExampleLabelKey(),example));
    }
  }
);
}

Fixed version (ground truth):
private void updateOutputExampleLabel(){
  if (isBlank(destinationField.getText())) {
    outputExampleLabel.setText(getMessage(getRenderDialogOutputExampleLabelKey(),"String_Node_Str"));
    return;
  }
  File destinationFile=new File(destinationField.getText());
  String name=stripSequenceNumber(stripExtension(destinationFile.getName()));
  int firstFrame=Math.max(0,frameStartField.getValue());
  int lastFrame=Math.min(frameEndField.getValue(),getCurrentAnimation().getFrameCount());
  int filenameLength=String.valueOf(lastFrame).length();
  final String example=createSequenceFileName(name,firstFrame,filenameLength,"String_Node_Str") + "String_Node_Str" + createSequenceFileName(name,lastFrame,filenameLength,"String_Node_Str");
  SwingUtil.invokeTaskOnEDT(new Runnable(){
    @Override public void run(){
      outputExampleLabel.setText(getMessage(getRenderDialogOutputExampleLabelKey(),example));
    }
  }
);
}
Program: 11123
Project: 11123
Buggy source:
@Override protected void applyDrawProjection(DrawContext dc){
  boolean loaded=false;
  if (dc.getView() instanceof StereoView) {
    StereoView stereo=(StereoView)dc.getView();
    double near=100;
    double far=stereo.getFarClipDistance() + 10e3;
    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);
  }
}

Fixed version (ground truth):
@Override protected void applyDrawProjection(DrawContext dc){
  boolean loaded=false;
  if (dc.getView() instanceof StereoView) {
    StereoView stereo=(StereoView)dc.getView();
    double near=100;
    double far=stereo.computeHorizonDistance() + 10e3;
    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);
  }
}
Program: 11124
Project: 11124
Buggy source:
@Override protected void updateSkyDone(DrawContext dc){
  GL gl=dc.getGL();
  View view=dc.getView();
  if (this.glListId != -1)   gl.glDeleteLists(this.glListId,1);
  double tangentalDistance=view.computeHorizonDistance();
  double distToCenterOfPlanet=view.getEyePoint().getLength3();
  Position camPos=dc.getGlobe().computePositionFromPoint(view.getEyePoint());
  double worldRadius=dc.getGlobe().getRadiusAt(camPos);
  double camAlt=camPos.getElevation();
  double horizonLat=(-Math.PI / 2 + Math.acos(tangentalDistance / distToCenterOfPlanet)) * 180 / Math.PI;
  double zenithLat=90;
  float zenithOpacity=1f;
  float gradientBias=2f;
  if (camAlt >= thickness) {
    double tangentalDistanceZenith=Math.sqrt(distToCenterOfPlanet * distToCenterOfPlanet - (worldRadius + thickness) * (worldRadius + thickness));
    zenithLat=(-Math.PI / 2 + Math.acos(tangentalDistanceZenith / distToCenterOfPlanet)) * 180 / Math.PI;
    zenithOpacity=0f;
    gradientBias=1f;
  }
  if (camAlt < thickness && camAlt > thickness * 0.7) {
    double factor=(thickness - camAlt) / (thickness - thickness * 0.7);
    zenithLat=factor * 90;
    zenithOpacity=(float)factor;
    gradientBias=1f + (float)factor;
  }
  this.makeSkyDome(dc,(float)(tangentalDistance),horizonLat,zenithLat,SLICES,STACKS,zenithOpacity,gradientBias);
  this.lastRebuildHorizon=tangentalDistance;
}

Fixed version (ground truth):
@Override protected void updateSkyDone(DrawContext dc){
  GL gl=dc.getGL();
  View view=dc.getView();
  if (this.glListId != -1) {
    gl.glDeleteLists(this.glListId,1);
  }
  double tangentalDistance=view.computeHorizonDistance();
  double distToCenterOfPlanet=view.getEyePoint().getLength3();
  Position camPos=dc.getGlobe().computePositionFromPoint(view.getEyePoint());
  double worldRadius=dc.getGlobe().getRadiusAt(camPos);
  double camAlt=camPos.getElevation();
  double horizonLat=(-PI_ON_2 + Math.acos(tangentalDistance / distToCenterOfPlanet)) * ONE80_ON_PI;
  double zenithLat=90;
  float zenithOpacity=1f;
  float gradientBias=2f;
  if (camAlt >= thickness) {
    double tangentalDistanceZenith=Math.sqrt(distToCenterOfPlanet * distToCenterOfPlanet - (worldRadius + thickness) * (worldRadius + thickness));
    zenithLat=(-PI_ON_2 + Math.acos(tangentalDistanceZenith / distToCenterOfPlanet)) * ONE80_ON_PI;
    zenithOpacity=0f;
    gradientBias=1f;
  }
  if (camAlt < thickness && camAlt > thickness * 0.7) {
    double factor=(thickness - camAlt) / (thickness - thickness * 0.7);
    zenithLat=factor * 90;
    zenithOpacity=(float)factor;
    gradientBias=1f + (float)factor;
  }
  this.makeSkyDome(dc,(float)(tangentalDistance),horizonLat,zenithLat,SLICES,STACKS,zenithOpacity,gradientBias);
  this.lastRebuildHorizon=tangentalDistance;
}
Program: 11125
Project: 11125
Buggy source:
@Override protected void doPreRender(final Animation animation,int firstFrame,int lastFrame,File outputDir,String frameName,double detailHint,boolean alpha){
  setupForRendering(detailHint);
  final Dimension renderDimensions=animation.getRenderParameters().getImageDimension();
  animatorSceneController.addPrePaintTask(new PaintTask(){
    @Override public void run(    DrawContext dc){
      frameBuffer.create(dc.getGL(),renderDimensions);
    }
  }
);
  preRenderTask=new PaintTask(){
    @Override public void run(    DrawContext dc){
      GL gl=dc.getGL();
      frameBuffer.bind(gl);
      gl.glViewport(0,0,renderDimensions.width,renderDimensions.height);
    }
  }
;
  postRenderTask=new PaintTask(){
    @Override public void run(    DrawContext dc){
      GL gl=dc.getGL();
      frameBuffer.unbind(gl);
      gl.glViewport(0,0,dc.getDrawableWidth(),dc.getDrawableHeight());
      FrameBuffer.renderTexturedQuad(gl,frameBuffer.getTextureId());
    }
  }
;
  wwd.redrawNow();
}

Fixed version (ground truth):
@Override protected void doPreRender(final Animation animation,int firstFrame,int lastFrame,File outputDir,String frameName,double detailHint,boolean alpha){
  setupForRendering(detailHint);
  final Dimension renderDimensions=animation.getRenderParameters().getImageDimension();
  animatorSceneController.addPrePaintTask(new PaintTask(){
    @Override public void run(    DrawContext dc){
      frameBuffer.create(dc.getGL(),renderDimensions);
    }
  }
);
  preRenderTask=new PaintTask(){
    @Override public void run(    DrawContext dc){
      GL gl=dc.getGL();
      frameBuffer.bind(gl);
      gl.glViewport(0,0,renderDimensions.width,renderDimensions.height);
    }
  }
;
  prePostRenderTask=new PaintTask(){
    @Override public void run(    DrawContext dc){
      GL gl=dc.getGL();
      gl.glViewport(0,0,renderDimensions.width,renderDimensions.height);
    }
  }
;
  postRenderTask=new PaintTask(){
    @Override public void run(    DrawContext dc){
      GL gl=dc.getGL();
      frameBuffer.unbind(gl);
      gl.glViewport(0,0,dc.getDrawableWidth(),dc.getDrawableHeight());
      FrameBuffer.renderTexturedQuad(gl,frameBuffer.getTextureId());
    }
  }
;
  wwd.redrawNow();
}
Program: 11126
Project: 11126
Buggy source:
@Override protected void doRender(Animation animation,int frame,final File targetFile,double detailHint,boolean alpha){
  targetApplication.setSlider(frame);
  animation.applyFrame(frame);
  animatorSceneController.addPrePaintTask(preRenderTask);
  animatorSceneController.addPostPaintTask(preRenderTask);
  ScreenshotPaintTask screenshotTask=new ScreenshotPaintTask(targetFile,alpha);
  animatorSceneController.addPostPaintTask(screenshotTask);
  animatorSceneController.addPostPaintTask(postRenderTask);
  wwd.redraw();
  screenshotTask.waitForScreenshot();
}

Fixed version (ground truth):
@Override protected void doRender(Animation animation,int frame,final File targetFile,double detailHint,boolean alpha){
  targetApplication.setSlider(frame);
  animation.applyFrame(frame);
  animatorSceneController.addPrePaintTask(preRenderTask);
  animatorSceneController.addPostPaintTask(prePostRenderTask);
  ScreenshotPaintTask screenshotTask=new ScreenshotPaintTask(targetFile,alpha);
  animatorSceneController.addPostPaintTask(screenshotTask);
  animatorSceneController.addPostPaintTask(postRenderTask);
  wwd.redraw();
  screenshotTask.waitForScreenshot();
}
Program: 11127
Project: 11127
Buggy source:
/** 
 * Initialise the side bar, which contains a group of collapsible panels
 */
private void initialiseSideBar(){
  animationBrowserPanel=new AnimationBrowserPanel(getCurrentAnimation());
  objectPropertiesPanel=new ObjectPropertiesPanel(getCurrentAnimation());
  layerPalettePanel=new LayerPalettePanel(getCurrentAnimation());
  List<CollapsiblePanel> collapsiblePanels=new ArrayList<CollapsiblePanel>(3);
  collapsiblePanels.add(animationBrowserPanel);
  collapsiblePanels.add(objectPropertiesPanel);
  collapsiblePanels.add(layerPalettePanel);
  sideBar=new SideBar(splitPane,collapsiblePanels);
  splitPane.setLeftComponent(sideBar);
  slider.addChangeFrameListener(objectPropertiesPanel);
  slider.addChangeListener(objectPropertiesPanel);
  getView().addPropertyChangeListener(AVKey.VIEW,objectPropertiesPanel);
  animationChangeListeners.add(sideBar);
}

Fixed version (ground truth):
/** 
 * Initialise the side bar, which contains a group of collapsible panels
 */
private void initialiseSideBar(){
  animationBrowserPanel=new AnimationBrowserPanel(getCurrentAnimation());
  objectPropertiesPanel=new ObjectPropertiesPanel(getCurrentAnimation());
  layerPalettePanel=new LayerPalettePanel(getCurrentAnimation());
  List<CollapsiblePanel> collapsiblePanels=new ArrayList<CollapsiblePanel>(3);
  collapsiblePanels.add(animationBrowserPanel);
  collapsiblePanels.add(objectPropertiesPanel);
  collapsiblePanels.add(layerPalettePanel);
  sideBar=new SideBar(splitPane,collapsiblePanels);
  splitPane.setLeftComponent(sideBar);
  slider.addChangeFrameListener(objectPropertiesPanel);
  slider.addChangeListener(objectPropertiesPanel);
  getView().addPropertyChangeListener(AVKey.VIEW,objectPropertiesPanel);
  changeOfAnimationListeners.add(sideBar);
}
Program: 11128
Project: 11128
Buggy source:
private void initialiseKeyFrameClipboard(){
  keyFrameClipboard=new KeyFrameClipboard(getCurrentAnimation());
  slider.addChangeListener(keyFrameClipboard);
  slider.addChangeFrameListener(keyFrameClipboard);
  animation.addChangeListener(keyFrameClipboard);
  animationChangeListeners.add(keyFrameClipboard);
}

Fixed version (ground truth):
private void initialiseKeyFrameClipboard(){
  keyFrameClipboard=new KeyFrameClipboard(getCurrentAnimation());
  slider.addChangeListener(keyFrameClipboard);
  slider.addChangeFrameListener(keyFrameClipboard);
  animation.addChangeListener(keyFrameClipboard);
  changeOfAnimationListeners.add(keyFrameClipboard);
}
Program: 11129
Project: 11129
Buggy source:
private void notifyAnimationChanged(Animation newAnimation){
  for (int i=animationChangeListeners.size() - 1; i >= 0; i--) {
    animationChangeListeners.get(i).updateAnimation(newAnimation);
  }
}

Fixed version (ground truth):
private void notifyAnimationChanged(Animation newAnimation){
  for (int i=changeOfAnimationListeners.size() - 1; i >= 0; i--) {
    changeOfAnimationListeners.get(i).updateAnimation(newAnimation);
  }
}
Program: 11130
Project: 11130
Buggy source:
private void initialiseParameterEditor(){
  this.parameterEditor=new ParameterEditor(this);
}

Fixed version (ground truth):
private void initialiseParameterEditor(){
  this.parameterEditor=new ParameterEditor(this);
  changeOfAnimationListeners.add(parameterEditor);
}
Program: 11131
Project: 11131
Buggy source:
/** 
 * Initialise the utility layers used inside the animator application
 */
private void initialiseUtilityLayers(){
  if (cameraPathLayer == null) {
    cameraPathLayer=new CameraPathLayer(wwd,getCurrentAnimation());
    wwd.addSelectListener(cameraPathLayer);
    cameraPathLayer.setEnabled(Settings.get().isCameraPathShown());
    animationChangeListeners.add(cameraPathLayer);
  }
  if (crosshair == null) {
    crosshair=new CrosshairLayer();
  }
  if (gridOverlay == null) {
    gridOverlay=new GridOverlayLayer();
    gridOverlay.setEnabled(Settings.get().isGridShown());
  }
  if (ruleOfThirdsOverlay == null) {
    ruleOfThirdsOverlay=new GridOverlayLayer(false,1 / 3d,1 / 3d);
    ruleOfThirdsOverlay.setGridColor(Color.GREEN);
    ruleOfThirdsOverlay.setEnabled(Settings.get().isRuleOfThirdsShown());
  }
}

Fixed version (ground truth):
/** 
 * Initialise the utility layers used inside the animator application
 */
private void initialiseUtilityLayers(){
  if (cameraPathLayer == null) {
    cameraPathLayer=new CameraPathLayer(wwd,getCurrentAnimation());
    wwd.addSelectListener(cameraPathLayer);
    cameraPathLayer.setEnabled(Settings.get().isCameraPathShown());
    changeOfAnimationListeners.add(cameraPathLayer);
  }
  if (crosshair == null) {
    crosshair=new CrosshairLayer();
  }
  if (gridOverlay == null) {
    gridOverlay=new GridOverlayLayer();
    gridOverlay.setEnabled(Settings.get().isGridShown());
  }
  if (ruleOfThirdsOverlay == null) {
    ruleOfThirdsOverlay=new GridOverlayLayer(false,1 / 3d,1 / 3d);
    ruleOfThirdsOverlay.setGridColor(Color.GREEN);
    ruleOfThirdsOverlay.setEnabled(Settings.get().isRuleOfThirdsShown());
  }
}
Program: 11132
Project: 11132
Buggy source:
public KeyFrameMarkers(WorldWindow wwd,Animation animation){
  this.worldWindow=wwd;
  setAnimation(animation);
}

Fixed version (ground truth):
public KeyFrameMarkers(WorldWindow wwd,Animation animation){
  this.worldWindow=wwd;
  setAnimation(animation);
  markerRenderer.setKeepSeparated(false);
}
Program: 11133
Project: 11133
Buggy source:
/** 
 * Draw the camera eye position key frame markers
 */
private void drawKeyFrameMarkers(DrawContext dc){
  try {
    frontLock.readLock().lock();
    markerRenderer.render(dc,eyeMarkersFrontBuffer);
    markerRenderer.render(dc,lookatMarkersFrontBuffer);
    drawJoiners(dc);
  }
  finally {
    frontLock.readLock().unlock();
  }
}

Fixed version (ground truth):
/** 
 * Draw the camera eye position key frame markers
 */
private void drawKeyFrameMarkers(DrawContext dc){
  try {
    frontLock.readLock().lock();
    ArrayList<Marker> combinedBuffer=new ArrayList<Marker>();
    combinedBuffer.addAll(eyeMarkersFrontBuffer);
    combinedBuffer.addAll(lookatMarkersFrontBuffer);
    markerRenderer.render(dc,combinedBuffer);
    drawJoiners(dc);
  }
  finally {
    frontLock.readLock().unlock();
  }
}
Program: 11134
Project: 11134
Buggy source:
private void setupSplitPane(){
  TreeModel model=new ParameterTreeModel(targetApplication.getCurrentAnimation());
  parameterTree=new NameableTree(model);
  parameterTree.setEditable(false);
  parameterTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  parameterTree.setToggleClickCount(-1);
  parameterTree.setActionMap(null);
  leftScrollPane=new JScrollPane(parameterTree);
  rightScrollPane=new JScrollPane(new JPanel());
  containerPane=new JSplitPane();
  containerPane.setDividerLocation(300);
  containerPane.setLeftComponent(leftScrollPane);
  containerPane.setRightComponent(rightScrollPane);
  add(containerPane);
}

Fixed version (ground truth):
private void setupSplitPane(){
  treeModel=new ParameterTreeModel(targetApplication.getCurrentAnimation());
  parameterTree=new NameableTree(treeModel);
  parameterTree.setEditable(false);
  parameterTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  parameterTree.setToggleClickCount(-1);
  parameterTree.setActionMap(null);
  leftScrollPane=new JScrollPane(parameterTree);
  rightScrollPane=new JScrollPane(new JPanel());
  containerPane=new JSplitPane();
  containerPane.setDividerLocation(300);
  containerPane.setLeftComponent(leftScrollPane);
  containerPane.setRightComponent(rightScrollPane);
  add(containerPane);
}
Program: 11137
Project: 11137
Buggy source:
protected void loadPlaces(File file,boolean append){
  List<Place> places=PlacePersistance.readFromXML(file);
  if (places == null) {
    places=LegacyPlaceReader.readPlacesFromLegacyXML(file,wwd.getModel().getGlobe());
  }
  if (places == null)   places=new ArrayList<Place>();
  if (append)   this.places.addAll(places);
 else   this.places=places;
  populateList();
}

Fixed version (ground truth):
protected void loadPlaces(File file,boolean append){
  List<Place> places=PlacePersistance.readFromXML(file);
  if (places == null && wwd != null) {
    places=LegacyPlaceReader.readPlacesFromLegacyXML(file,wwd.getModel().getGlobe());
  }
  if (places == null)   places=new ArrayList<Place>();
  if (append)   this.places.addAll(places);
 else   this.places=places;
  populateList();
}
Program: 11138
Project: 11138
Buggy source:
private static String getNameFromDefinition(URL definitionLocation){
  Document definitionDocument=XMLUtil.openDocument(definitionLocation);
  if (definitionDocument == null) {
    return null;
  }
  Element nameElement=XMLUtil.getElement(definitionDocument.getDocumentElement(),"String_Node_Str",null);
  if (nameElement == null) {
    return null;
  }
  if (nameElement.getFirstChild() == null) {
    return null;
  }
  return nameElement.getFirstChild().getNodeValue();
}

Fixed version (ground truth):
private static String getNameFromDefinition(URL definitionLocation){
  Document definitionDocument=XMLUtil.openDocument(definitionLocation);
  if (definitionDocument == null) {
    return null;
  }
  Element nameElement=XMLUtil.getElement(definitionDocument.getDocumentElement(),"String_Node_Str",null);
  if (nameElement == null || nameElement.getFirstChild() == null) {
    return null;
  }
  return nameElement.getFirstChild().getNodeValue();
}
Program: 11139
Project: 11139
Buggy source:
private static String getNameFromDefinition(URL definitionLocation){
  Document definitionDocument=XMLUtil.openDocument(definitionLocation);
  if (definitionDocument == null) {
    return null;
  }
  Element nameElement=XMLUtil.getElement(definitionDocument.getDocumentElement(),"String_Node_Str",null);
  if (nameElement == null) {
    return null;
  }
  return nameElement.getFirstChild().getNodeValue();
}

Fixed version (ground truth):
private static String getNameFromDefinition(URL definitionLocation){
  Document definitionDocument=XMLUtil.openDocument(definitionLocation);
  if (definitionDocument == null) {
    return null;
  }
  Element nameElement=XMLUtil.getElement(definitionDocument.getDocumentElement(),"String_Node_Str",null);
  if (nameElement == null || nameElement.getFirstChild() == null) {
    return null;
  }
  return nameElement.getFirstChild().getNodeValue();
}
Program: 11140
Project: 11140
Buggy source:
private static String getNameFromDefinition(URL definitionLocation){
  Document definitionDocument=XMLUtil.openDocument(definitionLocation);
  if (definitionDocument == null) {
    return null;
  }
  Element nameElement=XMLUtil.getElement(definitionDocument.getDocumentElement(),"String_Node_Str",null);
  if (nameElement == null) {
    return null;
  }
  return nameElement.getFirstChild().getNodeValue();
}

Fixed version (ground truth):
private static String getNameFromDefinition(URL definitionLocation){
  Document definitionDocument=XMLUtil.openDocument(definitionLocation);
  if (definitionDocument == null) {
    return null;
  }
  Element nameElement=XMLUtil.getElement(definitionDocument.getDocumentElement(),"String_Node_Str",null);
  if (nameElement == null) {
    return null;
  }
  if (nameElement.getFirstChild() == null) {
    return null;
  }
  return nameElement.getFirstChild().getNodeValue();
}
Program: 11142
Project: 11142
Buggy source:
@Override public void setTexture(TextureCache tc,Texture texture){
  if (tc == null) {
    String message=Logging.getMessage("String_Node_Str");
    Logging.logger().severe(message);
    throw new IllegalStateException(message);
  }
  tc.put(this.getTileKey(),texture);
  this.updateTime=System.currentTimeMillis();
  nullTextureData();
  this.updateMemoryCache();
}

Fixed version (ground truth):
@Override public void setTexture(TextureCache tc,Texture texture){
  if (tc == null) {
    String message=Logging.getMessage("String_Node_Str");
    Logging.logger().severe(message);
    throw new IllegalStateException(message);
  }
  tc.put(getTransformedTileKey(),texture);
  this.updateTime=System.currentTimeMillis();
  nullTextureData();
  this.updateMemoryCache();
}
Program: 11143
Project: 11143
Buggy source:
private void updateMemoryCache(){
  TileKey tileKey=this.getTileKey();
  tileKey=delegate.transformTileKey(tileKey);
  if (getMemoryCache().getObject(tileKey) != null)   getMemoryCache().add(tileKey,this);
}

Fixed version (ground truth):
private void updateMemoryCache(){
  if (getMemoryCache().getObject(getTransformedTileKey()) != null)   getMemoryCache().add(getTransformedTileKey(),this);
}
Program: 11144
Project: 11144
Buggy source:
@Override public void paint(Graphics g,JComponent c){
{
    super.paint(g,c);
  }
}

Fixed version (ground truth):
@Override public void paint(Graphics g,JComponent c){
  if (relayout || invalidatePath != null) {
    if (invalidatePath == null)     treeState.invalidateSizes();
 else     treeState.invalidatePathBounds(invalidatePath);
    updateSize();
    relayout=false;
    invalidatePath=null;
  }
  super.paint(g,c);
}
Program: 11145
Project: 11145
Buggy source:
public void relayout(){
synchronized (lock) {
    treeState.invalidateSizes();
    updateSize();
  }
}

Fixed version (ground truth):
public void relayout(){
  relayout=true;
}
Program: 11146
Project: 11146
Buggy source:
protected RenderInfo(DrawContext dc,int density,DoubleBuffer vertices,Integer verticesBuffer,Vec4 refCenter){
  processIndices(dc,density);
  processTextureCoordinates(dc,density);
  this.density=density;
  this.referenceCenter=refCenter;
  this.vertices=vertices;
  this.bufferIdVertices=verticesBuffer;
  this.indices=indexLists.get(this.density);
  this.bufferIdIndicies=indexBuffers.get(this.density);
  this.texCoords=parameterizations.get(this.density);
  this.bufferIdTexCoords=parameterizationsBuffers.get(this.density);
  this.time=System.currentTimeMillis();
}

Fixed version (ground truth):
public RenderInfo(DrawContext dc,int density,DoubleBuffer vertices,Integer verticesBuffer,Vec4 refCenter){
  processIndices(dc,density);
  processTextureCoordinates(dc,density);
  this.density=density;
  this.referenceCenter=refCenter;
  this.vertices=vertices;
  this.bufferIdVertices=verticesBuffer;
  this.indices=indexLists.get(this.density);
  this.bufferIdIndicies=indexBuffers.get(this.density);
  this.texCoords=parameterizations.get(this.density);
  this.bufferIdTexCoords=parameterizationsBuffers.get(this.density);
  this.time=System.currentTimeMillis();
}
Program: 11147
Project: 11147
Buggy source:
public static void main(String[] args){
  Settings.get();
  if (Settings.isNewSettings()) {
    try {
      String hostname=InetAddress.getLocalHost().getCanonicalHostName();
      if (hostname.endsWith("String_Node_Str")) {
        Settings.get().setProxyHost("String_Node_Str");
        Settings.get().setProxyPort(8080);
        Settings.get().setProxyType(ProxyType.HTTP);
        Settings.get().setProxyEnabled(true);
      }
    }
 catch (    Throwable t) {
    }
  }
  int argsLength=args.length;
  String lastArg=argsLength > 0 ? args[argsLength - 1].toLowerCase().trim() : null;
  boolean sandpit="String_Node_Str".equals(lastArg) || "String_Node_Str".equals(lastArg);
  GASandpit.setSandpitMode(sandpit);
  if (sandpit)   argsLength--;
  URL themeUrl=null;
  if (argsLength > 0) {
    try {
      themeUrl=new URL(args[0]);
    }
 catch (    MalformedURLException e) {
    }
  }
  if (themeUrl == null) {
    File file=new File("String_Node_Str");
    if (file.exists()) {
      try {
        themeUrl=file.toURI().toURL();
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  ThemeOpenDelegate delegate=new ThemeOpenDelegate(){
    @Override public void opened(    Theme theme){
      start(theme);
    }
  }
;
  if (themeUrl == null)   ThemeOpener.openDefault(delegate);
 else   ThemeOpener.openTheme(themeUrl,delegate);
}

Fixed version (ground truth):
public static void main(String[] args){
  int argsLength=args.length;
  String lastArg=argsLength > 0 ? args[argsLength - 1].toLowerCase().trim() : null;
  boolean sandpit="String_Node_Str".equals(lastArg) || "String_Node_Str".equals(lastArg);
  GASandpit.setSandpitMode(sandpit);
  if (sandpit)   argsLength--;
  Settings.init();
  if (Settings.isNewSettings()) {
    try {
      String hostname=InetAddress.getLocalHost().getCanonicalHostName();
      if (hostname.endsWith("String_Node_Str")) {
        Settings.get().setProxyHost("String_Node_Str");
        Settings.get().setProxyPort(8080);
        Settings.get().setProxyType(ProxyType.HTTP);
        Settings.get().setProxyEnabled(true);
      }
    }
 catch (    Throwable t) {
    }
  }
  URL themeUrl=null;
  if (argsLength > 0) {
    try {
      themeUrl=new URL(args[0]);
    }
 catch (    MalformedURLException e) {
    }
  }
  if (themeUrl == null) {
    File file=new File("String_Node_Str");
    if (file.exists()) {
      try {
        themeUrl=file.toURI().toURL();
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  ThemeOpenDelegate delegate=new ThemeOpenDelegate(){
    @Override public void opened(    Theme theme){
      start(theme);
    }
  }
;
  if (themeUrl == null)   ThemeOpener.openDefault(delegate);
 else   ThemeOpener.openTheme(themeUrl,delegate);
}
Program: 11148
Project: 11148
Buggy source:
public Settings(){
  init();
}

Fixed version (ground truth):
public Settings(){
  updateProxyConfiguration();
  setVerticalExaggeration(getVerticalExaggeration());
}
Program: 11149
Project: 11149
Buggy source:
private void init(){
  updateProxyConfiguration();
  setVerticalExaggeration(getVerticalExaggeration());
}

Fixed version (ground truth):
public static void init(){
  instance=SettingsPersistance.load(getSettingsFile());
  if (instance == null) {
    instance=new Settings();
    newSettings=true;
  }
}
Program: 11150
Project: 11150
Buggy source:
public static Settings get(){
  return instance;
}

Fixed version (ground truth):
public static Settings get(){
  if (instance == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return instance;
}
Program: 11153
Project: 11153
Buggy source:
public static AVList getExpirationParams(Element domElement,AVList params){
  if (params == null)   params=new AVListImpl();
  XPath xpath=WWXML.makeXPath();
  WWXML.checkAndSetLongParam(domElement,params,AVKeyMore.EXPIRY_START_TIME,"String_Node_Str",xpath);
  WWXML.checkAndSetDateTimeParam(domElement,params,AVKeyMore.EXPIRY_START_TIME,"String_Node_Str",DATE_TIME_PATTERN,xpath);
  WWXML.checkAndSetTimeParamAsInteger(domElement,params,AVKeyMore.EXPIRY_TIMESPAN,"String_Node_Str",xpath);
  return params;
}

Fixed version (ground truth):
public static AVList getExpirationParams(Element domElement,AVList params){
  if (params == null)   params=new AVListImpl();
  XPath xpath=WWXML.makeXPath();
  WWXML.checkAndSetLongParam(domElement,params,AVKeyMore.EXPIRY_START_TIME,"String_Node_Str",xpath);
  WWXML.checkAndSetDateTimeParam(domElement,params,AVKeyMore.EXPIRY_START_TIME,"String_Node_Str",DATE_TIME_PATTERN,xpath);
  WWXML.checkAndSetTimeParam(domElement,params,AVKeyMore.EXPIRY_TIMESPAN,"String_Node_Str",xpath);
  return params;
}
Program: 11155
Project: 11155
Buggy source:
private void saveDDS(BufferedImage image,File file) throws IOException {
  ByteBuffer buffer;
  if (image.getColorModel().hasAlpha())   buffer=DDSConverter.convertToDxt3(image);
 else   buffer=DDSConverter.convertToDxt1NoTransparency(image);
synchronized (this.getFileLock()) {
    WWIO.saveBuffer(buffer,file);
  }
}

Fixed version (ground truth):
private void saveDDS(BufferedImage image,File file) throws IOException {
  ByteBuffer buffer=DDSCompressor.compressImage(image);
synchronized (this.getFileLock()) {
    WWIO.saveBuffer(buffer,file);
  }
}
Program: 11157
Project: 11157
Buggy source:
public static int levelCount(Dataset dataset,double lztd,Sector sector,int tilesize){
  double width=dataset.getRasterXSize();
  double height=dataset.getRasterYSize();
  double lonPixels=sector.getDeltaLongitude() / width;
  double latPixels=sector.getDeltaLatitude() / height;
  double texelSize=Math.min(latPixels,lonPixels);
  return (int)Math.ceil(Math.log10(texelSize * tilesize / lztd) / Math.log10(0.5)) + 1;
}

Fixed version (ground truth):
public static int levelCount(Dataset dataset,double lztd,Sector sector,int tilesize){
  double width=dataset.getRasterXSize();
  double height=dataset.getRasterYSize();
  double lonPixels=sector.getDeltaLongitude() / width;
  double latPixels=sector.getDeltaLatitude() / height;
  double texelSize=Math.min(latPixels,lonPixels);
  int level=(int)Math.ceil(Math.log10(texelSize * tilesize / lztd) / Math.log10(0.5)) + 1;
  return Math.max(level,1);
}
Program: 11160
Project: 11160
Buggy source:
private static void start() throws Exception {
  File dataDir=new File("String_Node_Str");
  File gdalDir=new File("String_Node_Str");
  if (!dataDir.exists()) {
    throw new FileNotFoundException("String_Node_Str" + dataDir.getAbsolutePath());
  }
  if (!gdalDir.exists()) {
    throw new FileNotFoundException("String_Node_Str" + gdalDir.getAbsolutePath());
  }
  Object libc=Native.loadLibrary("String_Node_Str",WinLibC.class);
  ((WinLibC)libc)._putenv("String_Node_Str" + dataDir.getAbsolutePath());
  String path=System.getenv("String_Node_Str");
  path=path + "String_Node_Str" + gdalDir.getAbsolutePath();
  ((WinLibC)libc)._putenv("String_Node_Str" + path);
  String newLibPath=gdalDir.getAbsolutePath() + File.pathSeparator + System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str",newLibPath);
  Field fieldSysPath=ClassLoader.class.getDeclaredField("String_Node_Str");
  if (fieldSysPath != null) {
    fieldSysPath.setAccessible(true);
    fieldSysPath.set(System.class.getClassLoader(),null);
  }
  Application.start();
}

Fixed version (ground truth):
private static void start() throws Exception {
  File dataDir=new File("String_Node_Str");
  File gdalDir=new File("String_Node_Str");
  if (!dataDir.exists()) {
    throw new FileNotFoundException("String_Node_Str" + dataDir.getAbsolutePath());
  }
  if (!gdalDir.exists()) {
    throw new FileNotFoundException("String_Node_Str" + gdalDir.getAbsolutePath());
  }
  Object libc=Native.loadLibrary("String_Node_Str",WinLibC.class);
  ((WinLibC)libc)._putenv("String_Node_Str" + dataDir.getAbsolutePath());
  String path=System.getenv("String_Node_Str");
  path=gdalDir.getAbsolutePath() + "String_Node_Str" + path;
  ((WinLibC)libc)._putenv("String_Node_Str" + path);
  String newLibPath=gdalDir.getAbsolutePath() + File.pathSeparator + System.getProperty("String_Node_Str");
  System.setProperty("String_Node_Str",newLibPath);
  Field fieldSysPath=ClassLoader.class.getDeclaredField("String_Node_Str");
  if (fieldSysPath != null) {
    fieldSysPath.setAccessible(true);
    fieldSysPath.set(System.class.getClassLoader(),null);
  }
  Application.start();
}
Program: 11161
Project: 11161
Buggy source:
protected void readDatasetReprojected(Dataset dataset,SpatialReference dstSR) throws GDALException, TilerException {
  Driver memDriver=gdal.GetDriverByName("String_Node_Str");
  Dataset dst=memDriver.Create("String_Node_Str",width,height);
  while (dst.getRasterCount() < dataset.getRasterCount())   dst.AddBand();
  double[] geoTransformArray=new double[6];
  geoTransformArray[0]=minLongitude;
  geoTransformArray[3]=maxLatitude;
  geoTransformArray[1]=(maxLongitude - minLongitude) / (double)width;
  geoTransformArray[5]=(minLatitude - maxLatitude) / (double)height;
  dst.SetGeoTransform(geoTransformArray);
  dst.SetProjection(dstSR.ExportToWkt());
  int returnVal=gdal.ReprojectImage(dataset,dst,null,null,gdalconst.GRA_NearestNeighbour);
  if (returnVal != gdalconstConstants.CE_None) {
    throw new GDALException();
  }
  readRectangle(dataset,null);
}

Fixed version (ground truth):
protected void readDatasetReprojected(Dataset dataset,SpatialReference dstSR) throws GDALException, TilerException {
  Driver memDriver=gdal.GetDriverByName("String_Node_Str");
  Dataset dst=memDriver.Create("String_Node_Str",width,height);
  while (dst.getRasterCount() < dataset.getRasterCount())   dst.AddBand();
  double[] geoTransformArray=new double[6];
  geoTransformArray[0]=minLongitude;
  geoTransformArray[3]=maxLatitude;
  geoTransformArray[1]=(maxLongitude - minLongitude) / (double)width;
  geoTransformArray[5]=(minLatitude - maxLatitude) / (double)height;
  dst.SetGeoTransform(geoTransformArray);
  dst.SetProjection(dstSR.ExportToWkt());
  int returnVal=gdal.ReprojectImage(dataset,dst,null,null,gdalconst.GRA_NearestNeighbour);
  if (returnVal != gdalconstConstants.CE_None) {
    throw new GDALException();
  }
  readRectangle(dst,null);
}
Program: 11163
Project: 11163
Buggy source:
private static Double[] stringsToDoubles(String[] s){
  Double[] d=new Double[s.length];
  for (int i=0; i < s.length; i++) {
    if (s.length == 0) {
      d[i]=null;
    }
 else {
      d[i]=Double.parseDouble(s[i]);
    }
  }
  return d;
}

Fixed version (ground truth):
private static Double[] stringsToDoubles(String[] s){
  Double[] d=new Double[s.length];
  for (int i=0; i < s.length; i++) {
    String t=s[i].trim();
    if (t.length() == 0) {
      d[i]=null;
    }
 else {
      d[i]=Double.parseDouble(t);
    }
  }
  return d;
}
Program: 11164
Project: 11164
Buggy source:
private static NullableNumberArray parseNumberArray(Option option,String arg) throws IllegalOptionValueException {
  try {
    String[] split=arg.split("String_Node_Str");
    Double[] d=stringsToDoubles(split);
    NullableNumberArray n=new NullableNumberArray(d.length);
    n.setDoubles(d);
    return n;
  }
 catch (  Exception e) {
    throw new IllegalOptionValueException(option,arg);
  }
}

Fixed version (ground truth):
private static NullableNumberArray parseNumberArray(Option option,String arg) throws IllegalOptionValueException {
  try {
    String[] split=(arg + "String_Node_Str").split("String_Node_Str");
    Double[] d=stringsToDoubles(split);
    NullableNumberArray n=new NullableNumberArray(d.length);
    n.setDoubles(d);
    return n;
  }
 catch (  Exception e) {
    throw new IllegalOptionValueException(option,arg);
  }
}
Program: 11165
Project: 11165
Buggy source:
private BufferedImage loadImage(File file) throws IOException {
  if (!elevations)   return ImageIO.read(file);
 else {
    FileInputStream fis=null;
    ByteBuffer bb=ByteBuffer.allocate((int)file.length());
    bb.order(ByteOrder.LITTLE_ENDIAN);
    int length=bb.limit() / typeSize;
    try {
      fis=new FileInputStream(file);
      fis.getChannel().read(bb);
      bb.rewind();
    }
  finally {
      if (fis != null)       fis.close();
    }
    double min=Double.MAX_VALUE, max=-Double.MAX_VALUE;
    for (int i=0; i < width * height && i < length; i++) {
      double value=getBufferValue(bb);
      if (value == nodata)       continue;
      if (value < min)       min=value;
      if (value > max)       max=value;
    }
    if (max == min)     max=min + 1;
    int pixels=width * height;
    int[] offsets=new int[4];
    offsets[3]=pixels;
    bb.rewind();
    byte[] bytes=new byte[pixels * 2];
    for (int i=0; i < width * height && i < length; i++) {
      double value=getBufferValue(bb);
      bytes[i]=(byte)(255d * (value - min) / (max - min));
      bytes[i + pixels]=(byte)(value == nodata ? 0 : 255);
    }
    DataBuffer dataBuffer=new DataBufferByte(bytes,bytes.length);
    SampleModel sampleModel=new ComponentSampleModel(DataBuffer.TYPE_BYTE,width,height,1,width,offsets);
    WritableRaster raster=Raster.createWritableRaster(sampleModel,dataBuffer,null);
    BufferedImage image=new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
    image.setData(raster);
    return image;
  }
}

Fixed version (ground truth):
private BufferedImage loadImage(File file) throws IOException {
  if (!elevations)   return ImageIO.read(file);
 else {
    FileInputStream fis=null;
    ByteBuffer bb=ByteBuffer.allocate((int)file.length());
    bb.order(ByteOrder.LITTLE_ENDIAN);
    int length=bb.limit() / typeSize;
    try {
      fis=new FileInputStream(file);
      fis.getChannel().read(bb);
      bb.rewind();
    }
  finally {
      if (fis != null)       fis.close();
    }
    double min=Double.MAX_VALUE, max=-Double.MAX_VALUE;
    for (int i=0; i < width * height && i < length; i++) {
      double value=getBufferValue(bb);
      if (nodata != null && value == nodata)       continue;
      if (value < min)       min=value;
      if (value > max)       max=value;
    }
    if (max == min)     max=min + 1;
    int pixels=width * height;
    int[] offsets=new int[4];
    offsets[3]=pixels;
    bb.rewind();
    byte[] bytes=new byte[pixels * 2];
    for (int i=0; i < width * height && i < length; i++) {
      double value=getBufferValue(bb);
      bytes[i]=(byte)(255d * (value - min) / (max - min));
      bytes[i + pixels]=(byte)(nodata != null && value == nodata ? 0 : 255);
    }
    DataBuffer dataBuffer=new DataBufferByte(bytes,bytes.length);
    SampleModel sampleModel=new ComponentSampleModel(DataBuffer.TYPE_BYTE,width,height,1,width,offsets);
    WritableRaster raster=Raster.createWritableRaster(sampleModel,dataBuffer,null);
    BufferedImage image=new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
    image.setData(raster);
    return image;
  }
}
Program: 11166
Project: 11166
Buggy source:
@Override public void mousePressed(MouseEvent e){
  dragging=getListItemUnderMouse(e.getPoint());
}

Fixed version (ground truth):
@Override public void mousePressed(MouseEvent e){
  stopAnnotations();
  if (!playing) {
    wwd.getInputHandler().removeMouseListener(this);
  }
}
Program: 11168
Project: 11168
Buggy source:
private long flyToAnnotation(Annotation annotation){
  View view=wwd.getView();
  if (view instanceof OrbitView) {
    OrbitView orbitView=(OrbitView)view;
    Position center=orbitView.getCenterPosition();
    Position newCenter=Position.fromDegrees(annotation.getLatitude(),annotation.getLongitude(),0);
    long lengthMillis=Util.getScaledLengthMillis(center,newCenter);
    Angle heading=orbitView.getHeading();
    Angle pitch=orbitView.getPitch();
    double zoom=orbitView.getZoom();
    if (annotation.isSaveCamera()) {
      zoom=annotation.getZoom();
      heading=Angle.fromDegrees(annotation.getHeading());
      pitch=Angle.fromDegrees(annotation.getPitch());
    }
 else {
      double minZoom=annotation.getMinZoom();
      double maxZoom=annotation.getMaxZoom();
      if (minZoom >= 0 && zoom > minZoom)       zoom=Math.max(minZoom,1000);
 else       if (maxZoom >= 0 && zoom < maxZoom)       zoom=maxZoom;
    }
    view.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView,center,newCenter,orbitView.getHeading(),heading,orbitView.getPitch(),pitch,orbitView.getZoom(),zoom,lengthMillis,true));
    return lengthMillis;
  }
  return -1;
}

Fixed version (ground truth):
private long flyToAnnotation(Annotation annotation){
  View view=wwd.getView();
  if (view instanceof OrbitView) {
    OrbitView orbitView=(OrbitView)view;
    Position center=orbitView.getCenterPosition();
    Position newCenter=Position.fromDegrees(annotation.getLatitude(),annotation.getLongitude(),0);
    long lengthMillis=Util.getScaledLengthMillis(center,newCenter);
    Angle heading=orbitView.getHeading();
    Angle pitch=orbitView.getPitch();
    double zoom=orbitView.getZoom();
    if (annotation.isSaveCamera()) {
      zoom=annotation.getZoom();
      heading=Angle.fromDegrees(annotation.getHeading());
      pitch=Angle.fromDegrees(annotation.getPitch());
    }
 else {
      double minZoom=annotation.getMinZoom();
      double maxZoom=annotation.getMaxZoom();
      if (minZoom >= 0 && zoom > minZoom)       zoom=Math.max(minZoom,1000);
 else       if (maxZoom >= 0 && zoom < maxZoom)       zoom=maxZoom;
    }
    view.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView,center,newCenter,orbitView.getHeading(),heading,orbitView.getPitch(),pitch,orbitView.getZoom(),zoom,lengthMillis,true));
    wwd.redraw();
    return lengthMillis;
  }
  return -1;
}
Program: 11169
Project: 11169
Buggy source:
private void updateBookmarksMenu(){
  while (bookmarksMenu.getMenuComponentCount() > 3) {
    bookmarksMenu.remove(3);
  }
  for (  final Bookmark bookmark : Bookmarks.iterable()) {
    JMenuItem mi=new JMenuItem(bookmark.getName());
    bookmarksMenu.add(mi);
    mi.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        View view=wwd.getView();
        if (view instanceof OrbitView) {
          OrbitView orbitView=(OrbitView)view;
          Position center=orbitView.getCenterPosition();
          Position newCenter=Position.fromDegrees(bookmark.getLat(),bookmark.getLon(),bookmark.getElevation());
          long lengthMillis=Util.getScaledLengthMillis(center,newCenter);
          orbitView.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView,center,newCenter,orbitView.getHeading(),Angle.fromDegrees(bookmark.getHeading()),orbitView.getPitch(),Angle.fromDegrees(bookmark.getPitch()),orbitView.getZoom(),bookmark.getZoom(),lengthMillis,true));
        }
      }
    }
);
  }
}

Fixed version (ground truth):
private void updateBookmarksMenu(){
  while (bookmarksMenu.getMenuComponentCount() > 3) {
    bookmarksMenu.remove(3);
  }
  for (  final Bookmark bookmark : Bookmarks.iterable()) {
    JMenuItem mi=new JMenuItem(bookmark.getName());
    bookmarksMenu.add(mi);
    mi.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        View view=wwd.getView();
        if (view instanceof OrbitView) {
          OrbitView orbitView=(OrbitView)view;
          Position center=orbitView.getCenterPosition();
          Position newCenter=Position.fromDegrees(bookmark.getLat(),bookmark.getLon(),bookmark.getElevation());
          long lengthMillis=Util.getScaledLengthMillis(center,newCenter);
          orbitView.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView,center,newCenter,orbitView.getHeading(),Angle.fromDegrees(bookmark.getHeading()),orbitView.getPitch(),Angle.fromDegrees(bookmark.getPitch()),orbitView.getZoom(),bookmark.getZoom(),lengthMillis,true));
          wwd.redraw();
        }
      }
    }
);
  }
}
Program: 11170
Project: 11170
Buggy source:
public void actionPerformed(ActionEvent e){
  View view=wwd.getView();
  if (view instanceof OrbitView) {
    OrbitView orbitView=(OrbitView)view;
    Position center=orbitView.getCenterPosition();
    Position newCenter=Position.fromDegrees(bookmark.getLat(),bookmark.getLon(),bookmark.getElevation());
    long lengthMillis=Util.getScaledLengthMillis(center,newCenter);
    orbitView.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView,center,newCenter,orbitView.getHeading(),Angle.fromDegrees(bookmark.getHeading()),orbitView.getPitch(),Angle.fromDegrees(bookmark.getPitch()),orbitView.getZoom(),bookmark.getZoom(),lengthMillis,true));
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  View view=wwd.getView();
  if (view instanceof OrbitView) {
    OrbitView orbitView=(OrbitView)view;
    Position center=orbitView.getCenterPosition();
    Position newCenter=Position.fromDegrees(bookmark.getLat(),bookmark.getLon(),bookmark.getElevation());
    long lengthMillis=Util.getScaledLengthMillis(center,newCenter);
    orbitView.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(orbitView,center,newCenter,orbitView.getHeading(),Angle.fromDegrees(bookmark.getHeading()),orbitView.getPitch(),Angle.fromDegrees(bookmark.getPitch()),orbitView.getZoom(),bookmark.getZoom(),lengthMillis,true));
    wwd.redraw();
  }
}
Program: 11171
Project: 11171
Buggy source:
private void createDoubleClickListener(){
  wwd.addMouseListener(new DoubleClickZoomListener(wwd,5000d));
}

Fixed version (ground truth):
private void createDoubleClickListener(){
  wwd.getInputHandler().addMouseListener(new DoubleClickZoomListener(wwd,5000d));
}
Program: 11172
Project: 11172
Buggy source:
private void resetView(){
  if (!(wwd.getView() instanceof OrbitView))   return;
  OrbitView view=(OrbitView)wwd.getView();
  Position beginCenter=view.getCenterPosition();
  Double initLat=Configuration.getDoubleValue(AVKey.INITIAL_LATITUDE);
  Double initLon=Configuration.getDoubleValue(AVKey.INITIAL_LONGITUDE);
  Double initAltitude=Configuration.getDoubleValue(AVKey.INITIAL_ALTITUDE);
  Double initHeading=Configuration.getDoubleValue(AVKey.INITIAL_HEADING);
  Double initPitch=Configuration.getDoubleValue(AVKey.INITIAL_PITCH);
  if (initLat == null)   initLat=0d;
  if (initLon == null)   initLon=0d;
  if (initAltitude == null)   initAltitude=3d * Earth.WGS84_EQUATORIAL_RADIUS;
  if (initHeading == null)   initHeading=0d;
  if (initPitch == null)   initPitch=0d;
  Position endCenter=Position.fromDegrees(initLat,initLon,beginCenter.getElevation());
  long lengthMillis=Util.getScaledLengthMillis(beginCenter,endCenter);
  view.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(view,beginCenter,endCenter,view.getHeading(),Angle.fromDegrees(initHeading),view.getPitch(),Angle.fromDegrees(initPitch),view.getZoom(),initAltitude,lengthMillis,true));
}

Fixed version (ground truth):
private void resetView(){
  if (!(wwd.getView() instanceof OrbitView))   return;
  OrbitView view=(OrbitView)wwd.getView();
  Position beginCenter=view.getCenterPosition();
  Double initLat=Configuration.getDoubleValue(AVKey.INITIAL_LATITUDE);
  Double initLon=Configuration.getDoubleValue(AVKey.INITIAL_LONGITUDE);
  Double initAltitude=Configuration.getDoubleValue(AVKey.INITIAL_ALTITUDE);
  Double initHeading=Configuration.getDoubleValue(AVKey.INITIAL_HEADING);
  Double initPitch=Configuration.getDoubleValue(AVKey.INITIAL_PITCH);
  if (initLat == null)   initLat=0d;
  if (initLon == null)   initLon=0d;
  if (initAltitude == null)   initAltitude=3d * Earth.WGS84_EQUATORIAL_RADIUS;
  if (initHeading == null)   initHeading=0d;
  if (initPitch == null)   initPitch=0d;
  Position endCenter=Position.fromDegrees(initLat,initLon,beginCenter.getElevation());
  long lengthMillis=Util.getScaledLengthMillis(beginCenter,endCenter);
  view.addAnimator(FlyToOrbitViewAnimator.createFlyToOrbitViewAnimator(view,beginCenter,endCenter,view.getHeading(),Angle.fromDegrees(initHeading),view.getPitch(),Angle.fromDegrees(initPitch),view.getZoom(),initAltitude,lengthMillis,true));
  wwd.redraw();
}
Program: 11174
Project: 11174
Buggy source:
@Override protected String makeEyeAltitudeDescription(double metersAltitude){
  String s;
  if (UNIT_IMPERIAL.equals(getElevationUnit()))   return super.makeEyeAltitudeDescription(metersAltitude);
 else {
    if (metersAltitude < 1e4)     s=String.format("String_Node_Str",(int)Math.round(metersAltitude));
 else     s=String.format("String_Node_Str",(int)Math.round(metersAltitude / 1e3));
  }
  return s;
}

Fixed version (ground truth):
@Override protected String makeEyeAltitudeDescription(double metersAltitude){
  String s;
  String altitude=Logging.getMessage("String_Node_Str");
  if (UNIT_IMPERIAL.equals(getElevationUnit()))   return super.makeEyeAltitudeDescription(metersAltitude);
 else {
    if (metersAltitude < 1e4)     s=String.format(altitude + "String_Node_Str",(int)Math.round(metersAltitude));
 else     s=String.format(altitude + "String_Node_Str",(int)Math.round(metersAltitude / 1e3));
  }
  return s;
}