Program: 164363
Project: 164363
Buggy source:
public WndSettings(boolean inGame){
  super();
  CheckBox btnImmersive=null;
  if (inGame) {
    int w=BTN_HEIGHT;
    btnZoomOut=new RedButton(TXT_ZOOM_OUT){
      @Override protected void onClick(){
        zoom(Camera.main.zoom - 1);
      }
    }
;
    add(btnZoomOut.setRect(0,0,w,BTN_HEIGHT));
    btnZoomIn=new RedButton(TXT_ZOOM_IN){
      @Override protected void onClick(){
        zoom(Camera.main.zoom + 1);
      }
    }
;
    add(btnZoomIn.setRect(WIDTH - w,0,w,BTN_HEIGHT));
    add(new RedButton(TXT_ZOOM_DEFAULT){
      @Override protected void onClick(){
        zoom(PixelScene.defaultZoom);
      }
    }
.setRect(btnZoomOut.right(),0,WIDTH - btnZoomIn.width() - btnZoomOut.width(),BTN_HEIGHT));
  }
 else {
    CheckBox btnScaleUp=new CheckBox(TXT_SCALE_UP){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.scaleUp(checked());
      }
    }
;
    btnScaleUp.setRect(0,0,WIDTH,BTN_HEIGHT);
    btnScaleUp.checked(ShatteredPixelDungeon.scaleUp());
    add(btnScaleUp);
    btnImmersive=new CheckBox(TXT_IMMERSIVE){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.immerse(checked());
      }
    }
;
    btnImmersive.setRect(0,btnScaleUp.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnImmersive.checked(ShatteredPixelDungeon.immersed());
    btnImmersive.enable(android.os.Build.VERSION.SDK_INT >= 19);
    add(btnImmersive);
  }
  CheckBox btnMusic=new CheckBox(TXT_MUSIC){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.music(checked());
    }
  }
;
  btnMusic.setRect(0,(btnImmersive != null ? btnImmersive.bottom() : BTN_HEIGHT) + GAP,WIDTH,BTN_HEIGHT);
  btnMusic.checked(ShatteredPixelDungeon.music());
  add(btnMusic);
  CheckBox btnSound=new CheckBox(TXT_SOUND){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.soundFx(checked());
      Sample.INSTANCE.play(Assets.SND_CLICK);
    }
  }
;
  btnSound.setRect(0,btnMusic.bottom() + GAP,WIDTH,BTN_HEIGHT);
  btnSound.checked(ShatteredPixelDungeon.soundFx());
  add(btnSound);
  if (!inGame) {
    RedButton btnOrientation=new RedButton(orientationText()){
      @Override protected void onClick(){
        ShatteredPixelDungeon.landscape(!ShatteredPixelDungeon.landscape());
      }
    }
;
    btnOrientation.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
    add(btnOrientation);
    resize(WIDTH,(int)btnOrientation.bottom());
  }
 else {
    CheckBox btnBrightness=new CheckBox(TXT_BRIGHTNESS){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.brightness(checked());
      }
    }
;
    btnBrightness.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnBrightness.checked(ShatteredPixelDungeon.brightness());
    add(btnBrightness);
    CheckBox btnQuickSlot=new CheckBox(TXT_QUICKSLOT){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.quickSlots(checked() ? 2 : 1);
        Toolbar.QuickSlots=checked() ? 2 : 1;
      }
    }
;
    btnQuickSlot.setRect(0,btnBrightness.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnQuickSlot.checked(ShatteredPixelDungeon.quickSlots() == 1);
    add(btnQuickSlot);
    resize(WIDTH,(int)btnQuickSlot.bottom());
  }
}

Fixed version (ground truth):
public WndSettings(boolean inGame){
  super();
  CheckBox btnImmersive=null;
  if (inGame) {
    int w=BTN_HEIGHT;
    btnZoomOut=new RedButton(TXT_ZOOM_OUT){
      @Override protected void onClick(){
        zoom(Camera.main.zoom - 1);
      }
    }
;
    add(btnZoomOut.setRect(0,0,w,BTN_HEIGHT));
    btnZoomIn=new RedButton(TXT_ZOOM_IN){
      @Override protected void onClick(){
        zoom(Camera.main.zoom + 1);
      }
    }
;
    add(btnZoomIn.setRect(WIDTH - w,0,w,BTN_HEIGHT));
    add(new RedButton(TXT_ZOOM_DEFAULT){
      @Override protected void onClick(){
        zoom(PixelScene.defaultZoom);
      }
    }
.setRect(btnZoomOut.right(),0,WIDTH - btnZoomIn.width() - btnZoomOut.width(),BTN_HEIGHT));
  }
 else {
    CheckBox btnScaleUp=new CheckBox(TXT_SCALE_UP){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.scaleUp(checked());
      }
    }
;
    btnScaleUp.setRect(0,0,WIDTH,BTN_HEIGHT);
    btnScaleUp.checked(ShatteredPixelDungeon.scaleUp());
    add(btnScaleUp);
    btnImmersive=new CheckBox(TXT_IMMERSIVE){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.immerse(checked());
      }
    }
;
    btnImmersive.setRect(0,btnScaleUp.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnImmersive.checked(ShatteredPixelDungeon.immersed());
    btnImmersive.enable(android.os.Build.VERSION.SDK_INT >= 19);
    add(btnImmersive);
  }
  CheckBox btnMusic=new CheckBox(TXT_MUSIC){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.music(checked());
    }
  }
;
  btnMusic.setRect(0,(btnImmersive != null ? btnImmersive.bottom() : BTN_HEIGHT) + GAP,WIDTH,BTN_HEIGHT);
  btnMusic.checked(ShatteredPixelDungeon.music());
  add(btnMusic);
  CheckBox btnSound=new CheckBox(TXT_SOUND){
    @Override protected void onClick(){
      super.onClick();
      ShatteredPixelDungeon.soundFx(checked());
      Sample.INSTANCE.play(Assets.SND_CLICK);
    }
  }
;
  btnSound.setRect(0,btnMusic.bottom() + GAP,WIDTH,BTN_HEIGHT);
  btnSound.checked(ShatteredPixelDungeon.soundFx());
  add(btnSound);
  if (!inGame) {
    RedButton btnOrientation=new RedButton(orientationText()){
      @Override protected void onClick(){
        ShatteredPixelDungeon.landscape(!ShatteredPixelDungeon.landscape());
      }
    }
;
    btnOrientation.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
    add(btnOrientation);
    resize(WIDTH,(int)btnOrientation.bottom());
  }
 else {
    CheckBox btnBrightness=new CheckBox(TXT_BRIGHTNESS){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.brightness(checked());
      }
    }
;
    btnBrightness.setRect(0,btnSound.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnBrightness.checked(ShatteredPixelDungeon.brightness());
    add(btnBrightness);
    CheckBox btnQuickSlot=new CheckBox(TXT_QUICKSLOT){
      @Override protected void onClick(){
        super.onClick();
        ShatteredPixelDungeon.quickSlots(checked() ? 2 : 1);
        Toolbar.QuickSlots=checked() ? 2 : 1;
      }
    }
;
    btnQuickSlot.setRect(0,btnBrightness.bottom() + GAP,WIDTH,BTN_HEIGHT);
    btnQuickSlot.checked(ShatteredPixelDungeon.quickSlots() == 2);
    add(btnQuickSlot);
    resize(WIDTH,(int)btnQuickSlot.bottom());
  }
}