nus-yam/ex-repair huggingface dataset:
Program: 46375
Project: 46375
Buggy source:
/** 
 * Create a new instance of FrameHeader.
 * @param view The view the frame encloses.
 * @param closeListeners The listeners to be notified when the header's close button is pressed.
 */
public FrameHeader(Window2DView view,LinkedList<Window2DFrame.CloseListener> closeListeners){
  super("String_Node_Str",view,Side.TOP,new Gui2DSide(view));
  title=new FrameLabelTitle(view,gui);
  controller=new FrameLabelController(view,gui,closeButton);
}

Fixed version (ground truth):
/** 
 * Create a new instance of FrameHeader.
 * @param view The view the frame encloses.
 * @param closeListeners The listeners to be notified when the header's close button is pressed.
 */
public FrameHeader(Window2DView view,LinkedList<Window2DFrame.CloseListener> closeListeners){
  super("String_Node_Str",view,Side.TOP,new Gui2DSide(view));
}
Program: 46376
Project: 46376
Buggy source:
/** 
 * {@inheritDoc}
 */
public void update() throws InstantiationException {
  System.err.println("String_Node_Str");
  updateLayout();
  if (quad == null) {
    quad=new Quad("String_Node_Str",width,height);
    quad.setModelBound(new BoundingBox());
  }
 else {
    quad.resize(width,height);
  }
  quad.updateModelBound();
  super.update();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void update() throws InstantiationException {
  updateLayout();
  if (quad == null) {
    quad=new Quad("String_Node_Str",width,height);
    quad.setModelBound(new BoundingBox());
  }
 else {
    quad.resize(width,height);
  }
  quad.updateModelBound();
  localToCellNode.attachChild(quad);
  super.update();
}
Program: 46377
Project: 46377
Buggy source:
/** 
 * Change the size of this component.
 * @param width The new width.
 * @param height The new height.
 */
public void resize(float width,float height) throws InstantiationException {
  System.err.println("String_Node_Str");
  this.width=width;
  this.height=height;
  update();
}

Fixed version (ground truth):
/** 
 * Change the size of this component.
 * @param width The new width.
 * @param height The new height.
 */
public void resize(float width,float height) throws InstantiationException {
  this.width=width;
  this.height=height;
  update();
}
Program: 46378
Project: 46378
Buggy source:
/** 
 * {@inheritDoc}
 */
public void update() throws InstantiationException {
  updateLayout();
  System.err.println("String_Node_Str" + entity);
  if (quad == null) {
    quad=new TexturedQuad(texture,"String_Node_Str",width,height);
    quad.setModelBound(new BoundingBox());
  }
 else {
    System.err.println("String_Node_Str" + quad);
    quad.resize(width,height);
  }
  quad.updateModelBound();
  updateColor();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void update() throws InstantiationException {
  updateLayout();
  if (quad == null) {
    quad=new TexturedQuad(texture,"String_Node_Str",width,height);
    quad.setModelBound(new BoundingBox());
  }
 else {
    quad.resize(width,height);
  }
  quad.updateModelBound();
  updateColor();
}
Program: 46379
Project: 46379
Buggy source:
public void setParentEntity(Entity parentEntity){
  if (entity == null)   return;
  Entity prevParentEntity=entity.getParent();
  if (prevParentEntity != null) {
    prevParentEntity.removeEntity(entity);
  }
  if (parentEntity != null) {
    parentEntity.addEntity(entity);
  }
}

Fixed version (ground truth):
public void setParentEntity(Entity parentEntity){
  if (entity == null)   return;
  Entity prevParentEntity=entity.getParent();
  if (prevParentEntity != null) {
    prevParentEntity.removeEntity(entity);
    RenderComponent rcEntity=(RenderComponent)entity.getComponent(RenderComponent.class);
    if (rcEntity != null) {
      rcEntity.setAttachPoint(null);
    }
  }
  if (parentEntity != null) {
    parentEntity.addEntity(entity);
    RenderComponent rcParentEntity=(RenderComponent)parentEntity.getComponent(RenderComponent.class);
    RenderComponent rcEntity=(RenderComponent)entity.getComponent(RenderComponent.class);
    ClientContextJME.getWorldManager().addEntity(rcEntity.getEntity());
    if (rcParentEntity != null && rcParentEntity.getSceneRoot() != null && rcEntity != null) {
      rcEntity.setAttachPoint(rcParentEntity.getSceneRoot());
    }
  }
}
Program: 46380
Project: 46380
Buggy source:
public void commitEvent(Event event){
  MouseEnterExitEvent3D eeEvent=(MouseEnterExitEvent3D)event;
  StringBuffer sb=new StringBuffer();
  if (name != null) {
    sb.append(name + "String_Node_Str");
  }
  String typeStr=eeEvent.getID() == MouseEvent.MOUSE_ENTERED ? "String_Node_Str" : "String_Node_Str";
  sb.append("String_Node_Str" + typeStr + "String_Node_Str");
  sb.append(event + "String_Node_Str" + event.getEntity());
  logger.info(sb.toString());
}

Fixed version (ground truth):
public void commitEvent(Event event){
  MouseEnterExitEvent3D eeEvent=(MouseEnterExitEvent3D)event;
  StringBuffer sb=new StringBuffer();
  if (name != null) {
    sb.append(name + "String_Node_Str");
  }
  String typeStr=eeEvent.getID() == MouseEvent.MOUSE_ENTERED ? "String_Node_Str" : "String_Node_Str";
  sb.append(typeStr + "String_Node_Str" + event.getEntity());
  logger.info(sb.toString());
}
Program: 46382
Project: 46382
Buggy source:
/** 
 * Calculate the current set of entities the pointer is inside.
 */
private void calcInsideEntities(MouseEvent awtEvent,MouseEnterExitEvent3D enterEventProto,PickInfo pickInfo){
  insideEntities.clear();
  if (awtEvent.getID() == MouseEvent.MOUSE_EXITED) {
    return;
  }
  boolean propagatesToUnder=true;
  PickDetails pickDetails=pickInfo.get(0);
  int idx=0;
  while (pickDetails != null && idx < destPickInfo.size() && propagatesToUnder) {
    Entity entity=pickDetailsToEntity(pickDetails);
    insideEntities.add(new EntityAndPickDetails(entity,pickDetails));
    propagatesToUnder=false;
    EventListenerCollection listeners=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
    if (listeners == null) {
      propagatesToUnder=false;
    }
 else {
      Iterator<EventListener> it=listeners.iterator();
      while (it.hasNext()) {
        EventListener listener=it.next();
        if (listener.isEnabled()) {
          MouseEnterExitEvent3D distribEvent=(MouseEnterExitEvent3D)EventDistributor.createEventForEntity(enterEventProto,entity);
          distribEvent.setPickDetails(pickDetails);
          distribEvent.setPickInfo(pickInfo);
          propagatesToUnder|=listener.propagatesToUnder(distribEvent);
        }
      }
      if (propagatesToUnder) {
        idx++;
        if (idx < destPickInfo.size()) {
          pickDetails=destPickInfo.get(idx);
        }
 else {
          pickDetails=null;
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the current set of entities the pointer is inside.
 */
private void calcInsideEntities(MouseEvent awtEvent,MouseEnterExitEvent3D enterEventProto,PickInfo pickInfo){
  insideEntities.clear();
  if (awtEvent.getID() == MouseEvent.MOUSE_EXITED || pickInfo == null) {
    return;
  }
  boolean propagatesToUnder=true;
  PickDetails pickDetails=pickInfo.get(0);
  int idx=0;
  while (pickDetails != null && idx < destPickInfo.size() && propagatesToUnder) {
    Entity entity=pickDetailsToEntity(pickDetails);
    insideEntities.add(new EntityAndPickDetails(entity,pickDetails));
    propagatesToUnder=false;
    EventListenerCollection listeners=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
    if (listeners == null) {
      propagatesToUnder=false;
    }
 else {
      Iterator<EventListener> it=listeners.iterator();
      while (it.hasNext()) {
        EventListener listener=it.next();
        if (listener.isEnabled()) {
          MouseEnterExitEvent3D distribEvent=(MouseEnterExitEvent3D)EventDistributor.createEventForEntity(enterEventProto,entity);
          distribEvent.setPickDetails(pickDetails);
          distribEvent.setPickInfo(pickInfo);
          propagatesToUnder|=listener.propagatesToUnder(distribEvent);
        }
      }
      if (propagatesToUnder) {
        idx++;
        if (idx < destPickInfo.size()) {
          pickDetails=destPickInfo.get(idx);
        }
 else {
          pickDetails=null;
        }
      }
    }
  }
}
Program: 46383
Project: 46383
Buggy source:
/** 
 * Mouse Event picker for non-Swing (3D) events. 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 pickMouseEvent3D(MouseEvent awtEvent){
  logger.fine("String_Node_Str" + awtEvent);
  MouseEvent3D event;
  destPickInfo=determineDestPickInfo(awtEvent);
  if (destPickInfo == null || destPickInfo.size() <= 0) {
    logger.finest("String_Node_Str");
    event=(MouseEvent3D)createWonderlandEvent(awtEvent);
    eventDistributor.enqueueEvent(event,null);
    return;
  }
  logger.fine("String_Node_Str" + destPickInfo);
  int eventID=awtEvent.getID();
  if (eventID == MouseEvent.MOUSE_MOVED || eventID == MouseEvent.MOUSE_DRAGGED || eventID == MouseEvent.MOUSE_ENTERED || eventID == MouseEvent.MOUSE_EXITED) {
    generateEnterExitEvents(awtEvent,destPickInfo);
  }
  event=(MouseEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(event,destPickInfo);
}

Fixed version (ground truth):
/** 
 * Mouse Event picker for non-Swing (3D) events. 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 pickMouseEvent3D(MouseEvent awtEvent){
  logger.fine("String_Node_Str" + awtEvent);
  MouseEvent3D event;
  destPickInfo=determineDestPickInfo(awtEvent);
  int eventID=awtEvent.getID();
  if (eventID == MouseEvent.MOUSE_MOVED || eventID == MouseEvent.MOUSE_DRAGGED || eventID == MouseEvent.MOUSE_ENTERED || eventID == MouseEvent.MOUSE_EXITED) {
    generateEnterExitEvents(awtEvent,destPickInfo);
  }
  if (destPickInfo == null || destPickInfo.size() <= 0) {
    logger.finest("String_Node_Str");
    event=(MouseEvent3D)createWonderlandEvent(awtEvent);
    eventDistributor.enqueueEvent(event,null);
    return;
  }
  logger.fine("String_Node_Str" + destPickInfo);
  event=(MouseEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(event,destPickInfo);
}
Program: 46384
Project: 46384
Buggy source:
/** 
 * Generate the appropriate enter/exit events.  NOTE: the pointer can be inside an entity, but if this entity is obscured by an entity with event listeners that don't propagate to under then the obscured entity is effectively exitted. This is an example of an "event shadow."
 */
private void generateEnterExitEvents(MouseEvent awtEvent,PickInfo pickInfo){
  MouseEnterExitEvent3D enterEventProto=createEnterExitEventFromAwtEvent(awtEvent,MouseEvent.MOUSE_ENTERED);
  MouseEnterExitEvent3D exitEventProto=createEnterExitEventFromAwtEvent(awtEvent,MouseEvent.MOUSE_EXITED);
  calcInsideEntities(awtEvent,enterEventProto,pickInfo);
  noLongerInsideEntities.clear();
  for (  EntityAndPickDetails entry : insideEntitiesPrev) {
    if (!insideEntities.contains(entry.entity)) {
      noLongerInsideEntities.add(entry);
    }
  }
  newlyInsideEntities.clear();
  for (  EntityAndPickDetails entry : insideEntitiesPrev) {
    if (!insideEntitiesPrev.contains(entry.entity)) {
      newlyInsideEntities.add(entry);
    }
  }
  sendExitEvents(exitEventProto,pickInfo);
  sendEnterEvents(enterEventProto,pickInfo);
  insideEntitiesPrev.clear();
  insideEntitiesPrev.addAll(insideEntities);
}

Fixed version (ground truth):
/** 
 * Generate the appropriate enter/exit events.  NOTE: the pointer can be inside an entity, but if this entity is obscured by an entity with event listeners that don't propagate to under then the obscured entity is effectively exitted. This is an example of an "event shadow."
 */
private void generateEnterExitEvents(MouseEvent awtEvent,PickInfo pickInfo){
  MouseEnterExitEvent3D enterEventProto=createEnterExitEventFromAwtEvent(awtEvent,MouseEvent.MOUSE_ENTERED);
  MouseEnterExitEvent3D exitEventProto=createEnterExitEventFromAwtEvent(awtEvent,MouseEvent.MOUSE_EXITED);
  calcInsideEntities(awtEvent,enterEventProto,pickInfo);
  noLongerInsideEntities.clear();
  for (  EntityAndPickDetails entry : insideEntitiesPrev) {
    boolean found=false;
    for (    EntityAndPickDetails entryInside : insideEntities) {
      if (entry.entity.equals(entryInside.entity)) {
        found=true;
        break;
      }
    }
    if (!found) {
      noLongerInsideEntities.add(entry);
    }
  }
  newlyInsideEntities.clear();
  for (  EntityAndPickDetails entry : insideEntities) {
    boolean found=false;
    for (    EntityAndPickDetails entryInsidePrev : insideEntitiesPrev) {
      if (entry.entity.equals(entryInsidePrev.entity)) {
        found=true;
        break;
      }
    }
    if (!found) {
      newlyInsideEntities.add(entry);
    }
  }
  sendExitEvents(exitEventProto,pickInfo);
  sendEnterEvents(enterEventProto,pickInfo);
  insideEntitiesPrev.clear();
  insideEntitiesPrev.addAll(insideEntities);
}
Program: 46385
Project: 46385
Buggy source:
/** 
 * Notify any registered status listeners of a status change
 * @param session the session that changed
 * @param status the new status
 */
protected void fireClientStatusChanged(WonderlandSession.Status status){
  for (  SessionStatusListener listener : sessionStatusListeners) {
    listener.sessionStatusChanged(this,status);
  }
}

Fixed version (ground truth):
/** 
 * Notify any registered status listeners of a status change
 * @param session the session that changed
 * @param status the new status
 */
protected void fireClientStatusChanged(final WonderlandSession.Status status){
  notifier.submit(new Runnable(){
    public void run(){
      for (      SessionStatusListener listener : sessionStatusListeners) {
        listener.sessionStatusChanged(WonderlandSessionImpl.this,status);
      }
    }
  }
);
}
Program: 46386
Project: 46386
Buggy source:
/** 
 * Create a new client to log in to the given server.  Use the provided classloader to resolve the class of any messages that are received.
 * @param server the server to connect to
 * @param classloader the classloader to resolve messages with,or null to use the system classloader.
 */
public WonderlandSessionImpl(WonderlandServerInfo server,ClassLoader classLoader){
  this.server=server;
  this.classLoader=classLoader;
  status=Status.DISCONNECTED;
  sessionStatusListeners=new CopyOnWriteArrayList<SessionStatusListener>();
  clients=Collections.synchronizedMap(new HashMap<ConnectionType,ClientRecord>());
  clientsByID=Collections.synchronizedMap(new HashMap<Short,ClientRecord>());
  SessionInternalHandler internal=new SessionInternalHandler(this);
  ClientRecord internalRecord=addClientRecord(internal);
  setClientID(internalRecord,SessionInternalConnectionType.SESSION_INTERNAL_CLIENT_ID);
  internal.connected(this);
}

Fixed version (ground truth):
/** 
 * Create a new client to log in to the given server.  Use the provided classloader to resolve the class of any messages that are received.
 * @param server the server to connect to
 * @param classloader the classloader to resolve messages with,or null to use the system classloader.
 */
public WonderlandSessionImpl(WonderlandServerInfo server,ClassLoader classLoader){
  this.server=server;
  this.classLoader=classLoader;
  status=Status.DISCONNECTED;
  sessionStatusListeners=new CopyOnWriteArrayList<SessionStatusListener>();
  notifier=Executors.newSingleThreadExecutor();
  clients=Collections.synchronizedMap(new HashMap<ConnectionType,ClientRecord>());
  clientsByID=Collections.synchronizedMap(new HashMap<Short,ClientRecord>());
  SessionInternalHandler internal=new SessionInternalHandler(this);
  ClientRecord internalRecord=addClientRecord(internal);
  setClientID(internalRecord,SessionInternalConnectionType.SESSION_INTERNAL_CLIENT_ID);
  internal.connected(this);
}
Program: 46387
Project: 46387
Buggy source:
/** 
 * Fire when a message is received over the session channel
 * @param data the message that was received
 */
protected void fireSessionMessageReceived(ByteBuffer data){
  Message message;
  short clientID;
  try {
    ReceivedMessage recv=MessagePacker.unpack(data,getClassLoader());
    message=recv.getMessage();
    clientID=recv.getClientID();
  }
 catch (  PackerException eme) {
    logger.log(Level.WARNING,"String_Node_Str",eme);
    if (eme.getMessageID() != null) {
      message=new ErrorMessage(eme.getMessageID(),eme.getMessage(),eme.getCause());
      clientID=eme.getClientID();
    }
 else {
      return;
    }
  }
catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
    return;
  }
  ClientRecord record=getClientRecord(clientID);
  if (record == null) {
    throw new IllegalStateException("String_Node_Str" + message + "String_Node_Str"+ clientID);
  }
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest(getName() + "String_Node_Str" + record.getClient().getConnectionType()+ "String_Node_Str"+ message.getClass().getName());
  }
  record.handleMessage(message);
}

Fixed version (ground truth):
/** 
 * Fire when a message is received over the session channel
 * @param data the message that was received
 */
protected void fireSessionMessageReceived(ByteBuffer data){
  Message message;
  short clientID;
  try {
    ReceivedMessage recv=MessagePacker.unpack(data,getClassLoader());
    message=recv.getMessage();
    clientID=recv.getClientID();
  }
 catch (  PackerException eme) {
    logger.log(Level.WARNING,"String_Node_Str",eme);
    if (eme.getMessageID() != null) {
      message=new ErrorMessage(eme.getMessageID(),eme.getMessage(),eme.getCause());
      clientID=eme.getClientID();
    }
 else {
      return;
    }
  }
catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
    return;
  }
  ClientRecord record=getClientRecord(clientID);
  if (record == null) {
    throw new IllegalStateException("String_Node_Str" + message + "String_Node_Str"+ clientID);
  }
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest(getName() + "String_Node_Str" + "String_Node_Str"+ record.getClient().getConnectionType()+ "String_Node_Str"+ message.getClass().getName());
  }
  record.handleMessage(message);
}
Program: 46388
Project: 46388
Buggy source:
public void viewConfigured(LocalAvatar localAvatar){
  logger.warning("String_Node_Str");
  cellID=localAvatar.getViewCell().getCellID();
  if (!connected) {
    logger.warning("String_Node_Str");
    return;
  }
  connectSoftphone();
}

Fixed version (ground truth):
public void viewConfigured(LocalAvatar localAvatar){
  logger.warning("String_Node_Str");
  cellID=localAvatar.getViewCell().getCellID();
  connectSoftphone();
}
Program: 46389
Project: 46389
Buggy source:
public AudioManagerClient(WonderlandSession session) throws ConnectionFailureException {
  this.session=session;
  session.addSessionStatusListener(this);
  ((CellClientSession)session).getLocalAvatar().addViewCellConfiguredListener(this);
  SoftphoneControlImpl.getInstance().addSoftphoneListener(this);
  logger.warning("String_Node_Str");
  new Connector(this);
}

Fixed version (ground truth):
/** 
 * Create a new AudioManagerClient
 * @param session the session to connect to, guaranteed to be inthe CONNECTED state
 * @throws org.jdesktop.wonderland.client.comms.ConnectionFailureException
 */
public AudioManagerClient(WonderlandSession session) throws ConnectionFailureException {
  this.session=session;
  session.connect(this);
  LocalAvatar avatar=((CellClientSession)session).getLocalAvatar();
  avatar.addViewCellConfiguredListener(this);
  if (avatar.getViewCell() != null) {
    viewConfigured(avatar);
  }
  SoftphoneControlImpl.getInstance().addSoftphoneListener(this);
  JmeClientMain.getFrame().addAudioMenuListener(this);
  logger.warning("String_Node_Str");
}
Program: 46390
Project: 46390
Buggy source:
public void initialize(WonderlandSession session){
  session.addSessionStatusListener(this);
  logger.warning("String_Node_Str" + session);
}

Fixed version (ground truth):
public void initialize(WonderlandSession session){
  logger.warning("String_Node_Str" + session);
  session.addSessionStatusListener(this);
  if (session.getStatus() == WonderlandSession.Status.CONNECTED) {
    connectClient(session);
  }
}
Program: 46391
Project: 46391
Buggy source:
public void sessionStatusChanged(WonderlandSession session,WonderlandSession.Status status){
  logger.warning("String_Node_Str" + session + "String_Node_Str"+ status);
  if (status.equals(WonderlandSession.Status.CONNECTED)) {
    try {
      new AudioManagerClient(session);
    }
 catch (    ConnectionFailureException e) {
      logger.warning(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void sessionStatusChanged(WonderlandSession session,WonderlandSession.Status status){
  logger.warning("String_Node_Str" + session + "String_Node_Str"+ status);
  if (status.equals(WonderlandSession.Status.CONNECTED)) {
    connectClient(session);
  }
 else   if (status.equals(WonderlandSession.Status.DISCONNECTED)) {
    disconnectClient();
  }
}
Program: 46392
Project: 46392
Buggy source:
/** 
 * Create a new instance of AppCellRendererJME.
 * @param cell The cell to be rendered.
 */
public AppCellRendererJME(AppCell cell){
  super(cell);
}

Fixed version (ground truth):
/** 
 * Create a new instance of AppCellRendererJME.
 * @param cell The cell to be rendered.
 */
public AppCellRendererJME(AppCell cell){
  super(cell);
  rootNode=new Node();
  rootNode.setName("String_Node_Str" + cell.getCellID().toString());
  initZBufferState();
  initLightState();
  rootNode.setRenderState(zBufferState);
  rootNode.setRenderState(lightState);
}
Program: 46393
Project: 46393
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected Node createSceneGraph(Entity entity){
  Node ret=new Node();
  ret.setName("String_Node_Str" + cell.getCellID().toString());
  applyTransform(ret,cell.getLocalTransform());
  return ret;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected Node createSceneGraph(Entity entity){
  applyTransform(rootNode,cell.getLocalTransform());
  return rootNode;
}
Program: 46394
Project: 46394
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void attachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  rootNode.attachChild(viewWorld.getBaseNode());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void attachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  rootNode.attachChild(viewWorld.getBaseNode());
  FrameWorldDefault frame=viewWorld.getFrame();
  rootNode.attachChild(frame.getBaseNode());
}
Program: 46395
Project: 46395
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void detachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  rootNode.detachChild(viewWorld.getBaseNode());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void detachView(WindowView view){
  ViewWorldDefault viewWorld=(ViewWorldDefault)view;
  rootNode.detachChild(viewWorld.getBaseNode());
  FrameWorldDefault frame=viewWorld.getFrame();
  rootNode.detachChild(frame.getBaseNode());
}
Program: 46396
Project: 46396
Buggy source:
/** 
 * Create a new instance of FrameHeader.
 * @param view The view the frame encloses.
 * @param closeListeners The listeners to be notified when the header's close button is pressed.
 */
public FrameHeader(Window2DView view,LinkedList<Window2DFrame.CloseListener> closeListeners){
  super("String_Node_Str",view,Side.TOP,null);
  closeButton=new FrameCloseButton(view,closeListeners);
  attachChild(closeButton);
  title=new FrameLabelTitle(view,gui);
  attachChild(title);
  controller=new FrameLabelController(view,gui,closeButton);
  attachChild(controller);
}

Fixed version (ground truth):
/** 
 * Create a new instance of FrameHeader.
 * @param view The view the frame encloses.
 * @param closeListeners The listeners to be notified when the header's close button is pressed.
 */
public FrameHeader(Window2DView view,LinkedList<Window2DFrame.CloseListener> closeListeners){
  super("String_Node_Str",view,Side.TOP,null);
  title=new FrameLabelTitle(view,gui);
  attachChild(title);
  controller=new FrameLabelController(view,gui,closeButton);
  attachChild(controller);
}
Program: 46397
Project: 46397
Buggy source:
/** 
 * Disconnect the frame components from the frame's window view.
 */
void disconnect(){
  if (view == null)   return;
  if (header != null) {
    frameNode.detachChild(header);
  }
  if (leftSide != null) {
    frameNode.detachChild(leftSide);
  }
  if (rightSide != null) {
    frameNode.detachChild(rightSide);
  }
  if (bottomSide != null) {
    frameNode.detachChild(bottomSide);
  }
  if (resizeCorner != null) {
    frameNode.detachChild(resizeCorner);
  }
  AppCell cell=getCell();
  if (cell != null && connectedToCell) {
  }
}

Fixed version (ground truth):
/** 
 * Disconnect the frame components from the frame's window view.
 */
void disconnect(){
  if (view == null)   return;
  if (header != null) {
    frameNode.detachChild(header);
  }
  if (leftSide != null) {
    frameNode.detachChild(leftSide);
  }
  if (rightSide != null) {
    frameNode.detachChild(rightSide);
  }
  if (bottomSide != null) {
    frameNode.detachChild(bottomSide);
  }
  if (resizeCorner != null) {
    frameNode.detachChild(resizeCorner);
  }
}
Program: 46398
Project: 46398
Buggy source:
/** 
 * Create a new instance of FrameWorldDefault.
 * @param view The view the frame encloses.
 */
public FrameWorldDefault(WindowView frameView){
  super((Window2DView)frameView);
  header=new FrameHeader(view,closeListeners);
  leftSide=new FrameSide(view,FrameSide.Side.LEFT,null);
  rightSide=new FrameSide(view,FrameSide.Side.RIGHT,null);
  bottomSide=new FrameSide(view,FrameSide.Side.BOTTOM,null);
  resizeCorner=new FrameResizeCorner(view,rightSide,bottomSide);
  frameNode=new Node("String_Node_Str");
  frameNode.attachChild(header);
  updateVisibility();
}

Fixed version (ground truth):
/** 
 * Create a new instance of FrameWorldDefault.
 * @param view The view the frame encloses.
 */
public FrameWorldDefault(WindowView frameView){
  super((Window2DView)frameView);
  header=new FrameHeader(view,closeListeners);
  leftSide=new FrameSide(view,FrameSide.Side.LEFT,null);
  rightSide=new FrameSide(view,FrameSide.Side.RIGHT,null);
  bottomSide=new FrameSide(view,FrameSide.Side.BOTTOM,null);
  resizeCorner=new FrameResizeCorner(view,rightSide,bottomSide);
  frameNode=new Node("String_Node_Str");
  frameNode.attachChild(header);
  frameNode.attachChild(leftSide);
  frameNode.attachChild(rightSide);
  frameNode.attachChild(bottomSide);
  frameNode.attachChild(resizeCorner);
  updateVisibility();
}
Program: 46399
Project: 46399
Buggy source:
/** 
 * Make sure that the frame is visible when it needs to be. It should be visible when the view is visible.
 */
private void updateVisibility(){
  AppCell cell=getCell();
  ((ViewWorldDefault)view).updateVisibility();
  boolean viewIsVisible=((ViewWorldDefault)view).getActuallyVisible();
  if (viewIsVisible && !connectedToCell) {
    if (cell == null) {
      logger.warning("String_Node_Str");
    }
 else {
      connectedToCell=true;
    }
  }
 else {
    if (cell != null) {
    }
    connectedToCell=false;
  }
  updateControl(controlArb);
}

Fixed version (ground truth):
/** 
 * Make sure that the frame is visible when it needs to be. It should be visible when the view is visible.
 */
private void updateVisibility(){
  AppCell cell=getCell();
  ((ViewWorldDefault)view).updateVisibility();
  boolean viewIsVisible=((ViewWorldDefault)view).getActuallyVisible();
  updateControl(controlArb);
}
Program: 46400
Project: 46400
Buggy source:
/** 
 * Initialize the whiteboard with parameters from the server.
 * @param configData the config data to initialize the cell with
 */
public void configure(CellConfig configData){
  System.err.println("String_Node_Str");
  config=(WhiteboardCellConfig)configData;
  setApp(new WhiteboardApp(getAppType(),config.getPreferredWidth(),config.getPreferredHeight(),config.getPixelScale(),commComponent));
  app.setCell(this);
  whiteboardWin=((WhiteboardApp)app).getWindow();
  ((WhiteboardApp)app).setVisible(true);
}

Fixed version (ground truth):
/** 
 * Initialize the whiteboard with parameters from the server.
 * @param configData the config data to initialize the cell with
 */
public void configure(CellConfig configData){
  config=(WhiteboardCellConfig)configData;
  setApp(new WhiteboardApp(getAppType(),config.getPreferredWidth(),config.getPreferredHeight(),config.getPixelScale(),commComponent));
  app.setCell(this);
  whiteboardWin=((WhiteboardApp)app).getWindow();
  ((WhiteboardApp)app).setVisible(true);
}
Program: 46401
Project: 46401
Buggy source:
public void erase(){
  Graphics2D g=getGraphics();
  setClip(g,true);
  g.setBackground(Color.WHITE);
  g.clearRect(0,0,getWidth(),getHeight());
  setClip(g,false);
}

Fixed version (ground truth):
public void erase(){
  Graphics2D g=getGraphics();
  setClip(g,true);
  g.setColor(Color.WHITE);
  g.fillRect(0,0,getWidth(),getHeight());
  setClip(g,false);
}
Program: 46402
Project: 46402
Buggy source:
protected void initSurface(Graphics2D g){
  for (  Button b : buttons) {
    b.paint(g);
  }
}

Fixed version (ground truth):
protected void initSurface(Graphics2D g){
  erase();
  for (  Button b : buttons) {
    b.paint(g);
  }
}
Program: 46404
Project: 46404
Buggy source:
/** 
 * Add a window to this app. It is added on top of the app's window stack.
 * @param window The window to add.
 */
public void windowAdd(Window2D window){
  super.windowAdd(window);
  stack.add(window);
}

Fixed version (ground truth):
/** 
 * / Add a window to this app. It is added on top of the app's window stack.
 * @param window The window to add.
 */
public void windowAdd(Window2D window){
  super.windowAdd(window);
  stack.add(window);
}
Program: 46405
Project: 46405
Buggy source:
/** 
 * Resize the surface. 
 * @param width The new width of the surface in pixels.
 * @param height The new height of the surface in pixels.
 */
public void setSize(int width,int height){
  imageGraphics=ImageGraphics.createInstance(width,height,0);
  surfaceWidth=width;
  surfaceHeight=height;
  imageGraphics.setBackground(Color.WHITE);
  imageGraphics.setColor(Color.WHITE);
  imageGraphics.fillRect(0,0,width,height);
  initSurface(imageGraphics);
}

Fixed version (ground truth):
/** 
 * Resize the surface. 
 * @param width The new width of the surface in pixels.
 * @param height The new height of the surface in pixels.
 */
public synchronized void setSize(int width,int height){
  imageGraphics=ImageGraphics.createInstance(width,height,0);
  surfaceWidth=width;
  surfaceHeight=height;
  imageGraphics.setBackground(Color.WHITE);
  imageGraphics.setColor(Color.WHITE);
  imageGraphics.fillRect(0,0,width,height);
  updateUpdating();
}
Program: 46406
Project: 46406
Buggy source:
/** 
 * Create an instance of DrawingSurface.
 * @param width The width of the surface in pixels.
 * @param height The height of the surface in pixels.
 */
public DrawingSurface(int width,int height){
  setSize(width,height);
}

Fixed version (ground truth):
/** 
 * Create an instance of DrawingSurface.
 * @param width The width of the surface in pixels.
 * @param height The height of the surface in pixels.
 */
public DrawingSurface(int width,int height){
  this();
  setSize(width,height);
}
Program: 46407
Project: 46407
Buggy source:
/** 
 * Create a Window2D instance. Initially the window is not visible.
 * @param app The application to which this window belongs
 */
public Window(App app){
  this.app=app;
  guiFactory=app.getAppType().getGuiFactory();
  app.windowAdd(this);
}

Fixed version (ground truth):
/** 
 * Create a Window instance. Initially the window is not visible.
 * @param app The application to which this window belongs
 */
public Window(App app){
  this.app=app;
  guiFactory=app.getAppType().getGuiFactory();
  app.windowAdd(this);
}
Program: 46408
Project: 46408
Buggy source:
public JmeClientMain(String[] args){
  props=loadProperties("String_Node_Str");
  String serverName=props.getProperty(SERVER_NAME_PROP,SERVER_NAME_DEFAULT);
  String serverPort=props.getProperty(SERVER_PORT_PROP,SERVER_PORT_DEFAULT);
  String userName=props.getProperty(USER_NAME_PROP,USER_NAME_DEFAULT);
  ClientManager clientManager=new ClientManager(serverName,Integer.parseInt(serverPort),userName);
  processArgs(args);
  WorldManager worldManager=ClientContextJME.getWorldManager();
  worldManager.getRenderManager().setDesiredFrameRate(desiredFrameRate);
  createUI(worldManager);
}

Fixed version (ground truth):
public JmeClientMain(String[] args){
  props=loadProperties("String_Node_Str");
  String serverName=props.getProperty(SERVER_NAME_PROP,SERVER_NAME_DEFAULT);
  String serverPort=props.getProperty(SERVER_PORT_PROP,SERVER_PORT_DEFAULT);
  String userName=props.getProperty(USER_NAME_PROP,USER_NAME_DEFAULT);
  processArgs(args);
  WorldManager worldManager=ClientContextJME.getWorldManager();
  worldManager.getRenderManager().setDesiredFrameRate(desiredFrameRate);
  createUI(worldManager);
  ClientManager clientManager=new ClientManager(serverName,Integer.parseInt(serverPort),userName);
}
Program: 46409
Project: 46409
Buggy source:
/** 
 * {@inheritDoc}<br> If event is null, a new event of this class is created and returned.
 */
@Override public Event clone(Event event){
  if (event == null) {
    event=new MouseMovedEvent3D();
  }
  return super.clone(event);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<br> If event is null, a new event of this class is created and returned.
 */
@Override public Event clone(Event event){
  if (event == null) {
    event=new MouseWheelEvent3D();
  }
  return super.clone(event);
}
Program: 46410
Project: 46410
Buggy source:
/** 
 * INTERNAL ONLY.
 */
@InternalAPI public boolean consumesEvent(Event event){
  Class<Event>[] eventClasses=eventClassesToConsume();
  if (eventClasses == null)   return false;
  for (  Class eventClass : eventClasses) {
    if (!Event.class.isAssignableFrom(eventClass)) {
      logger.warning("String_Node_Str");
      logger.warning("String_Node_Str");
      return false;
    }
    if (event.getClass().isAssignableFrom(eventClass)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * INTERNAL ONLY.
 */
@InternalAPI public boolean consumesEvent(Event event){
  Class<Event>[] eventClasses=eventClassesToConsume();
  if (eventClasses == null)   return false;
  for (  Class eventClass : eventClasses) {
    if (!Event.class.isAssignableFrom(eventClass)) {
      logger.warning("String_Node_Str");
      logger.warning("String_Node_Str");
      return false;
    }
    if (eventClass.isAssignableFrom(event.getClass())) {
      return true;
    }
  }
  return false;
}
Program: 46411
Project: 46411
Buggy source:
/** 
 * Returns true if the given entity is marked as having focus. Called at Event Distribution time. Therefore this is based on the information on the entity itself, not the focus sets, which are in a different time domain.
 * @param event The event to be delivered.
 * @param entity The entity to check if it is in the focus set.
 */
private static boolean entityHasFocus(Event event,Entity entity){
  EventFocusComponent focusComp=(EventFocusComponent)entity.getComponent(EventFocusComponent.class);
  if (focusComp == null)   return false;
  return focusComp.contains(event.getClass());
}

Fixed version (ground truth):
/** 
 * Returns true if the given entity is marked as having focus. Called at Event Distribution time. Therefore this is based on the information on the entity itself, not the focus sets, which are in a different time domain.
 * @param event The event to be delivered.
 * @param entity The entity to check if it is in the focus set.
 */
private static boolean entityHasFocus(Event event,Entity entity){
  EventFocusComponent focusComp=(EventFocusComponent)entity.getComponent(EventFocusComponent.class);
  if (focusComp == null)   return false;
  return focusComp.containsClassOrSuperclass(event.getClass());
}
Program: 46412
Project: 46412
Buggy source:
/** 
 * 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>();
      }
synchronized (computedEvents) {
        computedEvents.add(event);
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    logger.warning("String_Node_Str");
  }
}

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;
synchronized (computedEvents) {
    computedEvents.clear();
  }
  try {
    while (inputQueue.peek() != null) {
      event=inputQueue.take();
      if (event == null) {
        logger.warning("String_Node_Str");
        return;
      }
      computeEvent(event);
synchronized (computedEvents) {
        computedEvents.add(event);
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    logger.warning("String_Node_Str");
  }
}
Program: 46413
Project: 46413
Buggy source:
/** 
 * Create all of the Swing windows - and the 3D window
 */
private void createUI(WorldManager wm){
  MainFrame frame=new MainFrame(wm,width,height);
  frame.setLocationRelativeTo(null);
  frame.setVisible(true);
  CameraComponent cameraComp=ViewManager.getViewManager().getCameraComponent();
  InputManager inputManager=InputManager3D.getInputManager();
  inputManager.initialize(wm,frame.getCanvas(),cameraComp);
  inputManager.addKeyMouseFocus(inputManager.getGlobalFocusEntity());
  InputManager3D.getInputManager().addGlobalEventListener(new EventClassFocusListener(){
    private final Logger logger=Logger.getLogger("String_Node_Str");
    public Class[] eventClassesToConsume(){
      return new Class[]{KeyEvent3D.class};
    }
    public void commitEvent(    Event event){
      if (((KeyEvent3D)event).isPressed()) {
        logger.fine("String_Node_Str" + event);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create all of the Swing windows - and the 3D window
 */
private void createUI(WorldManager wm){
  MainFrame frame=new MainFrame(wm,width,height);
  frame.setLocationRelativeTo(null);
  frame.setVisible(true);
  CameraComponent cameraComp=ViewManager.getViewManager().getCameraComponent();
  InputManager inputManager=InputManager3D.getInputManager();
  inputManager.initialize(wm,frame.getCanvas(),cameraComp);
  inputManager.addKeyMouseFocus(inputManager.getGlobalFocusEntity());
  InputManager3D.getInputManager().addGlobalEventListener(new EventClassFocusListener(){
    private final Logger logger=Logger.getLogger("String_Node_Str");
    public Class[] eventClassesToConsume(){
      return new Class[]{KeyEvent3D.class,MouseEvent3D.class};
    }
    public void commitEvent(    Event event){
      if (event instanceof KeyEvent3D) {
        if (((KeyEvent3D)event).isPressed()) {
          logger.fine("String_Node_Str" + event);
        }
      }
 else {
        logger.fine("String_Node_Str" + event);
      }
    }
  }
);
}
Program: 46414
Project: 46414
Buggy source:
public void commitEvent(Event event){
  if (((KeyEvent3D)event).isPressed()) {
    logger.fine("String_Node_Str" + event);
  }
}

Fixed version (ground truth):
public void commitEvent(Event event){
  if (event instanceof KeyEvent3D) {
    if (((KeyEvent3D)event).isPressed()) {
      logger.fine("String_Node_Str" + event);
    }
  }
 else {
    logger.fine("String_Node_Str" + event);
  }
}
Program: 46415
Project: 46415
Buggy source:
public Class[] eventClassesToConsume(){
  return new Class[]{KeyEvent3D.class};
}

Fixed version (ground truth):
public Class[] eventClassesToConsume(){
  return new Class[]{KeyEvent3D.class,MouseEvent3D.class};
}
Program: 46416
Project: 46416
Buggy source:
protected Entity createEntity(){
  Entity ret=new Entity(this.getClass().getName() + "String_Node_Str" + cell.getCellID());
  rootNode=createSceneGraph(ret);
  if (cell.getComponent(MovableComponent.class) != null) {
    moveProcessor=new MoveProcessor(ClientContextJME.getWorldManager(),rootNode);
    ret.addComponent(ProcessorComponent.class,moveProcessor);
  }
  RenderComponent rc=ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(rootNode);
  ret.addComponent(RenderComponent.class,rc);
  JMECollisionSystem collisionSystem=(JMECollisionSystem)ClientContextJME.getWorldManager().getCollisionManager().loadCollisionSystem(JMECollisionSystem.class);
  JMECollisionComponent cc=collisionSystem.createCollisionComponent(rootNode);
  ret.addComponent(JMECollisionComponent.class,cc);
  return ret;
}

Fixed version (ground truth):
protected Entity createEntity(){
  Entity ret=new Entity(this.getClass().getName() + "String_Node_Str" + cell.getCellID());
  rootNode=createSceneGraph(ret);
  if (cell.getComponent(MovableComponent.class) != null) {
    moveProcessor=new MoveProcessor(ClientContextJME.getWorldManager(),rootNode);
    ret.addComponent(ProcessorComponent.class,moveProcessor);
  }
  RenderComponent rc=ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(rootNode);
  ret.addComponent(RenderComponent.class,rc);
  JMECollisionSystem collisionSystem=(JMECollisionSystem)ClientContextJME.getWorldManager().getCollisionManager().loadCollisionSystem(JMECollisionSystem.class);
  CollisionComponent cc=collisionSystem.createCollisionComponent(rootNode);
  ret.addComponent(CollisionComponent.class,cc);
  return ret;
}
Program: 46417
Project: 46417
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.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);
}

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);
  MouseEvent3D event;
  destPickInfo=determineDestPickInfo(awtEvent);
  if (destPickInfo == null || destPickInfo.size() <= 0) {
    logger.finest("String_Node_Str");
    event=(MouseEvent3D)createWonderlandEvent(awtEvent);
    eventDistributor.enqueueEvent(event,null);
    return;
  }
  logger.fine("String_Node_Str" + destPickInfo);
  int eventID=awtEvent.getID();
  if (eventID == MouseEvent.MOUSE_MOVED || eventID == MouseEvent.MOUSE_DRAGGED) {
    generateEnterExitEvents(awtEvent,destPickInfo);
  }
  event=(MouseEvent3D)createWonderlandEvent(awtEvent);
  eventDistributor.enqueueEvent(event,destPickInfo);
}
Program: 46418
Project: 46418
Buggy source:
/** 
 * The run loop of the thread.
 */
public void run(){
  while (true) {
    try {
      Entry entry=null;
      entry=inputQueue.take();
      processEvent(entry.event,entry.pickInfo);
    }
 catch (    Exception ex) {
      logger.warning("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * The run loop of the thread.
 */
public void run(){
  while (true) {
    try {
      Entry entry=null;
      entry=inputQueue.take();
      processEvent(entry.event,entry.pickInfo);
    }
 catch (    Exception ex) {
      ex.printStackTrace();
      logger.warning("String_Node_Str");
    }
  }
}
Program: 46419
Project: 46419
Buggy source:
/** 
 * Remove this global event listener. <br><br> Note: It is not a good idea to call this from inside EventListener.computeEvent function. However, it is okay to call this from inside EventListener.commitEvent function if necessary.
 * @param listener The global event listener to be removed.
 */
public void removeGlobalEventListener(EventListener listener){
synchronized (globalEventListeners) {
    globalEventListeners.remove(listener);
  }
}

Fixed version (ground truth):
/** 
 * Remove this global event listener. <br><br> Note: It is not a good idea to call this from inside EventListener.computeEvent function. However, it is okay to call this from inside EventListener.commitEvent function if necessary.
 * @param listener The global event listener to be removed.
 */
public void removeGlobalEventListener(EventListener listener){
synchronized (globalEventListeners) {
    globalEventListeners.remove(listener);
    listener.removeFromEntity(InputManager.inputManager().getGlobalFocusEntity());
  }
}
Program: 46420
Project: 46420
Buggy source:
/** 
 * Add an event listener to be tried once per event. This global listener can be added only once. Subsequent attempts to add it will be ignored. <br><br> Note: It is not a good idea to call this from inside EventListener.computeEvent function. However, it is okay to call this from inside EventListener.commitEvent function if necessary.
 * @param listener The global event listener to be added.
 */
public void addGlobalEventListener(EventListener listener){
synchronized (globalEventListeners) {
    if (globalEventListeners.contains(listener)) {
      return;
    }
 else {
      globalEventListeners.add(listener);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add an event listener to be tried once per event. This global listener can be added only once. Subsequent attempts to add it will be ignored. <br><br> Note: It is not a good idea to call this from inside EventListener.computeEvent function. However, it is okay to call this from inside EventListener.commitEvent function if necessary.
 * @param listener The global event listener to be added.
 */
public void addGlobalEventListener(EventListener listener){
synchronized (globalEventListeners) {
    if (globalEventListeners.contains(listener)) {
      return;
    }
 else {
      globalEventListeners.add(listener);
      listener.addToEntity(InputManager.inputManager().getGlobalFocusEntity());
    }
  }
}
Program: 46421
Project: 46421
Buggy source:
/** 
 * INTERNAL ONLY <br> Called in the render loop to allow this collection to commit the  <code>compute()</code> calculations to alter the scene graph.
 */
@InternalAPI public void commit(ProcessorArmingCollection collection){
  commitEvent(lastComputedEvent);
}

Fixed version (ground truth):
/** 
 * INTERNAL ONLY <br> Called in the render loop to allow this collection to commit the  <code>compute()</code> calculations to alter the scene graph.
 */
@InternalAPI public void commit(ProcessorArmingCollection collection){
  for (  Event event : computedEvents) {
    commitEvent(event);
  }
}
Program: 46422
Project: 46422
Buggy source:
/** 
 * {@inheritDoc}
 */
public void removeFromEntity(Entity entity){
  EventListenerCollection collection=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (collection == null) {
    return;
  }
  if (!collection.remove(this)) {
  }
  if (collection.size() <= 0) {
    entity.removeComponent(EventListenerCollection.class);
  }
  numEntitiesAttached--;
  if (numEntitiesAttached <= 0) {
    disarm();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void removeFromEntity(Entity entity){
  EventListenerCollection collection=(EventListenerCollection)entity.getComponent(EventListenerCollection.class);
  if (collection == null) {
    return;
  }
  if (!collection.remove(this)) {
  }
  if (collection.size() <= 0) {
    entity.removeComponent(EventListenerCollection.class);
  }
  removeProcessorCompFromEntity(this,entity);
  numEntitiesAttached--;
  if (numEntitiesAttached <= 0) {
    disarm();
  }
}