nus-yam/ex-repair huggingface dataset:
Program: 46423
Project: 46423
Buggy source:
/** 
 * Disarm the processor 
 */
private void disarm(){
  setArmingCondition(null);
}

Fixed version (ground truth):
/** 
 * Disarm the listener's processor. 
 */
void disarm(){
  setArmingCondition(null);
}
Program: 46424
Project: 46424
Buggy source:
/** 
 * INTERNAL ONLY. <br> Called when there is new event in the input queue.
 */
@InternalAPI public void compute(ProcessorArmingCollection collection){
  Event event=null;
  try {
    event=inputQueue.take();
  }
 catch (  Exception ex) {
  }
  if (event == null)   return;
  computeEvent(event);
  lastComputedEvent=event;
}

Fixed version (ground truth):
/** 
 * INTERNAL ONLY. <br> Called when there is new event in the input queue.
 */
@InternalAPI public void compute(ProcessorArmingCollection collection){
  Event event=null;
  if (computedEvents != null) {
    computedEvents.clear();
  }
  try {
    while (inputQueue.peek() != null) {
      event=inputQueue.take();
      if (event == null) {
        logger.warning("String_Node_Str");
        return;
      }
      computeEvent(event);
      if (computedEvents == null) {
        computedEvents=new LinkedList<Event>();
      }
      computedEvents.add(event);
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    logger.warning("String_Node_Str");
  }
}
Program: 46425
Project: 46425
Buggy source:
/** 
 * {@inheritDoc}
 */
public void addToEntity(Entity entity){
  EventListenerCollection collection=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (collection == null) {
    collection=new EventListenerCollection();
    entity.addComponent(EventListenerCollection.class,collection);
  }
 else {
    if (collection.contains(this)) {
      return;
    }
    collection.add(this);
  }
  numEntitiesAttached++;
  if (numEntitiesAttached == 1 && enabled) {
    arm();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void addToEntity(Entity entity){
  EventListenerCollection collection=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (collection == null) {
    collection=new EventListenerCollection();
    entity.addComponent(EventListenerCollection.class,collection);
  }
 else {
    if (collection.contains(this)) {
      return;
    }
    collection.add(this);
  }
  addProcessorCompToEntity(this,entity);
  numEntitiesAttached++;
  if (numEntitiesAttached == 1 && enabled) {
    arm();
  }
}
Program: 46426
Project: 46426
Buggy source:
/** 
 * Arm the processor 
 */
private void arm(){
  setArmingCondition(new PostEventCondition(this,new long[]{MTGAME_EVENT_ID}));
}

Fixed version (ground truth):
/** 
 * Arm the listener's processor. 
 */
void arm(){
  setArmingCondition(new PostEventCondition(this,new long[]{MTGAME_EVENT_ID}));
}
Program: 46427
Project: 46427
Buggy source:
/** 
 * Initialize the input manager to receive input events from the given AWT canvas and start the input manager running. The input manager will perform picks with the given camera. This routine can only be called once. To subsequently change the  camera, use <code>setCameraComponent</code>. To subsequently change the focus manager, use <code>setFocusManager</code>.
 * @param canvas The AWT canvas which generates AWT user events.
 * @param cameraComp The mtgame camera component to use for picking operations.
 */
public void initialize(Canvas canvas,CameraComponent cameraComp){
  if (this.canvas != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.canvas=canvas;
  inputPicker.setCanvas(canvas);
  setCameraComponent(cameraComp);
  canvas.addKeyListener(this);
  if (ENABLE_EMBEDDED_SWING) {
    logger.info("String_Node_Str");
  }
 else {
    logger.info("String_Node_Str");
    canvas.addMouseListener(this);
    canvas.addMouseMotionListener(this);
    canvas.addMouseWheelListener(this);
  }
  injectInitialMouseEvent();
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initialize the input manager to receive input events from the given AWT canvas and start the input manager running. The input manager will perform picks with the given camera. This routine can only be called once. To subsequently change the  camera, use <code>setCameraComponent</code>. To subsequently change the focus manager, use <code>setFocusManager</code>.
 * @param wm The mtgame world manager.
 * @param canvas The AWT canvas which generates AWT user events.
 * @param cameraComp The mtgame camera component to use for picking operations.
 */
public void initialize(WorldManager wm,Canvas canvas,CameraComponent cameraComp){
  if (this.canvas != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.canvas=canvas;
  inputPicker.setCanvas(canvas);
  setCameraComponent(cameraComp);
  initializeGlobalFocus(wm);
  canvas.addKeyListener(this);
  if (ENABLE_EMBEDDED_SWING) {
    logger.fine("String_Node_Str");
  }
 else {
    logger.fine("String_Node_Str");
    canvas.addMouseListener(this);
    canvas.addMouseMotionListener(this);
    canvas.addMouseWheelListener(this);
  }
  logger.fine("String_Node_Str");
}
Program: 46428
Project: 46428
Buggy source:
/** 
 * Process key events. No picking is actually performed. Key events are delivered starting at the entity that has the keyboard focus.
 */
void pickKeyEvent(KeyEvent awtEvent){
  KeyEvent3D keyEvent=(KeyEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(keyEvent);
}

Fixed version (ground truth):
/** 
 * Process key events. No picking is actually performed. Key events are delivered starting at the entity that has the keyboard focus.
 */
void pickKeyEvent(KeyEvent awtEvent){
  logger.fine("String_Node_Str" + awtEvent);
  KeyEvent3D keyEvent=(KeyEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(keyEvent);
}
Program: 46429
Project: 46429
Buggy source:
/** 
 * Mouse Event picker for non-Embedded Swing case. Finds the first consuming entity and then turns the work over to the event deliverer. This method does not return a result but instead enqueues an entry for the event in the input queue of the event deliverer.
 */
void pickMouseEventNonSwing(MouseEvent awtEvent){
  logger.info("String_Node_Str" + awtEvent);
  destPickInfo=determineDestPickInfo(awtEvent);
  if (destPickInfo == null || destPickInfo.size() <= 0) {
    return;
  }
  logger.info("String_Node_Str" + destPickInfo);
  int eventID=awtEvent.getID();
  if (eventID == MouseEvent.MOUSE_MOVED || eventID == MouseEvent.MOUSE_DRAGGED) {
    generateEnterExitEvents(awtEvent,destPickInfo);
  }
  MouseEvent3D event=(MouseEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(event,destPickInfo);
}

Fixed version (ground truth):
/** 
 * Mouse Event picker for non-Embedded Swing case. Finds the first consuming entity and then turns the work over to the event deliverer. This method does not return a result but instead enqueues an entry for the event in the input queue of the event deliverer.
 */
void pickMouseEventNonSwing(MouseEvent awtEvent){
  logger.fine("String_Node_Str" + awtEvent);
  destPickInfo=determineDestPickInfo(awtEvent);
  if (destPickInfo == null || destPickInfo.size() <= 0) {
    logger.finest("String_Node_Str");
    return;
  }
  logger.fine("String_Node_Str" + destPickInfo);
  int eventID=awtEvent.getID();
  if (eventID == MouseEvent.MOUSE_MOVED || eventID == MouseEvent.MOUSE_DRAGGED) {
    generateEnterExitEvents(awtEvent,destPickInfo);
  }
  MouseEvent3D event=(MouseEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(event,destPickInfo);
}
Program: 46430
Project: 46430
Buggy source:
/** 
 * See if any of the enabled event listeners for the given entity are willing to consume the given event. Post the event to willing consumers. Also, returns the OR of propagatesToParent for all enabled listeners  and the OR of propagatesToUnder for all enabled listeners in propState.
 */
protected void tryListenersForEntity(Entity entity,Event event,PropagationState propState){
  logger.fine("String_Node_Str" + entity + "String_Node_Str"+ event);
  EventListenerCollection listeners=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (listeners == null) {
    logger.fine("String_Node_Str");
    propState.toUnder=false;
  }
 else {
    Iterator<EventListener> it=listeners.iterator();
    while (it.hasNext()) {
      EventListener listener=it.next();
      if (listener.isEnabled()) {
        logger.fine("String_Node_Str" + listener);
        Event distribEvent=createEventForEntity(event,entity);
        if (listener.consumesEvent(distribEvent)) {
          logger.fine("String_Node_Str");
          listener.postEvent(distribEvent);
        }
        propState.toParent|=listener.propagatesToParent(distribEvent);
        propState.toUnder|=listener.propagatesToUnder(distribEvent);
        logger.finer("String_Node_Str" + propState.toParent + "String_Node_Str"+ propState.toUnder);
      }
    }
  }
  logger.fine("String_Node_Str" + propState.toParent + "String_Node_Str"+ propState.toUnder);
}

Fixed version (ground truth):
/** 
 * See if any of the enabled event listeners for the given entity are willing to consume the given event. Post the event to willing consumers. Also, returns the OR of propagatesToParent for all enabled listeners  and the OR of propagatesToUnder for all enabled listeners in propState.
 */
protected void tryListenersForEntity(Entity entity,Event event,PropagationState propState){
  logger.fine("String_Node_Str" + entity + "String_Node_Str"+ event);
  EventListenerCollection listeners=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (listeners == null || listeners.size() <= 0) {
    logger.fine("String_Node_Str");
    propState.toUnder=false;
  }
 else {
    Iterator<EventListener> it=listeners.iterator();
    while (it.hasNext()) {
      EventListener listener=it.next();
      if (listener.isEnabled()) {
        logger.fine("String_Node_Str" + listener);
        Event distribEvent=createEventForEntity(event,entity);
        if (listener.consumesEvent(distribEvent)) {
          logger.fine("String_Node_Str");
          listener.postEvent(distribEvent);
        }
        propState.toParent|=listener.propagatesToParent(distribEvent);
        propState.toUnder|=listener.propagatesToUnder(distribEvent);
        logger.finer("String_Node_Str" + propState.toParent + "String_Node_Str"+ propState.toUnder);
      }
    }
  }
  logger.fine("String_Node_Str" + propState.toParent + "String_Node_Str"+ propState.toUnder);
}
Program: 46431
Project: 46431
Buggy source:
/** 
 * {@inheritDoc}
 */
public void addToEntity(Entity entity){
  EventListenerCollection collection=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (collection == null) {
    collection=new EventListenerCollection();
    entity.addComponent(EventListenerCollection.class,collection);
  }
 else {
    if (collection.contains(this)) {
      return;
    }
    collection.add(this);
  }
  addProcessorCompToEntity(this,entity);
  numEntitiesAttached++;
  if (numEntitiesAttached == 1 && enabled) {
    arm();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void addToEntity(Entity entity){
  EventListenerCollection collection=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (collection == null) {
    collection=new EventListenerCollection();
    entity.addComponent(EventListenerCollection.class,collection);
  }
 else {
    if (collection.contains(this)) {
      return;
    }
  }
  collection.add(this);
  addProcessorCompToEntity(this,entity);
  numEntitiesAttached++;
  if (numEntitiesAttached == 1 && enabled) {
    arm();
  }
}
Program: 46432
Project: 46432
Buggy source:
public void commitEvent(Event event){
  logger.info("String_Node_Str" + event + "String_Node_Str"+ event.getEntity());
}

Fixed version (ground truth):
public void commitEvent(Event event){
  StringBuffer sb=new StringBuffer();
  if (name != null) {
    sb.append(name + "String_Node_Str");
  }
  sb.append("String_Node_Str" + event + "String_Node_Str"+ event.getEntity());
  logger.info(sb.toString());
}
Program: 46433
Project: 46433
Buggy source:
public void commitEvent(Event event){
  logger.info("String_Node_Str" + event + "String_Node_Str"+ event.getEntity());
}

Fixed version (ground truth):
public void commitEvent(Event event){
  StringBuffer sb=new StringBuffer();
  if (name != null) {
    sb.append(name + "String_Node_Str");
  }
  sb.append("String_Node_Str" + event + "String_Node_Str"+ event.getEntity());
  logger.info(sb.toString());
}
Program: 46434
Project: 46434
Buggy source:
/** 
 * Free an already allocated event ID.
 */
protected static void free(int eventID){
  idAllocator.free(eventID);
}

Fixed version (ground truth):
/** 
 * Free an already allocated event class ID.
 */
protected static void free(int eventClassID){
  classIdAllocator.free(eventClassID);
}
Program: 46435
Project: 46435
Buggy source:
/** 
 * {@inheritDoc}
 */
public void commitEvent(Event event){
  MouseButtonEvent3D buttonEvent=(MouseButtonEvent3D)event;
  if (!buttonEvent.isPressed()) {
    return;
  }
  Entity entity=event.getEntity();
  if (entity.getComponent(SpinProcessor.class) != null) {
    entity.removeComponent(SpinProcessor.class);
  }
 else {
    try {
      entity.addComponent(SpinProcessor.class,new SpinProcessor(entity));
    }
 catch (    InstantiationException ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void commitEvent(Event event){
  if (!((MouseButtonEvent3D)event).isPressed()) {
    return;
  }
  Entity entity=event.getEntity();
  if (entity.getComponent(SpinProcessor.class) != null) {
    entity.removeComponent(SpinProcessor.class);
  }
 else {
    try {
      entity.addComponent(SpinProcessor.class,new SpinProcessor(entity));
    }
 catch (    InstantiationException ex) {
    }
  }
}
Program: 46436
Project: 46436
Buggy source:
/** 
 * Initialize the input manager to receive input events from the given AWT canvas and start the input manager running. The input manager will perform picks with the given camera. This routine can only be called once. To subsequently change the  camera, use <code>setCameraComponent</code>.
 * @param canvas The AWT canvas which generates AWT user events.
 * @param cameraComp The mtgame camera component to use for picking operations.
 */
public void initialize(Canvas canvas,CameraComponent cameraComp){
  if (canvas != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.canvas=canvas;
  inputPicker.setCanvas(canvas);
  setCameraComponent(cameraComp);
  canvas.addKeyListener(this);
  if (!ENABLE_EMBEDDED_SWING) {
    canvas.addMouseListener(this);
    canvas.addMouseMotionListener(this);
    canvas.addMouseWheelListener(this);
  }
  injectInitialMouseEvent();
}

Fixed version (ground truth):
/** 
 * Initialize the input manager to receive input events from the given AWT canvas and start the input manager running. The input manager will perform picks with the given camera. This routine can only be called once. To subsequently change the  camera, use <code>setCameraComponent</code>.
 * @param canvas The AWT canvas which generates AWT user events.
 * @param cameraComp The mtgame camera component to use for picking operations.
 */
public void initialize(Canvas canvas,CameraComponent cameraComp){
  if (this.canvas != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.canvas=canvas;
  inputPicker.setCanvas(canvas);
  setCameraComponent(cameraComp);
  canvas.addKeyListener(this);
  if (ENABLE_EMBEDDED_SWING) {
    logger.info("String_Node_Str");
  }
 else {
    logger.info("String_Node_Str");
    canvas.addMouseListener(this);
    canvas.addMouseMotionListener(this);
    canvas.addMouseWheelListener(this);
  }
  injectInitialMouseEvent();
  logger.info("String_Node_Str");
}
Program: 46437
Project: 46437
Buggy source:
/** 
 * Returns a string representation of the object.
 */
public String toString(){
  String str="String_Node_Str" + super.toString();
  str+="String_Node_Str";
  return str;
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + butAction();
}
Program: 46439
Project: 46439
Buggy source:
private String[] getNearbyLocations(){
  int count=dbcache.getNodeCount();
  ArrayList<String> names=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    MapNode n=dbcache.getNodeByIdx(i);
    double dist=n.distance(bestKnownLocation.getLatitude(),bestKnownLocation.getLongitude());
    if (dist < NEARBY_THRESHOLD) {
      for (      String name : n.locations) {
        names.add(name);
      }
    }
    Log.i("String_Node_Str","String_Node_Str" + n.name + "String_Node_Str"+ dist);
  }
  if (names.size() > 0) {
    String[] n=new String[names.size()];
    names.toArray(n);
    return n;
  }
 else {
    String[] n=new String[]{"String_Node_Str"};
    return n;
  }
}

Fixed version (ground truth):
private String[] getNearbyLocations(){
  int count=dbcache.getNodeCount();
  ArrayList<String> names=new ArrayList<String>();
  for (int i=0; i < count; i++) {
    MapNode n=dbcache.getNodeByIdx(i);
    double dist=n.distance(bestKnownLocation.getLatitude(),bestKnownLocation.getLongitude());
    if (dist < NEARBY_THRESHOLD) {
      for (      String name : n.locations) {
        names.add(ComUtil.decode(name));
      }
    }
    Log.i("String_Node_Str","String_Node_Str" + n.name + "String_Node_Str"+ dist);
  }
  if (names.size() > 0) {
    String[] n=new String[names.size()];
    names.toArray(n);
    return n;
  }
 else {
    String[] n=new String[]{"String_Node_Str"};
    return n;
  }
}
Program: 46440
Project: 46440
Buggy source:
/** 
 * Creates a new <code>MainFrame</code>.
 * @param base the base to be used by the whole GUI
 */
public MainFrame(DataBase base){
  super(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  this.base=base;
  layout=new CardLayout();
  setLayout(layout);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent event){
      MainFrame.this.windowClosing();
    }
  }
);
  initializeGUI();
  setSize(1000,600);
  setLocationRelativeTo(null);
  setExtendedState(MAXIMIZED_BOTH);
  setVisible(true);
}

Fixed version (ground truth):
/** 
 * Creates a new <code>MainFrame</code>.
 * @param base the base to be used by the whole GUI
 */
public MainFrame(DataBase base){
  super(java.util.ResourceBundle.getBundle("String_Node_Str").getString("String_Node_Str"));
  this.base=base;
  layout=new CardLayout();
  setLayout(layout);
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent event){
      MainFrame.this.windowClosing();
    }
  }
);
  initializeGUI();
  setSize(1000,600);
  setLocationRelativeTo(null);
  setLocation(0,0);
  setExtendedState(MAXIMIZED_BOTH);
  setVisible(true);
}
Program: 46441
Project: 46441
Buggy source:
/** 
 * Checks whether the entered authors are existing, if not, the background color will be changed to yellow.
 */
private void checkAuthors(){
  String[] authors=getText().split("String_Node_Str");
  setBackground(Color.WHITE);
  for (  String author : authors) {
    try {
      if (!checkAuthor(author)) {
        setBackground(Color.YELLOW);
      }
    }
 catch (    SQLException ex) {
      Logger.getLogger(AuthorInputField.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks whether the entered authors are existing, if not, the background color will be changed to yellow.
 */
private void checkAuthors(){
  String[] authors=getText().split("String_Node_Str");
  setBackground(Color.WHITE);
  for (  String author : authors) {
    try {
      if (!checkAuthor(author.trim())) {
        setBackground(Color.YELLOW);
      }
    }
 catch (    SQLException ex) {
      Logger.getLogger(AuthorInputField.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}
Program: 46442
Project: 46442
Buggy source:
public void resetMask(){
  for (  Component c : getComponents()) {
    if (c instanceof ExtendedTextField) {
      ((ExtendedTextField)c).setText("String_Node_Str");
    }
  }
  titleInput.reset();
  informationInput.setText("String_Node_Str");
  tagInput.clearSelection();
  locationInput.reset();
  categoryInput.reset();
  book=null;
  titleInput.requestFocusInWindow();
}

Fixed version (ground truth):
public void resetMask(){
  for (  Component c : getComponents()) {
    if (c instanceof ExtendedTextField) {
      ((ExtendedTextField)c).setText("String_Node_Str");
    }
  }
  titleInput.reset();
  informationInput.setText("String_Node_Str");
  tagInput.clearSelection();
  book=null;
  titleInput.requestFocusInWindow();
}
Program: 46445
Project: 46445
Buggy source:
/** 
 * Creates an <code>ExtendedBookBaseWriter</code>.
 * @param reader the reader to be used by the <code>ExtendedBookBaseWriter</code>
 * @param writer the writer to be used by the <code>ExtendedBookBaseWeiter</code>
 */
public ExtendedBookBaseWriter(DataBaseReader reader,DataBaseWriter writer){
  this.reader=reader;
  this.writer=writer;
}

Fixed version (ground truth):
/** 
 * Creates an <code>ExtendedBookBaseWriter</code>.
 * @param reader the reader to be used bythe <code>ExtendedBookBaseWriter</code>
 * @param writer the writer to be used bythe <code>ExtendedBookBaseWeiter</code>
 */
public ExtendedBookBaseWriter(DataBaseReader reader,DataBaseWriter writer){
  this.reader=reader;
  this.writer=writer;
}
Program: 46447
Project: 46447
Buggy source:
@Override public double getChannelValue(String name){
  Object returnVal;
  try {
    returnVal=implGetTimeMethod.invoke(dataImpl,name);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return ((Double)returnVal).doubleValue();
}

Fixed version (ground truth):
@Override public double getChannelValue(String name){
  Object returnVal;
  try {
    returnVal=implGetChannelValueMethod.invoke(dataImpl,name);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  return ((Double)returnVal).doubleValue();
}
Program: 46449
Project: 46449
Buggy source:
public void paint(java.awt.Graphics g){
  if (!macOS) {
    g.setColor(getBackground());
    g.fillRect(0,0,getWidth(),getHeight());
  }
  g.drawImage(content.image,0,0,frame);
}

Fixed version (ground truth):
public void paint(java.awt.Graphics g){
  g.setColor(getBackground());
  g.fillRect(0,0,getWidth(),getHeight());
  g.drawImage(content.image,0,0,frame);
}
Program: 46450
Project: 46450
Buggy source:
public void setColorObjetivo(float r,float g,float b,float a){
  ColorObjetivo=MezcladorBasico.getColoredTexture(100,100,r,g,b,a);
  Button cambio=null;
  int i=(int)(Math.random() * 6);
  i++;
  this.colorcorrecto=i;
  try {
    imagenObjetivo=((Button)this.findActor("String_Node_Str" + i));
    imagenObjetivo.unpressedRegion=new TextureRegion(MezcladorBasico.getColoredTexture(100,100,r,g,b,a));
    imagenObjetivo.pressedRegion=new TextureRegion(MezcladorBasico.getColoredTexture(100,100,r,g,b,a));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void setColorObjetivo(float r,float g,float b,float a){
  ColorObjetivo=MezcladorBasico.getColoredTexture(100,100,r,g,b,a);
  int i=(int)(Math.random() * 6);
  i++;
  this.colorcorrecto=i;
  try {
    imagenObjetivo=((Button)this.findActor("String_Node_Str" + i));
    imagenObjetivo.unpressedRegion=new TextureRegion(MezcladorBasico.getColoredTexture(100,100,r,g,b,a));
    imagenObjetivo.pressedRegion=new TextureRegion(MezcladorBasico.getColoredTexture(100,100,r,g,b,a));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 46451
Project: 46451
Buggy source:
public void clicked(Button button){
  if (compruebaColor(Integer.parseInt(button.name.substring(1)))) {
    action(MoveTo.$(-600,-600,2));
    paleta.colorAcertado();
  }
 else {
  }
}

Fixed version (ground truth):
public void clicked(Button button){
  if (compruebaColor(Integer.parseInt(button.name.substring(1)))) {
    action(MoveTo.$(-600,-600,2));
    paleta.colorAcertado();
  }
 else {
    paleta.colorFallido();
  }
}
Program: 46453
Project: 46453
Buggy source:
public void eligeColores(){
switch (coloresDisponibles) {
case 0:
    colores[0][0]=1;
  colores[0][1]=0;
colores[0][2]=1;
colores[1][0]=1;
colores[1][1]=1;
colores[1][2]=0;
colores[2][0]=0;
colores[2][1]=1;
colores[2][2]=0;
break;
case 1:
colores[0][0]=1;
colores[0][1]=0;
colores[0][2]=1;
colores[1][0]=1;
colores[1][1]=1;
colores[1][2]=0;
colores[2][0]=1;
colores[2][1]=0;
colores[2][2]=0;
break;
case 2:
colores[0][0]=1;
colores[0][1]=0;
colores[0][2]=1;
colores[1][0]=0;
colores[1][1]=1;
colores[1][2]=1;
colores[2][0]=0;
colores[2][1]=0;
colores[2][2]=1;
break;
}
}

Fixed version (ground truth):
public void eligeColores(){
switch (coloresDisponibles) {
case 0:
    colores[0][0]=0;
  colores[0][1]=1;
colores[0][2]=1;
colores[1][0]=1;
colores[1][1]=1;
colores[1][2]=0;
colores[2][0]=0;
colores[2][1]=1;
colores[2][2]=0;
break;
case 1:
colores[0][0]=1;
colores[0][1]=0;
colores[0][2]=1;
colores[1][0]=1;
colores[1][1]=1;
colores[1][2]=0;
colores[2][0]=1;
colores[2][1]=0;
colores[2][2]=0;
break;
case 2:
colores[0][0]=1;
colores[0][1]=0;
colores[0][2]=1;
colores[1][0]=0;
colores[1][1]=1;
colores[1][2]=1;
colores[2][0]=0;
colores[2][1]=0;
colores[2][2]=1;
break;
}
}
Program: 46454
Project: 46454
Buggy source:
/** 
 * Base constructor for custom member types. The word size can be zero, in which case the   {@link #offset}of the member does not change, only   {@link #bitIndex} isincremented.
 * @param bitLength the number of bits or <code>0</code>to force next member on next word boundary.
 * @param wordSize the word size in bytes used when accessingthis member data or <code>0</code> if the data is accessed at the bit level.
 */
protected Member(int bitLength,int wordSize){
  _bitLength=bitLength;
  if (_resetIndex) {
    _index=0;
  }
  if ((wordSize == 0) || ((bitLength != 0) && (wordSize == _wordSize) && ((_bitsUsed + bitLength) <= (wordSize << 3)))) {
    _offset=_index - _wordSize;
    _bitIndex=_bitsUsed;
    _bitsUsed+=bitLength;
    while (_bitsUsed > (_wordSize << 3)) {
      _index++;
      _wordSize++;
      _size=MathLib.max(_size,_index);
    }
    return;
  }
  if (!isPacked()) {
    if ((_alignment < wordSize)) {
      _alignment=wordSize;
    }
    int misaligned=_index % wordSize;
    if (misaligned != 0) {
      _index+=wordSize - misaligned;
    }
  }
  _offset=_index;
  _bitIndex=0;
  _index+=MathLib.max(wordSize,(bitLength + 7) >> 3);
  _wordSize=wordSize;
  _bitsUsed=bitLength;
  _size=MathLib.max(_size,_index);
}

Fixed version (ground truth):
/** 
 * Base constructor for custom member types. The word size can be zero, in which case the   {@link #offset}of the member does not change, only   {@link #bitIndex} isincremented.
 * @param bitLength the number of bits or <code>0</code>to force next member on next word boundary.
 * @param wordSize the word size in bytes used when accessingthis member data or <code>0</code> if the data is accessed at the bit level.
 */
protected Member(int bitLength,int wordSize){
  _bitLength=bitLength;
  if (_resetIndex) {
    _index=0;
  }
  if ((wordSize == 0) || ((bitLength != 0) && (wordSize == _wordSize) && ((_bitsUsed + bitLength) <= (wordSize << 3)))) {
    _offset=_index - _wordSize;
    _bitIndex=_bitsUsed;
    _bitsUsed+=bitLength;
    while (_bitsUsed > (_wordSize << 3)) {
      _index++;
      _wordSize++;
      _length=MathLib.max(_length,_index);
    }
    return;
  }
  if (!isPacked()) {
    if ((_alignment < wordSize)) {
      _alignment=wordSize;
    }
    int misaligned=_index % wordSize;
    if (misaligned != 0) {
      _index+=wordSize - misaligned;
    }
  }
  _offset=_index;
  _bitIndex=0;
  _index+=MathLib.max(wordSize,(bitLength + 7) >> 3);
  _wordSize=wordSize;
  _bitsUsed=bitLength;
  _length=MathLib.max(_length,_index);
}
Program: 46455
Project: 46455
Buggy source:
/** 
 * Defines the specified struct as inner of this struct.
 * @param struct the inner struct.
 * @return the specified struct.
 * @throws IllegalArgumentException if the specified struct is alreadyan inner struct.
 */
protected Struct inner(Struct struct){
  if (struct._outer != null)   throw new IllegalArgumentException("String_Node_Str");
  Member inner=new Member(struct._size << 3,struct._alignment);
  struct._outer=this;
  struct._outerOffset=inner.offset();
  return (Struct)struct;
}

Fixed version (ground truth):
/** 
 * Defines the specified struct as inner of this struct.
 * @param struct the inner struct.
 * @return the specified struct.
 * @throws IllegalArgumentException if the specified struct is alreadyan inner struct.
 */
protected Struct inner(Struct struct){
  if (struct._outer != null)   throw new IllegalArgumentException("String_Node_Str");
  Member inner=new Member(struct.size() << 3,struct._alignment);
  struct._outer=this;
  struct._outerOffset=inner.offset();
  return (Struct)struct;
}
Program: 46456
Project: 46456
Buggy source:
/** 
 * Returns the size in bytes of this struct. The size includes tail padding to satisfy the struct word size requirement (defined by the largest word size of its   {@link Member members}).
 * @return the C/C++ <code>sizeof(this)</code>.
 */
public final int size(){
  return _size;
}

Fixed version (ground truth):
/** 
 * Returns the size in bytes of this struct. The size includes tail padding to satisfy the struct word size requirement (defined by the largest word size of its   {@link Member members}).
 * @return the C/C++ <code>sizeof(this)</code>.
 */
public final int size(){
  return (_alignment <= 1) ? _length : ((_length + _alignment - 1) / _alignment) * _alignment;
}
Program: 46457
Project: 46457
Buggy source:
@Override public void setField(Object obj,Class forClass,Class type){
synchronized (forClass) {
    FastMap typeToField=(FastMap)_fields.get(forClass);
    if ((typeToField != null) && typeToField.containsKey(type))     throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str"+ forClass);
    if (typeToField == null) {
      typeToField=new FastMap();
      _fields.put(forClass,typeToField);
    }
    typeToField.put(type,obj);
  }
}

Fixed version (ground truth):
public void setField(Object obj,Class forClass,Class type){
synchronized (forClass) {
    FastMap typeToField=(FastMap)_fields.get(forClass);
    if ((typeToField != null) && typeToField.containsKey(type))     throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str"+ forClass);
    if (typeToField == null) {
      typeToField=new FastMap();
      _fields.put(forClass,typeToField);
    }
    typeToField.put(type,obj);
  }
}
Program: 46458
Project: 46458
Buggy source:
@Override public Object getField(Class forClass,Class type,boolean inherited){
  ClassInitializer.initialize(forClass);
  return getField2(forClass,type,inherited);
}

Fixed version (ground truth):
public Object getField(Class forClass,Class type,boolean inherited){
  ClassInitializer.initialize(forClass);
  return getField2(forClass,type,inherited);
}
Program: 46459
Project: 46459
Buggy source:
/** 
 * Performs Built-In-Tests.
 */
private static void builtInTests() throws Exception {
  Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
  TestContext.run(new ContextTestSuite());
  TestContext.run(new TypeFormatTestSuite());
  TestContext.info("String_Node_Str");
  TestContext.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Performs Built-In-Tests.
 */
private static void builtInTests() throws Exception {
  Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
  TestContext.run(new ContextTestSuite());
  TestContext.run(new TypeFormatTestSuite());
  TestContext.run(new StructTestSuite());
  TestContext.info("String_Node_Str");
  TestContext.info("String_Node_Str");
}
Program: 46460
Project: 46460
Buggy source:
public static void main(String[] args){
  Random r=new Random();
  String choice;
  if (args.length > 0) {
    choice=args[r.nextInt(args.length)];
  }
 else {
    Restaurant[] choices=Restaurant.values();
    choice=choices[r.nextInt(choices.length)].name();
  }
  System.out.println("String_Node_Str" + choice);
}

Fixed version (ground truth):
public static void main(String[] args){
  Random r=new Random();
  String choice;
  if (args.length > 0) {
    if (args.length == 1 && "String_Node_Str".equalsIgnoreCase(args[0])) {
      choice=Restaurant.A2ChinaRestaurant.name();
    }
 else {
      choice=args[r.nextInt(args.length)];
    }
  }
 else {
    Restaurant[] choices=Restaurant.values();
    choice=choices[r.nextInt(choices.length)].name();
  }
  System.out.println("String_Node_Str" + choice);
}
Program: 46461
Project: 46461
Buggy source:
public static void main(String[] args){
  Random r=new Random();
  Restaurant[] restaurantos=Restaurant.values();
  Restaurant chosenEatingThing=restaurantos[r.nextInt(restaurantos.length)];
  System.out.println("String_Node_Str" + chosenEatingThing.name());
}

Fixed version (ground truth):
public static void main(String[] args){
  Restaurant chosenEatingThing=Restaurant.A2ChinaRestaurant;
  System.out.println("String_Node_Str" + chosenEatingThing.name());
}
Program: 46462
Project: 46462
Buggy source:
public FoodMoverUser getOwner(){
  return (FoodMoverUser)entity.getProperty(OWNER_KEY);
}

Fixed version (ground truth):
public FoodMoverUser getOwner(){
  FoodMoverUser foodMoverUser=new FoodMoverUser();
  foodMoverUser.setUser((User)entity.getProperty(OWNER_KEY));
  return foodMoverUser;
}
Program: 46463
Project: 46463
Buggy source:
public static Collection<FoodListing> getListingsFor(FoodMoverUser currentUser){
  Objectify ofy=ObjectifyUtil.get();
  return ofy.query(FoodListing.class).filter(OWNER_VAR_NAME,currentUser.getKey()).list();
}

Fixed version (ground truth):
public static Collection<FoodListing> getListingsFor(FoodMoverUser user){
  Objectify ofy=ObjectifyUtil.get();
  return ofy.query(FoodListing.class).filter(OWNER_VAR_NAME,user.getKey()).list();
}
Program: 46464
Project: 46464
Buggy source:
/** 
 * Get the currently logged in user.
 * @return null if not user is logged in <br />the FoodMoverUser wrapping the logged in user. If no FoodMoverUser already wrapping the current user already exists, it will be created and saved.
 */
public static FoodMoverUser getCurrentUser(){
  User currRawUser=UserServiceFactory.getUserService().getCurrentUser();
  if (currRawUser == null) {
    return null;
  }
  Objectify objectify=ObjectifyUtil.get();
  FoodMoverUser foodMoverUser=objectify.query(FoodMoverUser.class).filter(USER_VAR_NAME,currRawUser).get();
  if (foodMoverUser != null) {
    return foodMoverUser;
  }
  foodMoverUser=new FoodMoverUser();
  foodMoverUser.setUser(currRawUser);
  objectify.put(foodMoverUser);
  return foodMoverUser;
}

Fixed version (ground truth):
/** 
 * Get the currently logged in user.
 * @return null if not user is logged in <br />the FoodMoverUser wrapping the logged in user. If no FoodMoverUser already wrapping the current user already exists, it will be created and saved.
 */
public static FoodMoverUser getCurrentUser(){
  User currRawUser=UserServiceFactory.getUserService().getCurrentUser();
  if (currRawUser == null) {
    return null;
  }
  Objectify objectify=ObjectifyUtil.get();
  FoodMoverUser foodMoverUser=objectify.query(FoodMoverUser.class).filter(USER_VAR_NAME,keyOfUser(currRawUser)).get();
  if (foodMoverUser != null) {
    return foodMoverUser;
  }
  foodMoverUser=new FoodMoverUser();
  foodMoverUser.setUser(currRawUser);
  objectify.put(foodMoverUser);
  return foodMoverUser;
}
Program: 46465
Project: 46465
Buggy source:
private void setUser(User user){
  userKey=new Key<User>(User.class,user.getEmail());
}

Fixed version (ground truth):
private void setUser(User user){
  userKey=keyOfUser(user);
}
Program: 46466
Project: 46466
Buggy source:
public static List<FoodListing> getMyFoodListings(){
  List<FoodListing> result=new ArrayList<FoodListing>();
  FoodMoverUser me=FoodMoverUser.getCurrentUser();
  Query q=new Query("String_Node_Str");
  q.addFilter("String_Node_Str",Query.FilterOperator.EQUAL,me.getRawUserObject());
  DatastoreService data=DatastoreServiceFactory.getDatastoreService();
  PreparedQuery prepQ=data.prepare(q);
  for (  Entity found : prepQ.asIterable()) {
    FoodListing resultItem=new FoodListing(found);
    result.add(resultItem);
  }
  return result;
}

Fixed version (ground truth):
public static List<FoodListing> getMyFoodListings(){
  List<FoodListing> result=new ArrayList<FoodListing>();
  FoodMoverUser me=FoodMoverUser.getCurrentUser();
  Query q=new Query("String_Node_Str");
  q.addFilter("String_Node_Str",Query.FilterOperator.EQUAL,me.getRawUserObject());
  DatastoreService data=DatastoreServiceFactory.getDatastoreService();
  PreparedQuery prepQ=data.prepare(q);
  for (  Entity found : prepQ.asIterable()) {
    FoodListing resultItem=new FoodListing(found);
    if (resultItem.expired()) {
      continue;
    }
    result.add(resultItem);
  }
  return result;
}
Program: 46467
Project: 46467
Buggy source:
public static List<FoodListing> findFoodListings(Float longitude,Float latitude,Float distance){
  List<FoodListing> result=new ArrayList<FoodListing>();
  Query q=new Query("String_Node_Str");
  q.addFilter(FoodListing.LAT_KEY,Query.FilterOperator.GREATER_THAN_OR_EQUAL,latitude - distance);
  q.addFilter(FoodListing.LAT_KEY,Query.FilterOperator.LESS_THAN_OR_EQUAL,latitude + distance);
  DatastoreService data=DatastoreServiceFactory.getDatastoreService();
  PreparedQuery prepQ=data.prepare(q);
  for (  Entity found : prepQ.asIterable()) {
    FoodListing resultItem=new FoodListing(found);
    if (resultItem.getLongitude() >= (longitude - distance) && resultItem.getLongitude() <= (longitude + distance)) {
      result.add(resultItem);
    }
  }
  return result;
}

Fixed version (ground truth):
public static List<FoodListing> findFoodListings(Float longitude,Float latitude,Float distance){
  List<FoodListing> result=new ArrayList<FoodListing>();
  Query q=new Query("String_Node_Str");
  q.addFilter(FoodListing.LAT_KEY,Query.FilterOperator.GREATER_THAN_OR_EQUAL,latitude - distance);
  q.addFilter(FoodListing.LAT_KEY,Query.FilterOperator.LESS_THAN_OR_EQUAL,latitude + distance);
  DatastoreService data=DatastoreServiceFactory.getDatastoreService();
  PreparedQuery prepQ=data.prepare(q);
  for (  Entity found : prepQ.asIterable()) {
    FoodListing resultItem=new FoodListing(found);
    if (!resultItem.expired() && resultItem.getLongitude() >= (longitude - distance) && resultItem.getLongitude() <= (longitude + distance)) {
      result.add(resultItem);
    }
  }
  return result;
}
Program: 46468
Project: 46468
Buggy source:
public float getLat(){
  return ((Float)entity.getProperty(LAT_KEY)).floatValue();
}

Fixed version (ground truth):
public float getLat(){
  Object lat=entity.getProperty(LAT_KEY);
  if (lat instanceof Double) {
    lat=((Double)lat).floatValue();
  }
  return (Float)lat;
}
Program: 46469
Project: 46469
Buggy source:
public float getLongitude(){
  return ((Float)entity.getProperty(LONGITUDE_KEY)).floatValue();
}

Fixed version (ground truth):
public float getLongitude(){
  Object lng=entity.getProperty(LONGITUDE_KEY);
  if (lng instanceof Double) {
    lng=((Double)lng).floatValue();
  }
  return (Float)lng;
}
Program: 46470
Project: 46470
Buggy source:
public FoodListing(Entity entity){
  this.entity=entity;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public FoodListing(Entity entity){
  this.entity=entity;
  setDateOfCreation(new Date());
  final Date expiration=new Date();
  expiration.setHours(expiration.getHours() + EXPIRATION_HOURS);
  setDateOfExpiration(expiration);
}
Program: 46471
Project: 46471
Buggy source:
public Date getDateOfExpiration(){
  if (entity.getProperty(DATE_OF_EXPIRATION_KEY) != null) {
    return new Date((Long)entity.getProperty(DATE_OF_EXPIRATION_KEY));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Date getDateOfExpiration(){
  return new Date((Long)entity.getProperty(DATE_OF_EXPIRATION_KEY));
}
Program: 46472
Project: 46472
Buggy source:
public Date getDateOfCreation(){
  if (entity.getProperty(DATE_OF_CREATION_KEY) != null) {
    return new Date((Long)entity.getProperty(DATE_OF_CREATION_KEY));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Date getDateOfCreation(){
  return new Date((Long)entity.getProperty(DATE_OF_CREATION_KEY));
}
Program: 46473
Project: 46473
Buggy source:
public void notifyUser(FoodListing listing){
  if (getNotificationType().equals("String_Node_Str")) {
    Properties props=new Properties();
    Session session=Session.getDefaultInstance(props,null);
    MimeMessage msg=new MimeMessage(session);
    try {
      msg.setFrom(new InternetAddress("String_Node_Str","String_Node_Str"));
      msg.setSubject("String_Node_Str");
      msg.setText("String_Node_Str" + listing.getDescription());
      Transport.send(msg);
    }
 catch (    MessagingException e) {
      throw new RuntimeException(e);
    }
catch (    UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
public void notifyUser(FoodListing listing){
  if (!closeEnoughTo(listing)) {
    return;
  }
  if (getNotificationType().equals("String_Node_Str")) {
    Properties props=new Properties();
    Session session=Session.getDefaultInstance(props,null);
    MimeMessage msg=new MimeMessage(session);
    try {
      msg.setFrom(new InternetAddress("String_Node_Str","String_Node_Str"));
      msg.setSubject("String_Node_Str");
      msg.setText("String_Node_Str" + listing.getDescription());
      Transport.send(msg);
    }
 catch (    MessagingException e) {
      throw new RuntimeException(e);
    }
catch (    UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 46474
Project: 46474
Buggy source:
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  float lat=Float.parseFloat(req.getParameter("String_Node_Str"));
  float longitude=Float.parseFloat(req.getParameter("String_Node_Str"));
  int radius=Integer.parseInt(req.getParameter("String_Node_Str").toString());
  String type=req.getParameter("String_Node_Str").toString();
  FoodListingNotification notification=new FoodListingNotification();
  notification.setLat(lat);
  notification.setLongitude(longitude);
  notification.setNotificationType(type);
  notification.setRadius(radius);
  notification.setOwner(FoodMoverUser.getCurrentUser());
  notification.put();
  resp.getWriter().println(KeyFactory.keyToString(notification.getKey()));
}

Fixed version (ground truth):
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  if (req.getParameter("String_Node_Str") == null)   throw new IllegalStateException("String_Node_Str");
  float lat=Float.parseFloat(req.getParameter("String_Node_Str"));
  float longitude=Float.parseFloat(req.getParameter("String_Node_Str"));
  int radius=Integer.parseInt(req.getParameter("String_Node_Str").toString());
  String type=req.getParameter("String_Node_Str").toString();
  FoodListingNotification notification=new FoodListingNotification();
  notification.setLat(lat);
  notification.setLongitude(longitude);
  notification.setNotificationType(type);
  notification.setRadiusKm(radius);
  notification.setOwner(FoodMoverUser.getCurrentUser());
  notification.put();
  resp.getWriter().println(KeyFactory.keyToString(notification.getKey()));
}
Program: 46475
Project: 46475
Buggy source:
public float getLat(){
  return ((Double)entity.getProperty(LAT_KEY)).floatValue();
}

Fixed version (ground truth):
public float getLat(){
  return ((Float)entity.getProperty(LAT_KEY)).floatValue();
}
Program: 46476
Project: 46476
Buggy source:
public float getLongitude(){
  return ((Double)entity.getProperty(LONGITUDE_KEY)).floatValue();
}

Fixed version (ground truth):
public float getLongitude(){
  return ((Float)entity.getProperty(LONGITUDE_KEY)).floatValue();
}
Program: 46477
Project: 46477
Buggy source:
public float getLat(){
  return ((Double)entity.getProperty(LAT_KEY)).floatValue();
}

Fixed version (ground truth):
public float getLat(){
  return ((Float)entity.getProperty(LAT_KEY)).floatValue();
}
Program: 46478
Project: 46478
Buggy source:
public float getLongitude(){
  return ((Double)entity.getProperty(LONGITUDE_KEY)).floatValue();
}

Fixed version (ground truth):
public float getLongitude(){
  return ((Float)entity.getProperty(LONGITUDE_KEY)).floatValue();
}
Program: 46479
Project: 46479
Buggy source:
private boolean closeEnoughTo(FoodListing listing){
  final int EARTH_RADIUS_KM=6371;
  float deltaLat=getLat() - listing.getLat();
  float deltaLng=getLongitude() - listing.getLongitude();
  double a=Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2) + Math.cos(Math.toRadians(listing.getLat())) * Math.cos(Math.toRadians(getLat())) * Math.sin(deltaLng / 2)* Math.sin(deltaLng / 2);
  double c=Math.atan2(Math.sqrt(a),Math.sqrt(1 - a));
  double distance=EARTH_RADIUS_KM * c;
  return getRadius() < distance;
}

Fixed version (ground truth):
public boolean closeEnoughTo(FoodListing listing){
  final int EARTH_RADIUS_KM=6371;
  double lat1=Math.toRadians(listing.getLat());
  double lng1=Math.toRadians(listing.getLongitude());
  double lat2=Math.toRadians(getLat());
  double lng2=Math.toRadians(getLongitude());
  double distance=Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos(lng2 - lng1)) * EARTH_RADIUS_KM;
  return distance < getRadius();
}
Program: 46480
Project: 46480
Buggy source:
public void rdb_load(ByteBuffer file,Visitor visitor) throws Exception {
  String header=readStrFromFile(file,5);
  if (!header.equals("String_Node_Str")) {
    throw new Exception("String_Node_Str");
  }
  String version=readStrFromFile(file,4);
  int rdbVersion=Integer.parseInt(version);
  if (rdbVersion < 1 || 2 < rdbVersion) {
    throw new Exception("String_Node_Str" + rdbVersion);
  }
  int type=0;
  do {
    type=rdbLoadType(file);
    if (type == REDIS_EXPIRETIME) {
      rdbLoadTime(file);
      type=rdbLoadType(file);
    }
    if (type == REDIS_SELECTDB) {
      rdb_load_length(file);
    }
    if (type != REDIS_EOF && type != REDIS_SELECTDB) {
      String key=rdbLoadStringObject(file);
      String value=rdbLoadObject(type,file);
      visitor.callback(key,value);
    }
  }
 while (type != REDIS_EOF);
}

Fixed version (ground truth):
public void rdb_load(ByteBuffer file,Visitor visitor) throws Exception {
  String header=readStrFromFile(file,5);
  if (!header.equals("String_Node_Str")) {
    throw new Exception("String_Node_Str");
  }
  String version=readStrFromFile(file,4);
  int rdbVersion=Integer.parseInt(version);
  if (rdbVersion < 1 || 2 < rdbVersion) {
    throw new Exception("String_Node_Str" + rdbVersion);
  }
  int type=0;
  int dbSelect=1;
  do {
    type=rdbLoadType(file);
    if (type == REDIS_EXPIRETIME) {
      rdbLoadTime(file);
      type=rdbLoadType(file);
    }
    if (type == REDIS_SELECTDB) {
      if (dbSelect-- > 0) {
        rdb_load_length(file);
      }
 else {
        break;
      }
    }
    if (type != REDIS_EOF && type != REDIS_SELECTDB) {
      String key=rdbLoadStringObject(file);
      String value=rdbLoadObject(type,file);
      visitor.callback(key,value);
    }
  }
 while (type != REDIS_EOF);
}