nus-yam/ex-repair huggingface dataset:
Program: 188603
Project: 188603
Buggy source:
public void init(List<PluginInfo> plugins){
  this.plugins=plugins;
  name.setText(messages.processNewDefaultName(new Date()));
  workflowOptions.setPlugins(plugins);
  updateObjectList();
  configurePlugins(selected.getSelectedClass());
  workflowCategoryList.addStyleName("String_Node_Str");
  workflowList.addChangeHandler(new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      String selectedPluginId=workflowList.getSelectedValue();
      if (selectedPluginId != null) {
        CreateJob.this.selectedPlugin=lookupPlugin(selectedPluginId);
      }
      updateWorkflowOptions();
    }
  }
);
}

Fixed version (ground truth):
public void init(List<PluginInfo> plugins){
  this.plugins=plugins;
  name.setText(messages.processNewDefaultName(new Date()));
  workflowOptions.setPlugins(plugins);
  configurePlugins(selected.getSelectedClass());
  workflowCategoryList.addStyleName("String_Node_Str");
  workflowList.addChangeHandler(new ChangeHandler(){
    @Override public void onChange(    ChangeEvent event){
      String selectedPluginId=workflowList.getSelectedValue();
      if (selectedPluginId != null) {
        CreateJob.this.selectedPlugin=lookupPlugin(selectedPluginId);
      }
      updateWorkflowOptions();
    }
  }
);
}
Program: 188605
Project: 188605
Buggy source:
@Override public boolean updateObjectList(){
  SelectedItems selected=getSelected();
  boolean isEmpty=false;
  if (selected != null) {
    if (selected instanceof SelectedItemsList) {
      List<String> ids=((SelectedItemsList)selected).getIds();
      Filter filter=new Filter(new OneOfManyFilterParameter(RodaConstants.TRANSFERRED_RESOURCE_UUID,ids));
      TransferredResourceList list=new TransferredResourceList(filter,null,messages.transferredResourcesTitle(),false,10,10);
      getTargetPanel().clear();
      getTargetPanel().add(list);
    }
 else     if (selected instanceof SelectedItemsFilter) {
      Filter filter=((SelectedItemsFilter)selected).getFilter();
      TransferredResourceList list=new TransferredResourceList(filter,null,messages.transferredResourcesTitle(),false,10,10);
      getTargetPanel().clear();
      getTargetPanel().add(list);
    }
 else {
      isEmpty=true;
    }
    setJobSelectedDescription(messages.createJobSelectedSIP());
  }
  return isEmpty;
}

Fixed version (ground truth):
@Override public boolean updateObjectList(){
  SelectedItems selected=getSelected();
  boolean isEmpty=false;
  if (selected != null) {
    if (selected instanceof SelectedItemsList) {
      List<String> ids=((SelectedItemsList)selected).getIds();
      Filter filter=new Filter(new OneOfManyFilterParameter(RodaConstants.TRANSFERRED_RESOURCE_UUID,ids));
      TransferredResourceList list=new TransferredResourceList(filter,null,messages.transferredResourcesTitle(),false,10,10);
      getTargetPanel().clear();
      getTargetPanel().add(list);
      isEmpty=ids.isEmpty();
    }
 else     if (selected instanceof SelectedItemsFilter) {
      Filter filter=((SelectedItemsFilter)selected).getFilter();
      TransferredResourceList list=new TransferredResourceList(filter,null,messages.transferredResourcesTitle(),false,10,10);
      getTargetPanel().clear();
      getTargetPanel().add(list);
    }
 else {
      isEmpty=true;
    }
    setJobSelectedDescription(messages.createJobSelectedSIP());
  }
 else {
    isEmpty=true;
  }
  return isEmpty;
}
Program: 188608
Project: 188608
Buggy source:
@Override public void onChange(ChangeEvent event){
  IncrementalAssociativeList sourceList=(IncrementalAssociativeList)event.getSource();
  List<String> values=sourceList.getTextBoxesValue();
  if (!values.isEmpty()) {
    value=getValuesString(values);
  }
}

Fixed version (ground truth):
@Override public void onChange(ChangeEvent event){
  value=objectBox.getSelectedValue();
}
Program: 188609
Project: 188609
Buggy source:
private void updateLayout(){
  if (PluginParameterType.BOOLEAN.equals(parameter.getType())) {
    createBooleanLayout();
  }
 else   if (PluginParameterType.STRING.equals(parameter.getType())) {
    createStringLayout();
  }
 else   if (PluginParameterType.PLUGIN_SIP_TO_AIP.equals(parameter.getType())) {
    createPluginSipToAipLayout();
  }
 else   if (PluginParameterType.AIP_ID.equals(parameter.getType())) {
    createSelectAipLayout();
  }
 else   if (PluginParameterType.RISK_ID.equals(parameter.getType())) {
    createSelectRiskLayout();
  }
 else   if (PluginParameterType.SEVERITY.equals(parameter.getType())) {
    createSelectSeverityLayout();
  }
 else {
    logger.warn("String_Node_Str" + parameter.getType() + "String_Node_Str");
    createStringLayout();
  }
}

Fixed version (ground truth):
private void updateLayout(){
  if (PluginParameterType.BOOLEAN.equals(parameter.getType())) {
    createBooleanLayout();
  }
 else   if (PluginParameterType.STRING.equals(parameter.getType())) {
    createStringLayout();
  }
 else   if (PluginParameterType.PLUGIN_SIP_TO_AIP.equals(parameter.getType())) {
    createPluginSipToAipLayout();
  }
 else   if (PluginParameterType.AIP_ID.equals(parameter.getType())) {
    createSelectAipLayout();
  }
 else   if (PluginParameterType.RISK_ID.equals(parameter.getType())) {
    createSelectRiskLayout();
  }
 else   if (PluginParameterType.SEVERITY.equals(parameter.getType())) {
    createSelectSeverityLayout();
  }
 else   if (PluginParameterType.SEVERITY.equals(parameter.getType())) {
    createSelectSeverityLayout();
  }
 else   if (PluginParameterType.RODA_OBJECT.equals(parameter.getType())) {
    createSelectRodaObjectLayout();
  }
 else {
    logger.warn("String_Node_Str" + parameter.getType() + "String_Node_Str");
    createStringLayout();
  }
}
Program: 188610
Project: 188610
Buggy source:
@Override public List<Class<AIP>> getObjectClasses(){
  return Arrays.asList(AIP.class);
}

Fixed version (ground truth):
@Override public List<Class<T>> getObjectClasses(){
  List<Class<? extends IsRODAObject>> list=new ArrayList<>();
  list.add(AIP.class);
  list.add(Risk.class);
  return (List)list;
}
Program: 188611
Project: 188611
Buggy source:
@Override public void setParameterValues(Map<String,String> parameters) throws InvalidParameterException {
  super.setParameterValues(parameters);
  if (parameters.containsKey("String_Node_Str")) {
    riskIds=parameters.get("String_Node_Str");
  }
  if (parameters.containsKey("String_Node_Str")) {
    aipIds=parameters.get("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void setParameterValues(Map<String,String> parameters) throws InvalidParameterException {
  super.setParameterValues(parameters);
}
Program: 188612
Project: 188612
Buggy source:
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<AIP> list) throws PluginException {
  LOGGER.debug("String_Node_Str");
  Report pluginReport=PluginHelper.initPluginReport(this);
  try {
    Filter filter=new Filter();
    int size=0;
    if (riskIds != null) {
      String[] risks=riskIds.split("String_Node_Str");
      size=risks.length;
      for (      String riskId : risks) {
        filter.add(new SimpleFilterParameter(RodaConstants.RISK_INCIDENCE_RISK_ID,riskId));
      }
    }
 else     if (aipIds != null) {
      String[] aips=aipIds.split("String_Node_Str");
      size=aips.length;
      for (      String aipId : aips) {
        filter.add(new SimpleFilterParameter(RodaConstants.RISK_INCIDENCE_AIP_ID,aipId));
      }
    }
    IndexResult<RiskIncidence> incidences=index.find(RiskIncidence.class,filter,Sorter.NONE,new Sublist(0,size));
    for (    RiskIncidence incidence : incidences.getResults()) {
      model.deleteRiskIncidence(incidence.getId(),false);
    }
  }
 catch (  GenericException|NotFoundException|AuthorizationDeniedException|RequestNotValidException e) {
    LOGGER.error("String_Node_Str");
  }
  LOGGER.debug("String_Node_Str");
  return pluginReport;
}

Fixed version (ground truth):
@Override public Report execute(IndexService index,ModelService model,StorageService storage,List<T> list) throws PluginException {
  LOGGER.debug("String_Node_Str");
  Report pluginReport=PluginHelper.initPluginReport(this);
  try {
    SimpleJobPluginInfo jobPluginInfo=PluginHelper.getInitialJobInformation(this,list.size());
    PluginHelper.updateJobInformation(this,jobPluginInfo);
    try {
      Filter filter=new Filter();
      for (      T object : list) {
        if (object instanceof AIP) {
          AIP aip=(AIP)object;
          filter.add(new SimpleFilterParameter(RodaConstants.RISK_INCIDENCE_AIP_ID,aip.getId()));
        }
 else         if (object instanceof Risk) {
          Risk risk=(Risk)object;
          filter.add(new SimpleFilterParameter(RodaConstants.RISK_INCIDENCE_RISK_ID,risk.getId()));
        }
      }
      IndexResult<RiskIncidence> incidences=index.find(RiskIncidence.class,filter,Sorter.NONE,new Sublist(0,list.size()));
      for (      RiskIncidence incidence : incidences.getResults()) {
        model.deleteRiskIncidence(incidence.getId(),false);
      }
      jobPluginInfo.incrementObjectsProcessedWithSuccess(list.size());
      jobPluginInfo.finalizeInfo();
      PluginHelper.updateJobInformation(this,jobPluginInfo);
    }
 catch (    GenericException|NotFoundException|AuthorizationDeniedException|RequestNotValidException e) {
      LOGGER.error("String_Node_Str");
      jobPluginInfo.incrementObjectsProcessedWithFailure(list.size());
    }
  }
 catch (  JobException e) {
    LOGGER.error("String_Node_Str",e);
  }
  LOGGER.debug("String_Node_Str");
  return pluginReport;
}
Program: 188613
Project: 188613
Buggy source:
@Override public Plugin<AIP> cloneMe(){
  return new RiskIncidenceRemoverPlugin();
}

Fixed version (ground truth):
@Override public Plugin<T> cloneMe(){
  return new RiskIncidenceRemoverPlugin();
}
Program: 188614
Project: 188614
Buggy source:
public static String deleteAIP(SelectedItems<IndexedAIP> selected,RodaUser user) throws AuthorizationDeniedException, GenericException, RequestNotValidException, NotFoundException {
  List<String> aipIds=consolidate(user,IndexedAIP.class,selected);
  String parentId=null;
  for (  String aipId : aipIds) {
    AIP aip=RodaCoreFactory.getModelService().retrieveAIP(aipId);
    parentId=aip.getParentId();
    RodaCoreFactory.getModelService().deleteAIP(aip.getId());
    Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.AIP_ANCESTORS,aip.getId()));
    RodaCoreFactory.getIndexService().execute(IndexedAIP.class,filter,new IndexRunnable<IndexedAIP>(){
      @Override public void run(      IndexedAIP item) throws GenericException, RequestNotValidException, AuthorizationDeniedException {
        try {
          RodaCoreFactory.getModelService().deleteAIP(item.getId());
        }
 catch (        NotFoundException e) {
        }
      }
    }
);
  }
  RodaCoreFactory.getIndexService().commitAIPs();
  try {
    Map<String,String> parameters=new HashMap<String,String>();
    parameters.put("String_Node_Str",StringUtils.join(aipIds,"String_Node_Str"));
    Job job=new Job();
    job.setName(RiskIncidenceRemoverPlugin.class.getSimpleName() + "String_Node_Str" + job.getStartDate());
    job.setPlugin(RiskIncidenceRemoverPlugin.class.getName());
    job.setPluginParameters(parameters);
    job.setSourceObjects(new SelectedItemsAll<>(AIP.class.getName()));
    Jobs.createJob(user,job);
  }
 catch (  JobAlreadyStartedException e) {
    LOGGER.error("String_Node_Str");
  }
  return parentId;
}

Fixed version (ground truth):
public static String deleteAIP(SelectedItems<IndexedAIP> selected,RodaUser user) throws AuthorizationDeniedException, GenericException, RequestNotValidException, NotFoundException {
  List<String> aipIds=consolidate(user,IndexedAIP.class,selected);
  try {
    Job job=new Job();
    job.setName(RiskIncidenceRemoverPlugin.class.getSimpleName() + "String_Node_Str" + job.getStartDate());
    job.setPlugin(RiskIncidenceRemoverPlugin.class.getName());
    job.setSourceObjects(SelectedItemsList.create(AIP.class,aipIds));
    Jobs.createJob(user,job);
  }
 catch (  JobAlreadyStartedException e) {
    LOGGER.error("String_Node_Str");
  }
  String parentId=null;
  for (  String aipId : aipIds) {
    AIP aip=RodaCoreFactory.getModelService().retrieveAIP(aipId);
    parentId=aip.getParentId();
    RodaCoreFactory.getModelService().deleteAIP(aip.getId());
    Filter filter=new Filter(new SimpleFilterParameter(RodaConstants.AIP_ANCESTORS,aip.getId()));
    RodaCoreFactory.getIndexService().execute(IndexedAIP.class,filter,new IndexRunnable<IndexedAIP>(){
      @Override public void run(      IndexedAIP item) throws GenericException, RequestNotValidException, AuthorizationDeniedException {
        try {
          RodaCoreFactory.getModelService().deleteAIP(item.getId());
        }
 catch (        NotFoundException e) {
        }
      }
    }
);
  }
  RodaCoreFactory.getIndexService().commitAIPs();
  return parentId;
}
Program: 188615
Project: 188615
Buggy source:
public static void deleteRisk(RodaUser user,SelectedItems<IndexedRisk> selected) throws GenericException, AuthorizationDeniedException, RequestNotValidException, NotFoundException, InvalidParameterException, JobAlreadyStartedException {
  List<String> idList=consolidate(user,IndexedRisk.class,selected);
  for (  String riskId : idList) {
    RodaCoreFactory.getModelService().deleteRisk(riskId,true);
  }
  Map<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",StringUtils.join(idList,"String_Node_Str"));
  Job job=new Job();
  job.setName(RiskIncidenceRemoverPlugin.class.getSimpleName() + "String_Node_Str" + job.getStartDate());
  job.setPlugin(RiskIncidenceRemoverPlugin.class.getName());
  job.setPluginParameters(parameters);
  job.setSourceObjects(new SelectedItemsAll<>(AIP.class.getName()));
  Jobs.createJob(user,job);
}

Fixed version (ground truth):
public static void deleteRisk(RodaUser user,SelectedItems<IndexedRisk> selected) throws GenericException, AuthorizationDeniedException, RequestNotValidException, NotFoundException, InvalidParameterException, JobAlreadyStartedException {
  List<String> idList=consolidate(user,IndexedRisk.class,selected);
  for (  String riskId : idList) {
    RodaCoreFactory.getModelService().deleteRisk(riskId,true);
  }
  Job job=new Job();
  job.setName(RiskIncidenceRemoverPlugin.class.getSimpleName() + "String_Node_Str" + job.getStartDate());
  job.setPlugin(RiskIncidenceRemoverPlugin.class.getName());
  job.setSourceObjects(SelectedItemsList.create(Risk.class,idList));
  Jobs.createJob(user,job);
}
Program: 188616
Project: 188616
Buggy source:
protected static void validateGetAIPRepresentationParams(String acceptFormat) throws RequestNotValidException {
  if (!RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_BIN.equals(acceptFormat) && !RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_JSON.equals(acceptFormat) && !RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_XML.equals(acceptFormat)) {
    throw new RequestNotValidException("String_Node_Str" + RodaConstants.API_QUERY_KEY_ACCEPT_FORMAT + "String_Node_Str"+ Arrays.asList(RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_JSON,RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_XML,RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_BIN));
  }
}

Fixed version (ground truth):
protected static void validateGetAIPRepresentationParams(String acceptFormat) throws RequestNotValidException {
  if (!RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_ZIP.equals(acceptFormat) && !RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_JSON.equals(acceptFormat) && !RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_XML.equals(acceptFormat)) {
    throw new RequestNotValidException("String_Node_Str" + RodaConstants.API_QUERY_KEY_ACCEPT_FORMAT + "String_Node_Str"+ Arrays.asList(RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_JSON,RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_XML,RodaConstants.API_QUERY_VALUE_ACCEPT_FORMAT_ZIP));
  }
}
Program: 188618
Project: 188618
Buggy source:
public AIP(String id,String parentId,String type,AIPState state,Permissions permissions,List<DescriptiveMetadata> descriptiveMetadata,List<Representation> representations){
  super();
  this.id=id;
  this.parentId=parentId;
  this.type=type;
  this.state=state;
  this.permissions=permissions;
  this.descriptiveMetadata=descriptiveMetadata;
  this.representations=representations;
}

Fixed version (ground truth):
public AIP(String id,String parentId,String type,AIPState state,Permissions permissions,List<DescriptiveMetadata> descriptiveMetadata,List<Representation> representations,AIPFormat format,List<Relationship> relationships,Date createdOn,String createdBy,Date updatedOn,String updatedBy){
  super();
  this.id=id;
  this.parentId=parentId;
  this.type=type;
  this.state=state;
  this.permissions=permissions;
  this.relationships=relationships;
  this.descriptiveMetadata=descriptiveMetadata;
  this.representations=representations;
  this.format=format;
  this.createdOn=createdOn;
  this.createdBy=createdBy;
  this.updatedOn=updatedOn;
  this.updatedBy=updatedBy;
}
Program: 188619
Project: 188619
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + '\''+ "String_Node_Str"+ parentId+ '\''+ "String_Node_Str"+ type+ '\''+ "String_Node_Str"+ state+ "String_Node_Str"+ permissions+ "String_Node_Str"+ descriptiveMetadata+ "String_Node_Str"+ representations+ "String_Node_Str"+ ingestSIPId+ '\''+ "String_Node_Str"+ ingestJobId+ '\''+ "String_Node_Str"+ ghost+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + '\''+ "String_Node_Str"+ parentId+ '\''+ "String_Node_Str"+ type+ '\''+ "String_Node_Str"+ state+ "String_Node_Str"+ permissions+ "String_Node_Str"+ descriptiveMetadata+ "String_Node_Str"+ representations+ "String_Node_Str"+ ingestSIPId+ '\''+ "String_Node_Str"+ ingestJobId+ '\''+ "String_Node_Str"+ ghost+ "String_Node_Str"+ format+ "String_Node_Str"+ relationships+ "String_Node_Str"+ createdOn+ "String_Node_Str"+ createdBy+ "String_Node_Str"+ updatedOn+ "String_Node_Str"+ updatedBy+ '}';
}
Program: 188620
Project: 188620
Buggy source:
@Override public ByteArrayInputStream load(String href) throws Exception {
  InputStream in=null;
  ByteArrayOutputStream out=null;
  try {
    in=RodaCoreFactory.getConfigurationFileAsStream(RodaConstants.CROSSWALKS_DISSEMINATION_OTHER_PATH + href);
    out=new ByteArrayOutputStream();
    IOUtils.copy(in,out);
    return new ByteArrayInputStream(out.toByteArray());
  }
  finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

Fixed version (ground truth):
@Override public byte[] load(String href) throws Exception {
  InputStream in=null;
  ByteArrayOutputStream out=null;
  try {
    in=RodaCoreFactory.getConfigurationFileAsStream(RodaConstants.CROSSWALKS_DISSEMINATION_OTHER_PATH + href);
    out=new ByteArrayOutputStream();
    IOUtils.copy(in,out);
    return out.toByteArray();
  }
  finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}
Program: 188621
Project: 188621
Buggy source:
@Override public Source resolve(String href,String base) throws TransformerException {
  try {
    ByteArrayInputStream in=cache.get(href);
    return new StreamSource(in);
  }
 catch (  ExecutionException e) {
    throw new TransformerException("String_Node_Str" + href,e);
  }
}

Fixed version (ground truth):
@Override public Source resolve(String href,String base) throws TransformerException {
  try {
    byte[] in=cache.get(href);
    return new StreamSource(new ByteArrayInputStream(in));
  }
 catch (  ExecutionException e) {
    throw new TransformerException("String_Node_Str" + href,e);
  }
}
Program: 188622
Project: 188622
Buggy source:
@Override public XsltExecutable load(Triple<String,String,String> key) throws Exception {
  String basePath=key.getLeft();
  String metadataType=key.getMiddle();
  String metadataVersion=key.getRight();
  return createMetadataTranformer(basePath,metadataType,metadataVersion);
}

Fixed version (ground truth):
@Override public XsltExecutable load(Triple<String,String,String> key) throws Exception {
  String basePath=key.getLeft();
  String metadataType=key.getMiddle();
  String metadataVersion=key.getRight();
  return createMetadataTransformer(basePath,metadataType,metadataVersion);
}
Program: 188623
Project: 188623
Buggy source:
public static Reader applyMetadataStylesheet(Binary binary,String basePath,String metadataType,String metadataVersion,Map<String,String> parameters) throws GenericException {
  Reader descMetadataReader=null;
  try {
    descMetadataReader=new InputStreamReader(new BOMInputStream(binary.getContent().createInputStream()));
    XMLReader xmlReader=XMLReaderFactory.createXMLReader();
    xmlReader.setEntityResolver(new RodaEntityResolver());
    InputSource source=new InputSource(descMetadataReader);
    Source text=new SAXSource(xmlReader,source);
    XsltExecutable xsltExecutable=CACHE.get(Triple.of(basePath,metadataType,metadataVersion));
    XsltTransformer transformer=xsltExecutable.load();
    CharArrayWriter transformerResult=new CharArrayWriter();
    transformer.setSource(text);
    transformer.setDestination(PROCESSOR.newSerializer(transformerResult));
    for (    Entry<String,String> parameter : parameters.entrySet()) {
      QName qName=new QName(parameter.getKey());
      XdmValue xdmValue=new XdmAtomicValue(parameter.getValue());
      transformer.setParameter(qName,xdmValue);
    }
    transformer.transform();
    return new CharArrayReader(transformerResult.toCharArray());
  }
 catch (  IOException|SAXException|ExecutionException|SaxonApiException e) {
    throw new GenericException("String_Node_Str" + binary.getStoragePath() + "String_Node_Str"+ metadataType+ "String_Node_Str"+ metadataVersion,e);
  }
 finally {
    IOUtils.closeQuietly(descMetadataReader);
  }
}

Fixed version (ground truth):
public static Reader applyMetadataStylesheet(Binary binary,String basePath,String metadataType,String metadataVersion,Map<String,String> parameters) throws GenericException {
  Reader descMetadataReader=null;
  try {
    descMetadataReader=new InputStreamReader(new BOMInputStream(binary.getContent().createInputStream()));
    XMLReader xmlReader=XMLReaderFactory.createXMLReader();
    xmlReader.setEntityResolver(new RodaEntityResolver());
    InputSource source=new InputSource(descMetadataReader);
    Source text=new SAXSource(xmlReader,source);
    XsltExecutable xsltExecutable=CACHE.get(Triple.of(basePath,metadataType,metadataVersion));
    XsltTransformer transformer=xsltExecutable.load();
    CharArrayWriter transformerResult=new CharArrayWriter();
    transformer.setSource(text);
    transformer.setDestination(PROCESSOR.newSerializer(transformerResult));
    for (    Entry<String,String> parameter : parameters.entrySet()) {
      QName qName=new QName(parameter.getKey());
      XdmValue xdmValue=new XdmAtomicValue(parameter.getValue());
      transformer.setParameter(qName,xdmValue);
    }
    transformer.transform();
    return new CharArrayReader(transformerResult.toCharArray());
  }
 catch (  IOException|SAXException|ExecutionException|SaxonApiException e) {
    LOGGER.error(e.getMessage(),e);
    throw new GenericException("String_Node_Str" + binary.getStoragePath() + "String_Node_Str"+ metadataType+ "String_Node_Str"+ metadataVersion,e);
  }
 finally {
    IOUtils.closeQuietly(descMetadataReader);
  }
}
Program: 188624
Project: 188624
Buggy source:
public static void checkTransferredResourceAccess(RodaUser user,List<String> ids) throws AuthorizationDeniedException {
  if ("String_Node_Str".equalsIgnoreCase(user.getId())) {
    return;
  }
 else {
    for (    String id : ids) {
      if (id == null && !"String_Node_Str".equals(user.getName())) {
        throw new AuthorizationDeniedException("String_Node_Str" + user.getId() + "String_Node_Str");
      }
 else       if (!Paths.get(id).getName(0).toString().equalsIgnoreCase(user.getName())) {
        throw new AuthorizationDeniedException("String_Node_Str" + user.getId() + "String_Node_Str"+ id+ "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method make sure that a normal user can only upload a file to a folder with its own username
 * @param user
 * @param ids
 * @throws AuthorizationDeniedException
 */
public static void checkTransferredResourceAccess(RodaUser user,List<String> ids) throws AuthorizationDeniedException {
  if ("String_Node_Str".equalsIgnoreCase(user.getId())) {
    return;
  }
 else {
    for (    String id : ids) {
      if (id == null && !"String_Node_Str".equals(user.getName())) {
        throw new AuthorizationDeniedException("String_Node_Str" + user.getId() + "String_Node_Str");
      }
 else {
        try {
          IndexService index=RodaCoreFactory.getIndexService();
          TransferredResource parent=index.retrieve(TransferredResource.class,id);
          if (!Paths.get(parent.getRelativePath()).getName(0).toString().equalsIgnoreCase(user.getName())) {
            throw new AuthorizationDeniedException("String_Node_Str" + user.getId() + "String_Node_Str"+ id+ "String_Node_Str");
          }
        }
 catch (        GenericException|NotFoundException e) {
          throw new AuthorizationDeniedException("String_Node_Str" + user.getId() + "String_Node_Str"+ id+ "String_Node_Str");
        }
      }
    }
  }
}
Program: 188625
Project: 188625
Buggy source:
private TransferredResource createCorpora() throws InterruptedException, IOException, FileAlreadyExistsException, NotFoundException, GenericException, RequestNotValidException {
  TransferredResourcesScanner f=RodaCoreFactory.getTransferredResourcesScanner();
  Path sip=corporaPath.resolve(CorporaConstants.SIP_FOLDER).resolve(CorporaConstants.BAGIT_SIP);
  TransferredResource transferredResourceCreated=f.createFile(null,CorporaConstants.BAGIT_SIP,Files.newInputStream(sip));
  index.commit(TransferredResource.class);
  TransferredResource transferredResource=index.retrieve(TransferredResource.class,transferredResourceCreated.getUUID());
  return transferredResource;
}

Fixed version (ground truth):
private TransferredResource createCorpora() throws InterruptedException, IOException, FileAlreadyExistsException, NotFoundException, GenericException, RequestNotValidException, AlreadyExistsException {
  TransferredResourcesScanner f=RodaCoreFactory.getTransferredResourcesScanner();
  Path sip=corporaPath.resolve(CorporaConstants.SIP_FOLDER).resolve(CorporaConstants.BAGIT_SIP);
  TransferredResource transferredResourceCreated=f.createFile(null,CorporaConstants.BAGIT_SIP,Files.newInputStream(sip));
  index.commit(TransferredResource.class);
  TransferredResource transferredResource=index.retrieve(TransferredResource.class,transferredResourceCreated.getUUID());
  return transferredResource;
}
Program: 188626
Project: 188626
Buggy source:
private TransferredResource createCorpora() throws InterruptedException, IOException, FileAlreadyExistsException, NotFoundException, GenericException, RequestNotValidException, IsStillUpdatingException {
  TransferredResourcesScanner f=RodaCoreFactory.getTransferredResourcesScanner();
  Path sip=corporaPath.resolve(CorporaConstants.SIP_FOLDER).resolve(CorporaConstants.EARK_SIP);
  f.createFile(null,CorporaConstants.EARK_SIP,Files.newInputStream(sip));
  f.updateAllTransferredResources(null,true);
  index.commit(TransferredResource.class);
  TransferredResource transferredResource=index.retrieve(TransferredResource.class,UUID.nameUUIDFromBytes(CorporaConstants.EARK_SIP.getBytes()).toString());
  return transferredResource;
}

Fixed version (ground truth):
private TransferredResource createCorpora() throws InterruptedException, IOException, FileAlreadyExistsException, NotFoundException, GenericException, RequestNotValidException, IsStillUpdatingException, AlreadyExistsException {
  TransferredResourcesScanner f=RodaCoreFactory.getTransferredResourcesScanner();
  Path sip=corporaPath.resolve(CorporaConstants.SIP_FOLDER).resolve(CorporaConstants.EARK_SIP);
  f.createFile(null,CorporaConstants.EARK_SIP,Files.newInputStream(sip));
  f.updateAllTransferredResources(null,true);
  index.commit(TransferredResource.class);
  TransferredResource transferredResource=index.retrieve(TransferredResource.class,UUID.nameUUIDFromBytes(CorporaConstants.EARK_SIP.getBytes()).toString());
  return transferredResource;
}
Program: 188628
Project: 188628
Buggy source:
public static AIP earkSIPToAIP(SIP sip,String username,Permissions fullPermissions,ModelService model,StorageService storage,String ingestSIPId,String ingestJobId,String parentId) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, ValidationException, IOException {
  AIPState state=AIPState.INGEST_PROCESSING;
  Permissions permissions=new Permissions();
  boolean notify=false;
  String aipType=IngestHelper.getType(sip);
  AIP aip=model.createAIP(state,parentId,aipType,permissions,ingestSIPId,ingestJobId,notify);
  processIPInformation(model,sip,aip.getId(),notify,false);
  for (  IPRepresentation representation : sip.getRepresentations()) {
    processIPRepresentationInformation(model,representation,aip.getId(),storage,notify,false);
  }
  model.notifyAIPCreated(aip.getId());
  AIP createdAIP=model.retrieveAIP(aip.getId());
  Permissions readPermissions=PermissionUtils.grantReadPermissionToUserGroup(model,createdAIP,aip.getPermissions());
  Permissions finalPermissions=PermissionUtils.grantAllPermissions(username,readPermissions,fullPermissions);
  createdAIP.setPermissions(finalPermissions);
  model.updateAIPPermissions(createdAIP);
  return model.retrieveAIP(aip.getId());
}

Fixed version (ground truth):
public static AIP earkSIPToAIP(SIP sip,String username,Permissions fullPermissions,ModelService model,StorageService storage,String ingestSIPId,String ingestJobId,String parentId) throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException, AuthorizationDeniedException, ValidationException, IOException {
  AIPState state=AIPState.INGEST_PROCESSING;
  Permissions permissions=new Permissions();
  boolean notify=false;
  String aipType=IngestHelper.getType(sip);
  AIP aip=model.createAIP(state,parentId,aipType,permissions,ingestSIPId,ingestJobId,notify);
  processIPInformation(model,sip,aip.getId(),notify,false);
  for (  IPRepresentation representation : sip.getRepresentations()) {
    processIPRepresentationInformation(model,representation,aip.getId(),storage,notify,false);
  }
  model.notifyAIPCreated(aip.getId());
  AIP createdAIP=model.retrieveAIP(aip.getId());
  Permissions readPermissions=PermissionUtils.grantReadPermissionToUserGroup(model,createdAIP,aip.getPermissions());
  Permissions finalPermissions=PermissionUtils.grantAllPermissions(username,readPermissions,fullPermissions);
  createdAIP.setPermissions(finalPermissions);
  model.updateAIP(createdAIP);
  return model.retrieveAIP(aip.getId());
}
Program: 188630
Project: 188630
Buggy source:
public void registerAction(RodaUser user){
  registerAction(user,null,Collections.EMPTY_LIST);
}

Fixed version (ground truth):
public void registerAction(RodaUser user){
  registerAction(user,(String)null);
}
Program: 188631
Project: 188631
Buggy source:
private static Path determineRodaHomePath(){
  Path rodaHomePath;
  if (System.getProperty(RodaConstants.INSTALL_FOLDER_SYSTEM_PROPERTY) != null) {
    rodaHomePath=Paths.get(System.getProperty(RodaConstants.INSTALL_FOLDER_SYSTEM_PROPERTY));
  }
 else   if (System.getenv(RodaConstants.INSTALL_FOLDER_ENVIRONEMNT_VARIABLE) != null) {
    rodaHomePath=Paths.get(System.getenv(RodaConstants.INSTALL_FOLDER_ENVIRONEMNT_VARIABLE));
  }
 else {
    String userHome=System.getProperty("String_Node_Str");
    rodaHomePath=Paths.get(userHome,"String_Node_Str");
    if (!Files.exists(rodaHomePath)) {
      try {
        Files.createDirectories(rodaHomePath);
      }
 catch (      IOException e) {
        throw new RuntimeException("String_Node_Str" + rodaHomePath + "String_Node_Str",e);
      }
    }
    System.setProperty(RodaConstants.INSTALL_FOLDER_SYSTEM_PROPERTY,rodaHomePath.toString());
  }
  configPath=rodaHomePath.resolve(RodaConstants.CORE_CONFIG_FOLDER);
  exampleConfigPath=rodaHomePath.resolve(RodaConstants.CORE_EXAMPLE_CONFIG_FOLDER);
  dataPath=rodaHomePath.resolve(RodaConstants.CORE_DATA_FOLDER);
  logPath=dataPath.resolve(RodaConstants.CORE_LOG_FOLDER);
  storagePath=dataPath.resolve(RodaConstants.CORE_STORAGE_FOLDER);
  indexDataPath=dataPath.resolve(RodaConstants.CORE_INDEX_FOLDER);
  if (nodeType != NodeType.TEST) {
    configureLogback();
  }
  return rodaHomePath;
}

Fixed version (ground truth):
private static Path determineRodaHomePath(){
  Path rodaHomePath;
  if (System.getProperty(RodaConstants.INSTALL_FOLDER_SYSTEM_PROPERTY) != null) {
    rodaHomePath=Paths.get(System.getProperty(RodaConstants.INSTALL_FOLDER_SYSTEM_PROPERTY));
  }
 else   if (System.getenv(RodaConstants.INSTALL_FOLDER_ENVIRONEMNT_VARIABLE) != null) {
    rodaHomePath=Paths.get(System.getenv(RodaConstants.INSTALL_FOLDER_ENVIRONEMNT_VARIABLE));
  }
 else {
    String userHome=System.getProperty("String_Node_Str");
    rodaHomePath=Paths.get(userHome,"String_Node_Str");
    if (!Files.exists(rodaHomePath)) {
      try {
        Files.createDirectories(rodaHomePath);
      }
 catch (      IOException e) {
        throw new RuntimeException("String_Node_Str" + rodaHomePath + "String_Node_Str",e);
      }
    }
    System.setProperty(RodaConstants.INSTALL_FOLDER_SYSTEM_PROPERTY,rodaHomePath.toString());
  }
  configPath=rodaHomePath.resolve(RodaConstants.CORE_CONFIG_FOLDER);
  exampleConfigPath=rodaHomePath.resolve(RodaConstants.CORE_EXAMPLE_CONFIG_FOLDER);
  defaultPath=rodaHomePath.resolve(RodaConstants.CORE_DEFAULT_FOLDER);
  dataPath=rodaHomePath.resolve(RodaConstants.CORE_DATA_FOLDER);
  logPath=dataPath.resolve(RodaConstants.CORE_LOG_FOLDER);
  storagePath=dataPath.resolve(RodaConstants.CORE_STORAGE_FOLDER);
  indexDataPath=dataPath.resolve(RodaConstants.CORE_INDEX_FOLDER);
  if (nodeType != NodeType.TEST) {
    configureLogback();
  }
  return rodaHomePath;
}
Program: 188632
Project: 188632
Buggy source:
private static <T extends AbstractPlugin>void createDefaultRisk(ModelService model,int riskIndex,String riskId,Class<T> pluginClass) throws AlreadyExistsException, GenericException, RequestNotValidException, NotFoundException, AuthorizationDeniedException {
  String configurationFile=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str",pluginClass.getName(),"String_Node_Str","String_Node_Str" + Integer.toString(riskIndex + 1));
  if (configurationFile != null) {
    InputStream inputStream=RodaCoreFactory.getConfigurationFileAsStream(configurationFile);
    try {
      Risk risk=JsonUtils.getObjectFromJson(inputStream,Risk.class);
      risk.setId(riskId);
      model.createRisk(risk,false);
    }
 catch (    GenericException e) {
      LOGGER.error("String_Node_Str");
    }
    IOUtils.closeQuietly(inputStream);
  }
}

Fixed version (ground truth):
private static <T extends AbstractPlugin>void createDefaultRisk(ModelService model,int riskIndex,String riskId,Class<T> pluginClass) throws AlreadyExistsException, GenericException, RequestNotValidException, NotFoundException, AuthorizationDeniedException {
  String defaultFile=RodaConstants.CORE_DATA_FOLDER + '/' + RodaConstants.CORE_STORAGE_FOLDER+ '/'+ RodaConstants.CORE_RISK_FOLDER+ '/'+ riskId+ "String_Node_Str";
  InputStream inputStream=RodaCoreFactory.getDefaultFileAsStream(defaultFile);
  try {
    Risk risk=JsonUtils.getObjectFromJson(inputStream,Risk.class);
    risk.setId(riskId);
    model.createRisk(risk,false);
  }
 catch (  GenericException e) {
    LOGGER.error("String_Node_Str");
  }
  IOUtils.closeQuietly(inputStream);
}
Program: 188634
Project: 188634
Buggy source:
@Override public List<Class<T>> getObjectClasses(){
  List<Class<? extends IsRODAObject>> list=new ArrayList<>();
  list.add(Agent.class);
  list.add(Format.class);
  list.add(Notification.class);
  list.add(Risk.class);
  list.add(RiskIncidence.class);
  return (List)list;
}

Fixed version (ground truth):
@Override public List<Class<T>> getObjectClasses(){
  List<Class<? extends IsRODAObject>> list=new ArrayList<>();
  list.add(Agent.class);
  list.add(Format.class);
  list.add(Notification.class);
  list.add(Risk.class);
  return (List)list;
}
Program: 188635
Project: 188635
Buggy source:
/** 
 * Add URL to CLASSPATH
 * @param url {@link URL}
 * @throws IOException IOException
 */
public static void addURL(URL url) throws IOException {
  URLClassLoader sysLoader=(URLClassLoader)ClassLoader.getSystemClassLoader();
  URL urls[]=sysLoader.getURLs();
  for (int i=0; i < urls.length; i++) {
    if (StringUtils.equalsIgnoreCase(urls[i].toString(),url.toString())) {
      LOGGER.debug("String_Node_Str" + url + "String_Node_Str");
      return;
    }
  }
  Class<?> sysclass=URLClassLoader.class;
  try {
    Method method=sysclass.getDeclaredMethod("String_Node_Str",PARAMETERS);
    method.setAccessible(true);
    method.invoke(sysLoader,new Object[]{url});
  }
 catch (  NoSuchMethodException|IllegalAccessException|InvocationTargetException|RuntimeException e) {
    throw new IOException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Add URL to CLASSPATH
 * @param url {@link URL}
 * @throws IOException IOException
 */
public static void addURL(URL url) throws IOException {
  URLClassLoader sysLoader=(URLClassLoader)ClassLoader.getSystemClassLoader();
  URL urls[]=sysLoader.getURLs();
  for (int i=0; i < urls.length; i++) {
    if (StringUtils.equalsIgnoreCase(urls[i].toString(),url.toString())) {
      LOGGER.debug("String_Node_Str" + url + "String_Node_Str");
      return;
    }
  }
  Class sysclass=URLClassLoader.class;
  try {
    Method method=sysclass.getDeclaredMethod("String_Node_Str",PARAMETERS);
    method.setAccessible(true);
    method.invoke(sysLoader,new Object[]{url});
  }
 catch (  Throwable t) {
    t.printStackTrace();
    throw new IOException("String_Node_Str");
  }
}
Program: 188636
Project: 188636
Buggy source:
/** 
 * Add file to CLASSPATH
 * @param f File object
 * @throws IOException IOException
 */
public static void addFile(File f) throws IOException {
  addURL(f.toURI().toURL());
}

Fixed version (ground truth):
/** 
 * Add file to CLASSPATH
 * @param f File object
 * @throws IOException IOException
 */
public static void addFile(File f) throws IOException {
  addURL(f.toURL());
}
Program: 188637
Project: 188637
Buggy source:
/** 
 * Adds the given file path to the classpath and creates an instance of the given class name.
 * @param filePath the path of the file to add to the classpath.
 * @param className the name of the class for which to create an instance.
 * @return the instance created.
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
public static Object createObject(String filePath,String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
  if (StringUtils.isBlank(className)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ClassLoaderUtility.addFile(filePath);
  filePath="String_Node_Str" + filePath + "String_Node_Str";
  URL url=new File(filePath).toURI().toURL();
  URLClassLoader clazzLoader=null;
  try {
    clazzLoader=new URLClassLoader(new URL[]{url},CLASS_LOADER);
    LOGGER.trace("String_Node_Str" + className + "String_Node_Str"+ CLASS_LOADER.getClass().getSimpleName());
    Class<?> clazz=clazzLoader.loadClass(className);
    return clazz.newInstance();
  }
  finally {
    IOUtils.closeQuietly(clazzLoader);
  }
}

Fixed version (ground truth):
/** 
 * Adds the given file path to the classpath and creates an instance of the given class name.
 * @param filePath the path of the file to add to the classpath.
 * @param className the name of the class for which to create an instance.
 * @return the instance created.
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
public static Object createObject(String filePath,String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
  if (StringUtils.isBlank(className)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ClassLoaderUtility.addFile(filePath);
  filePath="String_Node_Str" + filePath + "String_Node_Str";
  URL url=new File(filePath).toURL();
  URLClassLoader clazzLoader=new URLClassLoader(new URL[]{url},CLASS_LOADER);
  LOGGER.trace("String_Node_Str" + className + "String_Node_Str"+ CLASS_LOADER.getClass().getSimpleName());
  Class clazz=clazzLoader.loadClass(className);
  return clazz.newInstance();
}
Program: 188638
Project: 188638
Buggy source:
protected void viewAction(){
  aipId=null;
  viewingTop=true;
  browseTitle.setVisible(true);
  browseDescription.setVisible(true);
  breadcrumb.updatePath(Arrays.asList(new BreadcrumbItem(DescriptionLevelUtils.getTopIconSafeHtml(),RESOLVER.getHistoryPath())));
  HTMLPanel topIcon=DescriptionLevelUtils.getTopIconHTMLPanel();
  topIcon.addStyleName("String_Node_Str");
  itemIcon.setWidget(topIcon);
  itemTitle.setText(messages.allCollectionsTitle());
  itemTitle.addStyleName("String_Node_Str");
  itemIcon.getParent().addStyleName("String_Node_Str");
  aipList.setFilter(COLLECTIONS_FILTER);
  actionsSidebar.setVisible(true);
  createItem.setVisible(true);
  moveItem.setVisible(true);
  editPermissions.setVisible(false);
  remove.setVisible(true);
  downloadSection.setVisible(false);
  download.setVisible(false);
  this.removeStyleName("String_Node_Str");
  aipState.setVisible(false);
}

Fixed version (ground truth):
protected void viewAction(){
  aipId=null;
  viewingTop=true;
  browseTitle.setVisible(true);
  browseDescription.setVisible(true);
  breadcrumb.updatePath(Arrays.asList(new BreadcrumbItem(DescriptionLevelUtils.getTopIconSafeHtml(),RESOLVER.getHistoryPath())));
  HTMLPanel topIcon=DescriptionLevelUtils.getTopIconHTMLPanel();
  topIcon.addStyleName("String_Node_Str");
  itemIcon.setWidget(topIcon);
  itemTitle.setText(messages.allCollectionsTitle());
  itemTitle.addStyleName("String_Node_Str");
  itemIcon.getParent().addStyleName("String_Node_Str");
  aipList.set(COLLECTIONS_FILTER,justActive,FACETS);
  actionsSidebar.setVisible(true);
  createItem.setVisible(true);
  moveItem.setVisible(true);
  editPermissions.setVisible(false);
  remove.setVisible(true);
  downloadSection.setVisible(false);
  download.setVisible(false);
  this.removeStyleName("String_Node_Str");
  aipState.setVisible(false);
}
Program: 188639
Project: 188639
Buggy source:
private void clear(){
  browseTitle.setVisible(false);
  browseDescription.setVisible(false);
  HTMLPanel itemIconHtmlPanel=DescriptionLevelUtils.getTopIconHTMLPanel();
  itemIconHtmlPanel.addStyleName("String_Node_Str");
  itemIcon.setWidget(itemIconHtmlPanel);
  itemTitle.setText(messages.browseLoading());
  itemTitle.removeStyleName("String_Node_Str");
  itemIcon.getParent().removeStyleName("String_Node_Str");
  itemId.setText("String_Node_Str");
  breadcrumb.setVisible(false);
  itemMetadata.setVisible(false);
  itemMetadata.clear();
  removeHandlerRegistrations();
  newDescriptiveMetadata.setVisible(false);
  viewingTop=false;
  fondsPanelTitle.setVisible(false);
  aipList.setVisible(false);
  downloadList.clear();
  sidebarData.setVisible(false);
  appraisalSidebar.setVisible(false);
  preservationSidebar.setVisible(false);
  actionsSidebar.setVisible(false);
  createItem.setVisible(false);
  moveItem.setVisible(false);
  editPermissions.setVisible(false);
  remove.setVisible(false);
  submission.setVisible(false);
  documentation.setVisible(false);
  schemas.setVisible(false);
  for (  AIPState state : AIPState.values()) {
    this.removeStyleName(state.toString().toLowerCase());
  }
}

Fixed version (ground truth):
private void clear(){
  justActive=true;
  browseTitle.setVisible(false);
  browseDescription.setVisible(false);
  HTMLPanel itemIconHtmlPanel=DescriptionLevelUtils.getTopIconHTMLPanel();
  itemIconHtmlPanel.addStyleName("String_Node_Str");
  itemIcon.setWidget(itemIconHtmlPanel);
  itemTitle.setText(messages.browseLoading());
  itemTitle.removeStyleName("String_Node_Str");
  itemIcon.getParent().removeStyleName("String_Node_Str");
  itemId.setText("String_Node_Str");
  breadcrumb.setVisible(false);
  itemMetadata.setVisible(false);
  itemMetadata.clear();
  removeHandlerRegistrations();
  newDescriptiveMetadata.setVisible(false);
  viewingTop=false;
  fondsPanelTitle.setVisible(false);
  aipList.setVisible(false);
  downloadList.clear();
  sidebarData.setVisible(false);
  appraisalSidebar.setVisible(false);
  preservationSidebar.setVisible(false);
  actionsSidebar.setVisible(false);
  createItem.setVisible(false);
  moveItem.setVisible(false);
  editPermissions.setVisible(false);
  remove.setVisible(false);
  submission.setVisible(false);
  documentation.setVisible(false);
  schemas.setVisible(false);
  for (  AIPState state : AIPState.values()) {
    this.removeStyleName(state.toString().toLowerCase());
  }
}
Program: 188640
Project: 188640
Buggy source:
private Browse(){
  viewingTop=true;
  handlers=new ArrayList<HandlerRegistration>();
  String summary=messages.listOfItems();
  boolean selectable=true;
  aipList=new AIPList(Filter.NULL,justActive,Facets.NONE,summary,selectable);
  initWidget(uiBinder.createAndBindUi(this));
  browseDescription.add(new HTMLWidgetWrapper("String_Node_Str"));
  aipList.getSelectionModel().addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      IndexedAIP aip=aipList.getSelectionModel().getSelectedObject();
      if (aip != null) {
        view(aip.getId());
      }
    }
  }
);
  aipList.addValueChangeHandler(new ValueChangeHandler<IndexResult<IndexedAIP>>(){
    @Override public void onValueChange(    ValueChangeEvent<IndexResult<IndexedAIP>> event){
      fondsPanelTitle.setVisible(!viewingTop && event.getValue().getTotalCount() > 0);
      aipList.setVisible(viewingTop || event.getValue().getTotalCount() > 0);
    }
  }
);
}

Fixed version (ground truth):
private Browse(){
  viewingTop=true;
  handlers=new ArrayList<HandlerRegistration>();
  String summary=messages.listOfItems();
  boolean selectable=true;
  aipList=new AIPList(Filter.NULL,justActive,FACETS,summary,selectable);
  initWidget(uiBinder.createAndBindUi(this));
  browseDescription.add(new HTMLWidgetWrapper("String_Node_Str"));
  aipList.getSelectionModel().addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      IndexedAIP aip=aipList.getSelectionModel().getSelectedObject();
      if (aip != null) {
        view(aip.getId());
      }
    }
  }
);
  aipList.addValueChangeHandler(new ValueChangeHandler<IndexResult<IndexedAIP>>(){
    @Override public void onValueChange(    ValueChangeEvent<IndexResult<IndexedAIP>> event){
      fondsPanelTitle.setVisible(!viewingTop && event.getValue().getTotalCount() > 0);
      aipList.setVisible(viewingTop || event.getValue().getTotalCount() > 0);
    }
  }
);
}