Program: 188224
Project: 188224
Buggy source:
private static <T>SolrInputDocument toSolrDocument(Class<T> resultClass,T object) throws GenericException, NotSupportedException {
  SolrInputDocument ret;
  if (resultClass.equals(IndexedAIP.class)) {
    throw new NotSupportedException();
  }
 else   if (resultClass.equals(IndexedRepresentation.class) || resultClass.equals(Representation.class)) {
    throw new NotSupportedException();
  }
 else   if (resultClass.equals(LogEntry.class)) {
    ret=logEntryToSolrDocument((LogEntry)object);
  }
 else   if (resultClass.equals(Report.class) || resultClass.equals(IndexedReport.class)) {
    throw new NotSupportedException();
  }
 else   if (resultClass.equals(RODAMember.class) || resultClass.equals(User.class) || resultClass.equals(Group.class)) {
    ret=rodaMemberToSolrDocument((RODAMember)object);
  }
 else   if (resultClass.equals(TransferredResource.class)) {
    ret=transferredResourceToSolrDocument((TransferredResource)object);
  }
 else   if (resultClass.equals(Job.class)) {
    ret=jobToSolrDocument((Job)object);
  }
 else   if (resultClass.equals(Risk.class) || resultClass.equals(IndexedRisk.class)) {
    ret=riskToSolrDocument((Risk)object,0);
  }
 else   if (resultClass.equals(RepresentationInformation.class)) {
    ret=representationInformationToSolrDocument((RepresentationInformation)object);
  }
 else   if (resultClass.equals(Notification.class)) {
    ret=notificationToSolrDocument((Notification)object);
  }
 else   if (resultClass.equals(RiskIncidence.class)) {
    ret=riskIncidenceToSolrDocument((RiskIncidence)object);
  }
 else   if (resultClass.equals(DIP.class) || resultClass.equals(IndexedDIP.class)) {
    ret=dipToSolrDocument((DIP)object);
  }
 else   if (resultClass.equals(IndexedFile.class) || resultClass.equals(DIPFile.class)) {
    throw new NotSupportedException();
  }
 else   if (resultClass.equals(IndexedPreservationEvent.class)) {
    throw new NotSupportedException();
  }
 else   if (resultClass.equals(IndexedPreservationAgent.class)) {
    throw new NotSupportedException();
  }
 else   if (resultClass.equals(Format.class)) {
    ret=formatToSolrDocument((Format)object);
  }
 else {
    throw new GenericException("String_Node_Str" + resultClass.getName());
  }
  return ret;
}

Fixed version (ground truth):
private static <T>Optional<SolrInputDocument> toSolrDocument(Class<T> resultClass,T object) throws GenericException, NotSupportedException {
  Optional<SolrInputDocument> ret;
  if (resultClass.equals(IndexedAIP.class)) {
    ret=Optional.empty();
  }
 else   if (resultClass.equals(IndexedRepresentation.class) || resultClass.equals(Representation.class)) {
    ret=Optional.empty();
  }
 else   if (resultClass.equals(LogEntry.class)) {
    ret=Optional.of(logEntryToSolrDocument((LogEntry)object));
  }
 else   if (resultClass.equals(Report.class) || resultClass.equals(IndexedReport.class)) {
    ret=Optional.empty();
  }
 else   if (resultClass.equals(RODAMember.class) || resultClass.equals(User.class) || resultClass.equals(Group.class)) {
    ret=Optional.of(rodaMemberToSolrDocument((RODAMember)object));
  }
 else   if (resultClass.equals(TransferredResource.class)) {
    ret=Optional.of(transferredResourceToSolrDocument((TransferredResource)object));
  }
 else   if (resultClass.equals(Job.class)) {
    ret=Optional.of(jobToSolrDocument((Job)object));
  }
 else   if (resultClass.equals(Risk.class) || resultClass.equals(IndexedRisk.class)) {
    ret=Optional.of(riskToSolrDocument((Risk)object,0));
  }
 else   if (resultClass.equals(RepresentationInformation.class)) {
    ret=Optional.of(representationInformationToSolrDocument((RepresentationInformation)object));
  }
 else   if (resultClass.equals(Notification.class)) {
    ret=Optional.of(notificationToSolrDocument((Notification)object));
  }
 else   if (resultClass.equals(RiskIncidence.class)) {
    ret=Optional.of(riskIncidenceToSolrDocument((RiskIncidence)object));
  }
 else   if (resultClass.equals(DIP.class) || resultClass.equals(IndexedDIP.class)) {
    ret=Optional.of(dipToSolrDocument((DIP)object));
  }
 else   if (resultClass.equals(IndexedFile.class) || resultClass.equals(DIPFile.class)) {
    ret=Optional.empty();
  }
 else   if (resultClass.equals(IndexedPreservationEvent.class) || resultClass.equals(IndexedPreservationAgent.class)) {
    ret=Optional.empty();
  }
 else   if (resultClass.equals(Format.class)) {
    ret=Optional.of(formatToSolrDocument((Format)object));
  }
 else {
    throw new GenericException("String_Node_Str" + resultClass.getName());
  }
  return ret;
}