Program: 112251
Project: 112251
Buggy source:
@SuppressWarnings("String_Node_Str") private Bundle doTransaction(ServletRequestDetails theRequestDetails,Bundle theRequest,String theActionName){
  BundleType transactionType=theRequest.getTypeElement().getValue();
  if (transactionType == BundleType.BATCH) {
    return batch(theRequestDetails,theRequest);
  }
  if (transactionType == null) {
    String message="String_Node_Str" + BundleType.TRANSACTION.toCode();
    ourLog.warn(message);
    transactionType=BundleType.TRANSACTION;
  }
  if (transactionType != BundleType.TRANSACTION) {
    throw new InvalidRequestException("String_Node_Str" + transactionType.toCode());
  }
  ourLog.info("String_Node_Str",theActionName,theRequest.getEntry().size());
  long start=System.currentTimeMillis();
  Date updateTime=new Date();
  Set<IdType> allIds=new LinkedHashSet<IdType>();
  Map<IdType,IdType> idSubstitutions=new HashMap<IdType,IdType>();
  Map<IdType,DaoMethodOutcome> idToPersistedOutcome=new HashMap<IdType,DaoMethodOutcome>();
  for (int i=0; i < theRequest.getEntry().size(); i++) {
    BundleEntryComponent nextReqEntry=theRequest.getEntry().get(i);
    HTTPVerb verb=nextReqEntry.getRequest().getMethodElement().getValue();
    if (verb == null) {
      throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class,"String_Node_Str",nextReqEntry.getRequest().getMethod(),i));
    }
  }
  Bundle response=new Bundle();
  List<BundleEntryComponent> getEntries=new ArrayList<BundleEntryComponent>();
  IdentityHashMap<BundleEntryComponent,Integer> originalRequestOrder=new IdentityHashMap<Bundle.BundleEntryComponent,Integer>();
  for (int i=0; i < theRequest.getEntry().size(); i++) {
    originalRequestOrder.put(theRequest.getEntry().get(i),i);
    response.addEntry();
    if (theRequest.getEntry().get(i).getRequest().getMethodElement().getValue() == HTTPVerb.GET) {
      getEntries.add(theRequest.getEntry().get(i));
    }
  }
  Collections.sort(theRequest.getEntry(),new TransactionSorter());
  Set<String> deletedResources=new HashSet<String>();
  List<DeleteConflict> deleteConflicts=new ArrayList<DeleteConflict>();
  Map<BundleEntryComponent,ResourceTable> entriesToProcess=new IdentityHashMap<BundleEntryComponent,ResourceTable>();
  Set<ResourceTable> nonUpdatedEntities=new HashSet<ResourceTable>();
  for (int i=0; i < theRequest.getEntry().size(); i++) {
    if (i % 100 == 0) {
      ourLog.info("String_Node_Str",i,theRequest.getEntry().size());
    }
    BundleEntryComponent nextReqEntry=theRequest.getEntry().get(i);
    Resource res=nextReqEntry.getResource();
    IdType nextResourceId=null;
    if (res != null) {
      nextResourceId=res.getIdElement();
      if (nextResourceId.hasIdPart() == false) {
        if (isNotBlank(nextReqEntry.getFullUrl())) {
          nextResourceId=new IdType(nextReqEntry.getFullUrl());
        }
      }
      if (nextResourceId.hasIdPart() && nextResourceId.getIdPart().matches("String_Node_Str") && !isPlaceholder(nextResourceId)) {
        throw new InvalidRequestException("String_Node_Str" + nextResourceId.getIdPart() + "String_Node_Str");
      }
      if (nextResourceId.hasIdPart() && !nextResourceId.hasResourceType() && !isPlaceholder(nextResourceId)) {
        nextResourceId=new IdType(toResourceName(res.getClass()),nextResourceId.getIdPart());
        res.setId(nextResourceId);
      }
      if (isPlaceholder(nextResourceId)) {
        if (!allIds.add(nextResourceId)) {
          throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class,"String_Node_Str",nextResourceId));
        }
      }
 else       if (nextResourceId.hasResourceType() && nextResourceId.hasIdPart()) {
        IdType nextId=nextResourceId.toUnqualifiedVersionless();
        if (!allIds.add(nextId)) {
          throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class,"String_Node_Str",nextId));
        }
      }
    }
    HTTPVerb verb=nextReqEntry.getRequest().getMethodElement().getValue();
    String resourceType=res != null ? getContext().getResourceDefinition(res).getName() : null;
    BundleEntryComponent nextRespEntry=response.getEntry().get(originalRequestOrder.get(nextReqEntry));
switch (verb) {
case POST:
{
        @SuppressWarnings("String_Node_Str") IFhirResourceDao resourceDao=getDaoOrThrowException(res.getClass());
        res.setId((String)null);
        DaoMethodOutcome outcome;
        String matchUrl=nextReqEntry.getRequest().getIfNoneExist();
        outcome=resourceDao.create(res,matchUrl,false,theRequestDetails);
        if (nextResourceId != null) {
          handleTransactionCreateOrUpdateOutcome(idSubstitutions,idToPersistedOutcome,nextResourceId,outcome,nextRespEntry,resourceType,res);
        }
        entriesToProcess.put(nextRespEntry,outcome.getEntity());
        if (outcome.getCreated() == false) {
          nonUpdatedEntities.add(outcome.getEntity());
        }
        break;
      }
case DELETE:
{
      String url=extractTransactionUrlOrThrowException(nextReqEntry,verb);
      UrlParts parts=UrlUtil.parseUrl(url);
      ca.uhn.fhir.jpa.dao.IFhirResourceDao<? extends IBaseResource> dao=toDao(parts,verb.toCode(),url);
      int status=Constants.STATUS_HTTP_204_NO_CONTENT;
      if (parts.getResourceId() != null) {
        IdType deleteId=new IdType(parts.getResourceType(),parts.getResourceId());
        if (!deletedResources.contains(deleteId.getValueAsString())) {
          DaoMethodOutcome outcome=dao.delete(deleteId,deleteConflicts,theRequestDetails);
          if (outcome.getEntity() != null) {
            deletedResources.add(deleteId.getValueAsString());
            entriesToProcess.put(nextRespEntry,outcome.getEntity());
          }
        }
      }
 else {
        DeleteMethodOutcome deleteOutcome=dao.deleteByUrl(parts.getResourceType() + '?' + parts.getParams(),deleteConflicts,theRequestDetails);
        List<ResourceTable> allDeleted=deleteOutcome.getDeletedEntities();
        for (        ResourceTable deleted : allDeleted) {
          deletedResources.add(deleted.getIdDt().toUnqualifiedVersionless().getValueAsString());
        }
        if (allDeleted.isEmpty()) {
          status=Constants.STATUS_HTTP_204_NO_CONTENT;
        }
        nextRespEntry.getResponse().setOutcome((Resource)deleteOutcome.getOperationOutcome());
      }
      nextRespEntry.getResponse().setStatus(toStatusString(status));
      break;
    }
case PUT:
{
    @SuppressWarnings("String_Node_Str") IFhirResourceDao resourceDao=getDaoOrThrowException(res.getClass());
    String url=extractTransactionUrlOrThrowException(nextReqEntry,verb);
    DaoMethodOutcome outcome;
    UrlParts parts=UrlUtil.parseUrl(url);
    if (isNotBlank(parts.getResourceId())) {
      res.setId(new IdType(parts.getResourceType(),parts.getResourceId()));
      outcome=resourceDao.update(res,null,false,theRequestDetails);
    }
 else {
      res.setId((String)null);
      outcome=resourceDao.update(res,parts.getResourceType() + '?' + parts.getParams(),false,theRequestDetails);
    }
    handleTransactionCreateOrUpdateOutcome(idSubstitutions,idToPersistedOutcome,nextResourceId,outcome,nextRespEntry,resourceType,res);
    entriesToProcess.put(nextRespEntry,outcome.getEntity());
    break;
  }
}
}
for (Iterator<DeleteConflict> iter=deleteConflicts.iterator(); iter.hasNext(); ) {
DeleteConflict next=iter.next();
if (deletedResources.contains(next.getTargetId().toUnqualifiedVersionless().getValue())) {
iter.remove();
}
}
validateDeleteConflictsEmptyOrThrowException(deleteConflicts);
FhirTerser terser=getContext().newTerser();
for (DaoMethodOutcome nextOutcome : idToPersistedOutcome.values()) {
IBaseResource nextResource=nextOutcome.getResource();
if (nextResource == null) {
continue;
}
List<IBaseReference> allRefs=terser.getAllPopulatedChildElementsOfType(nextResource,IBaseReference.class);
for (IBaseReference nextRef : allRefs) {
IIdType nextId=nextRef.getReferenceElement();
if (!nextId.hasIdPart()) {
  continue;
}
if (idSubstitutions.containsKey(nextId)) {
  IdType newId=idSubstitutions.get(nextId);
  ourLog.info("String_Node_Str",nextId,newId);
  nextRef.setReference(newId.getValue());
}
 else if (nextId.getValue().startsWith("String_Node_Str")) {
  throw new InvalidRequestException("String_Node_Str" + nextId.getValue());
}
 else {
  ourLog.debug("String_Node_Str",nextId);
}
}
IPrimitiveType<Date> deletedInstantOrNull=ResourceMetadataKeyEnum.DELETED_AT.get((IAnyResource)nextResource);
Date deletedTimestampOrNull=deletedInstantOrNull != null ? deletedInstantOrNull.getValue() : null;
boolean shouldUpdate=!nonUpdatedEntities.contains(nextOutcome.getEntity());
if (shouldUpdate) {
updateEntity(nextResource,nextOutcome.getEntity(),deletedTimestampOrNull,shouldUpdate,true,updateTime);
}
}
myEntityManager.flush();
for (BundleEntryComponent nextEntry : theRequest.getEntry()) {
if (nextEntry.getRequest().getMethodElement().getValue() == HTTPVerb.POST) {
String matchUrl=nextEntry.getRequest().getIfNoneExist();
if (isNotBlank(matchUrl)) {
  IFhirResourceDao<?> resourceDao=getDao(nextEntry.getResource().getClass());
  Set<Long> val=resourceDao.processMatchUrl(matchUrl);
  if (val.size() > 1) {
    throw new InvalidRequestException("String_Node_Str" + theActionName + "String_Node_Str"+ matchUrl+ "String_Node_Str");
  }
}
}
}
for (IdType next : allIds) {
IdType replacement=idSubstitutions.get(next);
if (replacement == null) {
continue;
}
if (replacement.equals(next)) {
continue;
}
ourLog.info("String_Node_Str",next,replacement);
}
for (int i=0; i < getEntries.size(); i++) {
BundleEntryComponent nextReqEntry=getEntries.get(i);
Integer originalOrder=originalRequestOrder.get(nextReqEntry);
BundleEntryComponent nextRespEntry=response.getEntry().get(originalOrder);
ServletSubRequestDetails requestDetails=new ServletSubRequestDetails();
requestDetails.setServletRequest(theRequestDetails.getServletRequest());
requestDetails.setRequestType(RequestTypeEnum.GET);
requestDetails.setServer(theRequestDetails.getServer());
String url=extractTransactionUrlOrThrowException(nextReqEntry,HTTPVerb.GET);
int qIndex=url.indexOf('?');
ArrayListMultimap<String,String> paramValues=ArrayListMultimap.create();
requestDetails.setParameters(new HashMap<String,String[]>());
if (qIndex != -1) {
String params=url.substring(qIndex);
List<NameValuePair> parameters=translateMatchUrl(params);
for (NameValuePair next : parameters) {
  paramValues.put(next.getName(),next.getValue());
}
for (java.util.Map.Entry<String,Collection<String>> nextParamEntry : paramValues.asMap().entrySet()) {
  String[] nextValue=nextParamEntry.getValue().toArray(new String[nextParamEntry.getValue().size()]);
  requestDetails.getParameters().put(nextParamEntry.getKey(),nextValue);
}
url=url.substring(0,qIndex);
}
requestDetails.setRequestPath(url);
requestDetails.setFhirServerBase(theRequestDetails.getFhirServerBase());
theRequestDetails.getServer().populateRequestDetailsFromRequestPath(requestDetails,url);
BaseMethodBinding<?> method=theRequestDetails.getServer().determineResourceMethod(requestDetails,url);
if (method == null) {
throw new IllegalArgumentException("String_Node_Str" + url);
}
if (isNotBlank(nextReqEntry.getRequest().getIfMatch())) {
requestDetails.addHeader(Constants.HEADER_IF_MATCH,nextReqEntry.getRequest().getIfMatch());
}
if (isNotBlank(nextReqEntry.getRequest().getIfNoneExist())) {
requestDetails.addHeader(Constants.HEADER_IF_NONE_EXIST,nextReqEntry.getRequest().getIfNoneExist());
}
if (isNotBlank(nextReqEntry.getRequest().getIfNoneMatch())) {
requestDetails.addHeader(Constants.HEADER_IF_NONE_MATCH,nextReqEntry.getRequest().getIfNoneMatch());
}
if (method instanceof BaseResourceReturningMethodBinding) {
try {
  ResourceOrDstu1Bundle responseData=((BaseResourceReturningMethodBinding)method).doInvokeServer(theRequestDetails.getServer(),requestDetails);
  IBaseResource resource=responseData.getResource();
  if (paramValues.containsKey(Constants.PARAM_SUMMARY) || paramValues.containsKey(Constants.PARAM_CONTENT)) {
    resource=filterNestedBundle(requestDetails,resource);
  }
  nextRespEntry.setResource((Resource)resource);
  nextRespEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_200_OK));
}
 catch (NotModifiedException e) {
  nextRespEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_304_NOT_MODIFIED));
}
}
 else {
throw new IllegalArgumentException("String_Node_Str" + url);
}
}
for (Entry<BundleEntryComponent,ResourceTable> nextEntry : entriesToProcess.entrySet()) {
nextEntry.getKey().getResponse().setLocation(nextEntry.getValue().getIdDt().toUnqualified().getValue());
nextEntry.getKey().getResponse().setEtag(nextEntry.getValue().getIdDt().getVersionIdPart());
}
long delay=System.currentTimeMillis() - start;
ourLog.info(theActionName + "String_Node_Str",new Object[]{delay});
response.setType(BundleType.TRANSACTIONRESPONSE);
return response;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Bundle doTransaction(ServletRequestDetails theRequestDetails,Bundle theRequest,String theActionName){
  BundleType transactionType=theRequest.getTypeElement().getValue();
  if (transactionType == BundleType.BATCH) {
    return batch(theRequestDetails,theRequest);
  }
  if (transactionType == null) {
    String message="String_Node_Str" + BundleType.TRANSACTION.toCode();
    ourLog.warn(message);
    transactionType=BundleType.TRANSACTION;
  }
  if (transactionType != BundleType.TRANSACTION) {
    throw new InvalidRequestException("String_Node_Str" + transactionType.toCode());
  }
  ourLog.info("String_Node_Str",theActionName,theRequest.getEntry().size());
  long start=System.currentTimeMillis();
  Date updateTime=new Date();
  Set<IdType> allIds=new LinkedHashSet<IdType>();
  Map<IdType,IdType> idSubstitutions=new HashMap<IdType,IdType>();
  Map<IdType,DaoMethodOutcome> idToPersistedOutcome=new HashMap<IdType,DaoMethodOutcome>();
  for (int i=0; i < theRequest.getEntry().size(); i++) {
    BundleEntryComponent nextReqEntry=theRequest.getEntry().get(i);
    HTTPVerb verb=nextReqEntry.getRequest().getMethodElement().getValue();
    if (verb == null) {
      throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class,"String_Node_Str",nextReqEntry.getRequest().getMethod(),i));
    }
  }
  Bundle response=new Bundle();
  List<BundleEntryComponent> getEntries=new ArrayList<BundleEntryComponent>();
  IdentityHashMap<BundleEntryComponent,Integer> originalRequestOrder=new IdentityHashMap<Bundle.BundleEntryComponent,Integer>();
  for (int i=0; i < theRequest.getEntry().size(); i++) {
    originalRequestOrder.put(theRequest.getEntry().get(i),i);
    response.addEntry();
    if (theRequest.getEntry().get(i).getRequest().getMethodElement().getValue() == HTTPVerb.GET) {
      getEntries.add(theRequest.getEntry().get(i));
    }
  }
  Collections.sort(theRequest.getEntry(),new TransactionSorter());
  Set<String> deletedResources=new HashSet<String>();
  List<DeleteConflict> deleteConflicts=new ArrayList<DeleteConflict>();
  Map<BundleEntryComponent,ResourceTable> entriesToProcess=new IdentityHashMap<BundleEntryComponent,ResourceTable>();
  Set<ResourceTable> nonUpdatedEntities=new HashSet<ResourceTable>();
  for (int i=0; i < theRequest.getEntry().size(); i++) {
    if (i % 100 == 0) {
      ourLog.info("String_Node_Str",i,theRequest.getEntry().size());
    }
    BundleEntryComponent nextReqEntry=theRequest.getEntry().get(i);
    Resource res=nextReqEntry.getResource();
    IdType nextResourceId=null;
    if (res != null) {
      nextResourceId=res.getIdElement();
      if (nextResourceId.hasIdPart() == false) {
        if (isNotBlank(nextReqEntry.getFullUrl())) {
          nextResourceId=new IdType(nextReqEntry.getFullUrl());
        }
      }
      if (nextResourceId.hasIdPart() && nextResourceId.getIdPart().matches("String_Node_Str") && !isPlaceholder(nextResourceId)) {
        throw new InvalidRequestException("String_Node_Str" + nextResourceId.getIdPart() + "String_Node_Str");
      }
      if (nextResourceId.hasIdPart() && !nextResourceId.hasResourceType() && !isPlaceholder(nextResourceId)) {
        nextResourceId=new IdType(toResourceName(res.getClass()),nextResourceId.getIdPart());
        res.setId(nextResourceId);
      }
      if (isPlaceholder(nextResourceId)) {
        if (!allIds.add(nextResourceId)) {
          throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class,"String_Node_Str",nextResourceId));
        }
      }
 else       if (nextResourceId.hasResourceType() && nextResourceId.hasIdPart()) {
        IdType nextId=nextResourceId.toUnqualifiedVersionless();
        if (!allIds.add(nextId)) {
          throw new InvalidRequestException(getContext().getLocalizer().getMessage(BaseHapiFhirSystemDao.class,"String_Node_Str",nextId));
        }
      }
    }
    HTTPVerb verb=nextReqEntry.getRequest().getMethodElement().getValue();
    String resourceType=res != null ? getContext().getResourceDefinition(res).getName() : null;
    BundleEntryComponent nextRespEntry=response.getEntry().get(originalRequestOrder.get(nextReqEntry));
switch (verb) {
case POST:
{
        @SuppressWarnings("String_Node_Str") IFhirResourceDao resourceDao=getDaoOrThrowException(res.getClass());
        res.setId((String)null);
        DaoMethodOutcome outcome;
        String matchUrl=nextReqEntry.getRequest().getIfNoneExist();
        outcome=resourceDao.create(res,matchUrl,false,theRequestDetails);
        if (nextResourceId != null) {
          handleTransactionCreateOrUpdateOutcome(idSubstitutions,idToPersistedOutcome,nextResourceId,outcome,nextRespEntry,resourceType,res);
        }
        entriesToProcess.put(nextRespEntry,outcome.getEntity());
        if (outcome.getCreated() == false) {
          nonUpdatedEntities.add(outcome.getEntity());
        }
        break;
      }
case DELETE:
{
      String url=extractTransactionUrlOrThrowException(nextReqEntry,verb);
      UrlParts parts=UrlUtil.parseUrl(url);
      ca.uhn.fhir.jpa.dao.IFhirResourceDao<? extends IBaseResource> dao=toDao(parts,verb.toCode(),url);
      int status=Constants.STATUS_HTTP_204_NO_CONTENT;
      if (parts.getResourceId() != null) {
        IdType deleteId=new IdType(parts.getResourceType(),parts.getResourceId());
        if (!deletedResources.contains(deleteId.getValueAsString())) {
          DaoMethodOutcome outcome=dao.delete(deleteId,deleteConflicts,theRequestDetails);
          if (outcome.getEntity() != null) {
            deletedResources.add(deleteId.getValueAsString());
            entriesToProcess.put(nextRespEntry,outcome.getEntity());
          }
        }
      }
 else {
        DeleteMethodOutcome deleteOutcome=dao.deleteByUrl(parts.getResourceType() + '?' + parts.getParams(),deleteConflicts,theRequestDetails);
        List<ResourceTable> allDeleted=deleteOutcome.getDeletedEntities();
        for (        ResourceTable deleted : allDeleted) {
          deletedResources.add(deleted.getIdDt().toUnqualifiedVersionless().getValueAsString());
        }
        if (allDeleted.isEmpty()) {
          status=Constants.STATUS_HTTP_204_NO_CONTENT;
        }
        nextRespEntry.getResponse().setOutcome((Resource)deleteOutcome.getOperationOutcome());
      }
      nextRespEntry.getResponse().setStatus(toStatusString(status));
      break;
    }
case PUT:
{
    @SuppressWarnings("String_Node_Str") IFhirResourceDao resourceDao=getDaoOrThrowException(res.getClass());
    String url=extractTransactionUrlOrThrowException(nextReqEntry,verb);
    DaoMethodOutcome outcome;
    UrlParts parts=UrlUtil.parseUrl(url);
    if (isNotBlank(parts.getResourceId())) {
      res.setId(new IdType(parts.getResourceType(),parts.getResourceId()));
      outcome=resourceDao.update(res,null,false,theRequestDetails);
    }
 else {
      res.setId((String)null);
      outcome=resourceDao.update(res,parts.getResourceType() + '?' + parts.getParams(),false,theRequestDetails);
    }
    handleTransactionCreateOrUpdateOutcome(idSubstitutions,idToPersistedOutcome,nextResourceId,outcome,nextRespEntry,resourceType,res);
    entriesToProcess.put(nextRespEntry,outcome.getEntity());
    break;
  }
case GET:
case NULL:
break;
}
}
for (Iterator<DeleteConflict> iter=deleteConflicts.iterator(); iter.hasNext(); ) {
DeleteConflict next=iter.next();
if (deletedResources.contains(next.getTargetId().toUnqualifiedVersionless().getValue())) {
iter.remove();
}
}
validateDeleteConflictsEmptyOrThrowException(deleteConflicts);
FhirTerser terser=getContext().newTerser();
for (DaoMethodOutcome nextOutcome : idToPersistedOutcome.values()) {
IBaseResource nextResource=nextOutcome.getResource();
if (nextResource == null) {
continue;
}
List<IBaseReference> allRefs=terser.getAllPopulatedChildElementsOfType(nextResource,IBaseReference.class);
for (IBaseReference nextRef : allRefs) {
IIdType nextId=nextRef.getReferenceElement();
if (!nextId.hasIdPart()) {
continue;
}
if (idSubstitutions.containsKey(nextId)) {
IdType newId=idSubstitutions.get(nextId);
ourLog.info("String_Node_Str",nextId,newId);
nextRef.setReference(newId.getValue());
}
 else if (nextId.getValue().startsWith("String_Node_Str")) {
throw new InvalidRequestException("String_Node_Str" + nextId.getValue());
}
 else {
ourLog.debug("String_Node_Str",nextId);
}
}
IPrimitiveType<Date> deletedInstantOrNull=ResourceMetadataKeyEnum.DELETED_AT.get((IAnyResource)nextResource);
Date deletedTimestampOrNull=deletedInstantOrNull != null ? deletedInstantOrNull.getValue() : null;
boolean shouldUpdate=!nonUpdatedEntities.contains(nextOutcome.getEntity());
if (shouldUpdate) {
updateEntity(nextResource,nextOutcome.getEntity(),deletedTimestampOrNull,shouldUpdate,true,updateTime);
}
}
myEntityManager.flush();
for (BundleEntryComponent nextEntry : theRequest.getEntry()) {
if (nextEntry.getRequest().getMethodElement().getValue() == HTTPVerb.POST) {
String matchUrl=nextEntry.getRequest().getIfNoneExist();
if (isNotBlank(matchUrl)) {
IFhirResourceDao<?> resourceDao=getDao(nextEntry.getResource().getClass());
Set<Long> val=resourceDao.processMatchUrl(matchUrl);
if (val.size() > 1) {
  throw new InvalidRequestException("String_Node_Str" + theActionName + "String_Node_Str"+ matchUrl+ "String_Node_Str");
}
}
}
}
for (IdType next : allIds) {
IdType replacement=idSubstitutions.get(next);
if (replacement == null) {
continue;
}
if (replacement.equals(next)) {
continue;
}
ourLog.info("String_Node_Str",next,replacement);
}
for (int i=0; i < getEntries.size(); i++) {
BundleEntryComponent nextReqEntry=getEntries.get(i);
Integer originalOrder=originalRequestOrder.get(nextReqEntry);
BundleEntryComponent nextRespEntry=response.getEntry().get(originalOrder);
ServletSubRequestDetails requestDetails=new ServletSubRequestDetails();
requestDetails.setServletRequest(theRequestDetails.getServletRequest());
requestDetails.setRequestType(RequestTypeEnum.GET);
requestDetails.setServer(theRequestDetails.getServer());
String url=extractTransactionUrlOrThrowException(nextReqEntry,HTTPVerb.GET);
int qIndex=url.indexOf('?');
ArrayListMultimap<String,String> paramValues=ArrayListMultimap.create();
requestDetails.setParameters(new HashMap<String,String[]>());
if (qIndex != -1) {
String params=url.substring(qIndex);
List<NameValuePair> parameters=translateMatchUrl(params);
for (NameValuePair next : parameters) {
paramValues.put(next.getName(),next.getValue());
}
for (java.util.Map.Entry<String,Collection<String>> nextParamEntry : paramValues.asMap().entrySet()) {
String[] nextValue=nextParamEntry.getValue().toArray(new String[nextParamEntry.getValue().size()]);
requestDetails.getParameters().put(nextParamEntry.getKey(),nextValue);
}
url=url.substring(0,qIndex);
}
requestDetails.setRequestPath(url);
requestDetails.setFhirServerBase(theRequestDetails.getFhirServerBase());
theRequestDetails.getServer().populateRequestDetailsFromRequestPath(requestDetails,url);
BaseMethodBinding<?> method=theRequestDetails.getServer().determineResourceMethod(requestDetails,url);
if (method == null) {
throw new IllegalArgumentException("String_Node_Str" + url);
}
if (isNotBlank(nextReqEntry.getRequest().getIfMatch())) {
requestDetails.addHeader(Constants.HEADER_IF_MATCH,nextReqEntry.getRequest().getIfMatch());
}
if (isNotBlank(nextReqEntry.getRequest().getIfNoneExist())) {
requestDetails.addHeader(Constants.HEADER_IF_NONE_EXIST,nextReqEntry.getRequest().getIfNoneExist());
}
if (isNotBlank(nextReqEntry.getRequest().getIfNoneMatch())) {
requestDetails.addHeader(Constants.HEADER_IF_NONE_MATCH,nextReqEntry.getRequest().getIfNoneMatch());
}
if (method instanceof BaseResourceReturningMethodBinding) {
try {
ResourceOrDstu1Bundle responseData=((BaseResourceReturningMethodBinding)method).doInvokeServer(theRequestDetails.getServer(),requestDetails);
IBaseResource resource=responseData.getResource();
if (paramValues.containsKey(Constants.PARAM_SUMMARY) || paramValues.containsKey(Constants.PARAM_CONTENT)) {
  resource=filterNestedBundle(requestDetails,resource);
}
nextRespEntry.setResource((Resource)resource);
nextRespEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_200_OK));
}
 catch (NotModifiedException e) {
nextRespEntry.getResponse().setStatus(toStatusString(Constants.STATUS_HTTP_304_NOT_MODIFIED));
}
}
 else {
throw new IllegalArgumentException("String_Node_Str" + url);
}
}
for (Entry<BundleEntryComponent,ResourceTable> nextEntry : entriesToProcess.entrySet()) {
nextEntry.getKey().getResponse().setLocation(nextEntry.getValue().getIdDt().toUnqualified().getValue());
nextEntry.getKey().getResponse().setEtag(nextEntry.getValue().getIdDt().getVersionIdPart());
}
long delay=System.currentTimeMillis() - start;
ourLog.info(theActionName + "String_Node_Str",new Object[]{delay});
response.setType(BundleType.TRANSACTIONRESPONSE);
return response;
}