nus-yam/ex-repair huggingface dataset:
Program: 94214
Project: 94214
Buggy source:
private int handleItem(Object value,Source source){
  int numEmitted=0;
  if (source == Source.A) {
    @SuppressWarnings("String_Node_Str") A a=(A)value;
    K key=aKey.call(a);
    Queue<B> q=bs.get(key);
    if (q == null) {
      add(as,key,a);
    }
 else {
      B b=poll(bs,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_B && bs.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromA+=1;
    }
  }
 else {
    @SuppressWarnings("String_Node_Str") B b=(B)value;
    K key=bKey.call(b);
    Queue<A> q=as.get(key);
    if (q == null) {
      add(bs,key,b);
    }
 else {
      A a=poll(as,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_A && as.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromB+=1;
    }
  }
  if (requestFromA == requestSize && requestFromB == requestSize) {
    requestFromA=0;
    requestFromB=0;
    aSub.requestMore(requestSize);
    bSub.requestMore(requestSize);
  }
  return numEmitted;
}

Fixed version (ground truth):
private int handleItem(Object value,Source source){
  int numEmitted=0;
  if (source == Source.A) {
    @SuppressWarnings("String_Node_Str") A a=(A)value;
    K key=aKey.call(a);
    Queue<B> q=bs.get(key);
    if (q == null) {
      add(as,key,a);
    }
 else {
      B b=poll(bs,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_B && bs.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromA+=1;
    }
  }
 else {
    @SuppressWarnings("String_Node_Str") B b=(B)value;
    K key=bKey.call(b);
    Queue<A> q=as.get(key);
    if (q == null) {
      add(bs,key,b);
    }
 else {
      A a=poll(as,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_A && as.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromB+=1;
    }
  }
  if (requestFromA == requestSize && completed == COMPLETED_B) {
    requestFromA=0;
    aSub.requestMore(requestSize);
  }
 else   if (requestFromB == requestSize && completed == COMPLETED_A) {
    requestFromB=0;
    bSub.requestMore(requestSize);
  }
 else   if (requestFromA == requestSize && requestFromB == requestSize) {
    requestFromA=0;
    requestFromB=0;
    aSub.requestMore(requestSize);
    bSub.requestMore(requestSize);
  }
  return numEmitted;
}
Program: 94215
Project: 94215
Buggy source:
@Override public void call(final Subscriber<? super T> child){
  Subscriber<T> parent=createSubscriber(child,onEmpty);
  child.add(parent);
  observable.unsafeSubscribe(subscriber);
}

Fixed version (ground truth):
@Override public void call(final Subscriber<? super T> child){
  Subscriber<T> parent=createSubscriber(child,onEmpty);
  observable.unsafeSubscribe(parent);
}
Program: 94216
Project: 94216
Buggy source:
@Override public T poll(){
synchronized (queues) {
    if (queues.isEmpty())     return null;
 else {
      while (true) {
        T value=queues.peekFirst().poll();
        if (value == null) {
          if (queues.size() <= 1) {
            return null;
          }
 else {
            Queue2<T> removed=queues.pollFirst();
            removed.dispose();
          }
        }
 else {
          return value;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public T poll(){
  if (queues.isEmpty())   return null;
 else {
    while (true) {
      T value=queues.peekFirst().poll();
      if (value == null) {
        if (queues.size() <= 1) {
          return null;
        }
 else {
          Queue2<T> removed=queues.pollFirst();
          removed.dispose();
        }
      }
 else {
        return value;
      }
    }
  }
}
Program: 94217
Project: 94217
Buggy source:
@Override public T peek(){
synchronized (queues) {
    return queues.peekFirst().peek();
  }
}

Fixed version (ground truth):
@Override public T peek(){
  return queues.peekFirst().peek();
}
Program: 94218
Project: 94218
Buggy source:
@Override public boolean offer(T t){
synchronized (queues) {
    count++;
    if (count == 1 || count == maxItemsPerQueue) {
      count=1;
      queues.add(queueFactory.call());
    }
    return queues.peekLast().offer(t);
  }
}

Fixed version (ground truth):
@Override public boolean offer(T t){
  long c=count.incrementAndGet();
  if (c == 1 || c == maxItemsPerQueue) {
    count.set(1);
    queues.add(queueFactory.call());
  }
  return queues.peekLast().offer(t);
}
Program: 94219
Project: 94219
Buggy source:
private Action0 onUnsubscribe(){
  return new Action0(){
    @Override public void call(){
      Worker worker=Schedulers.computation().createWorker();
      worker.schedule(new Action0(){
        @Override public void call(){
          subscriberCount.decrementAndGet();
        }
      }
);
    }
  }
;
}

Fixed version (ground truth):
private Action0 onUnsubscribe(){
  return new Action0(){
    @Override public void call(){
      subscriberCount.decrementAndGet();
    }
  }
;
}
Program: 94220
Project: 94220
Buggy source:
public TransformerLimitSubscribers(AtomicInteger subscriberCount,int maxSubscribers,long delayMs){
  this.subscriberCount=subscriberCount;
  this.maxSubscribers=maxSubscribers;
  this.delayMs=delayMs;
}

Fixed version (ground truth):
public TransformerLimitSubscribers(AtomicInteger subscriberCount,int maxSubscribers){
  this.subscriberCount=subscriberCount;
  this.maxSubscribers=maxSubscribers;
}
Program: 94221
Project: 94221
Buggy source:
public Func1<Observable<? extends Throwable>,Observable<?>> build(){
  Preconditions.checkArgument(waits.isPresent());
  if (maxRetries.isPresent()) {
    waits=of(waits.get().take(maxRetries.get()));
  }
  return notificationHandler(waits.get(),scheduler.get(),action,retryExceptions,failExceptions,exceptionPredicate);
}

Fixed version (ground truth):
public Func1<Observable<? extends Throwable>,Observable<?>> build(){
  Preconditions.checkArgument(waits.isPresent(),"String_Node_Str");
  if (maxRetries.isPresent()) {
    waits=of(waits.get().take(maxRetries.get()));
  }
  return notificationHandler(waits.get(),scheduler.get(),action,retryExceptions,failExceptions,exceptionPredicate);
}
Program: 94222
Project: 94222
Buggy source:
/** 
 * Returns the deserialized objects from the given   {@link File} as an{@link Observable} stream. A buffer size of 8192 bytes is used by default.
 * @param file the input file containing serialized java objects
 * @param < T > the generic type of the deserialized objects returned in the stream
 * @return the stream of deserialized objects from the {@link InputStream}as an   {@link Observable}.
 */
public static <T extends Serializable>Observable<T> read(final File file){
  return read(file,DEFAULT_BUFFER_SIZE);
}

Fixed version (ground truth):
/** 
 * Returns the deserialized objects from the given   {@link File} as an{@link Observable} stream. A buffer size of 8192 bytes is used bydefault.
 * @param file the input file containing serialized java objects
 * @param < T > the generic type of the deserialized objects returned in the stream
 * @return the stream of deserialized objects from the {@link InputStream}as an   {@link Observable}.
 */
public static <T extends Serializable>Observable<T> read(final File file){
  return read(file,DEFAULT_BUFFER_SIZE);
}
Program: 94223
Project: 94223
Buggy source:
@Override public Observable<Integer> call(Observable<Integer> o){
  return o.mergeWith(MERGE_WITH);
}

Fixed version (ground truth):
@Override public Observable<Integer> call(Observable<Integer> o){
  return o.mergeWith(MERGE_WITH.subscribeOn(Schedulers.computation())).subscribeOn(Schedulers.computation());
}
Program: 94224
Project: 94224
Buggy source:
public Vector3f localCharPos(int charIndex){
  float[] verts=this.mesh().vertices();
  int quad=Bdx.VERT_STRIDE * 6;
  return new Vector3f(verts[charIndex * quad],verts[charIndex * quad + 1],0);
}

Fixed version (ground truth):
public Vector3f localCharPos(int charIndex){
  if (charIndex < 0 || charIndex >= capacity)   throw new RuntimeException("String_Node_Str" + charIndex + "String_Node_Str"+ name+ "String_Node_Str"+ capacity+ "String_Node_Str");
  float[] verts=this.mesh().vertices();
  int quad=Bdx.VERT_STRIDE * 6;
  return new Vector3f(verts[charIndex * quad],verts[charIndex * quad + 1],0);
}
Program: 94225
Project: 94225
Buggy source:
public Vector3f localCharSize(int charIndex){
  float[] verts=this.mesh().vertices();
  int quad=Bdx.VERT_STRIDE * 6;
  return new Vector3f(verts[charIndex * quad + Bdx.VERT_STRIDE] - verts[charIndex * quad],verts[charIndex * quad + (Bdx.VERT_STRIDE * 2) + 1] - verts[charIndex * quad + 1],0);
}

Fixed version (ground truth):
public Vector3f localCharSize(int charIndex){
  if (charIndex < 0 || charIndex >= capacity)   throw new RuntimeException("String_Node_Str" + charIndex + "String_Node_Str"+ name+ "String_Node_Str"+ capacity+ "String_Node_Str");
  float[] verts=this.mesh().vertices();
  int quad=Bdx.VERT_STRIDE * 6;
  return new Vector3f(verts[charIndex * quad + Bdx.VERT_STRIDE] - verts[charIndex * quad],verts[charIndex * quad + (Bdx.VERT_STRIDE * 2) + 1] - verts[charIndex * quad + 1],0);
}
Program: 94226
Project: 94226
Buggy source:
@Override public void set(ShaderProgram program){
  program.setUniformf("String_Node_Str",Bdx.time);
  program.setUniformi("String_Node_Str",1);
  program.setUniformi("String_Node_Str",2);
  program.setUniformf("String_Node_Str",vpw);
  program.setUniformf("String_Node_Str",vph);
  program.setUniformf("String_Node_Str",scene.camera.near());
  program.setUniformf("String_Node_Str",scene.camera.far());
}

Fixed version (ground truth):
@Override public void set(ShaderProgram program){
  program.setUniformf("String_Node_Str",Bdx.time);
  program.setUniformi("String_Node_Str",1);
  program.setUniformi("String_Node_Str",2);
  program.setUniformf("String_Node_Str",vpw * display.downsample());
  program.setUniformf("String_Node_Str",vph * display.downsample());
  program.setUniformf("String_Node_Str",scene.camera.near());
  program.setUniformf("String_Node_Str",scene.camera.far());
}
Program: 94228
Project: 94228
Buggy source:
public static void resize(int width,int height){
  spriteBatch.getProjectionMatrix().setToOrtho2D(0,0,width,height);
  if (frameBuffer != null)   frameBuffer.dispose();
  if (depthBuffer != null)   depthBuffer.dispose();
  int fx=Math.max(1,(int)(Gdx.graphics.getWidth() * display.downsample()));
  int fy=Math.max(1,(int)(Gdx.graphics.getHeight() * display.downsample()));
  frameBuffer=new RenderBuffer(spriteBatch,fx,fy);
  depthBuffer=new RenderBuffer(spriteBatch,fx,fy);
  for (  RenderBuffer b : availableTempBuffers.values())   b.dispose();
  availableTempBuffers.clear();
  for (  Scene scene : scenes) {
    for (    Camera cam : scene.cameras) {
      if (cam.renderBuffer != null)       cam.renderBuffer.dispose();
      cam.renderBuffer=null;
    }
    if (scene.lastFrameBuffer != null)     scene.lastFrameBuffer.dispose();
    scene.lastFrameBuffer=new RenderBuffer(spriteBatch,fx,fy);
    scene.viewport.update(width,height);
  }
  if (profiler.visible()) {
    profiler.updateViewport(width,height);
  }
  Bdx.display.changed=true;
}

Fixed version (ground truth):
public static void resize(int width,int height){
  spriteBatch.getProjectionMatrix().setToOrtho2D(0,0,width,height);
  if (frameBuffer != null)   frameBuffer.dispose();
  if (depthBuffer != null)   depthBuffer.dispose();
  int fx=Math.max(1,(int)(Gdx.graphics.getWidth() * display.downsample()));
  int fy=Math.max(1,(int)(Gdx.graphics.getHeight() * display.downsample()));
  frameBuffer=new RenderBuffer(spriteBatch,fx,fy);
  depthBuffer=new RenderBuffer(spriteBatch,fx,fy);
  for (  RenderBuffer b : availableTempBuffers.values())   b.dispose();
  availableTempBuffers.clear();
  for (  Scene scene : scenes) {
    for (    Camera cam : scene.cameras)     cam.updateRenderBuffer();
    if (scene.lastFrameBuffer != null)     scene.lastFrameBuffer.dispose();
    scene.lastFrameBuffer=new RenderBuffer(spriteBatch,fx,fy);
    scene.viewport.update(width,height);
  }
  if (profiler.visible()) {
    profiler.updateViewport(width,height);
  }
  Bdx.display.changed=true;
}
Program: 94229
Project: 94229
Buggy source:
public void updateRenderBuffer(){
  if (renderBuffer != null)   renderBuffer.dispose();
  initRenderBuffer();
}

Fixed version (ground truth):
public void updateRenderBuffer(){
  int targetX=Math.max(1,Math.round(resolution.x * Bdx.display.downsample()));
  int targetY=Math.max(1,Math.round(resolution.y * Bdx.display.downsample()));
  if (renderBuffer == null || (renderBuffer.getWidth() != targetX || renderBuffer.getHeight() != targetY)) {
    if (renderBuffer != null)     renderBuffer.dispose();
    renderBuffer=new RenderBuffer(null,targetX,targetY);
  }
}
Program: 94230
Project: 94230
Buggy source:
private void removeObjects(){
  for (  GameObject g : toBeRemoved) {
    g.parent(null);
    if (g.body.isInWorld())     world.removeRigidBody(g.body);
    g.body.setUserPointer(null);
    objects.remove(g);
    if (g instanceof Light)     lights.remove(g);
    if (g.mesh().instances.size() == 0 && g.mesh().autoDispose)     g.mesh().dispose();
    scene=null;
  }
  toBeRemoved.clear();
}

Fixed version (ground truth):
private void removeObjects(){
  for (  GameObject g : toBeRemoved) {
    g.parent(null);
    if (g.body.isInWorld())     world.removeRigidBody(g.body);
    g.body.setUserPointer(null);
    objects.remove(g);
    if (g instanceof Light)     lights.remove(g);
    if (g.mesh().instances.size() == 0 && g.mesh().autoDispose)     g.mesh().dispose();
    g.scene=null;
  }
  toBeRemoved.clear();
}
Program: 94231
Project: 94231
Buggy source:
public void update(){
  if (!paused) {
    Bdx.profiler.start("String_Node_Str");
    runObjectLogic();
    Bdx.profiler.stop("String_Node_Str");
    updateVisuals();
    for (    Camera cam : cameras) {
      if (cam == camera || cam.renderToTexture)       cam.update();
    }
    Bdx.profiler.stop("String_Node_Str");
    try {
      world.stepSimulation(Bdx.TICK_TIME * Bdx.physicsSpeed,0);
    }
 catch (    NullPointerException e) {
      throw new RuntimeException("String_Node_Str");
    }
    Bdx.profiler.stop("String_Node_Str");
    updateChildBodies();
    Bdx.profiler.stop("String_Node_Str");
    detectCollisions();
    Bdx.profiler.stop("String_Node_Str");
  }
}

Fixed version (ground truth):
public void update(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    dispose();
    init();
  }
  if (requestedEnd) {
    valid=false;
    dispose();
    if (Bdx.scenes.contains(this))     Bdx.scenes.remove(this);
  }
 else   if (!paused) {
    Bdx.profiler.start("String_Node_Str");
    runObjectLogic();
    Bdx.profiler.stop("String_Node_Str");
    updateVisuals();
    for (    Camera cam : cameras) {
      if (cam == camera || cam.renderToTexture)       cam.update();
    }
    Bdx.profiler.stop("String_Node_Str");
    try {
      world.stepSimulation(Bdx.TICK_TIME * Bdx.physicsSpeed,0);
    }
 catch (    NullPointerException e) {
      throw new RuntimeException("String_Node_Str");
    }
    Bdx.profiler.stop("String_Node_Str");
    updateChildBodies();
    Bdx.profiler.stop("String_Node_Str");
    detectCollisions();
    Bdx.profiler.stop("String_Node_Str");
  }
}
Program: 94232
Project: 94232
Buggy source:
private void runObjectLogic(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    dispose();
    init();
  }
  Bdx.mouse.init(this);
  for (  Finger f : Bdx.fingers) {
    f.init(this);
  }
  for (  GameObject g : objects) {
    if (g.bodyType() == GameObject.BodyType.SENSOR)     g.body.activate(true);
    if (!g.valid())     continue;
    if (g instanceof Light)     ((Light)g).updateLight();
    for (    Component c : g.components) {
      if (c.state != null) {
        if (c.logicCounter >= 1) {
          c.logicCounter-=1;
          c.state.main();
        }
        c.logicCounter+=c.logicFrequency * Bdx.TICK_TIME;
      }
    }
    if (g.logicCounter >= 1) {
      g.logicCounter-=1;
      g.main();
    }
    g.logicCounter+=g.logicFrequency * Bdx.TICK_TIME;
  }
  for (  GameObject g : toBeAdded) {
    objects.add(g);
    if (g instanceof Light)     lights.add((Light)g);
  }
  toBeAdded.clear();
  for (  GameObject g : toBeRemoved) {
    g.parent(null);
    world.removeRigidBody(g.body);
    objects.remove(g);
    if (g instanceof Light)     lights.remove(g);
  }
  toBeRemoved.clear();
  if (requestedEnd) {
    valid=false;
    dispose();
    if (Bdx.scenes.contains(this))     Bdx.scenes.remove(this);
  }
}

Fixed version (ground truth):
private void runObjectLogic(){
  Bdx.mouse.init(this);
  for (  Finger f : Bdx.fingers) {
    f.init(this);
  }
  for (  GameObject g : objects) {
    if (g.bodyType() == GameObject.BodyType.SENSOR)     g.body.activate(true);
    if (!g.valid())     continue;
    if (g instanceof Light)     ((Light)g).updateLight();
    for (    Component c : g.components) {
      if (c.state != null) {
        if (c.logicCounter >= 1) {
          c.logicCounter-=1;
          c.state.main();
        }
        c.logicCounter+=c.logicFrequency * Bdx.TICK_TIME;
      }
    }
    if (g.logicCounter >= 1) {
      g.logicCounter-=1;
      g.main();
    }
    g.logicCounter+=g.logicFrequency * Bdx.TICK_TIME;
  }
  for (  GameObject g : toBeAdded) {
    objects.add(g);
    if (g instanceof Light)     lights.add((Light)g);
  }
  toBeAdded.clear();
  for (  GameObject g : toBeRemoved) {
    g.parent(null);
    world.removeRigidBody(g.body);
    objects.remove(g);
    if (g instanceof Light)     lights.remove(g);
  }
  toBeRemoved.clear();
}
Program: 94233
Project: 94233
Buggy source:
public void end(){
  if (gl.active()) {
    gl.active(false);
  }
  scene.end();
}

Fixed version (ground truth):
public void end(){
  if (gl.active())   gl.active(false);
  if (scene != null)   scene.end();
}
Program: 94234
Project: 94234
Buggy source:
public void update(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    dispose();
    init();
  }
  if (requestedEnd) {
    valid=false;
    dispose();
    if (Bdx.scenes.contains(this))     Bdx.scenes.remove(this);
  }
 else   if (!paused) {
    Bdx.profiler.start("String_Node_Str");
    runObjectLogic();
    Bdx.profiler.stop("String_Node_Str");
    updateVisuals();
    for (    Camera cam : cameras) {
      if (cam == camera || cam.renderToTexture)       cam.update();
    }
    Bdx.profiler.stop("String_Node_Str");
    try {
      world.stepSimulation(Bdx.TICK_TIME * Bdx.physicsSpeed,0);
    }
 catch (    NullPointerException e) {
      throw new RuntimeException("String_Node_Str");
    }
    Bdx.profiler.stop("String_Node_Str");
    updateChildBodies();
    Bdx.profiler.stop("String_Node_Str");
    detectCollisions();
    Bdx.profiler.stop("String_Node_Str");
  }
}

Fixed version (ground truth):
public void update(){
  if (!paused) {
    Bdx.profiler.start("String_Node_Str");
    runObjectLogic();
    Bdx.profiler.stop("String_Node_Str");
    updateVisuals();
    for (    Camera cam : cameras) {
      if (cam == camera || cam.renderToTexture)       cam.update();
    }
    Bdx.profiler.stop("String_Node_Str");
    try {
      world.stepSimulation(Bdx.TICK_TIME * Bdx.physicsSpeed,0);
    }
 catch (    NullPointerException e) {
      throw new RuntimeException("String_Node_Str");
    }
    Bdx.profiler.stop("String_Node_Str");
    updateChildBodies();
    Bdx.profiler.stop("String_Node_Str");
    detectCollisions();
    Bdx.profiler.stop("String_Node_Str");
  }
  if (requestedEnd) {
    valid=false;
    dispose();
    if (Bdx.scenes.contains(this))     Bdx.scenes.remove(this);
  }
 else   if (requestedRestart) {
    dispose();
    init();
  }
}
Program: 94237
Project: 94237
Buggy source:
public float[] eval(int axis,float value){
  if (SharedLibraryLoader.isWindows) {
    if (axis == 4 && value < 0) {
      axis=5;
      value=-value;
    }
  }
 else   if ((SharedLibraryLoader.isLinux) && (axis == axes.get("String_Node_Str").code || axis == axes.get("String_Node_Str").code)) {
    value+=1;
    value/=2;
    value=Math.min(Math.max(value,0),1);
  }
  return new float[]{axis,value};
}

Fixed version (ground truth):
public float[] eval(int axis,float value){
  String os=System.getProperty("String_Node_Str");
  if (os.contains("String_Node_Str")) {
    if (axis == 4 && value < 0) {
      axis=5;
      value=-value;
    }
  }
 else   if ((os.contains("String_Node_Str")) && (axis == axes.get("String_Node_Str").code || axis == axes.get("String_Node_Str").code)) {
    value+=1;
    value/=2;
    value=Math.min(Math.max(value,0),1);
  }
  return new float[]{axis,value};
}
Program: 94238
Project: 94238
Buggy source:
public static void init(){
  time=0;
  physicsSpeed=1;
  timeSpeed=1;
  profiler=new Profiler();
  display=new Display();
  scenes=new ArrayListScenes();
  sounds=new Sounds();
  music=new Music();
  mouse=new Mouse();
  imaps=new InputMaps();
  keyboard=new Keyboard();
  fingers=new ArrayList<Finger>();
  components=new ArrayList<Component>();
  allocatedFingers=new ArrayList<Finger>();
  for (int i=0; i < 10; ++i) {
    allocatedFingers.add(new Finger(i));
  }
  gamepads=new ArrayListNamed<Gamepad>();
  for (int i=0; i < Controllers.getControllers().size; i++)   gamepads.add(new Gamepad(i));
  com.badlogic.gdx.graphics.glutils.ShaderProgram.pedantic=false;
  shaderProvider=new BDXShaderProvider();
  modelBatch=new ModelBatch(shaderProvider);
  spriteBatch=new SpriteBatch();
  spriteBatch.setBlendFunction(Gdx.gl.GL_SRC_ALPHA,Gdx.gl.GL_ONE_MINUS_SRC_ALPHA);
  frameBuffer=new RenderBuffer(spriteBatch);
  depthBuffer=new RenderBuffer(spriteBatch);
  depthShaderProvider=new BDXDepthShaderProvider(Gdx.files.internal("String_Node_Str"),Gdx.files.internal("String_Node_Str"));
  depthBatch=new ModelBatch(depthShaderProvider);
  clearColor=new Color();
  advancedLightingOn=true;
  Gdx.input.setInputProcessor(new GdxProcessor(keyboard,mouse,allocatedFingers,gamepads));
  availableTempBuffers=new HashMap<Float,RenderBuffer>();
  requestedRestart=false;
}

Fixed version (ground truth):
public static void init(){
  time=0;
  physicsSpeed=1;
  timeSpeed=1;
  profiler=new Profiler();
  display=new Display();
  scenes=new ArrayListScenes();
  sounds=new Sounds();
  music=new Music();
  mouse=new Mouse();
  imaps=new InputMaps();
  keyboard=new Keyboard();
  fingers=new ArrayList<Finger>();
  components=new ArrayList<Component>();
  allocatedFingers=new ArrayList<Finger>();
  for (int i=0; i < 10; ++i) {
    allocatedFingers.add(new Finger(i));
  }
  gamepads=new ArrayListNamed<Gamepad>();
  for (int i=0; i < Controllers.getControllers().size; i++)   gamepads.add(new Gamepad(i));
  com.badlogic.gdx.graphics.glutils.ShaderProgram.pedantic=false;
  shaderProvider=new BDXShaderProvider();
  modelBatch=new ModelBatch(shaderProvider);
  spriteBatch=new SpriteBatch();
  spriteBatch.setBlendFunction(Gdx.gl.GL_SRC_ALPHA,Gdx.gl.GL_ONE_MINUS_SRC_ALPHA);
  frameBuffer=new RenderBuffer(spriteBatch);
  depthBuffer=new RenderBuffer(spriteBatch);
  depthShaderProvider=new BDXDepthShaderProvider(Gdx.files.internal("String_Node_Str"),Gdx.files.internal("String_Node_Str"));
  depthBatch=new ModelBatch(depthShaderProvider);
  advancedLightingOn=true;
  Gdx.input.setInputProcessor(new GdxProcessor(keyboard,mouse,allocatedFingers,gamepads));
  availableTempBuffers=new HashMap<Float,RenderBuffer>();
  requestedRestart=false;
}
Program: 94241
Project: 94241
Buggy source:
public void render(Renderable renderable,Attributes combinedAttributes){
  super.render(renderable,combinedAttributes);
  if (scene != null) {
    program.setUniformf("String_Node_Str",scene.camera.far());
    program.setUniformf("String_Node_Str",scene.camera.near());
  }
}

Fixed version (ground truth):
public void render(Renderable renderable,Attributes combinedAttributes){
  if (scene != null) {
    program.setUniformf("String_Node_Str",scene.camera.far());
    program.setUniformf("String_Node_Str",scene.camera.near());
  }
  super.render(renderable,combinedAttributes);
}
Program: 94242
Project: 94242
Buggy source:
public void blendMode(int src,int dest){
  BlendingAttribute ba=(BlendingAttribute)get(BlendingAttribute.Type);
  ba.sourceFunction=src;
  ba.destFunction=dest;
}

Fixed version (ground truth):
public void blendMode(int src,int dest){
  BlendingAttribute ba=(BlendingAttribute)get(BlendingAttribute.Type);
  ba.sourceFunction=src;
  ba.destFunction=dest;
  ba.blended=true;
}
Program: 94244
Project: 94244
Buggy source:
public ArrayList<String> hitKeys(){
  ArrayList<String> keyNames=new ArrayList<String>();
  for (  String keyName : keyToCode.keySet()) {
    if (Gdx.input.isKeyJustPressed(keyToCode.get(keyName)))     keyNames.add(keyName);
  }
  return keyNames;
}

Fixed version (ground truth):
public ArrayList<String> hitKeys(){
  ArrayList<String> keyNames=new ArrayList<String>();
  for (  String keyName : keyToCode.keySet()) {
    if (!keyName.equals("String_Node_Str") && Gdx.input.isKeyJustPressed(keyToCode.get(keyName)))     keyNames.add(keyName);
  }
  return keyNames;
}
Program: 94245
Project: 94245
Buggy source:
public ArrayList<String> downKeys(){
  ArrayList<String> keyNames=new ArrayList<String>();
  for (  String keyName : keyToCode.keySet()) {
    if (Gdx.input.isKeyPressed(keyToCode.get(keyName)))     keyNames.add(keyName);
  }
  return keyNames;
}

Fixed version (ground truth):
public ArrayList<String> downKeys(){
  ArrayList<String> keyNames=new ArrayList<String>();
  for (  String keyName : keyToCode.keySet()) {
    if (!keyName.equals("String_Node_Str") && Gdx.input.isKeyPressed(keyToCode.get(keyName)))     keyNames.add(keyName);
  }
  return keyNames;
}
Program: 94246
Project: 94246
Buggy source:
public ArrayList<String> hitInputs(){
  ArrayList<String> inputs=new ArrayList<String>();
  if (profile != null) {
    for (    String s : profile.btnToCode.keySet()) {
      if (btnDown(s))       inputs.add(s);
    }
  }
  return inputs;
}

Fixed version (ground truth):
public ArrayList<String> hitInputs(){
  ArrayList<String> inputs=new ArrayList<String>();
  if (profile != null) {
    for (    String s : profile.btnToCode.keySet()) {
      if (btnHit(s))       inputs.add(s);
    }
  }
  return inputs;
}
Program: 94247
Project: 94247
Buggy source:
public Vector3f scale(){
  return scale;
}

Fixed version (ground truth):
public Vector3f scale(){
  return new Vector3f(scale);
}
Program: 94248
Project: 94248
Buggy source:
public void remove(GameObject g){
  toBeAdded.remove(g);
  world.removeRigidBody(g.body);
  toBeRemoved.add(g);
}

Fixed version (ground truth):
public void remove(GameObject g){
  toBeAdded.remove(g);
  toBeRemoved.add(g);
}
Program: 94249
Project: 94249
Buggy source:
private void runObjectLogic(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    dispose();
    init();
  }
  Bdx.mouse.scene=this;
  for (  Finger f : Bdx.fingers) {
    f.scene=this;
  }
  for (  GameObject g : objects) {
    if (!g.valid())     continue;
    if (g instanceof Light)     ((Light)g).updateLight();
    for (    Component c : g.components) {
      if (c.state != null) {
        if (c.logicCounter >= 1) {
          c.logicCounter-=1;
          c.state.main();
        }
        c.logicCounter+=c.logicFrequency * Bdx.TICK_TIME;
      }
    }
    if (g.logicCounter >= 1) {
      g.logicCounter-=1;
      g.main();
    }
    g.logicCounter+=g.logicFrequency * Bdx.TICK_TIME;
  }
  for (  GameObject g : toBeAdded) {
    objects.add(g);
    if (g instanceof Light)     lights.add((Light)g);
  }
  toBeAdded.clear();
  for (  GameObject g : toBeRemoved) {
    objects.remove(g);
    if (g instanceof Light)     lights.remove(g);
  }
  toBeRemoved.clear();
  if (requestedEnd) {
    valid=false;
    for (    GameObject g : objects)     g.end();
    dispose();
    if (Bdx.scenes.contains(this)) {
      if (Bdx.scenes.size() > 1)       Bdx.scenes.remove(this);
 else       Bdx.end();
    }
  }
}

Fixed version (ground truth):
private void runObjectLogic(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    dispose();
    init();
  }
  Bdx.mouse.scene=this;
  for (  Finger f : Bdx.fingers) {
    f.scene=this;
  }
  for (  GameObject g : objects) {
    if (!g.valid())     continue;
    if (g instanceof Light)     ((Light)g).updateLight();
    for (    Component c : g.components) {
      if (c.state != null) {
        if (c.logicCounter >= 1) {
          c.logicCounter-=1;
          c.state.main();
        }
        c.logicCounter+=c.logicFrequency * Bdx.TICK_TIME;
      }
    }
    if (g.logicCounter >= 1) {
      g.logicCounter-=1;
      g.main();
    }
    g.logicCounter+=g.logicFrequency * Bdx.TICK_TIME;
  }
  for (  GameObject g : toBeAdded) {
    objects.add(g);
    if (g instanceof Light)     lights.add((Light)g);
  }
  toBeAdded.clear();
  for (  GameObject g : toBeRemoved) {
    world.removeRigidBody(g.body);
    objects.remove(g);
    if (g instanceof Light)     lights.remove(g);
  }
  toBeRemoved.clear();
  if (requestedEnd) {
    valid=false;
    for (    GameObject g : objects)     g.end();
    dispose();
    if (Bdx.scenes.contains(this)) {
      if (Bdx.scenes.size() > 1)       Bdx.scenes.remove(this);
 else       Bdx.end();
    }
  }
}
Program: 94250
Project: 94250
Buggy source:
public float time(){
  if (paused)   return delta;
  return Bdx.time - timeLast;
}

Fixed version (ground truth):
public float time(){
  float f=Bdx.time - timeLast;
  if (paused)   f=delta;
  return Math.round(f * 10000.0f) / 10000.0f;
}
Program: 94251
Project: 94251
Buggy source:
public void dispose(){
  lastFrameBuffer.dispose();
  defaultModel.dispose();
  for (  Model m : models.values())   m.dispose();
  for (  Texture t : textures.values())   t.dispose();
  for (  ScreenShader s : screenShaders)   s.dispose();
  for (  Camera c : cameras)   c.renderBuffer.dispose();
  for (  Material m : materials.values()) {
    if (m.currentTexture != null)     m.currentTexture.dispose();
  }
}

Fixed version (ground truth):
public void dispose(){
  lastFrameBuffer.dispose();
  defaultModel.dispose();
  for (  Model m : models.values())   m.dispose();
  for (  Texture t : textures.values())   t.dispose();
  for (  ScreenShader s : screenShaders)   s.dispose();
  for (  Camera c : cameras) {
    if (c.renderBuffer != null)     c.renderBuffer.dispose();
  }
  for (  Material m : materials.values()) {
    if (m.currentTexture != null)     m.currentTexture.dispose();
  }
}
Program: 94252
Project: 94252
Buggy source:
public static void dispose(){
  modelBatch.dispose();
  spriteBatch.dispose();
  frameBuffer.dispose();
  tempBuffer.dispose();
  for (  ShaderProgram sp : matShaders.values()) {
    sp.disposeAll();
  }
}

Fixed version (ground truth):
public static void dispose(){
  modelBatch.dispose();
  spriteBatch.dispose();
  frameBuffer.dispose();
  tempBuffer.dispose();
}
Program: 94253
Project: 94253
Buggy source:
private GameObject cloneNoChildren(GameObject gobj){
  GameObject g=instantiator.newObject(gobj.json);
  g.json=gobj.json;
  g.name=gobj.name;
  g.visibleNoChildren(gobj.visible());
  g.modelInstance=new ModelInstance(gobj.modelInstance);
  g.body=Bullet.cloneBody(gobj.body);
  g.currBodyType=gobj.currBodyType;
  g.currBoundsType=gobj.currBoundsType;
  g.origin=gobj.origin;
  g.dimensionsNoScale=gobj.dimensionsNoScale;
  g.body.setUserPointer(g);
  g.scale(gobj.scale());
  g.props=gobj.props;
  g.scene=this;
  if (g instanceof Camera) {
    Camera c=(Camera)g;
    Camera cc=(Camera)gobj;
  }
 else   if (g instanceof Text) {
    Text t=(Text)g;
    Text tt=(Text)gobj;
    t.font=tt.font;
    t.useUniqueModel();
  }
 else   if (g instanceof Light) {
    Light l=(Light)g;
    Light ll=(Light)gobj;
    l.energy(ll.energy());
    l.color(ll.color());
    l.type=ll.type;
    l.makeLightData();
    environment.add(l.lightData);
  }
  return g;
}

Fixed version (ground truth):
private GameObject cloneNoChildren(GameObject gobj){
  GameObject g=instantiator.newObject(gobj.json);
  g.json=gobj.json;
  g.name=gobj.name;
  g.visibleNoChildren(gobj.visible());
  g.modelInstance=new ModelInstance(gobj.modelInstance);
  g.body=Bullet.cloneBody(gobj.body);
  g.currBodyType=gobj.currBodyType;
  g.currBoundsType=gobj.currBoundsType;
  g.origin=gobj.origin;
  g.dimensionsNoScale=gobj.dimensionsNoScale;
  g.body.setUserPointer(g);
  g.scale(gobj.scale());
  g.props=gobj.props;
  g.scene=this;
  if (g instanceof Camera) {
    Camera c=(Camera)g;
    Camera cc=(Camera)gobj;
  }
 else   if (g instanceof Text) {
    Text t=(Text)g;
    Text tt=(Text)gobj;
    t.font=tt.font;
    t.useUniqueModel();
  }
 else   if (g instanceof Light) {
    Light l=(Light)g;
    Light ll=(Light)gobj;
    l.energy(ll.energy());
    l.color(ll.color());
    l.type=ll.type;
    l.makeLightData();
    l.updateLight();
    environment.add(l.lightData);
  }
  return g;
}
Program: 94254
Project: 94254
Buggy source:
private void runObjectLogic(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    for (    Model m : models.values()) {
      m.dispose();
    }
    for (    Texture t : textures.values()) {
      t.dispose();
    }
    init();
  }
  Bdx.mouse.scene=this;
  for (  Finger f : Bdx.fingers) {
    f.scene=this;
  }
  for (  GameObject g : objects) {
    if (!g.valid())     continue;
    for (    Component c : g.components) {
      if (c.state != null)       c.state.main();
    }
    g.main();
  }
  if (toBeAdded.size() > 0) {
    objects.addAll(toBeAdded);
    toBeAdded.clear();
  }
  if (toBeRemoved.size() > 0) {
    objects.removeAll(toBeRemoved);
    toBeRemoved.clear();
  }
}

Fixed version (ground truth):
private void runObjectLogic(){
  if (requestedRestart) {
    for (    GameObject g : objects) {
      g.endNoChildren();
    }
    for (    Model m : models.values()) {
      m.dispose();
    }
    for (    Texture t : textures.values()) {
      t.dispose();
    }
    for (    ShaderProgram s : filters) {
      s.dispose();
    }
    init();
  }
  Bdx.mouse.scene=this;
  for (  Finger f : Bdx.fingers) {
    f.scene=this;
  }
  for (  GameObject g : objects) {
    if (!g.valid())     continue;
    if (g instanceof Light)     ((Light)g).updateLight();
    for (    Component c : g.components) {
      if (c.state != null)       c.state.main();
    }
    g.main();
  }
  if (toBeAdded.size() > 0) {
    objects.addAll(toBeAdded);
    toBeAdded.clear();
  }
  if (toBeRemoved.size() > 0) {
    objects.removeAll(toBeRemoved);
    toBeRemoved.clear();
  }
}
Program: 94255
Project: 94255
Buggy source:
public void dispose(){
  lastFrameBuffer.dispose();
  for (  ShaderProgram sp : filters) {
    sp.disposeAll();
  }
}

Fixed version (ground truth):
public void dispose(){
  lastFrameBuffer.dispose();
  for (  ShaderProgram s : filters) {
    s.dispose();
  }
}
Program: 94256
Project: 94256
Buggy source:
public void mass(float mass){
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  body.setMassProps(mass,inertia);
  lastNonZeroMass=mass;
}

Fixed version (ground truth):
public void mass(float mass){
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  body.setMassProps(mass,inertia);
}
Program: 94257
Project: 94257
Buggy source:
private GameObject cloneNoChildren(GameObject gobj){
  GameObject g=instantiator.newObject(gobj.json);
  g.json=gobj.json;
  g.name=gobj.name;
  g.visibleNoChildren(gobj.visible());
  g.modelInstance=new ModelInstance(gobj.modelInstance);
  g.body=Bullet.cloneBody(gobj.body);
  g.body.setUserPointer(g);
  g.scale(gobj.scale());
  g.props=gobj.props;
  g.scene=this;
  if (g instanceof Camera) {
    Camera c=(Camera)g;
    Camera cc=(Camera)gobj;
  }
 else   if (g instanceof Text) {
    Text t=(Text)g;
    Text tt=(Text)gobj;
    t.font=tt.font;
    t.useUniqueModel();
  }
 else   if (g instanceof Light) {
    Light l=(Light)g;
    Light ll=(Light)gobj;
    l.energy(ll.energy());
    l.color(ll.color());
    l.type=ll.type;
    l.makeLightData();
    environment.add(l.lightData);
  }
  return g;
}

Fixed version (ground truth):
private GameObject cloneNoChildren(GameObject gobj){
  GameObject g=instantiator.newObject(gobj.json);
  g.json=gobj.json;
  g.name=gobj.name;
  g.visibleNoChildren(gobj.visible());
  g.modelInstance=new ModelInstance(gobj.modelInstance);
  g.body=Bullet.cloneBody(gobj.body);
  g.mass(gobj.mass());
  g.body.setUserPointer(g);
  g.scale(gobj.scale());
  g.props=gobj.props;
  g.scene=this;
  if (g instanceof Camera) {
    Camera c=(Camera)g;
    Camera cc=(Camera)gobj;
  }
 else   if (g instanceof Text) {
    Text t=(Text)g;
    Text tt=(Text)gobj;
    t.font=tt.font;
    t.useUniqueModel();
  }
 else   if (g instanceof Light) {
    Light l=(Light)g;
    Light ll=(Light)gobj;
    l.energy(ll.energy());
    l.color(ll.color());
    l.type=ll.type;
    l.makeLightData();
    environment.add(l.lightData);
  }
  return g;
}
Program: 94258
Project: 94258
Buggy source:
public static RigidBody cloneBody(RigidBody body){
  GameObject gobj=(GameObject)body.getUserPointer();
  JsonValue physics=gobj.json.get("String_Node_Str");
  float mass=physics.get("String_Node_Str").asFloat();
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  CollisionShape shape;
  if (gobj.modelInstance != null) {
    shape=makeShape(gobj.modelInstance.model.meshes.first(),physics.get("String_Node_Str").asString(),physics.get("String_Node_Str").asBoolean());
  }
 else {
    shape=new BoxShape(new Vector3f(0.25f,0.25f,0.25f));
  }
  RigidBody b=new RigidBody(mass,new DefaultMotionState(new Transform(gobj.transform())),shape,inertia);
  b.setCollisionFlags(gobj.body.getCollisionFlags());
  b.setAngularFactor(gobj.body.getAngularFactor());
  b.setRestitution(gobj.body.getRestitution());
  b.setFriction(gobj.body.getFriction());
  return b;
}

Fixed version (ground truth):
public static RigidBody cloneBody(RigidBody body){
  GameObject gobj=(GameObject)body.getUserPointer();
  JsonValue physics=gobj.json.get("String_Node_Str");
  float mass=gobj.mass();
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  CollisionShape shape;
  if (gobj.modelInstance != null) {
    shape=makeShape(gobj.modelInstance.model.meshes.first(),physics.get("String_Node_Str").asString(),physics.get("String_Node_Str").asBoolean());
  }
 else {
    shape=new BoxShape(new Vector3f(0.25f,0.25f,0.25f));
  }
  RigidBody b=new RigidBody(mass,new DefaultMotionState(new Transform(gobj.transform())),shape,inertia);
  b.setCollisionFlags(gobj.body.getCollisionFlags());
  b.setAngularFactor(gobj.body.getAngularFactor());
  b.setRestitution(gobj.body.getRestitution());
  b.setFriction(gobj.body.getFriction());
  return b;
}
Program: 94259
Project: 94259
Buggy source:
public void mass(float mass){
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  body.setMassProps(mass,inertia);
  lastNonZeroMass=mass;
}

Fixed version (ground truth):
public void mass(float mass){
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  body.setMassProps(mass,inertia);
}
Program: 94260
Project: 94260
Buggy source:
private GameObject cloneNoChildren(GameObject gobj){
  GameObject g=instantiator.newObject(gobj.json);
  g.json=gobj.json;
  g.name=gobj.name;
  g.visibleNoChildren(gobj.visible());
  g.modelInstance=new ModelInstance(gobj.modelInstance);
  g.body=Bullet.cloneBody(gobj.body);
  g.body.setUserPointer(g);
  g.scale(gobj.scale());
  g.props=gobj.props;
  g.scene=this;
  if (g instanceof Camera) {
    Camera c=(Camera)g;
    Camera cc=(Camera)gobj;
  }
 else   if (g instanceof Text) {
    Text t=(Text)g;
    Text tt=(Text)gobj;
    t.font=tt.font;
    t.useUniqueModel();
  }
 else   if (g instanceof Light) {
    Light l=(Light)g;
    Light ll=(Light)gobj;
    l.energy(ll.energy());
    l.color(ll.color());
    l.type=ll.type;
    l.makeLightData();
    environment.add(l.lightData);
  }
  return g;
}

Fixed version (ground truth):
private GameObject cloneNoChildren(GameObject gobj){
  GameObject g=instantiator.newObject(gobj.json);
  g.json=gobj.json;
  g.name=gobj.name;
  g.visibleNoChildren(gobj.visible());
  g.modelInstance=new ModelInstance(gobj.modelInstance);
  g.body=Bullet.cloneBody(gobj.body);
  g.mass(gobj.mass());
  g.body.setUserPointer(g);
  g.scale(gobj.scale());
  g.props=gobj.props;
  g.scene=this;
  if (g instanceof Camera) {
    Camera c=(Camera)g;
    Camera cc=(Camera)gobj;
  }
 else   if (g instanceof Text) {
    Text t=(Text)g;
    Text tt=(Text)gobj;
    t.font=tt.font;
    t.useUniqueModel();
  }
 else   if (g instanceof Light) {
    Light l=(Light)g;
    Light ll=(Light)gobj;
    l.energy(ll.energy());
    l.color(ll.color());
    l.type=ll.type;
    l.makeLightData();
    environment.add(l.lightData);
  }
  return g;
}
Program: 94261
Project: 94261
Buggy source:
public static RigidBody cloneBody(RigidBody body){
  GameObject gobj=(GameObject)body.getUserPointer();
  JsonValue physics=gobj.json.get("String_Node_Str");
  float mass=physics.get("String_Node_Str").asFloat();
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  CollisionShape shape;
  if (gobj.modelInstance != null) {
    shape=makeShape(gobj.modelInstance.model.meshes.first(),physics.get("String_Node_Str").asString(),physics.get("String_Node_Str").asBoolean());
  }
 else {
    shape=new BoxShape(new Vector3f(0.25f,0.25f,0.25f));
  }
  RigidBody b=new RigidBody(mass,new DefaultMotionState(new Transform(gobj.transform())),shape,inertia);
  b.setCollisionFlags(gobj.body.getCollisionFlags());
  b.setAngularFactor(gobj.body.getAngularFactor());
  b.setRestitution(gobj.body.getRestitution());
  b.setFriction(gobj.body.getFriction());
  return b;
}

Fixed version (ground truth):
public static RigidBody cloneBody(RigidBody body){
  GameObject gobj=(GameObject)body.getUserPointer();
  JsonValue physics=gobj.json.get("String_Node_Str");
  float mass=gobj.mass();
  Vector3f inertia=new Vector3f();
  body.getCollisionShape().calculateLocalInertia(mass,inertia);
  CollisionShape shape;
  if (gobj.modelInstance != null) {
    shape=makeShape(gobj.modelInstance.model.meshes.first(),physics.get("String_Node_Str").asString(),physics.get("String_Node_Str").asBoolean());
  }
 else {
    shape=new BoxShape(new Vector3f(0.25f,0.25f,0.25f));
  }
  RigidBody b=new RigidBody(mass,new DefaultMotionState(new Transform(gobj.transform())),shape,inertia);
  b.setCollisionFlags(gobj.body.getCollisionFlags());
  b.setAngularFactor(gobj.body.getAngularFactor());
  b.setRestitution(gobj.body.getRestitution());
  b.setFriction(gobj.body.getFriction());
  return b;
}
Program: 94263
Project: 94263
Buggy source:
private GameObject clone(GameObject gobj){
  String instance=gobj._json.get("String_Node_Str").asString();
  GameObject inst=gobj;
  if (instance != null)   gobj=templates.get(instance);
  GameObject g=cloneNoChildren(gobj);
  for (  GameObject c : gobj.children) {
    GameObject nc=clone(c);
    nc.parent(g);
  }
  if (instance != null) {
    g.position(inst.position());
    Matrix3f ori=inst.orientation();
    ori.mul(g.orientation());
    g.orientation(ori);
    g.props=inst.props;
    for (    GameObject c : inst.children) {
      GameObject nc=clone(c);
      nc.parent(g);
    }
  }
  return g;
}

Fixed version (ground truth):
private GameObject clone(GameObject gobj){
  String instance=gobj._json.get("String_Node_Str").asString();
  GameObject inst=gobj;
  if (instance != null)   gobj=templates.get(instance);
  GameObject g=cloneNoChildren(gobj);
  for (  GameObject c : gobj.children) {
    GameObject nc=clone(c);
    nc.parent(g);
  }
  if (instance != null) {
    g.position(inst.position());
    Matrix3f ori=inst.orientation();
    ori.mul(g.orientation());
    g.orientation(ori);
    g.props=new HashMap<String,JsonValue>(g.props);
    g.props.putAll(inst.props);
    for (    GameObject c : inst.children) {
      GameObject nc=clone(c);
      nc.parent(g);
    }
  }
  return g;
}
Program: 94264
Project: 94264
Buggy source:
public boolean keyUp(int code){
  Keyboard.Log k=keyboard.codeToLog.get(code);
  k.up=Keyboard.t + 1;
  return true;
}

Fixed version (ground truth):
public boolean keyUp(int code){
  Keyboard.Log k=keyboard.codeToLog.get(code);
  if (k != null)   k.up=Keyboard.t + 1;
  return true;
}
Program: 94265
Project: 94265
Buggy source:
public boolean keyDown(int code){
  Keyboard.Log k=keyboard.codeToLog.get(code);
  k.hit=Keyboard.t + 1;
  return true;
}

Fixed version (ground truth):
public boolean keyDown(int code){
  Keyboard.Log k=keyboard.codeToLog.get(code);
  if (k != null)   k.hit=Keyboard.t + 1;
  return true;
}
Program: 94266
Project: 94266
Buggy source:
public void main(){
  if (active == null)   return;
  active.fps=Math.abs(active.fps);
  speed=Math.abs(speed);
  tick.delta(1f / nz(active.fps * speed));
  if (tick.time()) {
    showNextVector2f();
  }
}

Fixed version (ground truth):
public void main(){
  if (active == null)   return;
  active.fps=Math.abs(active.fps);
  speed=Math.abs(speed);
  tick.delta(1f / nz(active.fps * speed));
  if (tick.time()) {
    showNextFrame();
  }
}
Program: 94267
Project: 94267
Buggy source:
private void download(String path,HttpServletResponse response){
  try {
    File file=new File(path);
    String filename=file.getName();
    InputStream fis=new BufferedInputStream(new FileInputStream(path));
    byte[] buffer=new byte[fis.available()];
    fis.read(buffer);
    fis.close();
    response.reset();
    response.addHeader("String_Node_Str","String_Node_Str" + new String(filename.getBytes()));
    response.addHeader("String_Node_Str","String_Node_Str" + file.length());
    OutputStream toClient=new BufferedOutputStream(response.getOutputStream());
    response.setContentType("String_Node_Str");
    toClient.write(buffer);
    toClient.flush();
    toClient.close();
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
private void download(String path,HttpServletResponse response){
  try {
    File file=new File(path);
    String filename=file.getName();
    InputStream fis=new BufferedInputStream(new FileInputStream(path));
    byte[] buffer=new byte[fis.available()];
    fis.read(buffer);
    fis.close();
    response.reset();
    response.addHeader("String_Node_Str","String_Node_Str" + new String(filename.getBytes(),"String_Node_Str"));
    response.addHeader("String_Node_Str","String_Node_Str" + file.length());
    OutputStream toClient=new BufferedOutputStream(response.getOutputStream());
    response.setContentType("String_Node_Str");
    toClient.write(buffer);
    toClient.flush();
    toClient.close();
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}
Program: 94268
Project: 94268
Buggy source:
private void download(String path,HttpServletResponse response){
  try {
    File file=new File(path);
    String filename=file.getName();
    InputStream fis=new BufferedInputStream(new FileInputStream(path));
    byte[] buffer=new byte[fis.available()];
    fis.read(buffer);
    fis.close();
    response.reset();
    response.addHeader("String_Node_Str","String_Node_Str" + new String(filename.getBytes()));
    response.addHeader("String_Node_Str","String_Node_Str" + file.length());
    OutputStream toClient=new BufferedOutputStream(response.getOutputStream());
    response.setContentType("String_Node_Str");
    toClient.write(buffer);
    toClient.flush();
    toClient.close();
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
private void download(String path,HttpServletResponse response){
  try {
    File file=new File(path);
    String filename=file.getName();
    InputStream fis=new BufferedInputStream(new FileInputStream(path));
    byte[] buffer=new byte[fis.available()];
    fis.read(buffer);
    fis.close();
    response.reset();
    response.addHeader("String_Node_Str","String_Node_Str" + new String(filename.getBytes(),"String_Node_Str"));
    response.addHeader("String_Node_Str","String_Node_Str" + file.length());
    OutputStream toClient=new BufferedOutputStream(response.getOutputStream());
    response.setContentType("String_Node_Str");
    toClient.write(buffer);
    toClient.flush();
    toClient.close();
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}