Program: 164285
Project: 164285
Buggy source:
public WndDisplay(){
  OptionSlider scale=new OptionSlider("String_Node_Str",(int)Math.ceil(2 * Game.density) + "String_Node_Str",PixelScene.maxDefaultZoom + "String_Node_Str",(int)Math.ceil(2 * Game.density),PixelScene.maxDefaultZoom){
    @Override protected void onChange(){
      ShatteredPixelDungeon.scale(getSelectedValue());
    }
  }
;
  scale.setSelectedValue(PixelScene.defaultZoom);
  if ((int)Math.ceil(2 * Game.density) < PixelScene.maxDefaultZoom) {
    scale.setRect(0,0,WIDTH,SLIDER_HEIGHT);
    add(scale);
  }
 else {
    scale.setRect(0,0,0,0);
  }
  CheckBox chkImmersive=new CheckBox("String_Node_Str"){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.immerse(checked());
    }
  }
;
  chkImmersive.setRect(0,scale.bottom() + GAP_SML,WIDTH,BTN_HEIGHT);
  chkImmersive.checked(ShatteredPixelDungeon.immersed());
  chkImmersive.enable(android.os.Build.VERSION.SDK_INT >= 19);
  add(chkImmersive);
  OptionSlider brightness=new OptionSlider("String_Node_Str","String_Node_Str","String_Node_Str",-2,4){
    @Override protected void onChange(){
      ShatteredPixelDungeon.brightness(getSelectedValue());
    }
  }
;
  brightness.setSelectedValue(ShatteredPixelDungeon.brightness());
  brightness.setRect(0,chkImmersive.bottom() + GAP_LRG,WIDTH,SLIDER_HEIGHT);
  add(brightness);
  BitmapText barDesc=PixelScene.createText("String_Node_Str",9);
  barDesc.measure();
  barDesc.x=(WIDTH - barDesc.width()) / 2;
  barDesc.y=brightness.bottom() + GAP_LRG;
  add(barDesc);
  RedButton btnSplit=new RedButton("String_Node_Str"){
    @Override protected void onClick(){
      ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.SPLIT.name());
      Toolbar.updateLayout();
    }
  }
;
  btnSplit.setRect(1,barDesc.y + barDesc.height(),36,BTN_HEIGHT);
  add(btnSplit);
  RedButton btnGrouped=new RedButton("String_Node_Str"){
    @Override protected void onClick(){
      ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.GROUP.name());
      Toolbar.updateLayout();
    }
  }
;
  btnGrouped.setRect(btnSplit.right() + 1,barDesc.y + barDesc.height(),36,BTN_HEIGHT);
  add(btnGrouped);
  RedButton btnCentered=new RedButton("String_Node_Str"){
    @Override protected void onClick(){
      ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.CENTER.name());
      Toolbar.updateLayout();
    }
  }
;
  btnCentered.setRect(btnGrouped.right() + 1,barDesc.y + barDesc.height(),36,BTN_HEIGHT);
  add(btnCentered);
  OptionSlider slots=new OptionSlider("String_Node_Str","String_Node_Str","String_Node_Str",0,4){
    @Override protected void onChange(){
      ShatteredPixelDungeon.quickSlots(getSelectedValue());
      Toolbar.updateLayout();
    }
  }
;
  slots.setSelectedValue(ShatteredPixelDungeon.quickSlots());
  slots.setRect(0,btnGrouped.bottom() + GAP_SML,WIDTH,SLIDER_HEIGHT);
  add(slots);
  CheckBox chkFlip=new CheckBox("String_Node_Str"){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.flippedUI(checked());
      Toolbar.updateLayout();
    }
  }
;
  chkFlip.setRect(0,slots.bottom() + GAP_SML,WIDTH,BTN_HEIGHT);
  chkFlip.checked(ShatteredPixelDungeon.flippedUI());
  add(chkFlip);
  resize(WIDTH,(int)chkFlip.bottom());
}

Fixed version (ground truth):
public WndDisplay(){
  OptionSlider scale=new OptionSlider("String_Node_Str",(int)Math.ceil(2 * Game.density) + "String_Node_Str",PixelScene.maxDefaultZoom + "String_Node_Str",(int)Math.ceil(2 * Game.density),PixelScene.maxDefaultZoom){
    @Override protected void onChange(){
      ShatteredPixelDungeon.scale(getSelectedValue());
      ShatteredPixelDungeon.resetScene();
    }
  }
;
  scale.setSelectedValue(PixelScene.defaultZoom);
  if ((int)Math.ceil(2 * Game.density) < PixelScene.maxDefaultZoom) {
    scale.setRect(0,0,WIDTH,SLIDER_HEIGHT);
    add(scale);
  }
 else {
    scale.setRect(0,0,0,0);
  }
  CheckBox chkImmersive=new CheckBox("String_Node_Str"){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.immerse(checked());
    }
  }
;
  chkImmersive.setRect(0,scale.bottom() + GAP_SML,WIDTH,BTN_HEIGHT);
  chkImmersive.checked(ShatteredPixelDungeon.immersed());
  chkImmersive.enable(android.os.Build.VERSION.SDK_INT >= 19);
  add(chkImmersive);
  OptionSlider brightness=new OptionSlider("String_Node_Str","String_Node_Str","String_Node_Str",-2,4){
    @Override protected void onChange(){
      ShatteredPixelDungeon.brightness(getSelectedValue());
    }
  }
;
  brightness.setSelectedValue(ShatteredPixelDungeon.brightness());
  brightness.setRect(0,chkImmersive.bottom() + GAP_LRG,WIDTH,SLIDER_HEIGHT);
  add(brightness);
  BitmapText barDesc=PixelScene.createText("String_Node_Str",9);
  barDesc.measure();
  barDesc.x=(WIDTH - barDesc.width()) / 2;
  barDesc.y=brightness.bottom() + GAP_LRG;
  add(barDesc);
  RedButton btnSplit=new RedButton("String_Node_Str"){
    @Override protected void onClick(){
      ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.SPLIT.name());
      Toolbar.updateLayout();
    }
  }
;
  btnSplit.setRect(1,barDesc.y + barDesc.height(),36,BTN_HEIGHT);
  add(btnSplit);
  RedButton btnGrouped=new RedButton("String_Node_Str"){
    @Override protected void onClick(){
      ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.GROUP.name());
      Toolbar.updateLayout();
    }
  }
;
  btnGrouped.setRect(btnSplit.right() + 1,barDesc.y + barDesc.height(),36,BTN_HEIGHT);
  add(btnGrouped);
  RedButton btnCentered=new RedButton("String_Node_Str"){
    @Override protected void onClick(){
      ShatteredPixelDungeon.toolbarMode(Toolbar.Mode.CENTER.name());
      Toolbar.updateLayout();
    }
  }
;
  btnCentered.setRect(btnGrouped.right() + 1,barDesc.y + barDesc.height(),36,BTN_HEIGHT);
  add(btnCentered);
  OptionSlider slots=new OptionSlider("String_Node_Str","String_Node_Str","String_Node_Str",0,4){
    @Override protected void onChange(){
      ShatteredPixelDungeon.quickSlots(getSelectedValue());
      Toolbar.updateLayout();
    }
  }
;
  slots.setSelectedValue(ShatteredPixelDungeon.quickSlots());
  slots.setRect(0,btnGrouped.bottom() + GAP_SML,WIDTH,SLIDER_HEIGHT);
  add(slots);
  CheckBox chkFlip=new CheckBox("String_Node_Str"){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.flippedUI(checked());
      Toolbar.updateLayout();
    }
  }
;
  chkFlip.setRect(0,slots.bottom() + GAP_SML,WIDTH,BTN_HEIGHT);
  chkFlip.checked(ShatteredPixelDungeon.flippedUI());
  add(chkFlip);
  resize(WIDTH,(int)chkFlip.bottom());
}