Program: 188252
Project: 188252
Buggy source:
private void updateLayout(final BrowseRepresentationBundle bundle,final AIPState state,final boolean justActive){
  aipState.setHTML(HtmlSnippetUtils.getAIPStateHTML(state));
  aipState.setVisible(!justActive);
  HTMLPanel representationIconHtmlPanel=new HTMLPanel(DescriptionLevelUtils.getRepresentationTypeIcon(representation.getType(),false));
  representationIconHtmlPanel.addStyleName("String_Node_Str");
  representationIcon.setWidget(representationIconHtmlPanel);
  String title=representation.getTitle() != null ? representation.getTitle() : representation.getType();
  title=title == null ? representation.getId() : title;
  representationTitle.clear();
  HtmlSnippetUtils.getRepresentationTypeHTML(representationTitle,title,representation.getRepresentationStates());
  final String idFilter=RepresentationInformationUtils.createRepresentationInformationFilter(RodaConstants.INDEX_REPRESENTATION,RodaConstants.INDEX_UUID,representation.getUUID());
  RepresentationInformationHelper.addFieldWithRepresentationInformationIcon(SafeHtmlUtils.fromString(messages.representationId() + "String_Node_Str" + representation.getId()),idFilter,representationId,bundle.getRepresentationInformationFields().contains(RodaConstants.INDEX_UUID));
  if (representation.getType() != null) {
    final String typeFilter=RepresentationInformationUtils.createRepresentationInformationFilter(RodaConstants.INDEX_REPRESENTATION,RodaConstants.REPRESENTATION_TYPE,representation.getType());
    RepresentationInformationHelper.addFieldWithRepresentationInformationIcon(SafeHtmlUtils.fromString(messages.representationType() + "String_Node_Str" + representation.getType()),typeFilter,representationType,bundle.getRepresentationInformationFields().contains(RodaConstants.REPRESENTATION_TYPE));
  }
  if (!breadcrumbItems.isEmpty()) {
    breadcrumbItems.remove(breadcrumbItems.size() - 1);
    breadcrumbItems.add(BreadcrumbUtils.getBreadcrumbItem(representation));
    breadcrumb.updatePath(breadcrumbItems);
  }
  if (representation.getCreatedOn() != null) {
    dateCreated.setText(messages.dateCreated(Humanize.formatDateTime(representation.getCreatedOn()),representation.getCreatedBy()));
  }
  if (representation.getUpdatedOn() != null) {
    dateUpdated.setText(messages.dateUpdated(Humanize.formatDateTime(representation.getUpdatedOn()),representation.getUpdatedBy()));
  }
  actionsSidebar.setWidget(RepresentationActions.get(aipId).createActionsLayout(representation,new AsyncCallback<Actionable.ActionImpact>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    Actionable.ActionImpact impact){
      if (Actionable.ActionImpact.UPDATED.equals(impact)) {
        BrowserService.Util.getInstance().retrieve(IndexedRepresentation.class.getName(),representation.getUUID(),representationFields,new AsyncCallback<IndexedRepresentation>(){
          @Override public void onFailure(          Throwable caught){
            AsyncCallbackUtils.defaultFailureTreatment(caught);
          }
          @Override public void onSuccess(          IndexedRepresentation rep){
            representation=rep;
            updateLayout(bundle,state,justActive);
          }
        }
);
      }
    }
  }
));
}

Fixed version (ground truth):
private void updateLayout(final BrowseRepresentationBundle bundle,final AIPState state,final boolean justActive){
  aipState.setHTML(HtmlSnippetUtils.getAIPStateHTML(state));
  aipState.setVisible(!justActive);
  HTMLPanel representationIconHtmlPanel=new HTMLPanel(DescriptionLevelUtils.getRepresentationTypeIcon(representation.getType(),false));
  representationIconHtmlPanel.addStyleName("String_Node_Str");
  representationIcon.setWidget(representationIconHtmlPanel);
  String title=representation.getTitle() != null ? representation.getTitle() : representation.getType();
  title=title == null ? representation.getId() : title;
  representationTitle.clear();
  HtmlSnippetUtils.getRepresentationTypeHTML(representationTitle,title,representation.getRepresentationStates());
  representationId.clear();
  final String idFilter=RepresentationInformationUtils.createRepresentationInformationFilter(RodaConstants.INDEX_REPRESENTATION,RodaConstants.INDEX_UUID,representation.getUUID());
  RepresentationInformationHelper.addFieldWithRepresentationInformationIcon(SafeHtmlUtils.fromString(messages.representationId() + "String_Node_Str" + representation.getId()),idFilter,representationId,bundle.getRepresentationInformationFields().contains(RodaConstants.INDEX_UUID));
  if (representation.getType() != null) {
    representationType.clear();
    final String typeFilter=RepresentationInformationUtils.createRepresentationInformationFilter(RodaConstants.INDEX_REPRESENTATION,RodaConstants.REPRESENTATION_TYPE,representation.getType());
    RepresentationInformationHelper.addFieldWithRepresentationInformationIcon(SafeHtmlUtils.fromString(messages.representationType() + "String_Node_Str" + representation.getType()),typeFilter,representationType,bundle.getRepresentationInformationFields().contains(RodaConstants.REPRESENTATION_TYPE));
  }
  if (!breadcrumbItems.isEmpty()) {
    breadcrumbItems.remove(breadcrumbItems.size() - 1);
    breadcrumbItems.add(BreadcrumbUtils.getBreadcrumbItem(representation));
    breadcrumb.updatePath(breadcrumbItems);
  }
  if (representation.getCreatedOn() != null) {
    dateCreated.setText(messages.dateCreated(Humanize.formatDateTime(representation.getCreatedOn()),representation.getCreatedBy()));
  }
  if (representation.getUpdatedOn() != null) {
    dateUpdated.setText(messages.dateUpdated(Humanize.formatDateTime(representation.getUpdatedOn()),representation.getUpdatedBy()));
  }
  actionsSidebar.setWidget(RepresentationActions.get(aipId).createActionsLayout(representation,new AsyncCallback<Actionable.ActionImpact>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    Actionable.ActionImpact impact){
      if (Actionable.ActionImpact.UPDATED.equals(impact)) {
        BrowserService.Util.getInstance().retrieve(IndexedRepresentation.class.getName(),representation.getUUID(),representationFields,new AsyncCallback<IndexedRepresentation>(){
          @Override public void onFailure(          Throwable caught){
            AsyncCallbackUtils.defaultFailureTreatment(caught);
          }
          @Override public void onSuccess(          IndexedRepresentation rep){
            representation=rep;
            updateLayout(bundle,state,justActive);
          }
        }
);
      }
    }
  }
));
}