Program: 164221
Project: 164221
Buggy source:
public WndTradeItem(final Heap heap,boolean canBuy){
  super();
  Item item=heap.peek();
  float pos=createDescription(item,true);
  final int price=price(item);
  if (canBuy) {
    RedButton btnBuy=new RedButton(Messages.get(this,"String_Node_Str",price)){
      @Override protected void onClick(){
        hide();
        buy(heap);
      }
    }
;
    btnBuy.setRect(0,pos + GAP,WIDTH,BTN_HEIGHT);
    btnBuy.enable(price <= Dungeon.gold);
    add(btnBuy);
    RedButton btnCancel=new RedButton(Messages.get(this,"String_Node_Str")){
      @Override protected void onClick(){
        hide();
      }
    }
;
    final MasterThievesArmband.Thievery thievery=Dungeon.hero.buff(MasterThievesArmband.Thievery.class);
    if (thievery != null) {
      final float chance=thievery.stealChance(price);
      RedButton btnSteal=new RedButton(Messages.get(this,"String_Node_Str",Math.min(100,(int)(chance * 100)))){
        @Override protected void onClick(){
          if (thievery.steal(price)) {
            Hero hero=Dungeon.hero;
            Item item=heap.pickUp();
            GLog.i(Messages.get(this,"String_Node_Str",item.name()));
            hide();
            if (!item.doPickUp(hero)) {
              Dungeon.level.drop(item,heap.pos).sprite.drop();
            }
          }
 else {
            for (            Mob mob : Dungeon.level.mobs) {
              if (mob instanceof Shopkeeper) {
                mob.yell(Messages.get(mob,"String_Node_Str"));
                ((Shopkeeper)mob).flee();
                break;
              }
            }
            hide();
          }
        }
      }
;
      btnSteal.setRect(0,btnBuy.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnSteal);
      btnCancel.setRect(0,btnSteal.bottom() + GAP,WIDTH,BTN_HEIGHT);
    }
 else     btnCancel.setRect(0,btnBuy.bottom() + GAP,WIDTH,BTN_HEIGHT);
    add(btnCancel);
    resize(WIDTH,(int)btnCancel.bottom());
  }
 else {
    resize(WIDTH,(int)pos);
  }
}

Fixed version (ground truth):
public WndTradeItem(final Heap heap,boolean canBuy){
  super();
  Item item=heap.peek();
  float pos=createDescription(item,true);
  final int price=price(item);
  if (canBuy) {
    RedButton btnBuy=new RedButton(Messages.get(this,"String_Node_Str",price)){
      @Override protected void onClick(){
        hide();
        buy(heap);
      }
    }
;
    btnBuy.setRect(0,pos + GAP,WIDTH,BTN_HEIGHT);
    btnBuy.enable(price <= Dungeon.gold);
    add(btnBuy);
    RedButton btnCancel=new RedButton(Messages.get(this,"String_Node_Str")){
      @Override protected void onClick(){
        hide();
      }
    }
;
    final MasterThievesArmband.Thievery thievery=Dungeon.hero.buff(MasterThievesArmband.Thievery.class);
    if (thievery != null) {
      final float chance=thievery.stealChance(price);
      RedButton btnSteal=new RedButton(Messages.get(this,"String_Node_Str",Math.min(100,(int)(chance * 100)))){
        @Override protected void onClick(){
          if (thievery.steal(price)) {
            Hero hero=Dungeon.hero;
            Item item=heap.pickUp();
            GLog.i(Messages.get(WndTradeItem.class,"String_Node_Str",item.name()));
            hide();
            if (!item.doPickUp(hero)) {
              Dungeon.level.drop(item,heap.pos).sprite.drop();
            }
          }
 else {
            for (            Mob mob : Dungeon.level.mobs) {
              if (mob instanceof Shopkeeper) {
                mob.yell(Messages.get(mob,"String_Node_Str"));
                ((Shopkeeper)mob).flee();
                break;
              }
            }
            hide();
          }
        }
      }
;
      btnSteal.setRect(0,btnBuy.bottom() + GAP,WIDTH,BTN_HEIGHT);
      add(btnSteal);
      btnCancel.setRect(0,btnSteal.bottom() + GAP,WIDTH,BTN_HEIGHT);
    }
 else     btnCancel.setRect(0,btnBuy.bottom() + GAP,WIDTH,BTN_HEIGHT);
    add(btnCancel);
    resize(WIDTH,(int)btnCancel.bottom());
  }
 else {
    resize(WIDTH,(int)pos);
  }
}