nus-yam/ex-repair huggingface dataset:
Program: 112163
Project: 112163
Buggy source:
public void testRoundTrip() throws Exception {
  ZipInputStream is=new ZipInputStream(new FileInputStream("String_Node_Str"));
  try {
    while (true) {
      ZipEntry nextEntry=is.getNextEntry();
      if (nextEntry == null) {
        break;
      }
      ByteArrayOutputStream oos=new ByteArrayOutputStream();
      byte[] buffer=new byte[2048];
      int len=0;
      while ((len=is.read(buffer)) > 0) {
        oos.write(buffer,0,len);
      }
      String exampleText=oos.toString("String_Node_Str");
      ourLog.info("String_Node_Str",nextEntry.getName(),exampleText.length());
      if (!nextEntry.getName().contains("String_Node_Str")) {
        continue;
      }
      IBaseResource parsed=ourCtx.newXmlParser().parseResource(exampleText);
      String encodedXml=ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
      exampleText=cleanXml(exampleText);
      encodedXml=cleanXml(encodedXml);
      XmlParserDstu3Test.compareXml(exampleText,encodedXml);
    }
  }
  finally {
    is.close();
  }
}

Fixed version (ground truth):
@Test public void testRoundTrip() throws Exception {
  ZipInputStream is=new ZipInputStream(new FileInputStream("String_Node_Str"));
  try {
    while (true) {
      ZipEntry nextEntry=is.getNextEntry();
      if (nextEntry == null) {
        break;
      }
      ByteArrayOutputStream oos=new ByteArrayOutputStream();
      byte[] buffer=new byte[2048];
      int len=0;
      while ((len=is.read(buffer)) > 0) {
        oos.write(buffer,0,len);
      }
      String exampleText=oos.toString("String_Node_Str");
      ourLog.info("String_Node_Str",nextEntry.getName(),exampleText.length());
      if (!nextEntry.getName().contains("String_Node_Str")) {
        continue;
      }
      IBaseResource parsed=ourCtx.newXmlParser().parseResource(exampleText);
      String encodedXml=ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
      exampleText=cleanXml(exampleText);
      encodedXml=cleanXml(encodedXml);
      XmlParserDstu3Test.compareXml(exampleText,encodedXml);
    }
  }
  finally {
    is.close();
  }
}
Program: 112165
Project: 112165
Buggy source:
@Bean() public LocalContainerEntityManagerFactoryBean entityManagerFactory(){
  return FhirServerConfigCommon.getEntityManagerFactory(env,dataSource());
}

Fixed version (ground truth):
@Bean() public LocalContainerEntityManagerFactoryBean entityManagerFactory(){
  return FhirServerConfigCommon.getEntityManagerFactory(env,dataSource(),fhirContextDstu3());
}
Program: 112169
Project: 112169
Buggy source:
@Override public List<IAuthRule> buildRuleList(RequestDetails theRequestDetails){
  String authHeader=theRequestDetails.getHeader("String_Node_Str");
  if (isBlank(authHeader)) {
    return new RuleBuilder().deny().operation().named(BaseJpaSystemProvider.MARK_ALL_RESOURCES_FOR_REINDEXING).onServer().andThen().deny().operation().named(TerminologyUploaderProvider.UPLOAD_EXTERNAL_CODE_SYSTEM).onServer().andThen().allowAll().build();
  }
  if (!authHeader.startsWith("String_Node_Str")) {
    throw new ForbiddenOperationException("String_Node_Str");
  }
  String token=authHeader.substring("String_Node_Str".length()).trim();
  if (!myTokens.contains(token)) {
    ourLog.error("String_Node_Str",token,myTokens);
    throw new ForbiddenOperationException("String_Node_Str");
  }
  ourLog.info("String_Node_Str" + token.substring(0,4) + "String_Node_Str");
  return new RuleBuilder().allowAll().build();
}

Fixed version (ground truth):
@Override public List<IAuthRule> buildRuleList(RequestDetails theRequestDetails){
  String authHeader=theRequestDetails.getHeader("String_Node_Str");
  if (isBlank(authHeader)) {
    return new RuleBuilder().deny().operation().named(BaseJpaSystemProvider.MARK_ALL_RESOURCES_FOR_REINDEXING).onServer().andThen().deny().operation().named(BaseTerminologyUploaderProvider.UPLOAD_EXTERNAL_CODE_SYSTEM).onServer().andThen().allowAll().build();
  }
  if (!authHeader.startsWith("String_Node_Str")) {
    throw new ForbiddenOperationException("String_Node_Str");
  }
  String token=authHeader.substring("String_Node_Str".length()).trim();
  if (!myTokens.contains(token)) {
    ourLog.error("String_Node_Str",token,myTokens);
    throw new ForbiddenOperationException("String_Node_Str");
  }
  ourLog.info("String_Node_Str" + token.substring(0,4) + "String_Node_Str");
  return new RuleBuilder().allowAll().build();
}
Program: 112171
Project: 112171
Buggy source:
@Override void doSetValueAsQueryToken(FhirContext theContext,String theParamName,String theQualifier,String theValue){
  String q=theQualifier;
  String resourceType=null;
  if (isNotBlank(q)) {
    if (q.startsWith("String_Node_Str")) {
      int nextIdx=q.indexOf('.');
      if (nextIdx != -1) {
        resourceType=q.substring(1,nextIdx);
        myChain=q.substring(nextIdx + 1);
      }
 else {
        resourceType=q.substring(1);
      }
    }
 else     if (q.startsWith("String_Node_Str")) {
      myChain=q.substring(1);
    }
  }
  setValue(theValue);
  if (isNotBlank(resourceType) && isBlank(getResourceType())) {
    setValue(resourceType + '/' + theValue);
  }
}

Fixed version (ground truth):
@Override void doSetValueAsQueryToken(FhirContext theContext,String theParamName,String theQualifier,String theValue){
  String q=theQualifier;
  String resourceType=null;
  boolean skipSetValue=false;
  if (isNotBlank(q)) {
    if (q.startsWith("String_Node_Str")) {
      int nextIdx=q.indexOf('.');
      if (nextIdx != -1) {
        resourceType=q.substring(1,nextIdx);
        myChain=q.substring(nextIdx + 1);
        myId.setParts(null,resourceType,theValue,null);
        skipSetValue=true;
      }
 else {
        resourceType=q.substring(1);
      }
    }
 else     if (q.startsWith("String_Node_Str")) {
      myChain=q.substring(1);
      myId.setParts(null,null,theValue,null);
      skipSetValue=true;
    }
  }
  if (!skipSetValue) {
    setValue(theValue);
    if (isNotBlank(resourceType) && isBlank(getResourceType())) {
      setValue(resourceType + '/' + theValue);
    }
  }
}
Program: 112172
Project: 112172
Buggy source:
@Test public void testWithResourceTypeAsQualifierAndChain(){
  ReferenceParam rp=new ReferenceParam();
  rp.setValueAsQueryToken(ourCtx,null,"String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",rp.getResourceType());
  assertEquals("String_Node_Str",rp.getIdPart());
  assertEquals("String_Node_Str",rp.getQueryParameterQualifier());
  assertEquals("String_Node_Str",rp.getChain());
}

Fixed version (ground truth):
@Test public void testWithResourceTypeAsQualifierAndChain(){
  ReferenceParam rp=new ReferenceParam();
  rp.setValueAsQueryToken(ourCtx,null,"String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",rp.getResourceType());
  assertEquals("String_Node_Str",rp.getIdPart());
  assertEquals("String_Node_Str",rp.getValue());
  assertEquals("String_Node_Str",rp.getQueryParameterQualifier());
  assertEquals("String_Node_Str",rp.getChain());
}
Program: 112173
Project: 112173
Buggy source:
@Test public void testWithResourceTypeAsQualifier(){
  ReferenceParam rp=new ReferenceParam();
  rp.setValueAsQueryToken(ourCtx,null,"String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",rp.getResourceType());
  assertEquals("String_Node_Str",rp.getIdPart());
  assertEquals(null,rp.getQueryParameterQualifier());
}

Fixed version (ground truth):
@Test public void testWithResourceTypeAsQualifier(){
  ReferenceParam rp=new ReferenceParam();
  rp.setValueAsQueryToken(ourCtx,null,"String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",rp.getResourceType());
  assertEquals("String_Node_Str",rp.getIdPart());
  assertEquals("String_Node_Str",rp.getValue());
  assertEquals(null,rp.getQueryParameterQualifier());
}
Program: 112174
Project: 112174
Buggy source:
@Test public void testWithResourceType(){
  ReferenceParam rp=new ReferenceParam();
  rp.setValueAsQueryToken(ourCtx,null,null,"String_Node_Str");
  assertEquals("String_Node_Str",rp.getResourceType());
  assertEquals("String_Node_Str",rp.getIdPart());
  assertEquals(null,rp.getQueryParameterQualifier());
}

Fixed version (ground truth):
@Test public void testWithResourceType(){
  ReferenceParam rp=new ReferenceParam();
  rp.setValueAsQueryToken(ourCtx,null,null,"String_Node_Str");
  assertEquals("String_Node_Str",rp.getResourceType());
  assertEquals("String_Node_Str",rp.getIdPart());
  assertEquals("String_Node_Str",rp.getValue());
  assertEquals(null,rp.getQueryParameterQualifier());
}
Program: 112177
Project: 112177
Buggy source:
/** 
 * Constructor
 */
public SubscriptionActivatingSubscriber(IFhirResourceDao<? extends IBaseResource> theSubscriptionDao,Subscription.SubscriptionChannelType theChannelType,BaseSubscriptionInterceptor theSubscriptionInterceptor,PlatformTransactionManager theTransactionManager){
  mySubscriptionDao=theSubscriptionDao;
  mySubscriptionInterceptor=theSubscriptionInterceptor;
  myChannelType=theChannelType;
  myCtx=theSubscriptionDao.getContext();
  myTransactionManager=theTransactionManager;
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public SubscriptionActivatingSubscriber(IFhirResourceDao<? extends IBaseResource> theSubscriptionDao,Subscription.SubscriptionChannelType theChannelType,BaseSubscriptionInterceptor theSubscriptionInterceptor,PlatformTransactionManager theTransactionManager,AsyncTaskExecutor theTaskExecutor){
  mySubscriptionDao=theSubscriptionDao;
  mySubscriptionInterceptor=theSubscriptionInterceptor;
  myChannelType=theChannelType;
  myCtx=theSubscriptionDao.getContext();
  myTransactionManager=theTransactionManager;
  myTaskExecutor=theTaskExecutor;
  Validate.notNull(theTaskExecutor);
}
Program: 112179
Project: 112179
Buggy source:
@Override public void afterCommit(){
  activateSubscription(status,activeStatus,theSubscription,requestedStatus);
}

Fixed version (ground truth):
@Override public void afterCommit(){
  Future<?> activationFuture=myTaskExecutor.submit(new Runnable(){
    @Override public void run(){
      activateSubscription(activeStatus,theSubscription,requestedStatus);
    }
  }
);
  if (ourWaitForSubscriptionActivationSynchronouslyForUnitTest) {
    try {
      activationFuture.get(5,TimeUnit.SECONDS);
    }
 catch (    Exception e) {
      ourLog.error("String_Node_Str",e);
    }
  }
}
Program: 112180
Project: 112180
Buggy source:
private void activateSubscription(IPrimitiveType<?> theStatus,String theActiveStatus,final IBaseResource theSubscription,String theRequestedStatus){
  theStatus.setValueAsString(theActiveStatus);
  ourLog.info("String_Node_Str",theSubscription.getIdElement().toUnqualified().getValue(),theRequestedStatus,theActiveStatus);
  try {
    mySubscriptionDao.update(theSubscription);
  }
 catch (  final UnprocessableEntityException e) {
    ourLog.info("String_Node_Str",theSubscription.getIdElement());
    IBaseResource subscription=mySubscriptionDao.read(theSubscription.getIdElement());
    SubscriptionUtil.setStatus(myCtx,subscription,"String_Node_Str");
    SubscriptionUtil.setReason(myCtx,subscription,e.getMessage());
    mySubscriptionDao.update(subscription);
  }
}

Fixed version (ground truth):
private void activateSubscription(String theActiveStatus,final IBaseResource theSubscription,String theRequestedStatus){
  IBaseResource subscription=mySubscriptionDao.read(theSubscription.getIdElement());
  ourLog.info("String_Node_Str",subscription.getIdElement().toUnqualified().getValue(),theRequestedStatus,theActiveStatus);
  try {
    SubscriptionUtil.setStatus(myCtx,subscription,theActiveStatus);
    mySubscriptionDao.update(subscription);
    mySubscriptionInterceptor.registerSubscription(subscription.getIdElement(),subscription);
  }
 catch (  final UnprocessableEntityException e) {
    ourLog.info("String_Node_Str",subscription.getIdElement());
    SubscriptionUtil.setStatus(myCtx,subscription,"String_Node_Str");
    SubscriptionUtil.setReason(myCtx,subscription,e.getMessage());
    mySubscriptionDao.update(subscription);
  }
}
Program: 112181
Project: 112181
Buggy source:
@Bean() public BasicDataSource basicDataSource(){
  BasicDataSource retVal=new BasicDataSource(){
    @Override public Connection getConnection() throws SQLException {
      ConnectionWrapper retVal;
      try {
        retVal=new ConnectionWrapper(super.getConnection());
      }
 catch (      Exception e) {
        ourLog.error("String_Node_Str",e);
        logGetConnectionStackTrace();
        fail("String_Node_Str" + e.toString());
        retVal=null;
      }
      try {
        throw new Exception();
      }
 catch (      Exception e) {
        myLastStackTrace=e;
      }
      return retVal;
    }
    private void logGetConnectionStackTrace(){
      StringBuilder b=new StringBuilder();
      b.append("String_Node_Str");
      for (      StackTraceElement next : myLastStackTrace.getStackTrace()) {
        b.append("String_Node_Str");
        b.append(next.getClassName());
        b.append("String_Node_Str");
        b.append(next.getMethodName());
        b.append("String_Node_Str");
        b.append(next.getFileName());
        b.append("String_Node_Str");
        b.append(next.getLineNumber());
        b.append("String_Node_Str");
      }
      ourLog.info(b.toString());
    }
  }
;
  retVal.setDriver(new org.apache.derby.jdbc.EmbeddedDriver());
  retVal.setUrl("String_Node_Str");
  retVal.setMaxWaitMillis(10000);
  retVal.setUsername("String_Node_Str");
  retVal.setPassword("String_Node_Str");
  int maxThreads=(int)(Math.random() * 6.0) + 1;
  maxThreads=1;
  retVal.setMaxTotal(maxThreads);
  return retVal;
}

Fixed version (ground truth):
@Bean() public BasicDataSource basicDataSource(){
  BasicDataSource retVal=new BasicDataSource(){
    @Override public Connection getConnection(){
      ConnectionWrapper retVal;
      try {
        retVal=new ConnectionWrapper(super.getConnection());
      }
 catch (      Exception e) {
        ourLog.error("String_Node_Str",e);
        logGetConnectionStackTrace();
        fail("String_Node_Str" + e.toString());
        retVal=null;
      }
      try {
        throw new Exception();
      }
 catch (      Exception e) {
        myLastStackTrace=e;
      }
      return retVal;
    }
    private void logGetConnectionStackTrace(){
      StringBuilder b=new StringBuilder();
      b.append("String_Node_Str");
      for (      StackTraceElement next : myLastStackTrace.getStackTrace()) {
        b.append("String_Node_Str");
        b.append(next.getClassName());
        b.append("String_Node_Str");
        b.append(next.getMethodName());
        b.append("String_Node_Str");
        b.append(next.getFileName());
        b.append("String_Node_Str");
        b.append(next.getLineNumber());
        b.append("String_Node_Str");
      }
      ourLog.info(b.toString());
    }
  }
;
  retVal.setDriver(new org.apache.derby.jdbc.EmbeddedDriver());
  retVal.setUrl("String_Node_Str");
  retVal.setMaxWaitMillis(10000);
  retVal.setUsername("String_Node_Str");
  retVal.setPassword("String_Node_Str");
  int maxThreads=(int)(Math.random() * 6.0) + 1;
  maxThreads=1;
  retVal.setMaxTotal(maxThreads);
  return retVal;
}
Program: 112182
Project: 112182
Buggy source:
@Override public Connection getConnection() throws SQLException {
  ConnectionWrapper retVal;
  try {
    retVal=new ConnectionWrapper(super.getConnection());
  }
 catch (  Exception e) {
    ourLog.error("String_Node_Str",e);
    logGetConnectionStackTrace();
    fail("String_Node_Str" + e.toString());
    retVal=null;
  }
  try {
    throw new Exception();
  }
 catch (  Exception e) {
    myLastStackTrace=e;
  }
  return retVal;
}

Fixed version (ground truth):
@Override public Connection getConnection(){
  ConnectionWrapper retVal;
  try {
    retVal=new ConnectionWrapper(super.getConnection());
  }
 catch (  Exception e) {
    ourLog.error("String_Node_Str",e);
    logGetConnectionStackTrace();
    fail("String_Node_Str" + e.toString());
    retVal=null;
  }
  try {
    throw new Exception();
  }
 catch (  Exception e) {
    myLastStackTrace=e;
  }
  return retVal;
}
Program: 112183
Project: 112183
Buggy source:
@After public void afterResetDao(){
  myDaoConfig.setResourceServerIdStrategy(new DaoConfig().getResourceServerIdStrategy());
  BaseHapiFhirDao.setValidationDisabledForUnitTest(false);
}

Fixed version (ground truth):
@After public void afterResetDao(){
  SubscriptionActivatingSubscriber.setWaitForSubscriptionActivationSynchronouslyForUnitTest(false);
  myDaoConfig.setResourceServerIdStrategy(new DaoConfig().getResourceServerIdStrategy());
  BaseHapiFhirDao.setValidationDisabledForUnitTest(false);
}
Program: 112184
Project: 112184
Buggy source:
public boolean matchesInclude(Include theInclude){
  if (theInclude.getValue().equals("String_Node_Str")) {
    return true;
  }
  int colonIndex=theInclude.getValue().indexOf(':');
  if (colonIndex != -1) {
    String resourceName=theInclude.getValue().substring(0,colonIndex);
    String paramName=theInclude.getValue().substring(colonIndex + 1);
    RuntimeResourceDefinition resourceDef=myContext.getResourceDefinition(resourceName);
    if (resourceDef != null) {
      RuntimeSearchParam searchParamDef=resourceDef.getSearchParam(paramName);
      if (searchParamDef != null) {
        if (searchParamDef.getPathsSplit().contains(myOwningResource + "String_Node_Str" + myName)) {
          return true;
        }
      }
    }
    return false;
  }
  return (theInclude.getValue().equals(myOwningResource + '.' + myName));
}

Fixed version (ground truth):
public boolean matchesInclude(Include theInclude){
  if (theInclude.getValue().equals("String_Node_Str")) {
    return true;
  }
  int colonIndex=theInclude.getValue().indexOf(':');
  if (colonIndex != -1) {
    String resourceName=theInclude.getValue().substring(0,colonIndex);
    String paramName=theInclude.getValue().substring(colonIndex + 1);
    RuntimeResourceDefinition resourceDef=myContext.getResourceDefinition(resourceName);
    if (resourceDef != null) {
      RuntimeSearchParam searchParamDef=resourceDef.getSearchParam(paramName);
      if (searchParamDef != null) {
        final String myCompleteName=myOwningResource + "String_Node_Str" + myName;
        boolean matched=false;
        for (        String s : searchParamDef.getPathsSplit()) {
          if (s.equals(myCompleteName) || s.startsWith(myCompleteName + "String_Node_Str")) {
            matched=true;
            break;
          }
        }
        return matched;
      }
    }
    return false;
  }
  return (theInclude.getValue().equals(myOwningResource + '.' + myName));
}
Program: 112185
Project: 112185
Buggy source:
@Override public int hashCode(){
  HashCodeBuilder b=new HashCodeBuilder();
  b.append(getParamName());
  b.append(getResource());
  b.append(getValueHigh());
  b.append(getValueLow());
  return b.toHashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  HashCodeBuilder b=new HashCodeBuilder();
  b.append(getParamName());
  b.append(getResource());
  b.append(getTimeFromDate(getValueHigh()));
  b.append(getTimeFromDate(getValueLow()));
  return b.toHashCode();
}
Program: 112186
Project: 112186
Buggy source:
@Override public boolean equals(Object theObj){
  if (this == theObj) {
    return true;
  }
  if (theObj == null) {
    return false;
  }
  if (!(theObj instanceof ResourceIndexedSearchParamDate)) {
    return false;
  }
  ResourceIndexedSearchParamDate obj=(ResourceIndexedSearchParamDate)theObj;
  EqualsBuilder b=new EqualsBuilder();
  b.append(getParamName(),obj.getParamName());
  b.append(getResource(),obj.getResource());
  b.append(getValueHigh(),obj.getValueHigh());
  b.append(getValueLow(),obj.getValueLow());
  return b.isEquals();
}

Fixed version (ground truth):
@Override public boolean equals(Object theObj){
  if (this == theObj) {
    return true;
  }
  if (theObj == null) {
    return false;
  }
  if (!(theObj instanceof ResourceIndexedSearchParamDate)) {
    return false;
  }
  ResourceIndexedSearchParamDate obj=(ResourceIndexedSearchParamDate)theObj;
  EqualsBuilder b=new EqualsBuilder();
  b.append(getParamName(),obj.getParamName());
  b.append(getResource(),obj.getResource());
  b.append(getTimeFromDate(getValueHigh()),getTimeFromDate(obj.getValueHigh()));
  b.append(getTimeFromDate(getValueLow()),getTimeFromDate(obj.getValueLow()));
  return b.isEquals();
}
Program: 112187
Project: 112187
Buggy source:
/** 
 * This method will retrieve the conformance using the http GET method
 * @return the response containing the conformance
 */
@GET @Path("String_Node_Str") public Response conformance() throws IOException {
  Builder request=getRequest(RequestTypeEnum.OPTIONS,RestOperationTypeEnum.METADATA);
  IRestfulResponse response=request.build().getResponse();
  response.addHeader(Constants.HEADER_CORS_ALLOW_ORIGIN,"String_Node_Str");
  IBaseResource conformance=null;
  if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.R4)) {
    conformance=myR4CapabilityStatement;
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU3)) {
    conformance=myDstu3CapabilityStatement;
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU2_1)) {
    conformance=myDstu2_1Conformance;
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU2)) {
    conformance=myDstu2Conformance;
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU2_HL7ORG)) {
    conformance=myDstu2Hl7OrgConformance;
  }
  if (conformance != null) {
    Set<SummaryEnum> summaryMode=Collections.emptySet();
    return (Response)response.streamResponseAsResource(conformance,false,summaryMode,Constants.STATUS_HTTP_200_OK,null,true,false);
  }
  return (Response)response.returnResponse(null,Constants.STATUS_HTTP_500_INTERNAL_ERROR,true,null,getResourceType().getSimpleName());
}

Fixed version (ground truth):
/** 
 * This method will retrieve the conformance using the http GET method
 * @return the response containing the conformance
 */
@GET @Path("String_Node_Str") public Response conformance() throws IOException {
  Builder request=getRequest(RequestTypeEnum.OPTIONS,RestOperationTypeEnum.METADATA);
  IRestfulResponse response=request.build().getResponse();
  response.addHeader(Constants.HEADER_CORS_ALLOW_ORIGIN,"String_Node_Str");
  IBaseResource conformance;
  FhirVersionEnum fhirContextVersion=super.getFhirContext().getVersion().getVersion();
switch (fhirContextVersion) {
case R4:
    conformance=myR4CapabilityStatement;
  break;
case DSTU3:
conformance=myDstu3CapabilityStatement;
break;
case DSTU2_1:
conformance=myDstu2_1Conformance;
break;
case DSTU2_HL7ORG:
conformance=myDstu2Hl7OrgConformance;
break;
case DSTU2:
conformance=myDstu2Conformance;
break;
default :
throw new ConfigurationException("String_Node_Str" + fhirContextVersion);
}
if (conformance != null) {
Set<SummaryEnum> summaryMode=Collections.emptySet();
return (Response)response.streamResponseAsResource(conformance,false,summaryMode,Constants.STATUS_HTTP_200_OK,null,true,false);
}
return (Response)response.returnResponse(null,Constants.STATUS_HTTP_500_INTERNAL_ERROR,true,null,getResourceType().getSimpleName());
}
Program: 112188
Project: 112188
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Class<IBaseResource> getResourceType(){
  if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.R4)) {
    return Class.class.cast(org.hl7.fhir.r4.model.CapabilityStatement.class);
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU3)) {
    return Class.class.cast(CapabilityStatement.class);
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU2_1)) {
    return Class.class.cast(org.hl7.fhir.dstu2016may.model.Conformance.class);
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU2)) {
    return Class.class.cast(ca.uhn.fhir.model.dstu2.resource.Conformance.class);
  }
 else   if (super.getFhirContext().getVersion().getVersion().equals(FhirVersionEnum.DSTU2_HL7ORG)) {
    return Class.class.cast(org.hl7.fhir.instance.model.Conformance.class);
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Class<IBaseResource> getResourceType(){
  FhirVersionEnum fhirContextVersion=super.getFhirContext().getVersion().getVersion();
switch (fhirContextVersion) {
case R4:
    return Class.class.cast(org.hl7.fhir.r4.model.CapabilityStatement.class);
case DSTU3:
  return Class.class.cast(org.hl7.fhir.dstu3.model.CapabilityStatement.class);
case DSTU2_1:
return Class.class.cast(org.hl7.fhir.dstu2016may.model.Conformance.class);
case DSTU2_HL7ORG:
return Class.class.cast(org.hl7.fhir.instance.model.Conformance.class);
case DSTU2:
return Class.class.cast(ca.uhn.fhir.model.dstu2.resource.Conformance.class);
default :
throw new ConfigurationException("String_Node_Str" + fhirContextVersion);
}
}
Program: 112192
Project: 112192
Buggy source:
@Test public void testIfModifiedSince() throws Exception {
  CloseableHttpResponse status;
  HttpGet httpGet;
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(200,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
}

Fixed version (ground truth):
@Test public void testIfModifiedSince() throws Exception {
  CloseableHttpResponse status;
  HttpGet httpGet;
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(200,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
}
Program: 112193
Project: 112193
Buggy source:
@Test public void testIfModifiedSince() throws Exception {
  CloseableHttpResponse status;
  HttpGet httpGet;
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(200,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
}

Fixed version (ground truth):
@Test public void testIfModifiedSince() throws Exception {
  CloseableHttpResponse status;
  HttpGet httpGet;
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(200,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
}
Program: 112194
Project: 112194
Buggy source:
/** 
 * Convert an exception to a response
 * @param theRequest the incoming request
 * @param theException the exception to convert
 * @return response
 * @throws IOException
 */
public Response handleException(final JaxRsRequest theRequest,final Throwable theException) throws IOException {
  if (theException instanceof JaxRsResponseException) {
    return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest,(JaxRsResponseException)theException);
  }
 else   if (theException instanceof DataFormatException) {
    return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest,new JaxRsResponseException(new InvalidRequestException(theException.getMessage(),createOutcome((DataFormatException)theException))));
  }
 else {
    return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest,new JaxRsExceptionInterceptor().convertException(this,theException));
  }
}

Fixed version (ground truth):
/** 
 * Convert an exception to a response
 * @param theRequest the incoming request
 * @param theException the exception to convert
 * @return response
 * @throws IOException
 */
public Response handleException(final JaxRsRequest theRequest,final Throwable theException) throws IOException {
  if (theException instanceof JaxRsResponseException) {
    return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest,(JaxRsResponseException)theException);
  }
 else {
    return new JaxRsExceptionInterceptor().convertExceptionIntoResponse(theRequest,new JaxRsExceptionInterceptor().convertException(this,theException));
  }
}
Program: 112195
Project: 112195
Buggy source:
@Override public BaseServerResponseException preProcessOutgoingException(RequestDetails theRequestDetails,Throwable theException,HttpServletRequest theServletRequest) throws ServletException {
  BaseServerResponseException retVal;
  if (!(theException instanceof BaseServerResponseException)) {
    retVal=new InternalErrorException(theException);
  }
 else {
    retVal=(BaseServerResponseException)theException;
  }
  if (retVal.getOperationOutcome() == null) {
    retVal.setOperationOutcome(createOperationOutcome(theException,theRequestDetails.getServer().getFhirContext()));
  }
  return retVal;
}

Fixed version (ground truth):
@Override public BaseServerResponseException preProcessOutgoingException(RequestDetails theRequestDetails,Throwable theException,HttpServletRequest theServletRequest) throws ServletException {
  BaseServerResponseException retVal;
  if (theException instanceof DataFormatException) {
    retVal=new InvalidRequestException(theException);
  }
 else   if (!(theException instanceof BaseServerResponseException)) {
    retVal=new InternalErrorException(theException);
  }
 else {
    retVal=(BaseServerResponseException)theException;
  }
  if (retVal.getOperationOutcome() == null) {
    retVal.setOperationOutcome(createOperationOutcome(theException,theRequestDetails.getServer().getFhirContext()));
  }
  return retVal;
}
Program: 112196
Project: 112196
Buggy source:
private IBaseOperationOutcome createOutcome(final DataFormatException theException){
  final IBaseOperationOutcome oo=OperationOutcomeUtil.newInstance(getFhirContext());
  final String detailsValue=theException.getMessage() + "String_Node_Str" + ExceptionUtils.getStackTrace(theException);
  OperationOutcomeUtil.addIssue(getFhirContext(),oo,ERROR,detailsValue,null,PROCESSING);
  return oo;
}

Fixed version (ground truth):
private IBaseOperationOutcome createOutcome(final DataFormatException theException){
  final IBaseOperationOutcome oo=OperationOutcomeUtil.newInstance(getFhirContext());
  final String detailsValue=theException.getMessage() + (this.withStackTrace() ? "String_Node_Str" + ExceptionUtils.getStackTrace(theException) : "String_Node_Str");
  OperationOutcomeUtil.addIssue(getFhirContext(),oo,ERROR,detailsValue,null,PROCESSING);
  return oo;
}
Program: 112197
Project: 112197
Buggy source:
private void readArray(JsonArray arr,boolean root) throws FHIRException {
  while (!((itemType == ItemType.End) || (root && (itemType == ItemType.Eof)))) {
switch (itemType) {
case Object:
      JsonObject obj=new JsonObject();
    LocationData loc=lexer.location.copy();
  arr.add(obj);
next();
readObject(obj,false);
map.put(obj,loc);
break;
case String:
JsonPrimitive v=new JsonPrimitive(itemValue);
arr.add(v);
map.put(v,lexer.location.copy());
break;
case Number:
v=new JsonPrimitive(new BigDecimal(itemValue));
arr.add(v);
map.put(v,lexer.location.copy());
break;
case Null:
JsonNull n=new JsonNull();
arr.add(n);
map.put(n,lexer.location.copy());
break;
case Array:
JsonArray child=new JsonArray();
loc=lexer.location.copy();
arr.add(child);
next();
readArray(child,false);
map.put(arr,loc);
break;
case Eof:
throw lexer.error("String_Node_Str");
default :
break;
}
next();
}
}

Fixed version (ground truth):
private void readArray(JsonArray arr,boolean root) throws FHIRException {
  while (!((itemType == ItemType.End) || (root && (itemType == ItemType.Eof)))) {
switch (itemType) {
case Object:
      JsonObject obj=new JsonObject();
    LocationData loc=lexer.location.copy();
  arr.add(obj);
next();
readObject(obj,false);
map.put(obj,loc);
break;
case String:
JsonPrimitive v=new JsonPrimitive(itemValue);
arr.add(v);
map.put(v,lexer.location.copy());
break;
case Number:
v=new JsonPrimitive(new BigDecimal(itemValue));
arr.add(v);
map.put(v,lexer.location.copy());
break;
case Null:
JsonNull n=new JsonNull();
arr.add(n);
map.put(n,lexer.location.copy());
break;
case Array:
JsonArray child=new JsonArray();
loc=lexer.location.copy();
arr.add(child);
next();
readArray(child,false);
map.put(arr,loc);
break;
case Eof:
throw lexer.error("String_Node_Str");
case Boolean:
case End:
default :
break;
}
next();
}
}
Program: 112198
Project: 112198
Buggy source:
private void readObject(JsonObject obj,boolean root) throws FHIRException {
  map.put(obj,lexer.location.copy());
  while (!(itemType == ItemType.End) || (root && (itemType == ItemType.Eof))) {
    if (obj.has(itemName))     throw lexer.error("String_Node_Str" + itemName);
switch (itemType) {
case Object:
      JsonObject child=new JsonObject();
    LocationData loc=lexer.location.copy();
  obj.add(itemName,child);
next();
readObject(child,false);
map.put(obj,loc);
break;
case Boolean:
JsonPrimitive v=new JsonPrimitive(Boolean.valueOf(itemValue));
obj.add(itemName,v);
map.put(v,lexer.location.copy());
break;
case String:
v=new JsonPrimitive(itemValue);
obj.add(itemName,v);
map.put(v,lexer.location.copy());
break;
case Number:
v=new JsonPrimitive(new BigDecimal(itemValue));
obj.add(itemName,v);
map.put(v,lexer.location.copy());
break;
case Null:
JsonNull n=new JsonNull();
obj.add(itemName,n);
map.put(n,lexer.location.copy());
break;
case Array:
JsonArray arr=new JsonArray();
loc=lexer.location.copy();
obj.add(itemName,arr);
next();
readArray(arr,false);
map.put(arr,loc);
break;
case Eof:
throw lexer.error("String_Node_Str");
default :
break;
}
next();
}
}

Fixed version (ground truth):
private void readObject(JsonObject obj,boolean root) throws FHIRException {
  map.put(obj,lexer.location.copy());
  while (!(itemType == ItemType.End) || (root && (itemType == ItemType.Eof))) {
    if (obj.has(itemName))     throw lexer.error("String_Node_Str" + itemName);
switch (itemType) {
case Object:
      JsonObject child=new JsonObject();
    LocationData loc=lexer.location.copy();
  obj.add(itemName,child);
next();
readObject(child,false);
map.put(obj,loc);
break;
case Boolean:
JsonPrimitive v=new JsonPrimitive(Boolean.valueOf(itemValue));
obj.add(itemName,v);
map.put(v,lexer.location.copy());
break;
case String:
v=new JsonPrimitive(itemValue);
obj.add(itemName,v);
map.put(v,lexer.location.copy());
break;
case Number:
v=new JsonPrimitive(new BigDecimal(itemValue));
obj.add(itemName,v);
map.put(v,lexer.location.copy());
break;
case Null:
JsonNull n=new JsonNull();
obj.add(itemName,n);
map.put(n,lexer.location.copy());
break;
case Array:
JsonArray arr=new JsonArray();
loc=lexer.location.copy();
obj.add(itemName,arr);
next();
readArray(arr,false);
map.put(arr,loc);
break;
case Eof:
throw lexer.error("String_Node_Str");
case End:
default :
break;
}
next();
}
}
Program: 112199
Project: 112199
Buggy source:
private void deleteSearch(final Long theSearchPid){
  Search searchToDelete=mySearchDao.findOne(theSearchPid);
  ourLog.info("String_Node_Str",searchToDelete.getId(),searchToDelete.getUuid(),searchToDelete.getCreated(),searchToDelete.getSearchLastReturned());
  mySearchIncludeDao.deleteForSearch(searchToDelete.getId());
  mySearchResultDao.deleteForSearch(searchToDelete.getId());
  mySearchDao.delete(searchToDelete);
}

Fixed version (ground truth):
private void deleteSearch(final Long theSearchPid){
  Search searchToDelete=mySearchDao.findOne(theSearchPid);
  if (searchToDelete != null) {
    ourLog.info("String_Node_Str",searchToDelete.getId(),searchToDelete.getUuid(),searchToDelete.getCreated(),searchToDelete.getSearchLastReturned());
    mySearchIncludeDao.deleteForSearch(searchToDelete.getId());
    mySearchResultDao.deleteForSearch(searchToDelete.getId());
    mySearchDao.delete(searchToDelete);
  }
}
Program: 112205
Project: 112205
Buggy source:
@Override public void run(CommandLine theCommandLine) throws ParseException, Exception {
  FhirContext ctx=getSpecVersionContext(theCommandLine);
  String targetServer=theCommandLine.getOptionValue("String_Node_Str");
  IGenericClient client=ctx.newRestfulGenericClient(targetServer);
  String url=theCommandLine.getOptionValue("String_Node_Str");
  Collection<File> files=loadFile(ctx,url,null,false);
  for (  File nextFile : files) {
switch (ctx.getVersion().getVersion()) {
case DSTU3:
      IgPackParserDstu3 packParser=new IgPackParserDstu3(ctx);
    IValidationSupport ig=packParser.parseIg(new FileInputStream(nextFile),nextFile.getName());
  Iterable<IBaseResource> conformanceResources=ig.fetchAllConformanceResources(ctx);
for (IBaseResource nextResource : conformanceResources) {
  String nextResourceUrl=((IPrimitiveType<?>)ctx.newTerser().getSingleValueOrNull(nextResource,"String_Node_Str")).getValueAsString();
  ourLog.info("String_Node_Str",nextResourceUrl);
  client.update().resource(nextResource).conditional().and(StructureDefinition.URL.matches().value(nextResourceUrl)).execute();
}
default :
throw new ParseException("String_Node_Str" + ctx.getVersion().getVersion());
}
}
}

Fixed version (ground truth):
@Override public void run(CommandLine theCommandLine) throws ParseException, Exception {
  FhirContext ctx=getSpecVersionContext(theCommandLine);
  String targetServer=theCommandLine.getOptionValue("String_Node_Str");
  IGenericClient client=ctx.newRestfulGenericClient(targetServer);
  String url=theCommandLine.getOptionValue("String_Node_Str");
  Collection<File> files=loadFile(ctx,url,null,false);
  for (  File nextFile : files) {
switch (ctx.getVersion().getVersion()) {
case DSTU3:
      IgPackParserDstu3 packParser=new IgPackParserDstu3(ctx);
    IValidationSupport ig=packParser.parseIg(new FileInputStream(nextFile),nextFile.getName());
  Iterable<IBaseResource> conformanceResources=ig.fetchAllConformanceResources(ctx);
for (IBaseResource nextResource : conformanceResources) {
  String nextResourceUrl=((IPrimitiveType<?>)ctx.newTerser().getSingleValueOrNull(nextResource,"String_Node_Str")).getValueAsString();
  ourLog.info("String_Node_Str",nextResourceUrl);
  client.update().resource(nextResource).conditional().and(StructureDefinition.URL.matches().value(nextResourceUrl)).execute();
}
break;
default :
throw new ParseException("String_Node_Str" + ctx.getVersion().getVersion());
}
}
}
Program: 112206
Project: 112206
Buggy source:
@Override public String getClientInfo(String theName) throws SQLException {
  return getClientInfo(theName);
}

Fixed version (ground truth):
@Override public String getClientInfo(String theName) throws SQLException {
  return myWrap.getClientInfo(theName);
}
Program: 112207
Project: 112207
Buggy source:
protected List<String> toUnqualifiedVersionlessIdValues(IBundleProvider theFound){
  List<String> retVal=new ArrayList<String>();
  int size=theFound.size();
  ourLog.info("String_Node_Str",size);
  List<IBaseResource> resources=theFound.getResources(0,size);
  for (  IBaseResource next : resources) {
    retVal.add(next.getIdElement().toUnqualifiedVersionless().getValue());
  }
  return retVal;
}

Fixed version (ground truth):
protected List<String> toUnqualifiedVersionlessIdValues(IBundleProvider theFound){
  List<String> retVal=new ArrayList<String>();
  Integer size=theFound.size();
  ourLog.info("String_Node_Str",size);
  if (size == null) {
    size=99999;
  }
  List<IBaseResource> resources=theFound.getResources(0,size);
  for (  IBaseResource next : resources) {
    retVal.add(next.getIdElement().toUnqualifiedVersionless().getValue());
  }
  return retVal;
}
Program: 112212
Project: 112212
Buggy source:
@Test public void testIfModifiedSince() throws Exception {
  CloseableHttpResponse status;
  HttpGet httpGet;
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(200,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
}

Fixed version (ground truth):
@Test public void testIfModifiedSince() throws Exception {
  CloseableHttpResponse status;
  HttpGet httpGet;
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(304,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
  httpGet=new HttpGet("String_Node_Str" + ourPort + "String_Node_Str");
  httpGet.addHeader(Constants.HEADER_IF_MODIFIED_SINCE,DateUtils.formatDate(new InstantDt("String_Node_Str").getValue()));
  status=ourClient.execute(httpGet);
  try {
    assertEquals(200,status.getStatusLine().getStatusCode());
  }
  finally {
    IOUtils.closeQuietly(status);
  }
}
Program: 112213
Project: 112213
Buggy source:
/** 
 * Returns the value of this ID. Note that this value may be a fully qualified URL, a relative/partial URL, or a simple ID. Use   {@link #getIdPart()} to get just the ID portion.
 * @see #getIdPart()
 */
@Override public String getValue(){
  if (super.getValue() == null && myHaveComponentParts) {
    if (isLocal() || isUrn()) {
      return myUnqualifiedId;
    }
    StringBuilder b=new StringBuilder();
    if (isNotBlank(myBaseUrl)) {
      b.append(myBaseUrl);
      if (myBaseUrl.charAt(myBaseUrl.length() - 1) != '/') {
        b.append('/');
      }
    }
    if (isNotBlank(myResourceType)) {
      b.append(myResourceType);
    }
    if (b.length() > 0) {
      b.append('/');
    }
    b.append(myUnqualifiedId);
    if (isNotBlank(myUnqualifiedVersionId)) {
      b.append('/');
      b.append(Constants.PARAM_HISTORY);
      b.append('/');
      b.append(myUnqualifiedVersionId);
    }
    String value=b.toString();
    super.setValue(value);
  }
  return super.getValue();
}

Fixed version (ground truth):
/** 
 * Returns the value of this ID. Note that this value may be a fully qualified URL, a relative/partial URL, or a simple ID. Use   {@link #getIdPart()} to get just the ID portion.
 * @see #getIdPart()
 */
@Override public String getValue(){
  if (super.getValue() == null && myHaveComponentParts) {
    if (isLocal() || isUrn()) {
      return myUnqualifiedId;
    }
    StringBuilder b=new StringBuilder();
    if (isNotBlank(myBaseUrl)) {
      b.append(myBaseUrl);
      if (myBaseUrl.charAt(myBaseUrl.length() - 1) != '/') {
        b.append('/');
      }
    }
    if (isNotBlank(myResourceType)) {
      b.append(myResourceType);
    }
    if (b.length() > 0 && isNotBlank(myUnqualifiedId)) {
      b.append('/');
    }
    if (isNotBlank(myUnqualifiedId)) {
      b.append(myUnqualifiedId);
    }
 else     if (isNotBlank(myUnqualifiedVersionId)) {
      b.append('/');
    }
    if (isNotBlank(myUnqualifiedVersionId)) {
      b.append('/');
      b.append(Constants.PARAM_HISTORY);
      b.append('/');
      b.append(myUnqualifiedVersionId);
    }
    String value=b.toString();
    super.setValue(value);
  }
  return super.getValue();
}
Program: 112215
Project: 112215
Buggy source:
public void setTargetResourceUrl(IIdType theTargetResourceUrl){
  Validate.isTrue(theTargetResourceUrl.hasBaseUrl());
  Validate.isTrue(theTargetResourceUrl.hasResourceType());
  Validate.isTrue(theTargetResourceUrl.hasIdPart());
  myTargetResourceType=theTargetResourceUrl.getResourceType();
  myTargetResourceUrl=theTargetResourceUrl.getValue();
}

Fixed version (ground truth):
public void setTargetResourceUrl(IIdType theTargetResourceUrl){
  Validate.isTrue(theTargetResourceUrl.hasBaseUrl());
  Validate.isTrue(theTargetResourceUrl.hasResourceType());
  if (theTargetResourceUrl.hasIdPart()) {
  }
 else {
  }
  myTargetResourceType=theTargetResourceUrl.getResourceType();
  myTargetResourceUrl=theTargetResourceUrl.getValue();
}