nus-yam/ex-repair huggingface dataset:
Program: 96782
Project: 96782
Buggy source:
@Override public void readImage(DirectBuffer memory,OnComplete onComplete){
  new Thread(() -> {
    IntBuffer width=BufferUtils.createIntBuffer(1);
    IntBuffer height=BufferUtils.createIntBuffer(1);
    IntBuffer components=BufferUtils.createIntBuffer(1);
    ByteBuffer imageBuffer=stbi_load_from_memory((ByteBuffer)memory.nativeBuffer(),width,height,components,4);
    if (imageBuffer == null)     throw new SilenceException("String_Node_Str" + stbi_failure_reason());
    Image image=new Image(width.get(0),height.get(0));
    for (int y=0; y < image.getHeight(); y++) {
      for (int x=0; x < image.getWidth(); x++) {
        int start=4 * (y * image.getWidth() + x);
        float r=(imageBuffer.get(start) & 0xff) / 255f;
        float g=(imageBuffer.get(start + 1) & 0xff) / 255f;
        float b=(imageBuffer.get(start + 2) & 0xff) / 255f;
        float a=1 - (imageBuffer.get(start + 3) & 0xff) / 255f;
        image.setPixel(x,y,new Color(r,g,b,a));
      }
    }
    stbi_image_free(imageBuffer);
    TaskManager.runOnUpdate(() -> onComplete.invoke(image));
  }
).start();
}

Fixed version (ground truth):
@Override public void readImage(DirectBuffer memory,UniCallback<Image> onComplete){
  new Thread(() -> {
    IntBuffer width=BufferUtils.createIntBuffer(1);
    IntBuffer height=BufferUtils.createIntBuffer(1);
    IntBuffer components=BufferUtils.createIntBuffer(1);
    ByteBuffer imageBuffer=stbi_load_from_memory((ByteBuffer)memory.nativeBuffer(),width,height,components,4);
    if (imageBuffer == null)     throw new SilenceException("String_Node_Str" + stbi_failure_reason());
    Image image=new Image(width.get(0),height.get(0));
    for (int y=0; y < image.getHeight(); y++) {
      for (int x=0; x < image.getWidth(); x++) {
        int start=4 * (y * image.getWidth() + x);
        float r=(imageBuffer.get(start) & 0xff) / 255f;
        float g=(imageBuffer.get(start + 1) & 0xff) / 255f;
        float b=(imageBuffer.get(start + 2) & 0xff) / 255f;
        float a=1 - (imageBuffer.get(start + 3) & 0xff) / 255f;
        image.setPixel(x,y,new Color(r,g,b,a));
      }
    }
    stbi_image_free(imageBuffer);
    TaskManager.runOnUpdate(() -> onComplete.invoke(image));
  }
).start();
}
Program: 96783
Project: 96783
Buggy source:
private static void update(float deltaTime){
  while (!updateTasks.isEmpty()) {
    Task task;
    if ((task=updateTasks.poll()) != null)     task.perform();
  }
}

Fixed version (ground truth):
private static void update(float deltaTime){
  while (!updateTasks.isEmpty()) {
    SimpleCallback task;
    if ((task=updateTasks.poll()) != null)     task.invoke();
  }
}
Program: 96784
Project: 96784
Buggy source:
public static void runOnRender(Task task){
  renderTasks.add(task);
  checkInitialized();
}

Fixed version (ground truth):
public static void runOnRender(SimpleCallback task){
  renderTasks.add(task);
  checkInitialized();
}
Program: 96785
Project: 96785
Buggy source:
public static void runOnUpdate(Task task){
  updateTasks.add(task);
  checkInitialized();
}

Fixed version (ground truth):
public static void runOnUpdate(SimpleCallback task){
  updateTasks.add(task);
  checkInitialized();
}
Program: 96786
Project: 96786
Buggy source:
private static void render(float delta){
  while (!renderTasks.isEmpty()) {
    Task task;
    if ((task=renderTasks.poll()) != null)     task.perform();
  }
}

Fixed version (ground truth):
private static void render(float delta){
  while (!renderTasks.isEmpty()) {
    SimpleCallback task;
    if ((task=renderTasks.poll()) != null)     task.invoke();
  }
}
Program: 96787
Project: 96787
Buggy source:
@Override public int read() throws IOException {
  if (index >= directBuffer.sizeBytes())   return -1;
  return directBuffer.readByte(index++);
}

Fixed version (ground truth):
@Override public int read() throws IOException {
  if (index >= directBuffer.sizeBytes())   return -1;
  return directBuffer.readByte(index++) & 0xFF;
}
Program: 96788
Project: 96788
Buggy source:
/** 
 * Method borrowed from LWJGL 3 demos, this converts stereo and mono data samples to the internal format of OpenAL.
 * @param samples The ByteBuffer of audio samples
 * @param stereo  Whether to convert to stereo audio
 * @return The ByteBuffer containing fixed samples.
 */
static ByteBuffer convertAudioBytes(ByteBuffer samples,boolean stereo){
  ByteBuffer dest=ByteBuffer.allocateDirect(samples.capacity());
  dest.order(ByteOrder.nativeOrder());
  if (stereo) {
    ShortBuffer dest_short=dest.asShortBuffer();
    ShortBuffer src_short=samples.asShortBuffer();
    while (src_short.hasRemaining())     dest_short.put(src_short.get());
  }
 else {
    while (samples.hasRemaining())     dest.put(samples.get());
  }
  dest.rewind();
  return dest;
}

Fixed version (ground truth):
/** 
 * Method borrowed from LWJGL 3 demos, this converts stereo and mono data samples to the internal format of OpenAL.
 * @param samples        The ByteBuffer of audio samples
 * @param twoByteSamples Whether the samples are shorts or bytes
 * @return The ByteBuffer containing fixed samples.
 */
private static ByteBuffer convertAudioBytes(ByteBuffer samples,boolean twoByteSamples){
  ByteBuffer dest=ByteBuffer.allocateDirect(samples.capacity());
  dest.order(ByteOrder.nativeOrder());
  if (twoByteSamples) {
    ShortBuffer dest_short=dest.asShortBuffer();
    ShortBuffer src_short=samples.asShortBuffer();
    while (src_short.hasRemaining())     dest_short.put(src_short.get());
  }
 else {
    while (samples.hasRemaining())     dest.put(samples.get());
  }
  dest.rewind();
  return dest;
}
Program: 96789
Project: 96789
Buggy source:
public void play(Sound sound,AudioSource source,boolean loop){
  ALSource alSource=sourcesPool.pop();
  source.update();
  alSource.attachBuffer(sound.buffer);
  alSource.setParameter(AL_POSITION,source.position);
  alSource.setParameter(AL_VELOCITY,source.velocity);
  alSource.setParameter(AL_DIRECTION,source.direction);
  alSource.setParameter(AL_LOOPING,loop);
  alSource.play();
  PlayingSource playingSource=playingSourcesPool.pop();
  playingSource.sound=sound;
  playingSource.alSource=alSource;
  playingSources.put(playingSource,source);
}

Fixed version (ground truth):
public void play(Sound sound,AudioSource source,boolean loop){
  ALSource alSource=sourcesPool.pop();
  source.update();
  alSource.attachBuffer(sound.buffer);
  alSource.setParameter(AL_POSITION,source.position);
  alSource.setParameter(AL_VELOCITY,source.velocity);
  alSource.setParameter(AL_DIRECTION,source.direction);
  alSource.setParameter(AL_LOOPING,loop);
  source.updated=false;
  alSource.play();
  PlayingSource playingSource=playingSourcesPool.pop();
  playingSource.sound=sound;
  playingSource.alSource=alSource;
  playingSources.put(playingSource,source);
}
Program: 96790
Project: 96790
Buggy source:
private void updateSources(float deltaTime){
  for (  PlayingSource playingSource : playingSources.keySet()) {
    ALSource source=playingSource.alSource;
    AudioSource audioSource=playingSources.get(playingSource);
    if (audioSource.updated) {
      source.setParameter(AL_POSITION,audioSource.position);
      source.setParameter(AL_VELOCITY,audioSource.velocity);
      source.setParameter(AL_DIRECTION,audioSource.direction);
      audioSource.updated=false;
    }
    if (source.getState() != ALSource.State.PLAYING) {
      playingSources.remove(playingSource);
      sourcesPool.push(source);
      playingSourcesPool.push(playingSource);
    }
  }
}

Fixed version (ground truth):
private void updateSources(float deltaTime){
  Iterator<PlayingSource> iterator=playingSources.keySet().iterator();
  while (iterator.hasNext()) {
    PlayingSource playingSource=iterator.next();
    ALSource source=playingSource.alSource;
    AudioSource audioSource=playingSources.get(playingSource);
    if (source.getState() != ALSource.State.PLAYING) {
      source.attachBuffer(null);
      iterator.remove();
      sourcesPool.push(source);
      playingSourcesPool.push(playingSource);
      continue;
    }
    if (audioSource.updated) {
      source.pause();
      source.setParameter(AL_POSITION,audioSource.position);
      source.setParameter(AL_VELOCITY,audioSource.velocity);
      source.setParameter(AL_DIRECTION,audioSource.direction);
      audioSource.updated=false;
      source.play();
    }
  }
}
Program: 96791
Project: 96791
Buggy source:
/** 
 * Attaches an ALBuffer to this source. The buffer contains the audio samples that this source should play.
 * @param buffer The ALBuffer containing the sound samples to be played.
 * @throws ALException.InvalidValue If the buffer is already disposed.
 */
public void attachBuffer(ALBuffer buffer){
  setParameter(AL_BUFFER,buffer.getID());
}

Fixed version (ground truth):
/** 
 * Attaches an ALBuffer to this source. The buffer contains the audio samples that this source should play.
 * @param buffer The ALBuffer containing the sound samples to be played.
 * @throws ALException.InvalidValue If the buffer is already disposed.
 */
public void attachBuffer(ALBuffer buffer){
  setParameter(AL_BUFFER,buffer == null ? 0 : buffer.getID());
}
Program: 96792
Project: 96792
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void processHandlers(){
  while (!eventHandlersQueue.isEmpty()) {
    EventHandlerQueueObject object=eventHandlersQueue.remove();
switch (object.eventType) {
case UPDATE:
      if (object.action == EventQueueAction.ADD_HANDLER)       updateEventHandlers.add((IUpdateEventHandler)object.handler);
 else       updateEventHandlers.remove(object.handler);
    break;
case RENDER:
  if (object.action == EventQueueAction.ADD_HANDLER)   renderEventHandlers.add((IRenderEventHandler)object.handler);
 else   renderEventHandlers.remove(object.handler);
break;
case RESIZE:
if (object.action == EventQueueAction.ADD_HANDLER) resizeEventHandlers.add((IResizeEventHandler)object.handler);
 else resizeEventHandlers.remove(object.handler);
break;
case DISPOSE:
if (object.action == EventQueueAction.ADD_HANDLER) disposeEventHandlers.add((IDisposeEventHandler)object.handler);
 else disposeEventHandlers.remove(object.handler);
break;
}
}
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void processHandlers(){
  while (!eventHandlersQueue.isEmpty()) {
    EventHandlerQueueObject object=eventHandlersQueue.poll();
    if (object == null)     break;
switch (object.eventType) {
case UPDATE:
      if (object.action == EventQueueAction.ADD_HANDLER)       updateEventHandlers.add((IUpdateEventHandler)object.handler);
 else       updateEventHandlers.remove(object.handler);
    break;
case RENDER:
  if (object.action == EventQueueAction.ADD_HANDLER)   renderEventHandlers.add((IRenderEventHandler)object.handler);
 else   renderEventHandlers.remove(object.handler);
break;
case RESIZE:
if (object.action == EventQueueAction.ADD_HANDLER) resizeEventHandlers.add((IResizeEventHandler)object.handler);
 else resizeEventHandlers.remove(object.handler);
break;
case DISPOSE:
if (object.action == EventQueueAction.ADD_HANDLER) disposeEventHandlers.add((IDisposeEventHandler)object.handler);
 else disposeEventHandlers.remove(object.handler);
break;
}
}
}
Program: 96793
Project: 96793
Buggy source:
@Override public void performLoopFrame(){
  float currTime=(float)TimeUtils.currentTime();
  float elapsedTime=currTime - prevTime;
  prevTime=currTime;
  SilenceEngine.eventManager.raiseUpdateEvent(elapsedTime);
  GLContext.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  SilenceEngine.eventManager.raiseRenderEvent(elapsedTime);
}

Fixed version (ground truth):
@Override public void performLoopFrame(){
  if (prevTime == 0)   prevTime=(int)TimeUtils.currentTime();
  float currTime=(float)TimeUtils.currentTime();
  float elapsedTime=currTime - prevTime;
  prevTime=currTime;
  SilenceEngine.eventManager.raiseUpdateEvent(elapsedTime);
  GLContext.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  SilenceEngine.eventManager.raiseRenderEvent(elapsedTime);
}
Program: 96794
Project: 96794
Buggy source:
public static void start(){
  SilenceEngine.log=new GwtLogDevice();
  SilenceEngine.display=new GwtDisplayDevice();
  SilenceEngine.input=new GwtInputDevice();
  SilenceEngine.io=new GwtIODevice();
  SilenceEngine.graphics=new GwtGraphicsDevice();
}

Fixed version (ground truth):
public static void start(){
  SilenceEngine.log=new GwtLogDevice();
  SilenceEngine.display=new GwtDisplayDevice();
  SilenceEngine.input=new GwtInputDevice();
  SilenceEngine.io=new GwtIODevice();
  SilenceEngine.graphics=new GwtGraphicsDevice();
  Game.INSTANCE.init();
  AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
}
Program: 96795
Project: 96795
Buggy source:
@Override public void setSize(int width,int height){
  canvas.setCoordinateSpaceWidth(width);
  canvas.setCoordinateSpaceHeight(height);
}

Fixed version (ground truth):
@Override public void setSize(int width,int height){
  canvas.setCoordinateSpaceWidth(width);
  canvas.setCoordinateSpaceHeight(height);
  Game.INSTANCE.resized();
}
Program: 96796
Project: 96796
Buggy source:
@Override public void setFullscreen(boolean fullscreen){
  if (fullscreen)   context.requestFullscreen();
 else   WebGLContext.exitFullscreen();
}

Fixed version (ground truth):
@Override public void setFullscreen(boolean fullscreen){
  if (fullscreen)   context.requestFullscreen();
 else   WebGLContext.exitFullscreen();
  Game.INSTANCE.resized();
}
Program: 96797
Project: 96797
Buggy source:
/** 
 * Constructs an instance of FilePath by taking a path string, and a type.
 * @param path The path string of the path
 * @param type The type of the file, one of {@link Type#EXTERNAL} or {@link Type#RESOURCE}.
 */
protected GwtFilePath(String path,Type type){
  super(path,type);
  XMLHttpRequest request=XMLHttpRequest.create();
  request.open("String_Node_Str",getPath());
  request.setOnReadyStateChange(xhr -> {
    if (request.getReadyState() == XMLHttpRequest.DONE)     size=Integer.parseInt(request.getResponseHeader("String_Node_Str"));
  }
);
  request.send();
  exists=request.getStatus() != 404;
}

Fixed version (ground truth):
/** 
 * Constructs an instance of FilePath by taking a path string, and a type.
 * @param path The path string of the path
 * @param type The type of the file, one of {@link Type#EXTERNAL} or {@link Type#RESOURCE}.
 */
protected GwtFilePath(String path,Type type){
  super(path,type);
  XMLHttpRequest request=XMLHttpRequest.create();
  request.open("String_Node_Str",getPath());
  request.setOnReadyStateChange(xhr -> {
    if (request.getReadyState() == XMLHttpRequest.DONE)     try {
      size=Integer.parseInt(request.getResponseHeader("String_Node_Str"));
    }
 catch (    Exception e) {
      size=0;
    }
  }
);
  request.send();
  exists=request.getStatus() != 404;
}
Program: 96798
Project: 96798
Buggy source:
@Override public void centerOnScreen(){
  VideoMode mode=Monitor.getPrimaryMonitor().getVideoMode();
  Vector2 windowPosition=window.getPosition();
  windowPosition.x=(mode.getWidth() - windowPosition.x) / 2;
  windowPosition.y=(mode.getHeight() - windowPosition.y) / 2;
  window.setPosition(windowPosition);
}

Fixed version (ground truth):
@Override public void centerOnScreen(){
  VideoMode mode=Monitor.getPrimaryMonitor().getVideoMode();
  Vector2 windowPosition=window.getSize();
  windowPosition.x=(mode.getWidth() - windowPosition.x) / 2;
  windowPosition.y=(mode.getHeight() - windowPosition.y) / 2;
  window.setPosition(windowPosition);
}
Program: 96799
Project: 96799
Buggy source:
public LwjglDisplayDevice(){
  Window.setHint(GLFW.GLFW_OPENGL_PROFILE,GLFW.GLFW_OPENGL_CORE_PROFILE);
  Window.setHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT,GLFW.GLFW_TRUE);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR,3);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MINOR,2);
  window=new Window(800,600,"String_Node_Str");
  window.show();
}

Fixed version (ground truth):
public LwjglDisplayDevice(){
  GLFW3.init();
  GLFW3.setSwapInterval(1);
  Window.setHint(GLFW.GLFW_OPENGL_PROFILE,GLFW.GLFW_OPENGL_CORE_PROFILE);
  Window.setHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT,GLFW.GLFW_TRUE);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR,3);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MINOR,2);
  window=new Window(800,600,"String_Node_Str");
  centerOnScreen();
  window.show();
  window.setSizeCallback((window1,width,height) -> Game.INSTANCE.resized());
}
Program: 96800
Project: 96800
Buggy source:
@Override public void readImage(DirectBuffer memory,OnComplete onComplete){
  new Thread(() -> {
    IntBuffer width=BufferUtils.createIntBuffer(1);
    IntBuffer height=BufferUtils.createIntBuffer(1);
    IntBuffer components=BufferUtils.createIntBuffer(1);
    ByteBuffer imageBuffer=stbi_load_from_memory((ByteBuffer)memory.nativeBuffer(),width,height,components,4);
    if (imageBuffer == null)     throw new SilenceException("String_Node_Str" + stbi_failure_reason());
    Image image=new Image(width.get(0),height.get(0));
    FloatBuffer pixels=imageBuffer.asFloatBuffer();
    for (int x=0; x < image.getWidth(); x++) {
      for (int y=0; y < image.getHeight(); y++) {
        int start=y * height.get(0) + x;
        float r=pixels.get(start);
        float g=pixels.get(start + 1);
        float b=pixels.get(start + 2);
        float a=pixels.get(start + 3);
        image.setPixel(x,y,new Color(r,g,b,a));
      }
    }
    stbi_image_free(imageBuffer);
    onComplete.invoke(image);
  }
).start();
}

Fixed version (ground truth):
@Override public void readImage(DirectBuffer memory,OnComplete onComplete){
  new Thread(() -> {
    IntBuffer width=BufferUtils.createIntBuffer(1);
    IntBuffer height=BufferUtils.createIntBuffer(1);
    IntBuffer components=BufferUtils.createIntBuffer(1);
    ByteBuffer imageBuffer=stbi_load_from_memory((ByteBuffer)memory.nativeBuffer(),width,height,components,4);
    if (imageBuffer == null)     throw new SilenceException("String_Node_Str" + stbi_failure_reason());
    Image image=new Image(width.get(0),height.get(0));
    for (int y=0; y < image.getHeight(); y++) {
      for (int x=0; x < image.getWidth(); x++) {
        int start=4 * (y * image.getWidth() + x);
        float r=(imageBuffer.get(start) & 0xff) / 255f;
        float g=(imageBuffer.get(start + 1) & 0xff) / 255f;
        float b=(imageBuffer.get(start + 2) & 0xff) / 255f;
        float a=1 - (imageBuffer.get(start + 3) & 0xff) / 255f;
        image.setPixel(x,y,new Color(r,g,b,a));
      }
    }
    stbi_image_free(imageBuffer);
    onComplete.invoke(image);
  }
).start();
}
Program: 96801
Project: 96801
Buggy source:
public static void start(){
  SilenceEngine.log=new LwjglLogDevice();
  SilenceEngine.io=new LwjglIODevice();
  SilenceEngine.display=new LwjglDisplayDevice();
  SilenceEngine.input=new LwjglInputDevice();
  SilenceEngine.graphics=new LwjglGraphicsDevice();
}

Fixed version (ground truth):
public static void start(){
  SilenceEngine.log=new LwjglLogDevice();
  SilenceEngine.io=new LwjglIODevice();
  SilenceEngine.display=new LwjglDisplayDevice();
  SilenceEngine.input=new LwjglInputDevice();
  SilenceEngine.graphics=new LwjglGraphicsDevice();
  Window window=((LwjglDisplayDevice)SilenceEngine.display).window;
  Game.INSTANCE.init();
  while (!window.shouldClose()) {
    GLFW3.pollEvents();
    SilenceEngine.gameLoop.performLoopFrame();
    window.swapBuffers();
  }
  Game.INSTANCE.dispose();
  ((LwjglDisplayDevice)SilenceEngine.display).cleanUp();
}
Program: 96802
Project: 96802
Buggy source:
public void setMonitor(Monitor monitor,VideoMode videoMode){
  this.monitor=monitor;
  glfwSetWindowMonitor(handle,monitor.getHandle(),0,0,videoMode.getWidth(),videoMode.getHeight(),videoMode.getRefreshRate());
}

Fixed version (ground truth):
public void setMonitor(Monitor monitor){
  setMonitor(monitor,monitor.getVideoMode());
}
Program: 96803
Project: 96803
Buggy source:
public GwtAudioDevice(){
  try {
    context=ALContext.create();
  }
 catch (  AudioContextException e) {
    SilenceEngine.log.getRootLogger().error(e);
  }
}

Fixed version (ground truth):
public GwtAudioDevice(){
  try {
    context=ALContext.create();
    AL.setCurrentContext(context);
  }
 catch (  AudioContextException e) {
    SilenceEngine.log.getRootLogger().error(e);
  }
}
Program: 96804
Project: 96804
Buggy source:
public static void start(){
  SilenceEngine.log=new GwtLogDevice();
  SilenceEngine.display=new GwtDisplayDevice();
  SilenceEngine.input=new GwtInputDevice();
  SilenceEngine.io=new GwtIODevice();
  SilenceEngine.graphics=new GwtGraphicsDevice();
  Game.INSTANCE.init();
  AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
}

Fixed version (ground truth):
public static void start(){
  SilenceEngine.log=new GwtLogDevice();
  SilenceEngine.display=new GwtDisplayDevice();
  SilenceEngine.input=new GwtInputDevice();
  SilenceEngine.io=new GwtIODevice();
  SilenceEngine.graphics=new GwtGraphicsDevice();
  Game.INSTANCE.init();
  SilenceEngine.display.setFullscreen(false);
  AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
}
Program: 96806
Project: 96806
Buggy source:
@Override public void setFullscreen(boolean fullscreen){
  if (fullscreen)   context.requestFullscreen();
 else   WebGLContext.exitFullscreen();
  Game.INSTANCE.resized();
}

Fixed version (ground truth):
@Override public void setFullscreen(boolean fullscreen){
  if (fullscreen) {
    fullScreenRequested=true;
  }
 else {
    WebGLContext.exitFullscreen();
    fullScreenRequested=false;
  }
  Game.INSTANCE.resized();
  canvas.setFocus(true);
}
Program: 96807
Project: 96807
Buggy source:
@Override public void setFullscreen(boolean fullscreen){
  if (fullscreen)   window.setMonitor(Monitor.getPrimaryMonitor());
 else   window.setMonitor(null);
}

Fixed version (ground truth):
@Override public void setFullscreen(boolean fullscreen){
  if (fullscreen) {
    this.fullscreen=true;
    window.setMonitor(Monitor.getPrimaryMonitor());
  }
 else {
    window.setMonitor(null);
    window.setSize(windowWidth,windowHeight);
    window.setPosition(windowPositionX,windowPositionY);
    this.fullscreen=false;
  }
}
Program: 96808
Project: 96808
Buggy source:
public LwjglDisplayDevice(){
  GLFW3.init();
  GLFW3.setSwapInterval(1);
  Window.setHint(GLFW.GLFW_OPENGL_PROFILE,GLFW.GLFW_OPENGL_CORE_PROFILE);
  Window.setHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT,GLFW.GLFW_TRUE);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR,3);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MINOR,2);
  window=new Window(800,600,"String_Node_Str");
  centerOnScreen();
  window.show();
  window.setSizeCallback((window1,width,height) -> Game.INSTANCE.resized());
}

Fixed version (ground truth):
public LwjglDisplayDevice(){
  GLFW3.init();
  GLFW3.setSwapInterval(1);
  Window.setHint(GLFW.GLFW_OPENGL_PROFILE,GLFW.GLFW_OPENGL_CORE_PROFILE);
  Window.setHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT,GLFW.GLFW_TRUE);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR,3);
  Window.setHint(GLFW.GLFW_CONTEXT_VERSION_MINOR,2);
  windowWidth=800;
  windowHeight=600;
  window=new Window(windowWidth,windowHeight,"String_Node_Str");
  centerOnScreen();
  window.show();
  window.makeCurrent();
  window.setPositionCallback((window1,xPos,yPos) -> {
    if (!fullscreen) {
      windowPositionX=xPos;
      windowPositionY=yPos;
    }
  }
);
  window.setSizeCallback((window1,width,height) -> {
    if (!fullscreen) {
      windowWidth=width;
      windowHeight=height;
    }
    Game.INSTANCE.resized();
  }
);
}
Program: 96809
Project: 96809
Buggy source:
@Override public void setPosition(int x,int y){
  window.setPosition(x,y);
}

Fixed version (ground truth):
@Override public void setPosition(int x,int y){
  window.setPosition(x,y);
  windowPositionX=x;
  windowPositionY=y;
}
Program: 96810
Project: 96810
Buggy source:
@Override public void setSize(int width,int height){
  window.setSize(width,height);
}

Fixed version (ground truth):
@Override public void setSize(int width,int height){
  window.setSize(width,height);
  if (!fullscreen) {
    windowWidth=width;
    windowHeight=height;
  }
}
Program: 96811
Project: 96811
Buggy source:
@Override public void centerOnScreen(){
  VideoMode mode=Monitor.getPrimaryMonitor().getVideoMode();
  Vector2 windowPosition=window.getSize();
  windowPosition.x=(mode.getWidth() - windowPosition.x) / 2;
  windowPosition.y=(mode.getHeight() - windowPosition.y) / 2;
  window.setPosition(windowPosition);
}

Fixed version (ground truth):
@Override public void centerOnScreen(){
  VideoMode mode=Monitor.getPrimaryMonitor().getVideoMode();
  Vector2 windowPosition=window.getSize();
  windowPosition.x=(mode.getWidth() - windowPosition.x) / 2;
  windowPosition.y=(mode.getHeight() - windowPosition.y) / 2;
  window.setPosition(windowPosition);
  windowPositionX=(int)windowPosition.x;
  windowPositionY=(int)windowPosition.y;
}
Program: 96812
Project: 96812
Buggy source:
public void setMonitor(Monitor monitor){
  setMonitor(monitor,monitor.getVideoMode());
}

Fixed version (ground truth):
public void setMonitor(Monitor monitor){
  setMonitor(monitor,monitor == null ? null : monitor.getVideoMode());
}
Program: 96813
Project: 96813
Buggy source:
@Override public DirectBuffer writeInt(int byteIndex,int value){
  view.setInt32(byteIndex,value);
  return this;
}

Fixed version (ground truth):
@Override public DirectBuffer writeInt(int byteIndex,int value){
  view.setInt32(byteIndex,value,littleEndian);
  return this;
}
Program: 96814
Project: 96814
Buggy source:
public GwtDirectBuffer(int sizeInBytes){
  super(sizeInBytes);
  buffer=ArrayBufferNative.create(sizeInBytes);
  view=DataViewNative.create(buffer);
}

Fixed version (ground truth):
public GwtDirectBuffer(int sizeInBytes){
  super(sizeInBytes);
  if (!endiannness) {
    littleEndian=getEndianness();
    endiannness=true;
  }
  buffer=ArrayBufferNative.create(sizeInBytes);
  view=DataViewNative.create(buffer);
}
Program: 96815
Project: 96815
Buggy source:
@Override public DirectBuffer writeFloat(int byteIndex,float value){
  view.setFloat32(byteIndex,value);
  return this;
}

Fixed version (ground truth):
@Override public DirectBuffer writeFloat(int byteIndex,float value){
  view.setFloat32(byteIndex,value,littleEndian);
  return this;
}
Program: 96816
Project: 96816
Buggy source:
@Override public DirectBuffer writeLong(int byteIndex,long value){
  view.setUint32(byteIndex,value);
  return this;
}

Fixed version (ground truth):
@Override public DirectBuffer writeLong(int byteIndex,long value){
  view.setUint32(byteIndex,value,littleEndian);
  return this;
}
Program: 96817
Project: 96817
Buggy source:
@Override public long readLong(int byteIndex){
  return view.getUint32(byteIndex);
}

Fixed version (ground truth):
@Override public long readLong(int byteIndex){
  return view.getUint32(byteIndex,littleEndian);
}
Program: 96818
Project: 96818
Buggy source:
@Override public short readShort(int byteIndex){
  return view.getInt16(byteIndex);
}

Fixed version (ground truth):
@Override public short readShort(int byteIndex){
  return view.getInt16(byteIndex,littleEndian);
}
Program: 96819
Project: 96819
Buggy source:
@Override public double readDouble(int byteIndex){
  return view.getFloat64(byteIndex);
}

Fixed version (ground truth):
@Override public double readDouble(int byteIndex){
  return view.getFloat64(byteIndex,littleEndian);
}
Program: 96820
Project: 96820
Buggy source:
@Override public float readFloat(int byteIndex){
  return view.getFloat32(byteIndex);
}

Fixed version (ground truth):
@Override public float readFloat(int byteIndex){
  return view.getFloat32(byteIndex,littleEndian);
}
Program: 96821
Project: 96821
Buggy source:
@Override public DirectBuffer writeShort(int byteIndex,short value){
  view.setInt16(byteIndex,value);
  return this;
}

Fixed version (ground truth):
@Override public DirectBuffer writeShort(int byteIndex,short value){
  view.setInt16(byteIndex,value,littleEndian);
  return this;
}
Program: 96822
Project: 96822
Buggy source:
@Override public int readInt(int byteIndex){
  return view.getInt32(byteIndex);
}

Fixed version (ground truth):
@Override public int readInt(int byteIndex){
  return view.getInt32(byteIndex,littleEndian);
}
Program: 96823
Project: 96823
Buggy source:
@Override public DirectBuffer writeDouble(int byteIndex,double value){
  view.setFloat64(byteIndex,value);
  return this;
}

Fixed version (ground truth):
@Override public DirectBuffer writeDouble(int byteIndex,double value){
  view.setFloat64(byteIndex,value,littleEndian);
  return this;
}
Program: 96824
Project: 96824
Buggy source:
@Override public void glTexImage2D(int target,int level,int internalFormat,int width,int height,int border,int format,int type,DirectBuffer pixels){
  WebGL10.glTexImage2D(target,level,internalFormat,width,height,border,format,type,(ArrayBufferView)pixels.nativeBuffer());
}

Fixed version (ground truth):
@Override public void glTexImage2D(int target,int level,int internalFormat,int width,int height,int border,int format,int type,DirectBuffer pixels){
  ArrayBufferView arrayBufferView=null;
switch (type) {
case GL_FLOAT:
    arrayBufferView=Float32ArrayNative.create(((ArrayBufferView)pixels.nativeBuffer()).buffer());
  break;
case GL_UNSIGNED_BYTE:
arrayBufferView=Uint8ArrayNative.create(((ArrayBufferView)pixels.nativeBuffer()).buffer());
break;
}
WebGL10.glTexImage2D(target,level,internalFormat,width,height,border,format,type,arrayBufferView);
}
Program: 96825
Project: 96825
Buggy source:
@Override public int glGetShaderi(int shader,int param){
  return WebGL10.glGetShaderParameter(shader,param);
}

Fixed version (ground truth):
@Override public int glGetShaderi(int shader,int param){
  if (param == GL_SHADER_TYPE)   return WebGL10.<Integer>glGetShaderParameter(shader,param);
 else   return WebGL10.<Boolean>glGetShaderParameter(shader,param) ? Constants.GL_TRUE : Constants.GL_FALSE;
}
Program: 96826
Project: 96826
Buggy source:
@Override public int glGetProgrami(int program,int param){
  return WebGL10.glGetProgramParameter(program,param);
}

Fixed version (ground truth):
@Override public int glGetProgrami(int program,int param){
  if (param == GL_LINK_STATUS || param == GL_DELETE_STATUS || param == GL_VALIDATE_STATUS)   return WebGL10.<Boolean>glGetProgramParameter(program,param) ? GL_TRUE : GL_FALSE;
  return WebGL10.<Integer>glGetProgramParameter(program,param);
}
Program: 96827
Project: 96827
Buggy source:
private static void jsLoadedCallback(ImageData pixels,int width,int height,OnComplete onComplete){
  Image image=new Image(width,height);
  for (int x=0; x < width; x++) {
    for (int y=0; y < height; y++)     image.setPixel(x,y,new Color(pixels.getRedAt(x,y) / 255f,pixels.getGreenAt(x,y) / 255f,pixels.getBlueAt(x,y) / 255f,pixels.getAlphaAt(x,y) / 255f));
  }
  onComplete.invoke(image);
}

Fixed version (ground truth):
private static void jsLoadedCallback(ImageData pixels,int width,int height,OnComplete onComplete){
  Image image=new Image(width,height);
  for (int x=0; x < width; x++) {
    for (int y=0; y < height; y++)     image.setPixel(x,y,new Color(pixels.getRedAt(x,y) / 255f,pixels.getGreenAt(x,y) / 255f,pixels.getBlueAt(x,y) / 255f,1 - (pixels.getAlphaAt(x,y) / 255f)));
  }
  onComplete.invoke(image);
}
Program: 96828
Project: 96828
Buggy source:
public static void start(Game game){
  SilenceEngine.log=new GwtLogDevice();
  SilenceEngine.display=new GwtDisplayDevice();
  SilenceEngine.input=new GwtInputDevice();
  SilenceEngine.io=new GwtIODevice();
  SilenceEngine.graphics=new GwtGraphicsDevice();
  SilenceEngine.audio=new GwtAudioDevice();
  game.init();
  SilenceEngine.display.setFullscreen(false);
  AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
}

Fixed version (ground truth):
public static void start(Game game){
  SilenceEngine.log=new GwtLogDevice();
  GWT.setUncaughtExceptionHandler(new UnwrappingExceptionHandler());
  SilenceEngine.display=new GwtDisplayDevice();
  SilenceEngine.input=new GwtInputDevice();
  SilenceEngine.io=new GwtIODevice();
  SilenceEngine.graphics=new GwtGraphicsDevice();
  SilenceEngine.audio=new GwtAudioDevice();
  SilenceEngine.display.setIcon(FilePath.getResourceFile("String_Node_Str"));
  game.init();
  SilenceEngine.display.setFullscreen(false);
  AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop);
}
Program: 96829
Project: 96829
Buggy source:
public static void start(Game game){
  SilenceEngine.log=new LwjglLogDevice();
  SilenceEngine.io=new LwjglIODevice();
  SilenceEngine.display=new LwjglDisplayDevice();
  SilenceEngine.input=new LwjglInputDevice();
  SilenceEngine.graphics=new LwjglGraphicsDevice();
  SilenceEngine.audio=new LwjglAudioDevice();
  if (SilenceEngine.display.getPlatform() == SilenceEngine.Platform.MACOSX)   System.setProperty("String_Node_Str","String_Node_Str");
  Window window=((LwjglDisplayDevice)SilenceEngine.display).window;
  game.init();
  SilenceEngine.eventManager.raiseResizeEvent();
  while (!window.shouldClose()) {
    GLFW3.pollEvents();
    SilenceEngine.gameLoop.performLoopFrame();
    window.swapBuffers();
  }
  SilenceEngine.eventManager.raiseDisposeEvent();
}

Fixed version (ground truth):
public static void start(Game game){
  SilenceEngine.log=new LwjglLogDevice();
  SilenceEngine.io=new LwjglIODevice();
  SilenceEngine.display=new LwjglDisplayDevice();
  SilenceEngine.input=new LwjglInputDevice();
  SilenceEngine.graphics=new LwjglGraphicsDevice();
  SilenceEngine.audio=new LwjglAudioDevice();
  if (SilenceEngine.display.getPlatform() == SilenceEngine.Platform.MACOSX)   System.setProperty("String_Node_Str","String_Node_Str");
  Window window=((LwjglDisplayDevice)SilenceEngine.display).window;
  SilenceEngine.display.setIcon(FilePath.getResourceFile("String_Node_Str"));
  game.init();
  SilenceEngine.eventManager.raiseResizeEvent();
  while (!window.shouldClose()) {
    GLFW3.pollEvents();
    SilenceEngine.gameLoop.performLoopFrame();
    window.swapBuffers();
  }
  SilenceEngine.eventManager.raiseDisposeEvent();
}
Program: 96830
Project: 96830
Buggy source:
public GwtInputDevice(){
  createKeyMapping();
  createMouseMapping();
  Canvas canvas=((GwtDisplayDevice)SilenceEngine.display).canvas;
  canvas.addKeyDownHandler(event -> postKeyEvent(getKeyCode(event.getNativeKeyCode()),true));
  canvas.addKeyUpHandler(event -> postKeyEvent(getKeyCode(event.getNativeKeyCode()),false));
  canvas.addMouseDownHandler(event -> postMouseEvent(getMouseCode(event.getNativeButton()),true));
  canvas.addMouseUpHandler(event -> postMouseEvent(getMouseCode(event.getNativeButton()),false));
  canvas.addMouseMoveHandler(event -> {
    int x=event.getClientX();
    int y=event.getClientY();
    Mouse.dx=x - Mouse.x;
    Mouse.dy=y - Mouse.y;
    Mouse.x=x;
    Mouse.y=y;
  }
);
  canvas.addMouseWheelHandler(event -> {
    int dsy=event.getDeltaY();
    Mouse.deltaScrollY=dsy > 0 ? 1 : dsy == 0 ? 0 : -1;
    Mouse.deltaScrollX=0;
  }
);
  canvas.addTouchStartHandler(event -> postTouchEvents(event.getTargetTouches(),true));
  canvas.addTouchMoveHandler(event -> postTouchEvents(event.getTargetTouches(),true));
  canvas.addTouchEndHandler(event -> postTouchEvents(event.getTargetTouches(),false));
  canvas.addTouchCancelHandler(event -> postTouchEvents(event.getTargetTouches(),false));
}

Fixed version (ground truth):
public GwtInputDevice(){
  createKeyMapping();
  createMouseMapping();
  Canvas canvas=((GwtDisplayDevice)SilenceEngine.display).canvas;
  canvas.addKeyDownHandler(event -> postKeyEvent(getKeyCode(event.getNativeKeyCode()),true));
  canvas.addKeyUpHandler(event -> postKeyEvent(getKeyCode(event.getNativeKeyCode()),false));
  canvas.addMouseDownHandler(event -> postMouseEvent(getMouseCode(event.getNativeButton()),true));
  canvas.addMouseUpHandler(event -> postMouseEvent(getMouseCode(event.getNativeButton()),false));
  canvas.addMouseMoveHandler(event -> {
    int x=event.getX();
    int y=event.getY();
    Mouse.dx=x - Mouse.x;
    Mouse.dy=y - Mouse.y;
    Mouse.x=x;
    Mouse.y=y;
  }
);
  canvas.addMouseWheelHandler(event -> {
    int dsy=event.getDeltaY();
    Mouse.deltaScrollY=dsy > 0 ? 1 : dsy == 0 ? 0 : -1;
    Mouse.deltaScrollX=0;
  }
);
  canvas.addTouchStartHandler(event -> postTouchEvents(event.getTargetTouches(),true));
  canvas.addTouchMoveHandler(event -> postTouchEvents(event.getTargetTouches(),true));
  canvas.addTouchEndHandler(event -> postTouchEvents(event.getTargetTouches(),false));
  canvas.addTouchCancelHandler(event -> postTouchEvents(event.getTargetTouches(),false));
}
Program: 96833
Project: 96833
Buggy source:
public Vector3 rotate(Vector3 axis,float angle){
  Quaternion temp=Quaternion.REUSABLE_STACK.pop();
  temp.set(axis,angle);
  temp.multiply(this,this);
  Quaternion.REUSABLE_STACK.push(temp);
  return this;
}

Fixed version (ground truth):
public Vector3 rotate(Vector3 rotation){
  Quaternion temp=Quaternion.REUSABLE_STACK.pop();
  temp.set(rotation.x,rotation.y,rotation.z);
  temp.multiply(this,this);
  Quaternion.REUSABLE_STACK.push(temp);
  return this;
}
Program: 96834
Project: 96834
Buggy source:
public void scale(float sx,float sy){
  for (  Vector2 v : vertices)   v.scale(sx,sy);
}

Fixed version (ground truth):
public void scale(float sx,float sy){
  for (  Vector2 v : vertices)   v.scale(sx,sy);
  scaleX*=sx;
  scaleY*=sy;
}
Program: 96835
Project: 96835
Buggy source:
public Polygon(){
  this.vertices=new ArrayList<>();
  this.position=new Vector2();
  this.center=new Vector2();
  clearVertices();
}

Fixed version (ground truth):
public Polygon(){
  this.vertices=new ArrayList<>();
  this.position=new Vector2();
  this.center=new Vector2();
  scaleX=scaleY=1;
  clearVertices();
}
Program: 96836
Project: 96836
Buggy source:
public void setScale(Vector2 scale){
  this.scale.set(scale);
}

Fixed version (ground truth):
public void setScale(Vector2 scale){
  scale(scale.x / scaleX,scale.y / scaleY);
}
Program: 96837
Project: 96837
Buggy source:
void handleCollision(Entity2D other);

Fixed version (ground truth):
void handleCollision(Entity2D other,CollisionComponent2D component);
Program: 96838
Project: 96838
Buggy source:
@Override public void update(float deltaTime){
  polygon.setPosition(entity.position);
  polygon.setRotation(entity.rotation);
  polygon.setScale(entity.scale);
}

Fixed version (ground truth):
@Override public void update(float deltaTime){
  Vector2 tPosition=Vector2.REUSABLE_STACK.pop();
  Vector2 tScale=Vector2.REUSABLE_STACK.pop();
  float rotation=0;
  tPosition.set(entity.position);
  tScale.set(entity.scale);
  rotation+=entity.rotation;
  Entity2D parent=entity.parent;
  while (parent != null) {
    rotation+=parent.rotation;
    tScale.scale(parent.scale.x,parent.scale.y);
    tPosition.rotate(parent.rotation).add(parent.position);
    parent=parent.parent;
  }
  polygon.setCenter(tPosition);
  polygon.setScale(tScale);
  polygon.setRotation(rotation);
  Vector2.REUSABLE_STACK.push(tPosition);
  Vector2.REUSABLE_STACK.push(tScale);
}
Program: 96840
Project: 96840
Buggy source:
@Override public int getWidth(){
  return (int)window.getPosition().x;
}

Fixed version (ground truth):
@Override public int getWidth(){
  return (int)window.getSize().x;
}
Program: 96841
Project: 96841
Buggy source:
@Override public int getHeight(){
  return (int)window.getPosition().y;
}

Fixed version (ground truth):
@Override public int getHeight(){
  return (int)window.getSize().y;
}
Program: 96842
Project: 96842
Buggy source:
public static void start(Game game){
  SilenceEngine.log=new LwjglLogDevice();
  SilenceEngine.io=new LwjglIODevice();
  SilenceEngine.display=new LwjglDisplayDevice();
  SilenceEngine.input=new LwjglInputDevice();
  SilenceEngine.graphics=new LwjglGraphicsDevice();
  SilenceEngine.audio=new LwjglAudioDevice();
  Window window=((LwjglDisplayDevice)SilenceEngine.display).window;
  game.init();
  while (!window.shouldClose()) {
    GLFW3.pollEvents();
    SilenceEngine.gameLoop.performLoopFrame();
    window.swapBuffers();
  }
  SilenceEngine.eventManager.raiseDisposeEvent();
}

Fixed version (ground truth):
public static void start(Game game){
  SilenceEngine.log=new LwjglLogDevice();
  SilenceEngine.io=new LwjglIODevice();
  SilenceEngine.display=new LwjglDisplayDevice();
  SilenceEngine.input=new LwjglInputDevice();
  SilenceEngine.graphics=new LwjglGraphicsDevice();
  SilenceEngine.audio=new LwjglAudioDevice();
  if (SilenceEngine.display.getPlatform() == SilenceEngine.Platform.MACOSX)   System.setProperty("String_Node_Str","String_Node_Str");
  Window window=((LwjglDisplayDevice)SilenceEngine.display).window;
  game.init();
  while (!window.shouldClose()) {
    GLFW3.pollEvents();
    SilenceEngine.gameLoop.performLoopFrame();
    window.swapBuffers();
  }
  SilenceEngine.eventManager.raiseDisposeEvent();
}
Program: 96843
Project: 96843
Buggy source:
private String getIDEPath() throws IOException {
  URL url=Lwjgl3ResourceFilePath.class.getClassLoader().getResource(getPath());
  if (url == null)   throw new IOException("String_Node_Str");
  String urlString=url.toString();
  return URLDecoder.decode(urlString.substring(urlString.indexOf('/') + 1),"String_Node_Str");
}

Fixed version (ground truth):
private String getIDEPath() throws IOException {
  URL url=Lwjgl3ResourceFilePath.class.getClassLoader().getResource(getPath());
  if (url == null)   throw new IOException("String_Node_Str");
  String urlString=url.toString();
  SilenceEngine.Platform platform=SilenceEngine.getPlatform();
  if (platform == SilenceEngine.Platform.WINDOWS_32 || platform == SilenceEngine.Platform.WINDOWS_64)   return URLDecoder.decode(urlString.substring(urlString.indexOf('/') + 1),"String_Node_Str");
 else   return "String_Node_Str" + URLDecoder.decode(urlString.substring(urlString.indexOf('/') + 1),"String_Node_Str");
}
Program: 96844
Project: 96844
Buggy source:
/** 
 * Returns the extension of the file represented by this FilePath.
 * @return The extension of the file without the leading dot.
 */
public String getExtension(){
  String[] parts=getPath().split("String_Node_Str");
  return parts.length > 1 ? parts[1] : "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the extension of the file represented by this FilePath.
 * @return The extension of the file without the leading dot.
 */
public String getExtension(){
  if (isDirectory())   return "String_Node_Str";
  String[] parts=getPath().split("String_Node_Str");
  return parts.length > 1 ? parts[1] : "String_Node_Str";
}
Program: 96845
Project: 96845
Buggy source:
private String getIDEPath() throws IOException {
  URL url=ResourceFilePath.class.getClassLoader().getResource(getPath());
  if (url == null)   throw new IOException("String_Node_Str");
  String urlString=url.toString();
  return urlString.substring(urlString.indexOf('/') + 1);
}

Fixed version (ground truth):
private String getIDEPath() throws IOException {
  URL url=ResourceFilePath.class.getClassLoader().getResource(getPath());
  if (url == null)   throw new IOException("String_Node_Str");
  String urlString=url.toString();
  return URLDecoder.decode(urlString.substring(urlString.indexOf('/') + 1),"String_Node_Str");
}
Program: 96846
Project: 96846
Buggy source:
private List<JarEntry> getJarEntries() throws IOException {
  URL url=ResourceFilePath.class.getClassLoader().getResource(getPath());
  if (url == null)   throw new SilenceException("String_Node_Str");
  String jarUrl=url.toString();
  String jarPath=jarUrl.substring(jarUrl.indexOf('/') + 1,jarUrl.indexOf('!'));
  JarFile jarFile=new JarFile(new File(jarPath));
  List<JarEntry> entries=jarFile.stream().filter(e -> e.getName().startsWith(path)).collect(Collectors.toList());
  jarFile.close();
  if (entries != null)   return entries;
  throw new IOException("String_Node_Str" + getPath() + "String_Node_Str"+ jarPath);
}

Fixed version (ground truth):
private List<JarEntry> getJarEntries() throws IOException {
  URL url=ResourceFilePath.class.getClassLoader().getResource(getPath());
  if (url == null)   throw new SilenceException("String_Node_Str");
  String jarUrl=url.toString();
  String jarPath=URLDecoder.decode(jarUrl.substring(jarUrl.indexOf('/') + 1,jarUrl.indexOf('!')),"String_Node_Str");
  JarFile jarFile=new JarFile(new File(jarPath));
  List<JarEntry> entries=jarFile.stream().filter(e -> e.getName().startsWith(path)).collect(Collectors.toList());
  jarFile.close();
  if (entries != null)   return entries;
  throw new IOException("String_Node_Str" + getPath() + "String_Node_Str"+ jarPath);
}
Program: 96847
Project: 96847
Buggy source:
@Override public List<FilePath> listFiles() throws IOException {
  if (!isDirectory())   throw new SilenceException("String_Node_Str");
  if (!exists())   throw new SilenceException("String_Node_Str");
  if (getResourceType() == ResourceType.FILE)   return FilePath.getExternalFile(getIDEPath()).listFiles();
  List<FilePath> filePaths=new ArrayList<>();
  List<JarEntry> entries=getJarEntries();
  entries.forEach(e -> filePaths.add(FilePath.getResourceFile(e.getName())));
  return Collections.unmodifiableList(filePaths);
}

Fixed version (ground truth):
@Override public List<FilePath> listFiles() throws IOException {
  if (!isDirectory())   throw new SilenceException("String_Node_Str");
  if (!exists())   throw new SilenceException("String_Node_Str");
  List<FilePath> filePaths=new ArrayList<>();
  if (getResourceType() == ResourceType.FILE) {
    File file=new File(getIDEPath());
    File[] children=file.listFiles();
    if (children != null)     for (    File child : children)     filePaths.add(new ResourceFilePath(path + SEPARATOR + child.getPath().replace(file.getPath(),"String_Node_Str")));
  }
 else {
    List<JarEntry> entries=getJarEntries();
    entries.forEach(e -> filePaths.add(FilePath.getResourceFile(e.getName())));
  }
  return Collections.unmodifiableList(filePaths);
}
Program: 96849
Project: 96849
Buggy source:
/** 
 * This method returns the current gamma ramp of the specified monitor.
 * @return The current GammaRamp, or <code>null</code> if an error occurred.
 */
public GammaRamp getGammaRamp(){
  GLFWGammaRamp gammaRamp=glfwGetGammaRamp(handle);
  if (gammaRamp.address() == 0)   return null;
  int byteBufferSize=gammaRamp.size() * Short.BYTES;
  ShortBuffer rBuffer=gammaRamp.red(byteBufferSize);
  ShortBuffer gBuffer=gammaRamp.green(byteBufferSize);
  ShortBuffer bBuffer=gammaRamp.blue(byteBufferSize);
  short[] red=new short[gammaRamp.size()];
  short[] green=new short[gammaRamp.size()];
  short[] blue=new short[gammaRamp.size()];
  int i=0;
  while (rBuffer.hasRemaining())   red[i++]=rBuffer.get();
  i=0;
  while (gBuffer.hasRemaining())   green[i++]=gBuffer.get();
  i=0;
  while (bBuffer.hasRemaining())   blue[i++]=bBuffer.get();
  return new GammaRamp(red,green,blue);
}

Fixed version (ground truth):
/** 
 * This method returns the current gamma ramp of the specified monitor.
 * @return The current GammaRamp, or <code>null</code> if an error occurred.
 */
public GammaRamp getGammaRamp(){
  GLFWGammaRamp gammaRamp=glfwGetGammaRamp(handle);
  if (gammaRamp.address() == 0)   return null;
  int shortBufferSize=gammaRamp.size();
  ShortBuffer rBuffer=gammaRamp.red(shortBufferSize);
  ShortBuffer gBuffer=gammaRamp.green(shortBufferSize);
  ShortBuffer bBuffer=gammaRamp.blue(shortBufferSize);
  short[] red=new short[gammaRamp.size()];
  short[] green=new short[gammaRamp.size()];
  short[] blue=new short[gammaRamp.size()];
  int i=0;
  while (rBuffer.hasRemaining())   red[i++]=rBuffer.get();
  i=0;
  while (gBuffer.hasRemaining())   green[i++]=gBuffer.get();
  i=0;
  while (bBuffer.hasRemaining())   blue[i++]=bBuffer.get();
  return new GammaRamp(red,green,blue);
}
Program: 96850
Project: 96850
Buggy source:
private void sortSprites(){
  indices.sort((i,j) -> sprites.get(i).getTexture().getID() < sprites.get(j).getTexture().getID() ? 1 : -1);
}

Fixed version (ground truth):
private void sortSprites(){
  indices.sort((i,j) -> sprites.get(i).getTexture().getID() - sprites.get(j).getTexture().getID());
}
Program: 96851
Project: 96851
Buggy source:
private void asyncLoadResources(){
  loaderWindow.makeCurrent();
  for (  FilePath path : toBeLoaded.keySet()) {
    Class<?> clazz=toBeLoaded.get(path);
    loadHelpers.get(clazz).load(path,this);
  }
}

Fixed version (ground truth):
private void asyncLoadResources(){
  loaderWindow.makeCurrent();
  for (  FilePath path : toBeLoaded.keySet()) {
    Class<?> clazz=toBeLoaded.get(path);
    loadHelpers.get(clazz).load(path,this);
  }
  GL11.glFinish();
  GLError.check();
  GL11.glFlush();
  GLError.check();
}