nus-yam/ex-repair huggingface dataset:
Program: 36442
Project: 36442
Buggy source:
private File getImage(File dir,String name){
  if (dir == null)   return null;
  for (  ImageFileFormat format : ImageFileFormat.values()) {
    if (format.isSupported()) {
      File f=new File(dir,name + "String_Node_Str" + format.toString());
      if (dir == val) {
        return file_exists(this,f) ? f : null;
      }
 else {
        if (parent != null && parent.val != null && parent.val.equals(f.getParentFile())) {
          if (file_exists(parent,f))           return f;
        }
 else {
          if (f.exists())           return f;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private File getImage(File dir,String name){
  if (disposed)   return null;
  if (dir == null)   return null;
  for (  ImageFileFormat format : ImageFileFormat.values()) {
    if (format.isSupported()) {
      File f=new File(dir,name + "String_Node_Str" + format.toString());
      if (dir == val) {
        return file_exists(this,f) ? f : null;
      }
 else {
        if (parent != null && parent.val != null && parent.val.equals(f.getParentFile())) {
          if (file_exists(parent,f))           return f;
        }
 else {
          if (f.exists())           return f;
        }
      }
    }
  }
  return null;
}
Program: 36443
Project: 36443
Buggy source:
private File getImageT(File dir,String name){
  if (dir == null)   return null;
  for (  ImageFileFormat format : ImageFileFormat.values()) {
    if (format.isSupported()) {
      File f=new File(dir,name + "String_Node_Str" + format.toString());
      if (file_exists(this,f))       return f;
    }
  }
  return null;
}

Fixed version (ground truth):
private File getImageT(File dir,String name){
  if (disposed)   return null;
  if (dir == null)   return null;
  for (  ImageFileFormat format : ImageFileFormat.values()) {
    if (format.isSupported()) {
      File f=new File(dir,name + "String_Node_Str" + format.toString());
      if (file_exists(this,f))       return f;
    }
  }
  return null;
}
Program: 36444
Project: 36444
Buggy source:
private static void refreshItemsWithNow(List<Metadata> ms){
  noØ(ms);
  if (ms.isEmpty())   return;
  IO_THREAD.execute(() -> {
    MapSet<URI,Metadata> mm=new MapSet<>(Metadata::getUri,ms);
    APP.db.updatePer(ms);
    APP.db.updateInMemoryDbFromPersisted();
    Async.runFX(() -> {
      PlaylistManager.playlists.stream().flatMap(Playlist::stream).forEach((      PlaylistItem p) -> mm.ifHasK(p.getUri(),p::update));
      mm.ifHasE(playingItem.get(),playingItem::update);
      if (playing.i.getValue() != null)       mm.ifHasE(playing.i.getValue(),playing.i::setValue);
      if (playlistSelected.i.getValue() != null)       mm.ifHasK(playlistSelected.i.getValue().getUri(),m -> playlistSelected.i.setValue(m.toPlaylist()));
      if (librarySelected.i.getValue() != null)       mm.ifHasE(librarySelected.i.getValue(),librarySelected.i::setValue);
      refreshHandlers.forEach(h -> h.accept(mm));
    }
);
  }
);
}

Fixed version (ground truth):
private static void refreshItemsWithNow(List<Metadata> ms){
  noØ(ms);
  if (ms.isEmpty())   return;
  IO_THREAD.execute(() -> {
    MapSet<URI,Metadata> mm=new MapSet<>(Metadata::getUri,ms);
    APP.db.updatePer(ms);
    APP.db.updateInMemoryDbFromPersisted();
    runFX(() -> {
      PlaylistManager.playlists.stream().flatMap(Playlist::stream).forEach((      PlaylistItem p) -> mm.ifHasK(p.getUri(),p::update));
      mm.ifHasE(playingItem.get(),playingItem::update);
      if (playing.i.getValue() != null)       mm.ifHasE(playing.i.getValue(),playing.i::setValue);
      if (playlistSelected.i.getValue() != null)       mm.ifHasK(playlistSelected.i.getValue().getUri(),m -> playlistSelected.i.setValue(m.toPlaylist()));
      if (librarySelected.i.getValue() != null)       mm.ifHasE(librarySelected.i.getValue(),librarySelected.i::setValue);
      refreshHandlers.forEach(h -> h.accept(mm));
    }
);
  }
);
}
Program: 36445
Project: 36445
Buggy source:
/** 
 * Updates application (playlist, library, etc.) with latest metadata. Refreshes the given data for the whole application. <p/> Safe to call from any thread.
 * @param ms metadata to refresh
 * @param allowDelay flag for using delayed refresh to reduce refresh successions to single refresh. Normally falseis used. <p/> Use false to refresh immediatelly and true to queue the refresh for future execution (will wait few seconds for next refresh request and if it comes, will wait again and so on until none will come, which is when all queued refreshes execute all at once).
 */
public static void refreshItemsWith(List<Metadata> ms,boolean allowDelay){
  noØ(ms);
  if (allowDelay)   Async.runFX(() -> red.push(ms));
 else   refreshItemsWithNow(ms);
}

Fixed version (ground truth):
/** 
 * Updates application (playlist, library, etc.) with latest metadata. Refreshes the given data for the whole application. <p/> Safe to call from any thread.
 * @param ms metadata to refresh
 * @param allowDelay flag for using delayed refresh to reduce refresh successions to single refresh. Normally falseis used. <p/> Use false to refresh immediatelly and true to queue the refresh for future execution (will wait few seconds for next refresh request and if it comes, will wait again and so on until none will come, which is when all queued refreshes execute all at once).
 */
public static void refreshItemsWith(List<Metadata> ms,boolean allowDelay){
  noØ(ms);
  if (allowDelay)   runFX(() -> red.push(ms));
 else   refreshItemsWithNow(ms);
}
Program: 36446
Project: 36446
Buggy source:
public static void activate(){
  LOGGER.info("String_Node_Str");
  post_activating=true;
  Status s=state.status.get();
  if (s == PAUSED || s == PLAYING)   startTime=state.currentTime.get();
  if (s == PAUSED) {
    player.play(PlaylistManager.use(Playlist::getPlaying,null));
    util.async.Async.runFX(1000,player::pause);
  }
  if (s == PLAYING) {
    player.play(PlaylistManager.use(Playlist::getPlaying,null));
    runFX(200,() -> suspension_flag=false);
  }
 else {
    suspension_flag=false;
  }
}

Fixed version (ground truth):
public static void activate(){
  LOGGER.info("String_Node_Str");
  post_activating=true;
  Status s=state.status.get();
  if (s == PAUSED || s == PLAYING)   startTime=state.currentTime.get();
  if (s == PAUSED) {
    player.play(PlaylistManager.use(Playlist::getPlaying,null));
    runFX(1000,player::pause);
  }
  if (s == PLAYING) {
    player.play(PlaylistManager.use(Playlist::getPlaying,null));
    runFX(200,() -> suspension_flag=false);
  }
 else {
    suspension_flag=false;
  }
}
Program: 36448
Project: 36448
Buggy source:
@Override public void createPlayback(Item item,PlaybackState state,Runnable onOk,Runnable onFail){
  Player.IO_THREAD.execute(() -> {
    try {
      p.open(item.getFile());
      p.setVolume(state.volume.get());
      p.setMute(state.mute.get());
      p.setBalance(state.balance.get());
      runFX(() -> {
        state.volume.addListener((o,ov,nv) -> p.setVolume(nv.doubleValue()));
        state.mute.addListener((o,ov,nv) -> p.setMute(nv));
        state.balance.addListener((o,ov,nv) -> p.setBalance(nv.doubleValue()));
        Status s=state.status.get();
        if (PLAYBACK.startTime != null) {
          if (s == PLAYING)           play();
 else           if (s == PAUSED)           pause();
        }
        onOk.run();
      }
);
    }
 catch (    PlayerException ex) {
      Logger.getLogger(JavaSoundPlayer.class.getName()).log(Level.SEVERE,null,ex);
      onFail.run();
    }
  }
);
}

Fixed version (ground truth):
@Override public void createPlayback(Item item,PlaybackState state,Runnable onOk,Runnable onFail){
  Player.IO_THREAD.execute(() -> {
    try {
      p.open(item.getFile());
      p.setVolume(state.volume.get());
      p.setMute(state.mute.get());
      p.setBalance(state.balance.get());
      runFX(() -> {
        state.volume.addListener((o,ov,nv) -> p.setVolume(linToLog(nv.doubleValue())));
        state.mute.addListener((o,ov,nv) -> p.setMute(nv));
        state.balance.addListener((o,ov,nv) -> p.setBalance(nv.doubleValue()));
        Status s=state.status.get();
        if (PLAYBACK.startTime != null) {
          if (s == PLAYING)           play();
 else           if (s == PAUSED)           pause();
        }
        onOk.run();
      }
);
    }
 catch (    PlayerException ex) {
      Logger.getLogger(JavaSoundPlayer.class.getName()).log(Level.SEVERE,null,ex);
      onFail.run();
    }
  }
);
}
Program: 36449
Project: 36449
Buggy source:
public JavaSoundPlayer(){
  p.addPlaybackListener(new PlaybackListener(){
    long updateId=0;
    @Override public void playbackBuffering(    PlaybackEvent pe){
    }
    @Override public void playbackOpened(    PlaybackEvent pe){
      Duration d=millis(p.getDuration() / 1000);
      runLater(() -> state.duration.set(d));
    }
    @Override public void playbackEndOfMedia(    PlaybackEvent pe){
      runLater(PLAYBACK.onPlaybackEnd);
    }
    @Override public void playbackProgress(    PlaybackEvent pe){
      updateId++;
      if (updateId % 2 == 0) {
        Duration d=millis(seekOffsetMs + pe.getPosition() / 1000);
        runLater(() -> state.currentTime.set(d));
      }
    }
    @Override public void playbackPlaying(    PlaybackEvent pe){
      if (PLAYBACK.startTime != null) {
        seek(PLAYBACK.startTime);
        PLAYBACK.startTime=null;
      }
    }
    @Override public void playbackPaused(    PlaybackEvent pe){
      if (supposedToPause.getAndSet(true)) {
        if (PLAYBACK.startTime != null) {
          seek(PLAYBACK.startTime);
          PLAYBACK.startTime=null;
        }
        runLater(() -> PLAYBACK.state.status.set(PAUSED));
      }
    }
    @Override public void playbackStopped(    PlaybackEvent pe){
      if (supposedToStop.getAndSet(true)) {
        supposedToStop.set(false);
        runLater(() -> PLAYBACK.state.status.set(STOPPED));
      }
    }
  }
);
}

Fixed version (ground truth):
public JavaSoundPlayer(){
  p.addPlaybackListener(new PlaybackListener(){
    long updateId=0;
    @Override public void playbackBuffering(    PlaybackEvent pe){
    }
    @Override public void playbackOpened(    PlaybackEvent pe){
      Duration d=millis(p.getDuration() / 1000);
      runLater(() -> state.duration.set(d));
    }
    @Override public void playbackEndOfMedia(    PlaybackEvent pe){
      runLater((Runnable)PLAYBACK.onPlaybackEnd);
    }
    @Override public void playbackProgress(    PlaybackEvent pe){
      updateId++;
      if (updateId % 2 == 0) {
        Duration d=millis(seekOffsetMs + pe.getPosition() / 1000);
        runLater(() -> state.currentTime.set(d));
      }
    }
    @Override public void playbackPlaying(    PlaybackEvent pe){
      if (PLAYBACK.startTime != null) {
        seek(PLAYBACK.startTime);
        PLAYBACK.startTime=null;
      }
    }
    @Override public void playbackPaused(    PlaybackEvent pe){
      if (supposedToPause.getAndSet(true)) {
        if (PLAYBACK.startTime != null) {
          seek(PLAYBACK.startTime);
          PLAYBACK.startTime=null;
        }
        runLater(() -> PLAYBACK.state.status.set(PAUSED));
      }
    }
    @Override public void playbackStopped(    PlaybackEvent pe){
      if (supposedToStop.getAndSet(true)) {
        supposedToStop.set(false);
        runLater(() -> PLAYBACK.state.status.set(STOPPED));
      }
    }
  }
);
}
Program: 36450
Project: 36450
Buggy source:
@Override public void playbackEndOfMedia(PlaybackEvent pe){
  runLater(PLAYBACK.onPlaybackEnd);
}

Fixed version (ground truth):
@Override public void playbackEndOfMedia(PlaybackEvent pe){
  runLater((Runnable)PLAYBACK.onPlaybackEnd);
}
Program: 36451
Project: 36451
Buggy source:
@Override public HitInfo getIndex(double x,double y){
  final double leftWidth=leftPane == null ? 0.0 : snapSize(leftPane.prefWidth(getSkinnable().getHeight()));
  return super.getIndex(x - leftWidth,y);
}

Fixed version (ground truth):
@Override public HitInfo getIndex(double x,double y){
  final double leftWidth=leftPane == null ? 0.0 : snapSizeX(leftPane.prefWidth(getSkinnable().getHeight()));
  return super.getIndex(x - leftWidth,y);
}
Program: 36452
Project: 36452
Buggy source:
@Override protected void layoutChildren(double x,double y,double w,double h){
  final double fullHeight=h + snappedTopInset() + snappedBottomInset();
  final double leftWidth=leftPane == null ? 0.0 : snapSize(leftPane.prefWidth(fullHeight));
  final double rightWidth=rightPane == null ? 0.0 : snapSize(rightPane.prefWidth(fullHeight));
  final double textFieldStartX=snapPosition(x) + snapSize(leftWidth);
  final double textFieldWidth=w - snapSize(leftWidth) - snapSize(rightWidth);
  super.layoutChildren(textFieldStartX,0,textFieldWidth,fullHeight);
  if (leftPane != null) {
    final double leftStartX=0;
    leftPane.resizeRelocate(leftStartX,0,leftWidth,fullHeight);
  }
  if (rightPane != null) {
    final double rightStartX=rightPane == null ? 0.0 : w - rightWidth + snappedLeftInset();
    rightPane.resizeRelocate(rightStartX,0,rightWidth,fullHeight);
  }
}

Fixed version (ground truth):
@Override protected void layoutChildren(double x,double y,double w,double h){
  final double fullHeight=h + snappedTopInset() + snappedBottomInset();
  final double leftWidth=leftPane == null ? 0.0 : snapSizeX(leftPane.prefWidth(fullHeight));
  final double rightWidth=rightPane == null ? 0.0 : snapSizeX(rightPane.prefWidth(fullHeight));
  final double textFieldStartX=snapPositionX(x) + snapSizeX(leftWidth);
  final double textFieldWidth=w - snapSizeX(leftWidth) - snapSizeX(rightWidth);
  super.layoutChildren(textFieldStartX,0,textFieldWidth,fullHeight);
  if (leftPane != null) {
    final double leftStartX=0;
    leftPane.resizeRelocate(leftStartX,0,leftWidth,fullHeight);
  }
  if (rightPane != null) {
    final double rightStartX=rightPane == null ? 0.0 : w - rightWidth + snappedLeftInset();
    rightPane.resizeRelocate(rightStartX,0,rightWidth,fullHeight);
  }
}
Program: 36453
Project: 36453
Buggy source:
@Override protected double computePrefWidth(double h,double topInset,double rightInset,double bottomInset,double leftInset){
  final double pw=super.computePrefWidth(h,topInset,rightInset,bottomInset,leftInset);
  final double leftWidth=leftPane == null ? 0.0 : snapSize(leftPane.prefWidth(h));
  final double rightWidth=rightPane == null ? 0.0 : snapSize(rightPane.prefWidth(h));
  return pw + leftWidth + rightWidth+ leftInset+ rightInset;
}

Fixed version (ground truth):
@Override protected double computePrefWidth(double h,double topInset,double rightInset,double bottomInset,double leftInset){
  final double pw=super.computePrefWidth(h,topInset,rightInset,bottomInset,leftInset);
  final double leftWidth=leftPane == null ? 0.0 : snapSizeX(leftPane.prefWidth(h));
  final double rightWidth=rightPane == null ? 0.0 : snapSizeX(rightPane.prefWidth(h));
  return pw + leftWidth + rightWidth+ leftInset+ rightInset;
}
Program: 36454
Project: 36454
Buggy source:
@Override protected double computePrefHeight(double w,double topInset,double rightInset,double bottomInset,double leftInset){
  final double ph=super.computePrefHeight(w,topInset,rightInset,bottomInset,leftInset);
  final double leftHeight=leftPane == null ? 0.0 : snapSize(leftPane.prefHeight(-1));
  final double rightHeight=rightPane == null ? 0.0 : snapSize(rightPane.prefHeight(-1));
  return Math.max(ph,Math.max(leftHeight,rightHeight));
}

Fixed version (ground truth):
@Override protected double computePrefHeight(double w,double topInset,double rightInset,double bottomInset,double leftInset){
  final double ph=super.computePrefHeight(w,topInset,rightInset,bottomInset,leftInset);
  final double leftHeight=leftPane == null ? 0.0 : snapSizeY(leftPane.prefHeight(-1));
  final double rightHeight=rightPane == null ? 0.0 : snapSizeY(rightPane.prefHeight(-1));
  return Math.max(ph,Math.max(leftHeight,rightHeight));
}
Program: 36455
Project: 36455
Buggy source:
void set(boolean change,Metadata new_metadata){
  Metadata ov=val;
  Metadata nv=new_metadata;
  val=nv;
  if (PLAYBACK.suspension_flag)   return;
  if (change)   changes.forEach(h -> h.accept(ov,nv));
  updates.forEach(h -> h.accept(ov,nv));
}

Fixed version (ground truth):
private void set(boolean change,Metadata new_metadata){
  Metadata ov=val;
  Metadata nv=new_metadata;
  val=nv;
  if (PLAYBACK.suspension_flag)   return;
  if (change)   changes.forEach(h -> h.accept(ov,nv));
  updates.forEach(h -> h.accept(ov,nv));
}
Program: 36456
Project: 36456
Buggy source:
/** 
 * Execute when song starts playing. 
 */
public void itemChanged(Item item){
  if (item == null) {
    set(true,EMPTY);
    log(Player.class).info("String_Node_Str");
  }
 else   if (val.same(item)) {
    set(true,val);
    log(Player.class).info("String_Node_Str");
  }
 else   if (nextMetadataCache.same(item)) {
    set(true,nextMetadataCache);
    log(Player.class).info("String_Node_Str");
  }
 else {
    log(Player.class).info("String_Node_Str");
    load(true,item);
  }
  nextCachePreloader.start();
}

Fixed version (ground truth):
/** 
 * Execute when song starts playing. 
 */
public void itemChanged(Item item){
  if (item == null) {
    set(true,EMPTY);
    log(Player.class).info("String_Node_Str");
  }
 else   if (val.same(item)) {
    set(true,val);
    log(Player.class).info("String_Node_Str");
  }
 else   if (valNext.same(item)) {
    set(true,valNext);
    log(Player.class).info("String_Node_Str");
  }
 else {
    log(Player.class).info("String_Node_Str");
    load(true,item);
  }
  valNextLoader.start();
}
Program: 36457
Project: 36457
Buggy source:
private void preloadNext(){
  log(Player.class).info("String_Node_Str");
  PlaylistItem next=PlaylistManager.use(Playlist::getNextPlaying,null);
  if (next != null) {
    Fut.fut(next).map(MetadataReader::readMetadata).use(FX,m -> nextMetadataCache=m);
  }
}

Fixed version (ground truth):
private void preloadNext(){
  log(Player.class).info("String_Node_Str");
  PlaylistItem next=PlaylistManager.use(Playlist::getNextPlaying,null);
  if (next != null) {
    Fut.fut(next).map(MetadataReader::readMetadata).use(FX,m -> valNext=m);
  }
}
Program: 36458
Project: 36458
Buggy source:
private void openChooser(MouseEvent me){
  Picker<EffectType> w=new Picker<>();
  w.itemSupply=limitedToType == null ? EFFECT_TYPES::stream : () -> stream(new EffectType(limitedToType),new EffectType(null));
  w.textCoverter=EffectType::name;
  w.getNode().setPrefSize(300,500);
  PopOver<?> p=new PopOver<>(w.getNode());
  p.title.set("String_Node_Str");
  p.setArrowSize(0);
  p.setAutoFix(true);
  p.setAutoHide(true);
  p.show(propB);
  w.onCancel=p::hide;
  w.onSelect=ec -> {
    setValue(ec.instantiate());
    openProperties(me);
    p.hide();
  }
;
}

Fixed version (ground truth):
private void openChooser(MouseEvent me){
  Picker<EffectType> w=new Picker<>();
  w.itemSupply=limitedToType == null ? EFFECT_TYPES::stream : () -> stream(new EffectType(limitedToType),new EffectType(null));
  w.textConverter=EffectType::name;
  w.getNode().setPrefSize(300,500);
  PopOver<?> p=new PopOver<>(w.getNode());
  p.title.set("String_Node_Str");
  p.setArrowSize(0);
  p.setAutoFix(true);
  p.setAutoHide(true);
  p.show(propB);
  w.onCancel=p::hide;
  w.onSelect=ec -> {
    setValue(ec.instantiate());
    openProperties(me);
    p.hide();
  }
;
}
Program: 36459
Project: 36459
Buggy source:
private double distributeFrom(double size,List<Content> available){
  if (available.isEmpty()) {
    return size;
  }
  size=snapSize(size);
  int portion=(int)(size) / available.size();
  int remainder;
  while (size > 0 && !available.isEmpty()) {
    Iterator<Content> i=available.iterator();
    while (i.hasNext()) {
      Content c=i.next();
      if (portion >= c.getAvailable()) {
        c.setArea(c.getArea() - c.getAvailable());
        size-=c.getAvailable();
        c.setAvailable(0);
        i.remove();
      }
 else {
        c.setArea(c.getArea() - portion);
        c.setAvailable(c.getAvailable() - portion);
        size-=portion;
      }
      if ((int)size == 0) {
        return size;
      }
    }
    if (available.isEmpty()) {
      return size;
    }
    portion=(int)(size) / available.size();
    remainder=(int)(size) % available.size();
    if (portion == 0 && remainder != 0) {
      portion=remainder;
      remainder=0;
    }
  }
  return size;
}

Fixed version (ground truth):
private double distributeFrom(double size,List<Content> available){
  if (available.isEmpty()) {
    return size;
  }
  size=horizontal ? snapSizeX(size) : snapSizeY(size);
  int portion=(int)(size) / available.size();
  int remainder;
  while (size > 0 && !available.isEmpty()) {
    Iterator<Content> i=available.iterator();
    while (i.hasNext()) {
      Content c=i.next();
      if (portion >= c.getAvailable()) {
        c.setArea(c.getArea() - c.getAvailable());
        size-=c.getAvailable();
        c.setAvailable(0);
        i.remove();
      }
 else {
        c.setArea(c.getArea() - portion);
        c.setAvailable(c.getAvailable() - portion);
        size-=portion;
      }
      if ((int)size == 0) {
        return size;
      }
    }
    if (available.isEmpty()) {
      return size;
    }
    portion=(int)(size) / available.size();
    remainder=(int)(size) % available.size();
    if (portion == 0 && remainder != 0) {
      portion=remainder;
      remainder=0;
    }
  }
  return size;
}
Program: 36460
Project: 36460
Buggy source:
@Override protected double computeMaxWidth(double height){
  return snapSize(content.maxWidth(height));
}

Fixed version (ground truth):
@Override protected double computeMaxWidth(double height){
  return snapSizeX(content.maxWidth(height));
}
Program: 36461
Project: 36461
Buggy source:
private void initializeDivderEventHandlers(final ContentDivider divider){
  divider.setOnMousePressed(e -> {
    if (horizontal) {
      divider.setInitialPos(divider.getDividerPos());
      divider.setPressPos(e.getSceneX());
      divider.setPressPos(getSkinnable().getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT ? getSkinnable().getWidth() - e.getSceneX() : e.getSceneX());
    }
 else {
      divider.setInitialPos(divider.getDividerPos());
      divider.setPressPos(e.getSceneY());
    }
    e.consume();
  }
);
  divider.setOnMouseDragged(e -> {
    double delta=0;
    if (horizontal) {
      delta=getSkinnable().getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT ? getSkinnable().getWidth() - e.getSceneX() : e.getSceneX();
    }
 else {
      delta=e.getSceneY();
    }
    delta-=divider.getPressPos();
    setAndCheckAbsoluteDividerPos(divider,Math.ceil(divider.getInitialPos() + delta));
    e.consume();
  }
);
}

Fixed version (ground truth):
private void initializeDivderEventHandlers(final ContentDivider divider){
  divider.addEventHandler(MouseEvent.ANY,event -> {
  }
);
  divider.setOnMousePressed(e -> {
    if (horizontal) {
      divider.setInitialPos(divider.getDividerPos());
      divider.setPressPos(e.getSceneX());
      divider.setPressPos(getSkinnable().getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT ? getSkinnable().getWidth() - e.getSceneX() : e.getSceneX());
    }
 else {
      divider.setInitialPos(divider.getDividerPos());
      divider.setPressPos(e.getSceneY());
    }
    e.consume();
  }
);
  divider.setOnMouseDragged(e -> {
    double delta=0;
    if (horizontal) {
      delta=getSkinnable().getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT ? getSkinnable().getWidth() - e.getSceneX() : e.getSceneX();
    }
 else {
      delta=e.getSceneY();
    }
    delta-=divider.getPressPos();
    setAndCheckAbsoluteDividerPos(divider,Math.ceil(divider.getInitialPos() + delta));
    e.consume();
  }
);
}
Program: 36462
Project: 36462
Buggy source:
private void removeContent(Node n){
  for (  Content c : contentRegions) {
    if (c.getContent().equals(n)) {
      getChildren().remove(c);
      contentRegions.remove(c);
      break;
    }
  }
}

Fixed version (ground truth):
private void removeContent(Node n){
  for (  Content c : contentRegions) {
    if (c.getContent().equals(n)) {
      c.dispose();
      getChildren().remove(c);
      contentRegions.remove(c);
      break;
    }
  }
}
Program: 36463
Project: 36463
Buggy source:
@Override protected double computeMaxHeight(double width){
  return snapSize(content.maxHeight(width));
}

Fixed version (ground truth):
@Override protected double computeMaxHeight(double width){
  return snapSizeY(content.maxHeight(width));
}
Program: 36464
Project: 36464
Buggy source:
/** 
 * Creates a new SplitPaneSkin instance, installing the necessary child nodes into the Control   {@link Control#getChildren() children} list, aswell as the necessary  {@link Node#getInputMap() input mappings} forhandling key, mouse, etc events.
 * @param control The control that this skin should be installed onto.
 */
public ImprovedSplitPaneSkin(final SplitPane control){
  super(control);
  horizontal=getSkinnable().getOrientation() == Orientation.HORIZONTAL;
  contentRegions=FXCollections.observableArrayList();
  contentDividers=FXCollections.observableArrayList();
  int index=0;
  for (  Node n : getSkinnable().getItems()) {
    addContent(index++,n);
  }
  initializeContentListener();
  for (  SplitPane.Divider d : getSkinnable().getDividers()) {
    addDivider(d);
  }
  registerChangeListener(control.orientationProperty(),e -> {
    this.horizontal=getSkinnable().getOrientation() == Orientation.HORIZONTAL;
    this.previousSize=-1;
    for (    ContentDivider c : contentDividers) {
      c.setGrabberStyle(horizontal);
    }
    getSkinnable().requestLayout();
  }
);
  registerChangeListener(control.widthProperty(),e -> getSkinnable().requestLayout());
  registerChangeListener(control.heightProperty(),e -> getSkinnable().requestLayout());
}

Fixed version (ground truth):
/** 
 * Creates a new SplitPaneSkin instance, installing the necessary child nodes into the Control   {@link Control#getChildren() children} list, aswell as the necessary input mappings for handling key, mouse, etc events.
 * @param control The control that this skin should be installed onto.
 */
public ImprovedSplitPaneSkin(final SplitPane control){
  super(control);
  horizontal=getSkinnable().getOrientation() == Orientation.HORIZONTAL;
  contentRegions=FXCollections.<Content>observableArrayList();
  contentDividers=FXCollections.<ContentDivider>observableArrayList();
  int index=0;
  for (  Node n : getSkinnable().getItems()) {
    addContent(index++,n);
  }
  initializeContentListener();
  for (  SplitPane.Divider d : getSkinnable().getDividers()) {
    addDivider(d);
  }
  registerChangeListener(control.orientationProperty(),e -> {
    this.horizontal=getSkinnable().getOrientation() == Orientation.HORIZONTAL;
    this.previousSize=-1;
    for (    ContentDivider c : contentDividers) {
      c.setGrabberStyle(horizontal);
    }
    getSkinnable().requestLayout();
  }
);
  registerChangeListener(control.widthProperty(),e -> getSkinnable().requestLayout());
  registerChangeListener(control.heightProperty(),e -> getSkinnable().requestLayout());
}
Program: 36465
Project: 36465
Buggy source:
private double distributeTo(List<Content> available,double size){
  if (available.isEmpty()) {
    return size;
  }
  size=snapSize(size);
  int portion=(int)(size) / available.size();
  int remainder;
  while (size > 0 && !available.isEmpty()) {
    Iterator<Content> i=available.iterator();
    while (i.hasNext()) {
      Content c=i.next();
      double max=Math.min((horizontal ? c.maxWidth(-1) : c.maxHeight(-1)),Double.MAX_VALUE);
      double min=horizontal ? c.minWidth(-1) : c.minHeight(-1);
      if (c.getArea() >= max) {
        c.setAvailable(c.getArea() - min);
        i.remove();
        continue;
      }
      if (portion >= (max - c.getArea())) {
        size-=(max - c.getArea());
        c.setArea(max);
        c.setAvailable(max - min);
        i.remove();
      }
 else {
        c.setArea(c.getArea() + portion);
        c.setAvailable(c.getArea() - min);
        size-=portion;
      }
      if ((int)size == 0) {
        return size;
      }
    }
    if (available.isEmpty()) {
      return size;
    }
    portion=(int)(size) / available.size();
    remainder=(int)(size) % available.size();
    if (portion == 0 && remainder != 0) {
      portion=remainder;
      remainder=0;
    }
  }
  return size;
}

Fixed version (ground truth):
private double distributeTo(List<Content> available,double size){
  if (available.isEmpty()) {
    return size;
  }
  size=horizontal ? snapSizeX(size) : snapSizeY(size);
  int portion=(int)(size) / available.size();
  int remainder;
  while (size > 0 && !available.isEmpty()) {
    Iterator<Content> i=available.iterator();
    while (i.hasNext()) {
      Content c=i.next();
      double max=Math.min((horizontal ? c.maxWidth(-1) : c.maxHeight(-1)),Double.MAX_VALUE);
      double min=horizontal ? c.minWidth(-1) : c.minHeight(-1);
      if (c.getArea() >= max) {
        c.setAvailable(c.getArea() - min);
        i.remove();
        continue;
      }
      if (portion >= (max - c.getArea())) {
        size-=(max - c.getArea());
        c.setArea(max);
        c.setAvailable(max - min);
        i.remove();
      }
 else {
        c.setArea(c.getArea() + portion);
        c.setAvailable(c.getArea() - min);
        size-=portion;
      }
      if ((int)size == 0) {
        return size;
      }
    }
    if (available.isEmpty()) {
      return size;
    }
    portion=(int)(size) / available.size();
    remainder=(int)(size) % available.size();
    if (portion == 0 && remainder != 0) {
      portion=remainder;
      remainder=0;
    }
  }
  return size;
}
Program: 36466
Project: 36466
Buggy source:
public void buildContent(){
  tiles.getChildren().clear();
  itemSupply.get().sorted(byNC(textCoverter::toS)).forEach(item -> {
    Node cell=cellFactory.apply(item);
    cell.setOnMouseClicked(e -> {
      if (e.getButton() == PRIMARY) {
        onSelect.accept(item);
        e.consume();
      }
    }
);
    tiles.getChildren().add(cell);
  }
);
  int s=getCells().size();
  Anim.par(getCells(),(i,n) -> seq(new Anim(n::setOpacity).dur(i * (750 / s)).intpl(0),new Anim(n::setOpacity).dur(500).intpl(x -> sqrt(x)))).play();
}

Fixed version (ground truth):
public void buildContent(){
  tiles.getChildren().clear();
  itemSupply.get().sorted(byNC(textConverter::toS)).forEach(item -> {
    Node cell=cellFactory.apply(item);
    cell.setOnMouseClicked(e -> {
      if (e.getButton() == PRIMARY) {
        onSelect.accept(item);
        e.consume();
      }
    }
);
    tiles.getChildren().add(cell);
  }
);
  int s=getCells().size();
  Anim.par(getCells(),(i,n) -> seq(new Anim(n::setOpacity).dur(i * (750 / s)).intpl(0),new Anim(n::setOpacity).dur(500).intpl(x -> sqrt(x)))).play();
}
Program: 36467
Project: 36467
Buggy source:
public WidgetPicker(){
  super();
  itemSupply=APP.widgetManager::getFactories;
  textCoverter=WidgetFactory::nameGui;
  infoCoverter=WidgetInfo::toStr;
}

Fixed version (ground truth):
public WidgetPicker(){
  super();
  itemSupply=APP.widgetManager::getFactories;
  textConverter=WidgetFactory::nameGui;
  infoConverter=WidgetInfo::toStr;
}
Program: 36468
Project: 36468
Buggy source:
public Layouter(Container<?> c,int index){
  noØ(c);
  this.index=index;
  this.container=c;
  cp.itemSupply=() -> stream(tuple("String_Node_Str",this::showSplitV,"String_Node_Str"),tuple("String_Node_Str",this::showSplitH,"String_Node_Str"),tuple("String_Node_Str",this::showWidgetArea,"String_Node_Str"),tuple("String_Node_Str",this::showFreeform,"String_Node_Str" + "String_Node_Str"));
  cp.textCoverter=layout_action -> layout_action._1;
  cp.infoCoverter=layout_action -> layout_action._3;
  cp.onSelect=layout_action -> closeAndDo(cp.root,layout_action._2);
  cp.onCancel=() -> {
    isCancelPlaying=true;
    hide();
  }
;
  cp.consumeCancelClick=false;
  cp.buildContent();
  setAnchor(root,cp.root,0d);
  a1=new FadeTransition(ANIM_DUR,cp.root);
  a1.setInterpolator(LINEAR);
  a2=new ScaleTransition(ANIM_DUR,cp.root);
  a2.setInterpolator(new CircularInterpolator(EASE_OUT));
  cp.root.setOpacity(0);
  cp.root.setScaleX(0);
  cp.root.setScaleY(0);
  installDrag(root,EXCHANGE,"String_Node_Str",DragUtil::hasComponent,e -> container == DragUtil.getComponent(e),e -> DragUtil.getComponent(e).swapWith(container,index));
  clickShowHider=e -> {
    if (e.getButton() == PRIMARY) {
      if (cp.root.getOpacity() != 0)       return;
      if (container.lockedUnder.get())       return;
      show();
      e.consume();
    }
  }
;
  exitHider=e -> {
    if (!isCancelPlaying) {
      cp.onCancel.run();
      e.consume();
    }
  }
;
  setWeakMode(true);
}

Fixed version (ground truth):
public Layouter(Container<?> c,int index){
  noØ(c);
  this.index=index;
  this.container=c;
  cp.itemSupply=() -> stream(tuple("String_Node_Str",this::showSplitV,"String_Node_Str"),tuple("String_Node_Str",this::showSplitH,"String_Node_Str"),tuple("String_Node_Str",this::showWidgetArea,"String_Node_Str"),tuple("String_Node_Str",this::showFreeform,"String_Node_Str" + "String_Node_Str"));
  cp.textConverter=layout_action -> layout_action._1;
  cp.infoConverter=layout_action -> layout_action._3;
  cp.onSelect=layout_action -> closeAndDo(cp.root,layout_action._2);
  cp.onCancel=() -> {
    isCancelPlaying=true;
    hide();
  }
;
  cp.consumeCancelClick=false;
  cp.buildContent();
  setAnchor(root,cp.root,0d);
  a1=new FadeTransition(ANIM_DUR,cp.root);
  a1.setInterpolator(LINEAR);
  a2=new ScaleTransition(ANIM_DUR,cp.root);
  a2.setInterpolator(new CircularInterpolator(EASE_OUT));
  cp.root.setOpacity(0);
  cp.root.setScaleX(0);
  cp.root.setScaleY(0);
  installDrag(root,EXCHANGE,"String_Node_Str",DragUtil::hasComponent,e -> container == DragUtil.getComponent(e),e -> DragUtil.getComponent(e).swapWith(container,index));
  clickShowHider=e -> {
    if (e.getButton() == PRIMARY) {
      if (cp.root.getOpacity() != 0)       return;
      if (container.lockedUnder.get())       return;
      show();
      e.consume();
    }
  }
;
  exitHider=e -> {
    if (!isCancelPlaying) {
      cp.onCancel.run();
      e.consume();
    }
  }
;
  setWeakMode(true);
}
Program: 36469
Project: 36469
Buggy source:
/** 
 * Sets visibility of the background. The bgr is visible only when the image size ratio and thumbnail size ratio does not match. Default value is true. Invisible background becomes transparent. Stylizable with css.
 */
public void setBackgroundVisible(boolean val){
  if (val) {
    if (!root.getStyleClass().contains(bgr_styleclass))     root.getStyleClass().add(bgr_styleclass);
  }
 else   root.getStyleClass().remove(bgr_styleclass);
}

Fixed version (ground truth):
/** 
 * Sets visibility of the background. The bgr is visible only when the image size ratio and thumbnail size ratio does not match. Default value is true. Invisible background becomes transparent. Styleable with css.
 */
public void setBackgroundVisible(boolean val){
  if (val) {
    if (!root.getStyleClass().contains(bgr_styleclass))     root.getStyleClass().add(bgr_styleclass);
  }
 else   root.getStyleClass().remove(bgr_styleclass);
}
Program: 36470
Project: 36470
Buggy source:
@Override public void handleEvent(Object event){
  super.handleEvent(event);
  if (event == Events.PLANETOID_DESTROYED && !isMissionStartPlanetoidSplitting) {
    game.mission.spawnPlanetoid();
  }
}

Fixed version (ground truth):
@Override public void handleEvent(Object event){
  super.handleEvent(event);
  if (event == Events.PLANETOID_DESTROYED && !isMissionStartPlanetoidSplitting) {
    game.runNext.add(game.mission::spawnPlanetoid);
  }
}
Program: 36471
Project: 36471
Buggy source:
private void drawUfoRadar(double x,double y){
  double r=game.settings.UFO_RADAR_RADIUS;
  gc.setGlobalAlpha(0.3);
  gc.setFill(new RadialGradient(0,0,0.5,0.5,1,true,NO_CYCLE,new Stop(0.3,Color.TRANSPARENT),new Stop(1,rgb(114,208,74))));
  gc.fillOval(x - r,y - r,2 * r,2 * r);
  gc.setGlobalAlpha(1);
}

Fixed version (ground truth):
private void drawUfoRadar(double x,double y){
  double r=game.settings.UFO_RADAR_RADIUS;
  gc.setFill(new RadialGradient(0,0,0.5,0.5,1,true,NO_CYCLE,new Stop(0.3,Color.TRANSPARENT),new Stop(1,rgb(114,208,74,0.3))));
  gc.fillOval(x - r,y - r,2 * r,2 * r);
}
Program: 36472
Project: 36472
Buggy source:
public WindowBase(Stage owner,StageStyle style){
  if (s != null)   s.initOwner(owner);
  if (style != null)   s.initStyle(style);
  s.setFullScreenExitHint("String_Node_Str");
}

Fixed version (ground truth):
public WindowBase(Stage owner,StageStyle style){
  if (owner != null)   s.initOwner(owner);
  if (style != null)   s.initStyle(style);
  s.setFullScreenExitHint("String_Node_Str");
}
Program: 36473
Project: 36473
Buggy source:
public void serialize(){
  File dir=new File(APP.DIR_LAYOUTS,"String_Node_Str");
  if (!Util.isValidatedDirectory(dir)) {
    LOGGER.error("String_Node_Str",dir);
    return;
  }
  Set<File> filesOld=listFiles(dir).collect(toSet());
  List<Window> windows=stream(Window.WINDOWS).without(miniWindow).toList();
  LOGGER.info("String_Node_Str" + windows.size() + "String_Node_Str");
  String sessionUniqueName=LocalDateTime.now().toString();
  boolean isError=false;
  Set<File> filesNew=new HashSet<>();
  for (int i=0; i < windows.size(); i++) {
    Window w=windows.get(i);
    File f=new File(dir,"String_Node_Str" + sessionUniqueName + "String_Node_Str"+ i+ "String_Node_Str");
    filesNew.add(f);
    isError|=App.APP.serializators.toXML(new WindowState(w),f).ifError(e -> LOGGER.error("String_Node_Str",e)).isError();
    if (isError)     break;
  }
  (isError ? filesNew : filesOld).forEach(File::delete);
}

Fixed version (ground truth):
public void serialize(){
  File dir=new File(APP.DIR_LAYOUTS,"String_Node_Str");
  if (!Util.isValidatedDirectory(dir)) {
    LOGGER.error("String_Node_Str",dir);
    return;
  }
  Set<File> filesOld=listFiles(dir).collect(toSet());
  List<Window> windows=stream(Window.WINDOWS).without(miniWindow).toList();
  LOGGER.info("String_Node_Str" + windows.size() + "String_Node_Str");
  String sessionUniqueName=System.currentTimeMillis() + "String_Node_Str";
  boolean isError=false;
  Set<File> filesNew=new HashSet<>();
  for (int i=0; i < windows.size(); i++) {
    Window w=windows.get(i);
    File f=new File(dir,"String_Node_Str" + sessionUniqueName + "String_Node_Str"+ i+ "String_Node_Str");
    filesNew.add(f);
    isError|=App.APP.serializators.toXML(new WindowState(w),f).ifError(e -> LOGGER.error("String_Node_Str",e)).isError();
    if (isError)     break;
  }
  (isError ? filesNew : filesOld).forEach(File::delete);
}
Program: 36474
Project: 36474
Buggy source:
static String addText(String text,String added,StringDirection from){
  return from == FROM_START ? added + s : s + added;
}

Fixed version (ground truth):
static String addText(String text,String added,StringDirection from){
  return from == FROM_START ? added + text : text + added;
}
Program: 36476
Project: 36476
Buggy source:
@IsAction(name="String_Node_Str",desc="String_Node_Str",keys="String_Node_Str") public static void openLauncher(){
  File f=new File(APP.DIR_LAYOUTS,"String_Node_Str");
  Component c=UiContext.instantiateComponent(f);
  if (c != null) {
    OverlayPane op=new OverlayPane(){
      @Override public void show(){
        OverlayPane root=this;
        getChildren().add(c.load());
        if (c instanceof Widget) {
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).areaTemp=new ContainerNode(){
            @Override public Pane getRoot(){
              return root;
            }
            @Override public void show(){
            }
            @Override public void hide(){
            }
            @Override public void close(){
              root.hide();
            }
          }
;
        }
        super.show();
      }
    }
;
    op.display.set(SCREEN_OF_MOUSE);
    op.show();
    c.load().prefWidth(900);
    c.load().prefHeight(700);
  }
}

Fixed version (ground truth):
@IsAction(name="String_Node_Str",desc="String_Node_Str",keys="String_Node_Str") public static void openLauncher(){
  File f=new File(APP.DIR_LAYOUTS,"String_Node_Str");
  Component c=UiContext.instantiateComponent(f);
  if (c != null) {
    OverlayPane op=new OverlayPane(){
      @Override public void show(){
        OverlayPane root=this;
        getChildren().add(c.load());
        run(millis(500),() -> {
          stream(((Pane)((Widget<?>)c).load()).getChildren()).findAny(GridView.class::isInstance).ifPresent(n -> ((GridView)n).implGetSkin().getFlow().requestFocus());
        }
);
        if (c instanceof Widget) {
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).getController().getFieldOrThrow("String_Node_Str").setValue(true);
          ((Widget<?>)c).areaTemp=new ContainerNode(){
            @Override public Pane getRoot(){
              return root;
            }
            @Override public void show(){
            }
            @Override public void hide(){
            }
            @Override public void close(){
              root.hide();
            }
          }
;
        }
        super.show();
      }
    }
;
    op.display.set(SCREEN_OF_MOUSE);
    op.show();
    c.load().prefWidth(900);
    c.load().prefHeight(700);
  }
}
Program: 36477
Project: 36477
Buggy source:
private void visit(){
  if (!initialized)   return;
  Item item=new TopItem();
  visitId.incrementAndGet();
  Fut.fut(item).map(Item::children,executorIO).use(cells -> cells.sort(buildSortComparator()),executorIO).use(cells -> {
    grid.getItemsRaw().setAll(cells);
    if (item.last_gridposition >= 0)     grid.implGetSkin().getFlow().setPosition(item.last_gridposition);
    grid.implGetSkin().getFlow().requestFocus();
    run(400,grid::requestFocus);
  }
,FX).run();
}

Fixed version (ground truth):
private void visit(){
  if (!initialized)   return;
  Item item=new TopItem();
  visitId.incrementAndGet();
  Fut.fut(item).map(Item::children,executorIO).use(cells -> cells.sort(buildSortComparator()),executorIO).use(cells -> {
    grid.getItemsRaw().setAll(cells);
    if (item.last_gridposition >= 0)     grid.implGetSkin().getFlow().setPosition(item.last_gridposition);
    grid.implGetSkin().getFlow().requestFocus();
  }
,FX).run();
}
Program: 36478
Project: 36478
Buggy source:
private void visit(Item dir,Item scrollTo){
  if (!initialized)   return;
  if (item != null)   item.last_gridposition=grid.implGetSkin().getFlow().getPosition();
  if (item == dir)   return;
  if (item != null && item.isHChildOf(dir))   item.disposeChildren();
  visitId++;
  item=dir;
  lastVisited=dir.val;
  Fut.fut(item).map(Item::children,executorIO).use(cells -> cells.sort(buildSortComparator()),executorIO).use(cells -> {
    grid.getItemsRaw().setAll(cells);
    if (item.last_gridposition >= 0)     grid.implGetSkin().getFlow().setPosition(item.last_gridposition);
    grid.requestFocus();
  }
,FX).showProgress(getWidget().getWindow().taskAdd()).run();
}

Fixed version (ground truth):
private void visit(Item dir,Item scrollTo){
  if (!initialized)   return;
  if (item != null)   item.last_gridposition=grid.implGetSkin().getFlow().getPosition();
  if (item == dir)   return;
  if (item != null && item.isHChildOf(dir))   item.disposeChildren();
  visitId++;
  item=dir;
  lastVisited=dir.val;
  Fut.fut(item).map(Item::children,executorIO).use(cells -> cells.sort(buildSortComparator()),executorIO).use(cells -> {
    grid.getItemsRaw().setAll(cells);
    if (item.last_gridposition >= 0)     grid.implGetSkin().getFlow().setPosition(item.last_gridposition);
    grid.requestFocus();
    run(millis(500),() -> grid.requestFocus());
  }
,FX).showProgress(getWidget().getWindow().taskAdd()).run();
}
Program: 36479
Project: 36479
Buggy source:
private SliderField(Config<Number> c){
  super(c);
  double v=c.getValue().doubleValue();
  min=new Label(String.valueOf(c.getMin()));
  max=new Label(String.valueOf(c.getMax()));
  slider=new Slider(c.getMin(),c.getMax(),v);
  cur=new Label(get().toString());
  cur.setPadding(new Insets(0,5,0,0));
  slider.valueProperty().addListener((o,ov,nv) -> {
    cur.setText(get().toString());
    if (!slider.isValueChanging())     apply(false);
  }
);
  slider.setOnMouseReleased(e -> {
    if (applyOnChange)     apply(false);
  }
);
  slider.setBlockIncrement((c.getMax() - c.getMin()) / 20);
  slider.setMinWidth(-1);
  slider.setPrefWidth(-1);
  slider.setMaxWidth(-1);
  box=new HBox(min,slider,max);
  box.setAlignment(CENTER_LEFT);
  box.setSpacing(5);
  Class type=unPrimitivize(config.getType());
  if (isIn(type,Integer.class,Short.class,Long.class)) {
    box.getChildren().add(0,cur);
    slider.setMajorTickUnit(1);
    slider.setSnapToTicks(true);
  }
}

Fixed version (ground truth):
private SliderField(Config<Number> c){
  super(c);
  double v=c.getValue().doubleValue();
  min=new Label(String.valueOf(c.getMin()));
  max=new Label(String.valueOf(c.getMax()));
  slider=new Slider(c.getMin(),c.getMax(),v);
  cur=new Label(get().toString());
  cur.setPadding(new Insets(0,5,0,0));
  slider.valueProperty().addListener((o,ov,nv) -> {
    cur.setText(get().toString());
    if (!slider.isValueChanging())     apply(false);
  }
);
  slider.setOnMouseReleased(e -> {
    if (applyOnChange)     apply(false);
  }
);
  slider.setBlockIncrement((c.getMax() - c.getMin()) / 20);
  slider.setMinWidth(-1);
  slider.setPrefWidth(-1);
  slider.setMaxWidth(-1);
  box=new HBox(min,slider,max);
  box.setAlignment(CENTER_LEFT);
  box.setSpacing(5);
  Class type=config.getType();
  if (isIn(type,Integer.class,Short.class,Long.class)) {
    box.getChildren().add(0,cur);
    slider.setMajorTickUnit(1);
    slider.setSnapToTicks(true);
  }
}
Program: 36480
Project: 36480
Buggy source:
public static Window createWindowOwner(){
  Window w=new Window();
  w.getStage().initStyle(UTILITY);
  w.s.setOpacity(0);
  w.s.setScene(new Scene(new Region()));
  ((Region)w.s.getScene().getRoot()).setBackground(null);
  w.s.getScene().setFill(null);
  w.s.setTitle(APP.name);
  w.s.getIcons().add(APP.getIcon());
  w.setSize(20,20);
  return w;
}

Fixed version (ground truth):
public Window createWindowOwner(){
  Window w=new Window();
  w.getStage().initStyle(UTILITY);
  w.s.setOpacity(0);
  w.s.setScene(new Scene(new Region()));
  ((Region)w.s.getScene().getRoot()).setBackground(null);
  w.s.getScene().setFill(null);
  w.s.setTitle(APP.name);
  w.s.getIcons().add(APP.getIcon());
  w.setSize(20,20);
  return w;
}
Program: 36482
Project: 36482
Buggy source:
/** 
 * Converts primitive to wrappers, otherwise does nothing.
 * @param c
 * @return Object class of given class or class itself if not primitive.
 */
public static Class unPrimitivize(Class<?> c){
  if (c.isPrimitive()) {
    if (c.equals(boolean.class))     return Boolean.class;
    if (c.equals(int.class))     return Integer.class;
    if (c.equals(float.class))     return Float.class;
    if (c.equals(double.class))     return Double.class;
    if (c.equals(long.class))     return Long.class;
    if (c.equals(byte.class))     return Byte.class;
    if (c.equals(short.class))     return Short.class;
    if (c.equals(char.class))     return Character.class;
  }
  return c;
}

Fixed version (ground truth):
/** 
 * Converts primitive class to wrapper class.
 * @param c any class
 * @return respective primitive wrapper class of given class or the class itself if it is not primitive.
 */
@SuppressWarnings("String_Node_Str") public static <T>Class<T> unPrimitivize(Class<T> c){
  if (c.isPrimitive()) {
    if (c.equals(boolean.class))     return (Class)Boolean.class;
    if (c.equals(int.class))     return (Class)Integer.class;
    if (c.equals(float.class))     return (Class)Float.class;
    if (c.equals(double.class))     return (Class)Double.class;
    if (c.equals(long.class))     return (Class)Long.class;
    if (c.equals(byte.class))     return (Class)Byte.class;
    if (c.equals(short.class))     return (Class)Short.class;
    if (c.equals(char.class))     return (Class)Character.class;
  }
  return c;
}