Program: 188466
Project: 188466
Buggy source:
/** 
 * Create a new panel to view a representation
 * @param viewers
 * @param index
 * @param sorter
 * @param aipId
 * @param itemBundle
 * @param representationUUID
 * @param fileUUID
 * @param file
 */
public BrowseFile(Viewers viewers,final BrowseFileBundle bundle){
  this.bundle=bundle;
  filePreview=new IndexedFilePreview(viewers,bundle.getFile(),new Command(){
    @Override public void execute(){
      Scheduler.get().scheduleDeferred(new Command(){
        @Override public void execute(){
          Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.DIP_FILE_UUIDS,bundle.getFile().getUUID()));
          BrowserService.Util.getInstance().count(IndexedDIP.class.getName(),filter,new AsyncCallback<Long>(){
            @Override public void onFailure(            Throwable caught){
              AsyncCallbackUtils.defaultFailureTreatment(caught);
            }
            @Override public void onSuccess(            Long dipCount){
              if (dipCount > 0) {
                disseminationsSlider.open();
              }
            }
          }
);
        }
      }
);
    }
  }
);
  initWidget(uiBinder.createAndBindUi(this));
  breadcrumb.updatePath(getBreadcrumbs());
  breadcrumb.setVisible(true);
  infoFileButton.setTitle(messages.viewRepresentationInfoFileButton());
  disseminationsButton.setVisible(bundle.getDipCount() > 0);
  disseminationsSlider=Sliders.createDisseminationsSlider(center,disseminationsButton,bundle.getFile());
  infoSlider=Sliders.createInfoSlider(center,infoFileButton,bundle.getFile());
  optionsSlider=Sliders.createOptionsSlider(center,optionsButton,bundle.getFile());
  keyboardFocus.setFocus(true);
  ListSelectionUtils.bindLayout(bundle.getFile(),previousButton,nextButton,keyboardFocus,true,false,false);
}

Fixed version (ground truth):
/** 
 * Create a new panel to view a representation
 * @param viewers
 * @param index
 * @param sorter
 * @param aipId
 * @param itemBundle
 * @param representationUUID
 * @param fileUUID
 * @param file
 */
public BrowseFile(Viewers viewers,final BrowseFileBundle bundle){
  this.bundle=bundle;
  filePreview=new IndexedFilePreview(viewers,bundle.getFile(),new Command(){
    @Override public void execute(){
      Scheduler.get().scheduleDeferred(new Command(){
        @Override public void execute(){
          Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.DIP_FILE_UUIDS,bundle.getFile().getUUID()));
          boolean justActive=AIPState.ACTIVE.equals(bundle.getAip().getState());
          BrowserService.Util.getInstance().count(IndexedDIP.class.getName(),filter,justActive,new AsyncCallback<Long>(){
            @Override public void onFailure(            Throwable caught){
              AsyncCallbackUtils.defaultFailureTreatment(caught);
            }
            @Override public void onSuccess(            Long dipCount){
              if (dipCount > 0) {
                disseminationsSlider.open();
              }
            }
          }
);
        }
      }
);
    }
  }
);
  initWidget(uiBinder.createAndBindUi(this));
  breadcrumb.updatePath(getBreadcrumbs());
  breadcrumb.setVisible(true);
  infoFileButton.setTitle(messages.viewRepresentationInfoFileButton());
  disseminationsButton.setVisible(bundle.getDipCount() > 0);
  disseminationsSlider=Sliders.createDisseminationsSlider(center,disseminationsButton,bundle.getFile());
  infoSlider=Sliders.createInfoSlider(center,infoFileButton,bundle.getFile());
  optionsSlider=Sliders.createOptionsSlider(center,optionsButton,bundle.getFile());
  keyboardFocus.setFocus(true);
  ListSelectionUtils.bindLayout(bundle.getFile(),previousButton,nextButton,keyboardFocus,true,false,false);
}