Program: 188649
Project: 188649
Buggy source:
@UiHandler("String_Node_Str") void buttonRemoveHandler(ClickEvent e){
  final SelectedItems<IndexedAIP> selected=aipList.getSelected();
  if (SelectedItemsUtils.isEmpty(selected)) {
    if (aipId != null) {
      Dialogs.showConfirmDialog(messages.browseRemoveConfirmDialogTitle(),messages.browseRemoveConfirmDialogMessage(),messages.dialogCancel(),messages.dialogYes(),new AsyncCallback<Boolean>(){
        @Override public void onFailure(        Throwable caught){
        }
        @Override public void onSuccess(        Boolean confirmed){
          if (confirmed) {
            SelectedItemsList<IndexedAIP> selected=new SelectedItemsList<IndexedAIP>(Arrays.asList(aipId),IndexedAIP.class.getName());
            BrowserService.Util.getInstance().removeAIP(selected,new AsyncCallback<String>(){
              @Override public void onFailure(              Throwable caught){
                AsyncCallbackUtils.defaultFailureTreatment(caught);
              }
              @Override public void onSuccess(              String parentId){
                if (parentId != null) {
                  Tools.newHistory(Browse.RESOLVER,parentId);
                }
 else {
                  Tools.newHistory(Browse.RESOLVER);
                }
              }
            }
);
          }
        }
      }
);
    }
 else {
      Dialogs.showInformationDialog(messages.selectAnItemTitle(),messages.selectAnItemDescription(),messages.dialogOk());
    }
  }
 else {
    SelectedItemsUtils.size(IndexedAIP.class,selected,new AsyncCallback<Long>(){
      @Override public void onFailure(      Throwable caught){
        AsyncCallbackUtils.defaultFailureTreatment(caught);
      }
      @Override public void onSuccess(      final Long size){
        Dialogs.showConfirmDialog(messages.ingestTransferRemoveFolderConfirmDialogTitle(),messages.ingestTransferRemoveSelectedConfirmDialogMessage(size),messages.ingestTransferRemoveFolderConfirmDialogCancel(),messages.ingestTransferRemoveFolderConfirmDialogOk(),new AsyncCallback<Boolean>(){
          @Override public void onSuccess(          Boolean confirmed){
            if (confirmed) {
              BrowserService.Util.getInstance().removeAIP(selected,new LoadingAsyncCallback<String>(){
                @Override public void onFailureImpl(                Throwable caught){
                  AsyncCallbackUtils.defaultFailureTreatment(caught);
                  aipList.refresh();
                }
                @Override public void onSuccessImpl(                String parentId){
                  Toast.showInfo(messages.ingestTransferRemoveSuccessTitle(),messages.ingestTransferRemoveSuccessMessage(size));
                  aipList.refresh();
                }
              }
);
            }
          }
          @Override public void onFailure(          Throwable caught){
            AsyncCallbackUtils.defaultFailureTreatment(caught);
          }
        }
);
      }
    }
);
  }
}

Fixed version (ground truth):
@UiHandler("String_Node_Str") void buttonRemoveHandler(ClickEvent e){
  final SelectedItems<IndexedAIP> selected=aipList.getSelected();
  if (SelectedItemsUtils.isEmpty(selected)) {
    if (aipId != null) {
      Dialogs.showConfirmDialog(messages.browseRemoveConfirmDialogTitle(),messages.browseRemoveConfirmDialogMessage(),messages.dialogCancel(),messages.dialogYes(),new AsyncCallback<Boolean>(){
        @Override public void onFailure(        Throwable caught){
        }
        @Override public void onSuccess(        Boolean confirmed){
          if (confirmed) {
            SelectedItemsList<IndexedAIP> selected=new SelectedItemsList<IndexedAIP>(Arrays.asList(aipId),IndexedAIP.class.getName());
            BrowserService.Util.getInstance().removeAIP(selected,new AsyncCallback<String>(){
              @Override public void onFailure(              Throwable caught){
                AsyncCallbackUtils.defaultFailureTreatment(caught);
              }
              @Override public void onSuccess(              String parentId){
                if (parentId != null) {
                  Tools.newHistory(Browse.RESOLVER,parentId);
                }
 else {
                  Tools.newHistory(Browse.RESOLVER);
                }
              }
            }
);
          }
        }
      }
);
    }
 else {
      Dialogs.showInformationDialog(messages.selectAnItemTitle(),messages.selectAnItemToRemoveDescription(),messages.dialogOk());
    }
  }
 else {
    SelectedItemsUtils.size(IndexedAIP.class,selected,new AsyncCallback<Long>(){
      @Override public void onFailure(      Throwable caught){
        AsyncCallbackUtils.defaultFailureTreatment(caught);
      }
      @Override public void onSuccess(      final Long size){
        Dialogs.showConfirmDialog(messages.ingestTransferRemoveFolderConfirmDialogTitle(),messages.ingestTransferRemoveSelectedConfirmDialogMessage(size),messages.ingestTransferRemoveFolderConfirmDialogCancel(),messages.ingestTransferRemoveFolderConfirmDialogOk(),new AsyncCallback<Boolean>(){
          @Override public void onSuccess(          Boolean confirmed){
            if (confirmed) {
              BrowserService.Util.getInstance().removeAIP(selected,new LoadingAsyncCallback<String>(){
                @Override public void onFailureImpl(                Throwable caught){
                  AsyncCallbackUtils.defaultFailureTreatment(caught);
                  aipList.refresh();
                }
                @Override public void onSuccessImpl(                String parentId){
                  Toast.showInfo(messages.ingestTransferRemoveSuccessTitle(),messages.ingestTransferRemoveSuccessMessage(size));
                  aipList.refresh();
                }
              }
);
            }
          }
          @Override public void onFailure(          Throwable caught){
            AsyncCallbackUtils.defaultFailureTreatment(caught);
          }
        }
);
      }
    }
);
  }
}