nus-yam/ex-repair huggingface dataset:
Program: 188208
Project: 188208
Buggy source:
@Override protected void configureDisplay(CellTable<IndexedDIP> display){
  dateCreated=new Column<IndexedDIP,Date>(new DateCell(DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM))){
    @Override public Date getValue(    IndexedDIP dip){
      return dip != null ? dip.getDateCreated() : null;
    }
  }
;
  lastModified=new Column<IndexedDIP,Date>(new DateCell(DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_MEDIUM))){
    @Override public Date getValue(    IndexedDIP dip){
      return dip != null ? dip.getLastModified() : null;
    }
  }
;
  titleColumn=new TextColumn<IndexedDIP>(){
    @Override public String getValue(    IndexedDIP dip){
      return dip != null ? dip.getTitle() : null;
    }
  }
;
  titleColumn.setSortable(true);
  dateCreated.setSortable(true);
  lastModified.setSortable(true);
  display.addColumn(titleColumn,messages.aipGenericTitle());
  display.addColumn(dateCreated,messages.objectCreatedDate());
  display.addColumn(lastModified,messages.objectLastModified());
  Label emptyInfo=new Label(messages.noItemsToDisplay());
  display.setEmptyTableWidget(emptyInfo);
  display.getColumnSortList().push(new ColumnSortInfo(titleColumn,true));
  display.setColumnWidth(dateCreated,13.0,Unit.EM);
  display.setColumnWidth(lastModified,13.0,Unit.EM);
  dateCreated.setCellStyleNames("String_Node_Str");
  lastModified.setCellStyleNames("String_Node_Str");
  addStyleName("String_Node_Str");
  emptyInfo.addStyleName("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void configureDisplay(CellTable<IndexedDIP> display){
  dateCreated=new Column<IndexedDIP,Date>(new DateCell(DateTimeFormat.getFormat(RodaConstants.DEFAULT_DATETIME_FORMAT))){
    @Override public Date getValue(    IndexedDIP dip){
      return dip != null ? dip.getDateCreated() : null;
    }
  }
;
  lastModified=new Column<IndexedDIP,Date>(new DateCell(DateTimeFormat.getFormat(RodaConstants.DEFAULT_DATETIME_FORMAT))){
    @Override public Date getValue(    IndexedDIP dip){
      return dip != null ? dip.getLastModified() : null;
    }
  }
;
  titleColumn=new TextColumn<IndexedDIP>(){
    @Override public String getValue(    IndexedDIP dip){
      return dip != null ? dip.getTitle() : null;
    }
  }
;
  titleColumn.setSortable(true);
  dateCreated.setSortable(true);
  lastModified.setSortable(true);
  display.addColumn(titleColumn,messages.aipGenericTitle());
  display.addColumn(dateCreated,messages.objectCreatedDate());
  display.addColumn(lastModified,messages.objectLastModified());
  Label emptyInfo=new Label(messages.noItemsToDisplay());
  display.setEmptyTableWidget(emptyInfo);
  display.getColumnSortList().push(new ColumnSortInfo(titleColumn,true));
  display.setColumnWidth(dateCreated,13.0,Unit.EM);
  display.setColumnWidth(lastModified,13.0,Unit.EM);
  dateCreated.setCellStyleNames("String_Node_Str");
  lastModified.setCellStyleNames("String_Node_Str");
  addStyleName("String_Node_Str");
  emptyInfo.addStyleName("String_Node_Str");
}
Program: 188221
Project: 188221
Buggy source:
public static String formatDateTime(Date date){
  return DATE_TIME_FORMAT.format(date);
}

Fixed version (ground truth):
public static String formatDateTime(Date date){
  return DATE_TIME_FORMAT_TIMEZONE.format(date);
}
Program: 188223
Project: 188223
Buggy source:
private ReturnWithExceptions<Void,ModelObserver> indexDIPFile(DIP dip,DIPFile file,boolean recursive){
  ReturnWithExceptions<Void,ModelObserver> ret=addDocumentToIndex(DIPFile.class,file);
  if (recursive && file.isDirectory() && ret.isEmpty()) {
    try (CloseableIterable<OptionalWithCause<DIPFile>> allFiles=model.listDIPFilesUnder(file,true)){
      for (      OptionalWithCause<DIPFile> subfile : allFiles) {
        if (subfile.isPresent()) {
          indexDIPFile(dip,subfile.get(),false).addTo(ret);
        }
 else {
          LOGGER.error("String_Node_Str",subfile.getCause());
          ret.add(subfile.getCause());
        }
      }
    }
 catch (    NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException|IOException e) {
      LOGGER.error("String_Node_Str",file,e);
      ret.add(e);
    }
  }
  return ret;
}

Fixed version (ground truth):
private ReturnWithExceptions<Void,ModelObserver> indexDIPFile(DIP dip,DIPFile file,boolean recursive){
  ReturnWithExceptions<Void,ModelObserver> ret=new ReturnWithExceptions<>(this);
  SolrInputDocument dipFileDocument=SolrUtils.dipFileToSolrDocument(dip,file);
  SolrUtils.create(index,RodaConstants.INDEX_DIP_FILE,dipFileDocument,(ModelObserver)this).addTo(ret);
  if (recursive && file.isDirectory() && ret.isEmpty()) {
    try (CloseableIterable<OptionalWithCause<DIPFile>> allFiles=model.listDIPFilesUnder(file,true)){
      for (      OptionalWithCause<DIPFile> subfile : allFiles) {
        if (subfile.isPresent()) {
          indexDIPFile(dip,subfile.get(),false).addTo(ret);
        }
 else {
          LOGGER.error("String_Node_Str",subfile.getCause());
          ret.add(subfile.getCause());
        }
      }
    }
 catch (    NotFoundException|GenericException|RequestNotValidException|AuthorizationDeniedException|IOException e) {
      LOGGER.error("String_Node_Str",file,e);
      ret.add(e);
    }
  }
  return ret;
}
Program: 188225
Project: 188225
Buggy source:
public static <T extends IsIndexed,S extends Object>ReturnWithExceptions<Void,S> create(SolrClient index,Class<T> classToCreate,T instance,S source,boolean commit){
  ReturnWithExceptions<Void,S> ret=new ReturnWithExceptions<>();
  try {
    create(index,getIndexName(classToCreate).get(0),toSolrDocument(classToCreate,instance),source).addTo(ret);
    if (commit) {
      commit(index,classToCreate);
    }
  }
 catch (  NotSupportedException|GenericException e) {
    LOGGER.error("String_Node_Str",e);
    ret.add(e);
  }
  return ret;
}

Fixed version (ground truth):
public static <T extends IsIndexed,S extends Object>ReturnWithExceptions<Void,S> create(SolrClient index,Class<T> classToCreate,T instance,S source,boolean commit){
  ReturnWithExceptions<Void,S> ret=new ReturnWithExceptions<>();
  try {
    Optional<SolrInputDocument> solrDocument=toSolrDocument(classToCreate,instance);
    if (solrDocument.isPresent()) {
      create(index,getIndexName(classToCreate).get(0),solrDocument.get(),source).addTo(ret);
      if (commit) {
        commit(index,classToCreate);
      }
    }
  }
 catch (  NotSupportedException|GenericException e) {
    LOGGER.error("String_Node_Str",e);
    ret.add(e);
  }
  return ret;
}
Program: 188226
Project: 188226
Buggy source:
@Override public int hashCode(){
  return super.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=super.hashCode();
  result=prime * result + ((granularity == null) ? 0 : granularity.hashCode());
  result=prime * result + timeZoneOffset;
  result=prime * result + ((toName == null) ? 0 : toName.hashCode());
  return result;
}
Program: 188227
Project: 188227
Buggy source:
@Override public boolean equals(Object obj){
  return super.equals(obj);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  DateIntervalFilterParameter other=(DateIntervalFilterParameter)obj;
  if (granularity != other.granularity)   return false;
  if (timeZoneOffset != other.timeZoneOffset)   return false;
  if (toName == null) {
    if (other.toName != null)     return false;
  }
 else   if (!toName.equals(other.toName))   return false;
  return true;
}
Program: 188228
Project: 188228
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + getGranularity() + "String_Node_Str"+ getFromName()+ "String_Node_Str"+ getToName()+ "String_Node_Str"+ getFromValue()+ "String_Node_Str"+ getToValue()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + getGranularity() + "String_Node_Str"+ getFromName()+ "String_Node_Str"+ getToName()+ "String_Node_Str"+ getFromValue()+ "String_Node_Str"+ getToValue()+ "String_Node_Str"+ getTimeZoneOffset()+ "String_Node_Str";
}
Program: 188229
Project: 188229
Buggy source:
public DateIntervalFilterParameter(DateIntervalFilterParameter dateIntervalFilterParameter){
  this(dateIntervalFilterParameter.getFromName(),dateIntervalFilterParameter.getToName(),dateIntervalFilterParameter.getFromValue(),dateIntervalFilterParameter.getToValue(),dateIntervalFilterParameter.getGranularity());
}

Fixed version (ground truth):
public DateIntervalFilterParameter(DateIntervalFilterParameter dateIntervalFilterParameter){
  this(dateIntervalFilterParameter.getFromName(),dateIntervalFilterParameter.getToName(),dateIntervalFilterParameter.getFromValue(),dateIntervalFilterParameter.getToValue(),dateIntervalFilterParameter.getGranularity(),dateIntervalFilterParameter.getTimeZoneOffset());
}
Program: 188230
Project: 188230
Buggy source:
@Override public int hashCode(){
  return super.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=super.hashCode();
  result=prime * result + ((granularity == null) ? 0 : granularity.hashCode());
  result=prime * result + timeZoneOffset;
  return result;
}
Program: 188231
Project: 188231
Buggy source:
@Override public boolean equals(Object obj){
  return super.equals(obj);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  DateRangeFilterParameter other=(DateRangeFilterParameter)obj;
  if (granularity != other.granularity)   return false;
  if (timeZoneOffset != other.timeZoneOffset)   return false;
  return true;
}
Program: 188232
Project: 188232
Buggy source:
public DateRangeFilterParameter(String name,Date fromValue,Date toValue,DateGranularity granularity){
  super(name,fromValue,toValue);
  this.setGranularity(granularity);
}

Fixed version (ground truth):
public DateRangeFilterParameter(String name,Date fromValue,Date toValue,DateGranularity granularity,int timeZoneOffset){
  super(name,fromValue,toValue);
  this.setGranularity(granularity);
  this.setTimeZoneOffset(timeZoneOffset);
}
Program: 188234
Project: 188234
Buggy source:
private static void appendRangeInterval(StringBuilder ret,String fromKey,String toKey,Date fromValue,Date toValue,DateGranularity granularity,boolean prefixWithANDOperatorIfBuilderNotEmpty){
  if (fromValue != null || toValue != null) {
    appendANDOperator(ret,prefixWithANDOperatorIfBuilderNotEmpty);
    ret.append("String_Node_Str");
    ret.append(fromKey).append("String_Node_Str");
    ret.append(processFromDate(fromValue));
    ret.append("String_Node_Str");
    ret.append(processToDate(toValue,granularity));
    ret.append("String_Node_Str").append("String_Node_Str");
    ret.append(toKey).append("String_Node_Str");
    ret.append(processFromDate(fromValue));
    ret.append("String_Node_Str");
    ret.append(processToDate(toValue,granularity));
    ret.append("String_Node_Str");
    if (fromValue != null && toValue != null) {
      ret.append("String_Node_Str").append("String_Node_Str").append(fromKey).append("String_Node_Str").append(processToDate(fromValue,granularity)).append("String_Node_Str");
      ret.append("String_Node_Str").append(toKey).append("String_Node_Str").append(processFromDate(toValue)).append("String_Node_Str").append("String_Node_Str");
    }
    ret.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private static void appendRangeInterval(StringBuilder ret,String fromKey,String toKey,Date fromValue,Date toValue,DateGranularity granularity,int timeZoneOffset,boolean prefixWithANDOperatorIfBuilderNotEmpty){
  if (fromValue != null || toValue != null) {
    appendANDOperator(ret,prefixWithANDOperatorIfBuilderNotEmpty);
    ret.append("String_Node_Str");
    ret.append(fromKey).append("String_Node_Str");
    ret.append(processFromDate(fromValue));
    ret.append("String_Node_Str");
    ret.append(processToDate(toValue,granularity,timeZoneOffset));
    ret.append("String_Node_Str").append("String_Node_Str");
    ret.append(toKey).append("String_Node_Str");
    ret.append(processFromDate(fromValue));
    ret.append("String_Node_Str");
    ret.append(processToDate(toValue,granularity,timeZoneOffset));
    ret.append("String_Node_Str");
    if (fromValue != null && toValue != null) {
      ret.append("String_Node_Str").append("String_Node_Str").append(fromKey).append("String_Node_Str").append(processToDate(fromValue,granularity,timeZoneOffset)).append("String_Node_Str");
      ret.append("String_Node_Str").append(toKey).append("String_Node_Str").append(processFromDate(toValue)).append("String_Node_Str").append("String_Node_Str");
    }
    ret.append("String_Node_Str");
  }
}
Program: 188235
Project: 188235
Buggy source:
private static String processToDate(Date toValue,DateGranularity granularity,boolean returnAsteriskOnNull){
  final String ret;
  StringBuilder sb=new StringBuilder();
  if (toValue != null) {
    sb.append(DateUtil.getThreadLocalDateFormat().format(toValue));
switch (granularity) {
case YEAR:
      sb.append("String_Node_Str");
    break;
case MONTH:
  sb.append("String_Node_Str");
break;
case DAY:
sb.append("String_Node_Str");
break;
case HOUR:
sb.append("String_Node_Str");
break;
case MINUTE:
sb.append("String_Node_Str");
break;
case SECOND:
sb.append("String_Node_Str");
break;
default :
break;
}
ret=sb.toString();
}
 else {
ret=returnAsteriskOnNull ? "String_Node_Str" : null;
}
return ret;
}

Fixed version (ground truth):
private static String processToDate(Date toValue,DateGranularity granularity,int timeZoneOffset,boolean returnAsteriskOnNull){
  final String ret;
  StringBuilder sb=new StringBuilder();
  if (toValue != null) {
    Date toValueWithoutTimeZone=(Date)toValue.clone();
    toValueWithoutTimeZone.setMinutes(toValueWithoutTimeZone.getMinutes() - timeZoneOffset);
    sb.append(DateUtil.getThreadLocalDateFormat().format(toValueWithoutTimeZone));
switch (granularity) {
case YEAR:
      sb.append("String_Node_Str");
    break;
case MONTH:
  sb.append("String_Node_Str");
break;
case DAY:
sb.append("String_Node_Str");
break;
case HOUR:
sb.append("String_Node_Str");
break;
case MINUTE:
sb.append("String_Node_Str");
break;
case SECOND:
sb.append("String_Node_Str");
break;
default :
break;
}
ret=sb.toString();
}
 else {
ret=returnAsteriskOnNull ? "String_Node_Str" : null;
}
return ret;
}
Program: 188237
Project: 188237
Buggy source:
private void newProcess(SelectedItems<IndexedAIP> aips,AsyncCallback<ActionImpact> callback){
  LastSelectedItemsSingleton.getInstance().setSelectedItems(aips);
  LastSelectedItemsSingleton.getInstance().setLastHistory(HistoryUtils.getCurrentHistoryPath());
  HistoryUtils.newHistory(CreateSelectedJob.RESOLVER,RodaConstants.JOB_PROCESS_ACTION);
  callback.onSuccess(ActionImpact.UPDATED);
}

Fixed version (ground truth):
private void newProcess(SelectedItems<IndexedAIP> aips,AsyncCallback<ActionImpact> callback){
  LastSelectedItemsSingleton.getInstance().setSelectedItems(aips);
  LastSelectedItemsSingleton.getInstance().setLastHistory(HistoryUtils.getCurrentHistoryPath());
  HistoryUtils.newHistory(CreateSelectedJob.RESOLVER,RodaConstants.JOB_PROCESS_ACTION);
  callback.onSuccess(ActionImpact.NONE);
}
Program: 188238
Project: 188238
Buggy source:
public void resolve(List<String> historyTokens,AsyncCallback<Widget> callback){
  gettingFilterResults=true;
  createPanel.setVisible(false);
  resultsPanel.setVisible(false);
  if (historyTokens.size() == 2) {
    filter=createFilterAndSubtitleFromHistoryTokens(historyTokens);
    String[] parts=RepresentationInformationUtils.breakFilterIntoParts(historyTokens.get(1));
    createPanelTitle.setHTML(messages.representationInformationNoAssociations(parts[0],parts[1],parts[2]));
    resultsPanelTitle.setHTML(messages.representationInformationAssociatedWith(parts[0],parts[1],parts[2]));
    description.setHTML(messages.representationInformationAssociatedWithDescription(parts[0],parts[1],parts[2]));
    addWithAssociationDialogTitle=messages.representationInformationAssociateWith(parts[0],parts[1],parts[2]);
    searchPanel.setDefaultFilter(filter,true);
    representationInformationList.setFilter(filter);
    searchPanel.clearSearchInputBox();
    callback.onSuccess(this);
  }
 else {
    HistoryUtils.newHistory(RESOLVER);
    callback.onSuccess(null);
  }
}

Fixed version (ground truth):
public void resolve(List<String> historyTokens,AsyncCallback<Widget> callback){
  gettingFilterResults=true;
  createPanel.setVisible(false);
  resultsPanel.setVisible(false);
  if (historyTokens.size() == 2) {
    Filter filter=createFilterAndSubtitleFromHistoryTokens(historyTokens);
    String[] parts=RepresentationInformationUtils.breakFilterIntoParts(historyTokens.get(1));
    createPanelTitle.setHTML(messages.representationInformationNoAssociations(parts[0],parts[1],parts[2]));
    resultsPanelTitle.setHTML(messages.representationInformationAssociatedWith(parts[0],parts[1],parts[2]));
    description.setHTML(messages.representationInformationAssociatedWithDescription(parts[0],parts[1],parts[2]));
    addWithAssociationDialogTitle=messages.representationInformationAssociateWith(parts[0],parts[1],parts[2]);
    searchPanel.setDefaultFilter(filter,true);
    representationInformationList.setFilter(filter);
    searchPanel.clearSearchInputBox();
    callback.onSuccess(this);
  }
 else {
    HistoryUtils.newHistory(RESOLVER);
    callback.onSuccess(null);
  }
}
Program: 188241
Project: 188241
Buggy source:
/** 
 * Representation information dialog 
 */
String representationInformationChooseOptionLabel();

Fixed version (ground truth):
String representationInformationChooseOptionLabel();
Program: 188243
Project: 188243
Buggy source:
@Override public void onClick(ClickEvent event){
  relations.get(translations.get(relation.getValue().getRelationType())).remove(relation);
  listRelations();
  DomEvent.fireNativeEvent(Document.get().createChangeEvent(),IncrementalRelationList.this);
}

Fixed version (ground truth):
@Override public void onClick(ClickEvent event){
  relations.get(translations.get(relation.getValue().getObjectType()).get(relation.getValue().getRelationType())).remove(relation);
  listRelations();
  DomEvent.fireNativeEvent(Document.get().createChangeEvent(),IncrementalRelationList.this);
}
Program: 188244
Project: 188244
Buggy source:
private void addRelation(final RepresentationInformationRelation element,final boolean redesign,final Map<RelationObjectType,Map<String,String>> translations){
  final RemovableRelation relation=new RemovableRelation(element);
  String relationType=translations.get(element.getObjectType()).get(element.getRelationType());
  if (relations.containsKey(relationType)) {
    relations.get(relationType).add(relation);
  }
 else {
    List<RemovableRelation> list=new ArrayList<>();
    list.add(relation);
    relations.put(relationType,list);
  }
  relation.addRemoveClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      relations.get(translations.get(relation.getValue().getRelationType())).remove(relation);
      listRelations();
      DomEvent.fireNativeEvent(Document.get().createChangeEvent(),IncrementalRelationList.this);
    }
  }
);
  DomEvent.fireNativeEvent(Document.get().createChangeEvent(),IncrementalRelationList.this);
  if (redesign) {
    listRelations();
  }
}

Fixed version (ground truth):
private void addRelation(final RepresentationInformationRelation element,final boolean redesign,final Map<RelationObjectType,Map<String,String>> translations){
  final RemovableRelation relation=new RemovableRelation(element);
  String relationType=translations.get(element.getObjectType()).get(element.getRelationType());
  if (relations.containsKey(relationType)) {
    relations.get(relationType).add(relation);
  }
 else {
    List<RemovableRelation> list=new ArrayList<>();
    list.add(relation);
    relations.put(relationType,list);
  }
  relation.addRemoveClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      relations.get(translations.get(relation.getValue().getObjectType()).get(relation.getValue().getRelationType())).remove(relation);
      listRelations();
      DomEvent.fireNativeEvent(Document.get().createChangeEvent(),IncrementalRelationList.this);
    }
  }
);
  DomEvent.fireNativeEvent(Document.get().createChangeEvent(),IncrementalRelationList.this);
  if (redesign) {
    listRelations();
  }
}
Program: 188248
Project: 188248
Buggy source:
public static void create(FlowPanel panel,Set<MetadataValue> bundle,boolean addStyle){
  for (  MetadataValue mv : bundle) {
    boolean mandatory=(mv.get("String_Node_Str") != null && "String_Node_Str".equalsIgnoreCase(mv.get("String_Node_Str"))) ? true : false;
    if (mv.get("String_Node_Str") != null && "String_Node_Str".equals(mv.get("String_Node_Str"))) {
      continue;
    }
    FlowPanel layout=new FlowPanel();
    if (addStyle) {
      layout.addStyleName("String_Node_Str");
    }
    String controlType=mv.get("String_Node_Str");
    if (controlType == null) {
      addTextField(panel,layout,mv,mandatory);
    }
 else {
switch (controlType) {
case "String_Node_Str":
        addTextField(panel,layout,mv,mandatory);
      break;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    addTextArea(panel,layout,mv,mandatory);
  break;
case "String_Node_Str":
addList(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
addDatePicker(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
layout.addStyleName("String_Node_Str");
addSeparator(panel,layout,mv);
break;
default :
addTextField(panel,layout,mv,mandatory);
break;
}
}
}
}

Fixed version (ground truth):
public static void create(FlowPanel panel,Set<MetadataValue> bundle,boolean addStyle){
  for (  MetadataValue mv : bundle) {
    boolean mandatory=(mv.get("String_Node_Str") != null && "String_Node_Str".equalsIgnoreCase(mv.get("String_Node_Str"))) ? true : false;
    if (mv.get("String_Node_Str") != null && "String_Node_Str".equals(mv.get("String_Node_Str"))) {
      continue;
    }
    FlowPanel layout=new FlowPanel();
    if (addStyle) {
      layout.addStyleName("String_Node_Str");
    }
    String controlType=mv.get("String_Node_Str");
    if (controlType == null) {
      addTextField(panel,layout,mv,mandatory);
    }
 else {
switch (controlType) {
case "String_Node_Str":
        addTextField(panel,layout,mv,mandatory);
      break;
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
    addTextArea(panel,layout,mv,mandatory);
  break;
case "String_Node_Str":
addRichTextArea(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
addList(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
addDatePicker(panel,layout,mv,mandatory);
break;
case "String_Node_Str":
layout.addStyleName("String_Node_Str");
addSeparator(panel,layout,mv);
break;
default :
addTextField(panel,layout,mv,mandatory);
break;
}
}
}
}
Program: 188249
Project: 188249
Buggy source:
public static RepresentationInformationExtraBundle retrieveRepresentationInformationExtraBundle(User user,RepresentationInformation ri,Locale locale) throws AuthorizationDeniedException {
  final ControllerAssistant controllerAssistant=new ControllerAssistant(){
  }
;
  LOG_ENTRY_STATE state=LOG_ENTRY_STATE.SUCCESS;
  RepresentationInformationExtraBundle extra=null;
  controllerAssistant.checkRoles(user);
  try {
    extra=BrowserHelper.retrieveRepresentationInformationExtraBundle(ri,locale);
  }
 catch (  Exception e) {
    state=LOG_ENTRY_STATE.FAILURE;
  }
  controllerAssistant.registerAction(user,state,RodaConstants.CONTROLLER_REPRESENTATION_INFORMATION_PARAM,ri);
  return extra;
}

Fixed version (ground truth):
public static RepresentationInformationExtraBundle retrieveRepresentationInformationExtraBundle(User user,RepresentationInformation ri,Locale locale) throws AuthorizationDeniedException {
  final ControllerAssistant controllerAssistant=new ControllerAssistant(){
  }
;
  LOG_ENTRY_STATE state=LOG_ENTRY_STATE.SUCCESS;
  controllerAssistant.checkRoles(user);
  RepresentationInformationExtraBundle extra=BrowserHelper.retrieveRepresentationInformationExtraBundle(ri,locale);
  controllerAssistant.registerAction(user,state,RodaConstants.CONTROLLER_REPRESENTATION_INFORMATION_PARAM,ri);
  return extra;
}
Program: 188251
Project: 188251
Buggy source:
public void setRepresentationInformation(RepresentationInformation ri){
  this.name.setText(ri.getName());
  this.description.setText(ri.getDescription());
  int index=0;
  for (int i=0; i < this.family.getItemCount(); i++) {
    if (this.family.getValue(i).equals(ri.getFamily())) {
      index=i;
    }
  }
  this.family.setSelectedIndex(index);
  this.categories.setTextBoxList(ri.getCategories());
  for (int i=0; i < support.getItemCount(); i++) {
    if (support.getValue(i).equals(ri.getSupport().toString())) {
      support.setSelectedIndex(i);
      break;
    }
  }
  this.relations.setRelationList(ri.getRelations());
  this.filters.setFilters(ri.getFilters());
  BrowserService.Util.getInstance().retrieveRepresentationInformationExtraBundle(ri,LocaleInfo.getCurrentLocale().getLocaleName(),new AsyncCallback<RepresentationInformationExtraBundle>(){
    @Override public void onFailure(    Throwable caught){
      AsyncCallbackUtils.defaultFailureTreatment(caught);
    }
    @Override public void onSuccess(    RepresentationInformationExtraBundle extra){
      RepresentationInformationDataPanel.this.extraBundle=extra;
      extras.clear();
      FormUtilities.create(extras,extra.getFamilyValues().get(family.getSelectedValue()),false);
    }
  }
);
}

Fixed version (ground truth):
public void setRepresentationInformation(RepresentationInformation ri){
  this.name.setText(ri.getName());
  this.description.setText(ri.getDescription());
  int index=0;
  for (int i=0; i < this.family.getItemCount(); i++) {
    if (this.family.getValue(i).equals(ri.getFamily())) {
      index=i;
    }
  }
  this.family.setSelectedIndex(index);
  this.categories.setTextBoxList(ri.getCategories());
  for (int i=0; i < support.getItemCount(); i++) {
    if (support.getValue(i).equals(ri.getSupport().toString())) {
      support.setSelectedIndex(i);
      break;
    }
  }
  this.relations.setRelationList(ri.getRelations());
  this.filters.setFilters(ri.getFilters());
}
Program: 188254
Project: 188254
Buggy source:
private void doFilterWithCredentials(final HttpServletRequest request,final HttpServletResponse response,final FilterChain filterChain,final String username,final String password) throws GenericException, IOException, ServletException, AuthenticationDeniedException {
  if (UserUtility.getLdapUtility().isInternal(username)) {
    final User user=UserUtility.getLdapUtility().getAuthenticatedUser(username,password);
    user.setIpAddress(request.getRemoteAddr());
    UserUtility.setUser(request,user);
  }
 else {
    final String tgt=this.casClient.getTicketGrantingTicket(username,password);
    doFilterWithTGT(request,response,filterChain,tgt);
  }
}

Fixed version (ground truth):
private void doFilterWithCredentials(final HttpServletRequest request,final HttpServletResponse response,final FilterChain filterChain,final String username,final String password) throws GenericException, IOException, ServletException, AuthenticationDeniedException {
  if (UserUtility.getLdapUtility().isInternal(username)) {
    final User user=UserUtility.getLdapUtility().getAuthenticatedUser(username,password);
    user.setIpAddress(request.getRemoteAddr());
    UserUtility.setUser(request,user);
    filterChain.doFilter(request,response);
  }
 else {
    final String tgt=this.casClient.getTicketGrantingTicket(username,password);
    doFilterWithTGT(request,response,filterChain,tgt);
  }
}
Program: 188255
Project: 188255
Buggy source:
private static void instantiateTestNodeSpecificObjects(){
  if (TEST_DEPLOY_LDAP) {
    startApacheDS();
  }
  if (TEST_DEPLOY_SCANNER) {
    instantiateTransferredResourcesScanner();
  }
  if (TEST_DEPLOY_ORCHESTRATOR) {
    pluginOrchestrator=new AkkaEmbeddedPluginOrchestrator();
  }
}

Fixed version (ground truth):
private static void instantiateTestNodeSpecificObjects(){
  if (TEST_DEPLOY_LDAP) {
    startApacheDS();
  }
 else   if (TEST_DEPLOY_SOLR) {
    try {
      getIndexService().create(RODAMember.class,new User(RodaConstants.ADMIN));
      getIndexService().commit(RODAMember.class);
    }
 catch (    GenericException|RequestNotValidException e) {
      LOGGER.warn("String_Node_Str",e);
    }
  }
  if (TEST_DEPLOY_SCANNER) {
    instantiateTransferredResourcesScanner();
  }
  if (TEST_DEPLOY_ORCHESTRATOR) {
    pluginOrchestrator=new AkkaEmbeddedPluginOrchestrator();
  }
}
Program: 188256
Project: 188256
Buggy source:
private void ensureAllContainersExist(){
  try {
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_AIP);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_PRESERVATION);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_ACTIONLOG);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_JOB);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_JOB_REPORT);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_RISK);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_RISK_INCIDENCE);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_DIP);
  }
 catch (  RequestNotValidException|GenericException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void ensureAllContainersExist(){
  try {
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_AIP);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_PRESERVATION);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_ACTIONLOG);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_JOB);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_JOB_REPORT);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_RISK);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_RISK_INCIDENCE);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_DIP);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_REPRESENTATION_INFORMATION);
    createContainerIfNotExists(RodaConstants.STORAGE_CONTAINER_FORMAT);
  }
 catch (  RequestNotValidException|GenericException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 188258
Project: 188258
Buggy source:
private static void doJobCleanup(ModelService model,IterableIndexResult<IndexedAIP> results){
  for (  IndexedAIP indexedAIP : results) {
    try {
      LOGGER.info("String_Node_Str",indexedAIP.getId());
      model.deleteAIP(indexedAIP.getId());
    }
 catch (    RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private static void doJobCleanup(ModelService model,List<String> aipIds){
  for (  String aipId : aipIds) {
    try {
      LOGGER.info("String_Node_Str",aipId);
      model.deleteAIP(aipId);
    }
 catch (    RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 188259
Project: 188259
Buggy source:
public static void doJobObjectsCleanup(Job job,ModelService model,IndexService index){
  if (RodaCoreFactory.getNodeType() == NodeType.MASTER) {
    try {
      index.commit(IndexedAIP.class);
      Filter filter=new Filter();
      filter.add(new SimpleFilterParameter(RodaConstants.INGEST_JOB_ID,job.getId()));
      filter.add(new OneOfManyFilterParameter(RodaConstants.AIP_STATE,Arrays.asList(AIPState.CREATED.toString(),AIPState.INGEST_PROCESSING.toString())));
      doJobCleanup(model,index.findAll(IndexedAIP.class,filter,false,Arrays.asList(RodaConstants.INDEX_UUID)));
    }
 catch (    GenericException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public static void doJobObjectsCleanup(Job job,ModelService model,IndexService index){
  if (RodaCoreFactory.getNodeType() == NodeType.MASTER) {
    try {
      index.commit(IndexedAIP.class);
      Filter filter=new Filter();
      filter.add(new SimpleFilterParameter(RodaConstants.INGEST_JOB_ID,job.getId()));
      filter.add(new OneOfManyFilterParameter(RodaConstants.AIP_STATE,Arrays.asList(AIPState.CREATED.toString(),AIPState.INGEST_PROCESSING.toString())));
      List<String> aipIds=new ArrayList<>();
      index.findAll(IndexedAIP.class,filter,false,Arrays.asList(RodaConstants.INDEX_UUID)).forEach(e -> aipIds.add(e.getUUID()));
      ;
      doJobCleanup(model,aipIds);
    }
 catch (    GenericException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 188263
Project: 188263
Buggy source:
public static String getVersion(){
  String version=null;
  try {
    String siegfriedPath=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    List<String> command=new ArrayList<>(Arrays.asList(siegfriedPath,"String_Node_Str"));
    String siegfriedOutput=CommandUtility.execute(command);
    StringBuilder result=new StringBuilder("String_Node_Str");
    if (siegfriedOutput.contains("String_Node_Str")) {
      result.append(siegfriedOutput.split("String_Node_Str")[0].split("String_Node_Str")[1]);
    }
    if (siegfriedOutput.contains("String_Node_Str")) {
      result.append("String_Node_Str");
      Pattern pattern=Pattern.compile("String_Node_Str");
      Matcher matcher=pattern.matcher(siegfriedOutput);
      if (matcher.find()) {
        result.append(matcher.group(0));
      }
    }
    return result.toString();
  }
 catch (  CommandException ce) {
    LOGGER.error("String_Node_Str" + ce.getMessage(),ce);
  }
  return version;
}

Fixed version (ground truth):
public static String getVersion(){
  try {
    String siegfriedPath=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    List<String> command=new ArrayList<>(Arrays.asList(siegfriedPath,"String_Node_Str"));
    String siegfriedOutput=CommandUtility.execute(command);
    StringBuilder result=new StringBuilder("String_Node_Str");
    if (siegfriedOutput.contains("String_Node_Str")) {
      result.append(siegfriedOutput.split("String_Node_Str")[0].split("String_Node_Str")[1]);
    }
    if (siegfriedOutput.contains("String_Node_Str")) {
      result.append("String_Node_Str");
      Pattern pattern=Pattern.compile("String_Node_Str");
      Matcher matcher=pattern.matcher(siegfriedOutput);
      if (matcher.find()) {
        result.append(matcher.group(0));
      }
    }
    return result.toString();
  }
 catch (  CommandException ce) {
    LOGGER.error("String_Node_Str" + ce.getMessage(),ce);
  }
  return null;
}
Program: 188264
Project: 188264
Buggy source:
public static <T extends IsRODAObject>List<LinkingIdentifier> runSiegfriedOnFile(Plugin<T> plugin,ModelService model,File file) throws GenericException, RequestNotValidException, AlreadyExistsException, NotFoundException, AuthorizationDeniedException, PluginException {
  StoragePath fileStoragePath=ModelUtils.getFileStoragePath(file);
  DirectResourceAccess directAccess=model.getStorage().getDirectAccess(fileStoragePath);
  Path filePath=directAccess.getPath();
  List<LinkingIdentifier> sources=runSiegfriedOnRepresentationOrFile(plugin,model,file.getAipId(),file.getRepresentationId(),file.getPath(),file.getId(),filePath);
  IOUtils.closeQuietly(directAccess);
  model.notifyFileUpdated(file);
  return sources;
}

Fixed version (ground truth):
public static <T extends IsRODAObject>List<LinkingIdentifier> runSiegfriedOnFile(ModelService model,File file) throws GenericException, RequestNotValidException, AlreadyExistsException, NotFoundException, AuthorizationDeniedException, PluginException {
  StoragePath fileStoragePath=ModelUtils.getFileStoragePath(file);
  DirectResourceAccess directAccess=model.getStorage().getDirectAccess(fileStoragePath);
  Path filePath=directAccess.getPath();
  List<LinkingIdentifier> sources=runSiegfriedOnRepresentationOrFile(model,file.getAipId(),file.getRepresentationId(),file.getPath(),file.getId(),filePath);
  IOUtils.closeQuietly(directAccess);
  model.notifyFileUpdated(file);
  return sources;
}
Program: 188265
Project: 188265
Buggy source:
public static <T extends IsRODAObject>List<LinkingIdentifier> runSiegfriedOnRepresentation(Plugin<T> plugin,ModelService model,Representation representation) throws GenericException, RequestNotValidException, AlreadyExistsException, NotFoundException, AuthorizationDeniedException, PluginException {
  StoragePath representationDataPath=ModelUtils.getRepresentationDataStoragePath(representation.getAipId(),representation.getId());
  DirectResourceAccess directAccess=model.getStorage().getDirectAccess(representationDataPath);
  Path representationFsPath=directAccess.getPath();
  List<LinkingIdentifier> sources=runSiegfriedOnRepresentationOrFile(plugin,model,representation.getAipId(),representation.getId(),new ArrayList<>(),null,representationFsPath);
  IOUtils.closeQuietly(directAccess);
  return sources;
}

Fixed version (ground truth):
public static <T extends IsRODAObject>List<LinkingIdentifier> runSiegfriedOnRepresentation(ModelService model,Representation representation) throws GenericException, RequestNotValidException, AlreadyExistsException, NotFoundException, AuthorizationDeniedException, PluginException {
  StoragePath representationDataPath=ModelUtils.getRepresentationDataStoragePath(representation.getAipId(),representation.getId());
  DirectResourceAccess directAccess=model.getStorage().getDirectAccess(representationDataPath);
  Path representationFsPath=directAccess.getPath();
  List<LinkingIdentifier> sources=runSiegfriedOnRepresentationOrFile(model,representation.getAipId(),representation.getId(),new ArrayList<>(),null,representationFsPath);
  IOUtils.closeQuietly(directAccess);
  return sources;
}
Program: 188267
Project: 188267
Buggy source:
private static void bootstrap(CloudSolrClient cloudSolrClient,Path solrHome){
  CollectionAdminRequest.List req=new CollectionAdminRequest.List();
  try {
    CollectionAdminResponse response=req.process(cloudSolrClient);
    @SuppressWarnings("String_Node_Str") List<String> existingCollections=(List<String>)response.getResponse().get("String_Node_Str");
    if (existingCollections == null) {
      existingCollections=new ArrayList<>();
    }
    Map<String,Path> defaultCollections=getDefaultCollections(solrHome);
    for (    String defaultCollection : defaultCollections.keySet()) {
      if (!existingCollections.contains(defaultCollections)) {
        createCollection(cloudSolrClient,defaultCollection,defaultCollections.get(defaultCollection));
      }
    }
  }
 catch (  SolrServerException|IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private static void bootstrap(CloudSolrClient cloudSolrClient,Path solrHome){
  CollectionAdminRequest.List req=new CollectionAdminRequest.List();
  try {
    CollectionAdminResponse response=req.process(cloudSolrClient);
    @SuppressWarnings("String_Node_Str") List<String> existingCollections=(List<String>)response.getResponse().get("String_Node_Str");
    if (existingCollections == null) {
      existingCollections=new ArrayList<>();
    }
    Map<String,Path> defaultCollections=getDefaultCollections(solrHome);
    for (    String defaultCollection : defaultCollections.keySet()) {
      if (!existingCollections.contains(defaultCollection)) {
        createCollection(cloudSolrClient,defaultCollection,defaultCollections.get(defaultCollection));
      }
    }
  }
 catch (  SolrServerException|IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 188268
Project: 188268
Buggy source:
private static void createCollection(CloudSolrClient cloudSolrClient,String collection,Path configPath){
  CollectionAdminRequest.Create req=new CollectionAdminRequest.Create();
  try {
    LOGGER.info("String_Node_Str",collection);
    Path collectionConf=configPath.resolve("String_Node_Str");
    Path solrCoreProperties=collectionConf.resolve("String_Node_Str");
    try (BufferedWriter solrCorePropertiesWriter=Files.newBufferedWriter(solrCoreProperties)){
      IOUtils.write(String.format("String_Node_Str",collection,collection.toLowerCase()),solrCorePropertiesWriter);
    }
     cloudSolrClient.uploadConfig(collectionConf,collection);
    req.setCollectionName(collection).setConfigName(collection);
    req.setNumShards(getEnvInt("String_Node_Str",1));
    req.setReplicationFactor(getEnvInt("String_Node_Str",1));
    req.setAutoAddReplicas(getEnvBoolean("String_Node_Str",false));
    CollectionAdminResponse response=req.process(cloudSolrClient);
    if (!response.isSuccess()) {
      LOGGER.error("String_Node_Str",collection,response.getErrorMessages());
    }
  }
 catch (  SolrServerException|IOException e) {
    LOGGER.error("String_Node_Str",collection,e);
  }
}

Fixed version (ground truth):
private static void createCollection(CloudSolrClient cloudSolrClient,String collection,Path configPath){
  CollectionAdminRequest.Create req=new CollectionAdminRequest.Create();
  try {
    LOGGER.info("String_Node_Str",collection);
    Path collectionConf=configPath.resolve("String_Node_Str");
    Path solrCoreProperties=collectionConf.resolve("String_Node_Str");
    try (BufferedWriter solrCorePropertiesWriter=Files.newBufferedWriter(solrCoreProperties)){
      IOUtils.write(String.format("String_Node_Str",collection,collection.toLowerCase()),solrCorePropertiesWriter);
    }
     cloudSolrClient.uploadConfig(collectionConf,collection);
    req.setCollectionName(collection).setConfigName(collection);
    req.setNumShards(getEnvInt("String_Node_Str",1));
    req.setReplicationFactor(getEnvInt("String_Node_Str",1));
    req.setAutoAddReplicas(getEnvBoolean("String_Node_Str",false));
    CollectionAdminResponse response=req.process(cloudSolrClient);
    if (!response.isSuccess()) {
      LOGGER.error("String_Node_Str",collection,response.getErrorMessages());
    }
  }
 catch (  SolrServerException|SolrException|IOException e) {
    LOGGER.error("String_Node_Str",collection,e);
  }
}
Program: 188269
Project: 188269
Buggy source:
@Override public ReturnWithExceptions<Void> representationCreated(Representation representation){
  ReturnWithExceptions<Void> exceptions=new ReturnWithExceptions<>();
  try {
    AIP aip=model.retrieveAIP(representation.getAipId());
    List<String> ancestors=SolrUtils.getAncestors(aip.getParentId(),model);
    ReturnWithExceptions<Void> representationExceptions=indexRepresentation(aip,representation,ancestors);
    exceptions.addExceptions(representationExceptions.getExceptions());
    ReturnWithExceptions<Void> eventExceptions=indexPreservationsEvents(aip.getId(),representation.getId());
    exceptions.addExceptions(eventExceptions.getExceptions());
  }
 catch (  RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",representation,e);
  }
  return exceptions;
}

Fixed version (ground truth):
@Override public ReturnWithExceptions<Void> representationCreated(Representation representation){
  ReturnWithExceptions<Void> exceptions=new ReturnWithExceptions<>();
  try {
    AIP aip=model.retrieveAIP(representation.getAipId());
    List<String> ancestors=SolrUtils.getAncestors(aip.getParentId(),model);
    ReturnWithExceptions<Void> representationExceptions=indexRepresentation(aip,representation,ancestors);
    exceptions.addExceptions(representationExceptions.getExceptions());
    ReturnWithExceptions<Void> eventExceptions=indexPreservationsEvents(aip.getId(),representation.getId());
    exceptions.addExceptions(eventExceptions.getExceptions());
    if (aip.getRepresentations().size() == 1) {
      SolrInputDocument doc=SolrUtils.updateAIPHasRepresentations(aip.getId(),true);
      index.add(RodaConstants.INDEX_AIP,doc);
    }
  }
 catch (  RequestNotValidException|NotFoundException|GenericException|AuthorizationDeniedException e) {
    LOGGER.error("String_Node_Str",representation,e);
  }
catch (  SolrServerException|IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return exceptions;
}
Program: 188270
Project: 188270
Buggy source:
@Override public void representationDeleted(String aipId,String representationId,boolean deleteIncidences){
  String representationUUID=IdUtils.getRepresentationId(aipId,representationId);
  deleteDocumentFromIndex(IndexedRepresentation.class,representationUUID);
  deleteDocumentsFromIndex(IndexedFile.class,RodaConstants.FILE_REPRESENTATION_UUID,representationUUID);
  deleteDocumentsFromIndex(IndexedPreservationEvent.class,RodaConstants.PRESERVATION_EVENT_REPRESENTATION_UUID,representationUUID);
  if (deleteIncidences) {
    deleteDocumentsFromIndex(RiskIncidence.class,RodaConstants.RISK_INCIDENCE_REPRESENTATION_ID,representationId);
  }
}

Fixed version (ground truth):
@Override public void representationDeleted(String aipId,String representationId,boolean deleteIncidences){
  String representationUUID=IdUtils.getRepresentationId(aipId,representationId);
  deleteDocumentFromIndex(IndexedRepresentation.class,representationUUID);
  deleteDocumentsFromIndex(IndexedFile.class,RodaConstants.FILE_REPRESENTATION_UUID,representationUUID);
  deleteDocumentsFromIndex(IndexedPreservationEvent.class,RodaConstants.PRESERVATION_EVENT_REPRESENTATION_UUID,representationUUID);
  if (deleteIncidences) {
    deleteDocumentsFromIndex(RiskIncidence.class,RodaConstants.RISK_INCIDENCE_REPRESENTATION_ID,representationId);
  }
  try {
    AIP aip=model.retrieveAIP(aipId);
    if (aip.getRepresentations().size() == 0) {
      SolrInputDocument doc=SolrUtils.updateAIPHasRepresentations(aipId,false);
      index.add(RodaConstants.INDEX_AIP,doc);
    }
  }
 catch (  AuthorizationDeniedException|RequestNotValidException|NotFoundException|GenericException|SolrServerException|IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 188273
Project: 188273
Buggy source:
public boolean hasObjects(Class<? extends IsRODAObject> objectClass){
  try {
    if (LogEntry.class.equals(objectClass) || RODAMember.class.equals(objectClass) || TransferredResource.class.equals(objectClass)|| IndexedPreservationAgent.class.equals(objectClass)) {
      return true;
    }
 else {
      StoragePath storagePath=ModelUtils.getContainerPath(objectClass);
      try {
        return RodaCoreFactory.getStorageService().countResourcesUnderContainer(storagePath,false).intValue() > 0;
      }
 catch (      NotFoundException e) {
      }
    }
    return false;
  }
 catch (  RODAException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean hasObjects(Class<? extends IsRODAObject> objectClass){
  try {
    if (LogEntry.class.equals(objectClass) || RODAMember.class.equals(objectClass) || TransferredResource.class.equals(objectClass)|| IndexedPreservationAgent.class.equals(objectClass)|| IndexedAIP.class.equals(objectClass)) {
      return true;
    }
 else {
      StoragePath storagePath=ModelUtils.getContainerPath(objectClass);
      try {
        return RodaCoreFactory.getStorageService().countResourcesUnderContainer(storagePath,false).intValue() > 0;
      }
 catch (      NotFoundException e) {
      }
    }
    return false;
  }
 catch (  RODAException e) {
    return false;
  }
}