nus-yam/ex-repair huggingface dataset:
Program: 5387
Project: 5387
Buggy source:
@Override public void writeFile(String stream,File file,String contentType) throws IOException {
  URL url=getStreamURL(stream,true);
  HttpRequest.Builder requestBuilder=HttpRequest.post(url).withBody(file).addHeader(HttpHeaders.CONTENT_TYPE,contentType);
  writeToStream(Id.Stream.from(namespace,stream),requestBuilder);
}

Fixed version (ground truth):
@Override public void writeFile(final String stream,final File file,final String contentType) throws IOException {
  Retries.callWithRetries(new Retries.Callable<Void,IOException>(){
    @Override public Void call() throws IOException {
      HttpRequest.Builder requestBuilder=remoteClient.requestBuilder(HttpMethod.POST,stream + "String_Node_Str").withBody(file).addHeader(HttpHeaders.CONTENT_TYPE,contentType);
      writeToStream(namespace.stream(stream),requestBuilder);
      return null;
    }
  }
,retryStrategy);
}
Program: 5388
Project: 5388
Buggy source:
@Override public void handle(Throwable t,HttpRequest request,HttpResponder responder){
  if (Iterables.size(Iterables.filter(Throwables.getCausalChain(t),ServiceUnavailableException.class)) > 0) {
    responder.sendString(HttpResponseStatus.SERVICE_UNAVAILABLE,t.getMessage());
    return;
  }
  if (t instanceof HttpErrorStatusProvider) {
    logWithTrace(request,t);
    responder.sendString(HttpResponseStatus.valueOf(((HttpErrorStatusProvider)t).getStatusCode()),t.getMessage());
    return;
  }
  if (t.getClass().getName().endsWith("String_Node_Str")) {
    logWithTrace(request,t);
    responder.sendString(HttpResponseStatus.NOT_FOUND,t.getMessage());
    return;
  }
  if (t.getClass().getName().endsWith("String_Node_Str")) {
    logWithTrace(request,t);
    responder.sendString(HttpResponseStatus.CONFLICT,t.getMessage());
    return;
  }
  LOG.error("String_Node_Str",request.getMethod().getName(),request.getUri(),Objects.firstNonNull(SecurityRequestContext.getUserId(),"String_Node_Str"),t);
  responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,Throwables.getRootCause(t).getMessage());
}

Fixed version (ground truth):
@Override public void handle(Throwable t,HttpRequest request,HttpResponder responder){
  for (  Throwable cause : Throwables.getCausalChain(t)) {
    if (cause instanceof ServiceUnavailableException) {
      responder.sendString(HttpResponseStatus.SERVICE_UNAVAILABLE,cause.getMessage());
      return;
    }
  }
  if (t instanceof HttpErrorStatusProvider) {
    logWithTrace(request,t);
    responder.sendString(HttpResponseStatus.valueOf(((HttpErrorStatusProvider)t).getStatusCode()),t.getMessage());
    return;
  }
  if (t.getClass().getName().endsWith("String_Node_Str")) {
    logWithTrace(request,t);
    responder.sendString(HttpResponseStatus.NOT_FOUND,t.getMessage());
    return;
  }
  if (t.getClass().getName().endsWith("String_Node_Str")) {
    logWithTrace(request,t);
    responder.sendString(HttpResponseStatus.CONFLICT,t.getMessage());
    return;
  }
  LOG.error("String_Node_Str",request.getMethod().getName(),request.getUri(),Objects.firstNonNull(SecurityRequestContext.getUserId(),"String_Node_Str"),t);
  responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,Throwables.getRootCause(t).getMessage());
}
Program: 5390
Project: 5390
Buggy source:
@PUT @Path("String_Node_Str") @AuditPolicy(AuditDetail.REQUEST_BODY) public void setConfig(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String stream) throws Exception {
  StreamId streamId=validateAndGetStreamId(namespaceId,stream);
  checkStreamExists(streamId);
  StreamProperties properties=getAndValidateConfig(request,responder);
  if (properties == null) {
    return;
  }
  streamAdmin.updateConfig(streamId,properties);
  responder.sendStatus(HttpResponseStatus.OK);
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") @AuditPolicy(AuditDetail.REQUEST_BODY) public void setConfig(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String stream) throws Exception {
  StreamId streamId=validateAndGetStreamId(namespaceId,stream);
  checkStreamExists(streamId);
  StreamProperties properties=getAndValidateConfig(request);
  streamAdmin.updateConfig(streamId,properties);
  responder.sendStatus(HttpResponseStatus.OK);
}
Program: 5391
Project: 5391
Buggy source:
@PUT @Path("String_Node_Str") @AuditPolicy(AuditDetail.REQUEST_BODY) public void create(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String stream) throws Exception {
  namespaceQueryAdmin.get(new NamespaceId(namespaceId));
  StreamId streamId=validateAndGetStreamId(namespaceId,stream);
  Properties props=new Properties();
  StreamProperties streamProperties;
  if (request.getContent().readable()) {
    streamProperties=getAndValidateConfig(request,responder);
    if (streamProperties == null) {
      return;
    }
    if (streamProperties.getTTL() != null) {
      props.put(Constants.Stream.TTL,Long.toString(streamProperties.getTTL()));
    }
    if (streamProperties.getNotificationThresholdMB() != null) {
      props.put(Constants.Stream.NOTIFICATION_THRESHOLD,Integer.toString(streamProperties.getNotificationThresholdMB()));
    }
    if (streamProperties.getDescription() != null) {
      props.put(Constants.Stream.DESCRIPTION,streamProperties.getDescription());
    }
    if (streamProperties.getFormat() != null) {
      props.put(Constants.Stream.FORMAT_SPECIFICATION,GSON.toJson(streamProperties.getFormat()));
    }
    if (streamProperties.getOwnerPrincipal() != null) {
      props.put(Constants.Security.PRINCIPAL,streamProperties.getOwnerPrincipal());
    }
  }
  streamAdmin.create(streamId,props);
  responder.sendStatus(HttpResponseStatus.OK);
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") @AuditPolicy(AuditDetail.REQUEST_BODY) public void create(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String stream) throws Exception {
  namespaceQueryAdmin.get(new NamespaceId(namespaceId));
  StreamId streamId=validateAndGetStreamId(namespaceId,stream);
  Properties props=new Properties();
  StreamProperties streamProperties;
  if (request.getContent().readable()) {
    streamProperties=getAndValidateConfig(request);
    if (streamProperties.getTTL() != null) {
      props.put(Constants.Stream.TTL,Long.toString(streamProperties.getTTL()));
    }
    if (streamProperties.getNotificationThresholdMB() != null) {
      props.put(Constants.Stream.NOTIFICATION_THRESHOLD,Integer.toString(streamProperties.getNotificationThresholdMB()));
    }
    if (streamProperties.getDescription() != null) {
      props.put(Constants.Stream.DESCRIPTION,streamProperties.getDescription());
    }
    if (streamProperties.getFormat() != null) {
      props.put(Constants.Stream.FORMAT_SPECIFICATION,GSON.toJson(streamProperties.getFormat()));
    }
    if (streamProperties.getOwnerPrincipal() != null) {
      props.put(Constants.Security.PRINCIPAL,streamProperties.getOwnerPrincipal());
    }
  }
  streamAdmin.create(streamId,props);
  responder.sendStatus(HttpResponseStatus.OK);
}
Program: 5392
Project: 5392
Buggy source:
@POST @Path("String_Node_Str") public void enqueue(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String stream) throws Exception {
  StreamId streamId=validateAndGetStreamId(namespaceId,stream);
  authorizationEnforcer.enforce(streamId,authenticationContext.getPrincipal(),Action.WRITE);
  try {
    streamWriter.enqueue(streamId,getHeaders(request,stream),request.getContent().toByteBuffer());
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",stream,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void enqueue(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String stream) throws Exception {
  StreamId streamId=validateAndGetStreamId(namespaceId,stream);
  authorizationEnforcer.enforce(streamId,authenticationContext.getPrincipal(),Action.WRITE);
  streamWriter.enqueue(streamId,getHeaders(request,stream),request.getContent().toByteBuffer());
  responder.sendStatus(HttpResponseStatus.OK);
}
Program: 5393
Project: 5393
Buggy source:
@Override public void abort(@Nullable TransactionFailureException cause) throws TransactionFailureException {
  if (currentTx == null) {
    return;
  }
  try {
    boolean success=true;
    for (    TransactionAware txAware : getTransactionAwares()) {
      try {
        success=txAware.rollbackTx() && success;
      }
 catch (      Throwable e) {
        if (cause == null) {
          cause=new TransactionFailureException(String.format("String_Node_Str",txAware.getTransactionAwareName(),currentTx.getTransactionId()),e);
        }
 else {
          cause.addSuppressed(e);
        }
        success=false;
      }
    }
    if (success) {
      txClient.abort(currentTx);
    }
 else {
      txClient.invalidate(currentTx.getTransactionId());
    }
    if (cause != null) {
      throw cause;
    }
  }
  finally {
    currentTx=null;
    cleanup();
  }
}

Fixed version (ground truth):
@Override public void abort(@Nullable TransactionFailureException cause) throws TransactionFailureException {
  if (currentTx == null) {
    return;
  }
  try {
    boolean success=true;
    for (    TransactionAware txAware : getTransactionAwares()) {
      try {
        success=txAware.rollbackTx() && success;
      }
 catch (      Throwable e) {
        if (cause == null) {
          cause=new TransactionFailureException(String.format("String_Node_Str",txAware.getTransactionAwareName(),currentTx.getTransactionId()),e);
        }
 else {
          cause.addSuppressed(e);
        }
        success=false;
      }
    }
    try {
      if (success) {
        txClient.abort(currentTx);
      }
 else {
        txClient.invalidate(currentTx.getTransactionId());
      }
    }
 catch (    Throwable t) {
      if (cause == null) {
        cause=new TransactionFailureException(String.format("String_Node_Str",success ? "String_Node_Str" : "String_Node_Str",currentTx.getTransactionId()));
      }
 else {
        cause.addSuppressed(t);
      }
    }
    if (cause != null) {
      throw cause;
    }
  }
  finally {
    currentTx=null;
    cleanup();
  }
}
Program: 5394
Project: 5394
Buggy source:
@Override public void abort(Transaction tx){
  state=CommitState.Aborted;
  super.abort(tx);
}

Fixed version (ground truth):
@Override public void abort(Transaction transaction){
  throw new RuntimeException();
}
Program: 5395
Project: 5395
Buggy source:
@Override public boolean canCommit(Transaction tx,Collection<byte[]> changeIds) throws TransactionNotInProgressException {
  if (failCanCommitOnce) {
    failCanCommitOnce=false;
    return false;
  }
 else {
    return super.canCommit(tx,changeIds);
  }
}

Fixed version (ground truth):
@Override public boolean canCommit(Transaction transaction,Collection<byte[]> collection) throws TransactionNotInProgressException {
  throw new RuntimeException();
}
Program: 5396
Project: 5396
Buggy source:
@Inject RemoteLineageWriter(CConfiguration cConf,DiscoveryServiceClient discoveryClient){
  super(cConf,discoveryClient,Constants.Service.REMOTE_SYSTEM_OPERATION);
}

Fixed version (ground truth):
@Inject RemoteLineageWriter(DiscoveryServiceClient discoveryClient){
  super(discoveryClient,Constants.Service.REMOTE_SYSTEM_OPERATION);
}
Program: 5397
Project: 5397
Buggy source:
@Inject RemoteRuntimeStore(CConfiguration cConf,DiscoveryServiceClient discoveryClient){
  super(cConf,discoveryClient,Constants.Service.REMOTE_SYSTEM_OPERATION);
}

Fixed version (ground truth):
@Inject RemoteRuntimeStore(DiscoveryServiceClient discoveryClient){
  super(discoveryClient,Constants.Service.REMOTE_SYSTEM_OPERATION);
}
Program: 5398
Project: 5398
Buggy source:
@Inject RemoteRuntimeUsageRegistry(CConfiguration cConf,DiscoveryServiceClient discoveryClient){
  super(cConf,discoveryClient,Constants.Service.REMOTE_SYSTEM_OPERATION);
}

Fixed version (ground truth):
@Inject RemoteRuntimeUsageRegistry(DiscoveryServiceClient discoveryClient){
  super(discoveryClient,Constants.Service.REMOTE_SYSTEM_OPERATION);
}
Program: 5399
Project: 5399
Buggy source:
public ServiceUnavailableException(String serviceName,Throwable cause){
  super("String_Node_Str" + serviceName + "String_Node_Str",cause);
  this.serviceName=serviceName;
}

Fixed version (ground truth):
public ServiceUnavailableException(String serviceName,String message,Throwable cause){
  super(message,cause);
  this.serviceName=serviceName;
}
Program: 5400
Project: 5400
Buggy source:
protected RemoteOpsClient(CConfiguration cConf,final DiscoveryServiceClient discoveryClient,final String discoverableServiceName){
  this.endpointStrategySupplier=Suppliers.memoize(new Supplier<EndpointStrategy>(){
    @Override public EndpointStrategy get(){
      return new RandomEndpointStrategy(discoveryClient.discover(discoverableServiceName));
    }
  }
);
  this.httpRequestConfig=new DefaultHttpRequestConfig(false);
  this.discoverableServiceName=discoverableServiceName;
}

Fixed version (ground truth):
protected RemoteOpsClient(final DiscoveryServiceClient discoveryClient,final String discoverableServiceName){
  this.remoteClient=new RemoteClient(discoveryClient,discoverableServiceName,new DefaultHttpRequestConfig(false),"String_Node_Str");
}
Program: 5401
Project: 5401
Buggy source:
protected HttpResponse executeRequest(String methodName,Map<String,String> headers,Object... arguments){
  return doRequest("String_Node_Str" + methodName,HttpMethod.POST,headers,GSON.toJson(createArguments(arguments)));
}

Fixed version (ground truth):
protected HttpResponse executeRequest(String methodName,Map<String,String> headers,Object... arguments){
  String body=GSON.toJson(createBody(arguments));
  HttpRequest.Builder builder=remoteClient.requestBuilder(HttpMethod.POST,methodName).addHeaders(headers);
  if (body != null) {
    builder.withBody(body);
  }
  HttpRequest request=builder.build();
  try {
    HttpResponse response=remoteClient.execute(request);
    if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
      return response;
    }
    throw new RuntimeException(String.format("String_Node_Str",remoteClient.createErrorMessage(request,body),response));
  }
 catch (  IOException e) {
    throw new RuntimeException(remoteClient.createErrorMessage(request,body),e);
  }
}
Program: 5402
Project: 5402
Buggy source:
private void checkLogPartitionKey(Set<String> problemKeys){
  if (!isValidPartitionKey(cConf.get(Constants.Logging.LOG_PUBLISH_PARTITION_KEY))) {
    problemKeys.add(Constants.Logging.LOG_PUBLISH_PARTITION_KEY);
  }
}

Fixed version (ground truth):
private void checkLogPartitionKey(Set<String> problemKeys){
  validatePartitionKey(Constants.Logging.LOG_PUBLISH_PARTITION_KEY,problemKeys);
}
Program: 5403
Project: 5403
Buggy source:
private void checkPotentialPortConflicts(){
  Multimap<Integer,String> services=HashMultimap.create();
  if (cConf.getBoolean(Constants.Security.SSL.EXTERNAL_ENABLED)) {
    services.put(cConf.getInt(Constants.Router.ROUTER_SSL_PORT),"String_Node_Str");
    services.put(cConf.getInt(Constants.Security.AuthenticationServer.SSL_PORT),"String_Node_Str");
  }
 else {
    services.put(cConf.getInt(Constants.Router.ROUTER_PORT),"String_Node_Str");
    services.put(cConf.getInt(Constants.Security.AUTH_SERVER_BIND_PORT),"String_Node_Str");
  }
  for (  Integer port : services.keySet()) {
    Collection<String> conflictingServices=services.get(port);
    if (conflictingServices.size() > 1) {
      LOG.warn("String_Node_Str",port,Joiner.on("String_Node_Str").join(conflictingServices));
    }
  }
}

Fixed version (ground truth):
private void checkPotentialPortConflicts(Set<String> problemKeys){
  Multimap<Integer,String> services=HashMultimap.create();
  String sslKey=Constants.Security.SSL.EXTERNAL_ENABLED;
  boolean isSSL;
  try {
    isSSL=cConf.getBoolean(sslKey);
  }
 catch (  Exception e) {
    logProblem("String_Node_Str",sslKey,cConf.get(sslKey),e);
    problemKeys.add(Constants.Security.SSL.EXTERNAL_ENABLED);
    return;
  }
  if (isSSL) {
    services.put(cConf.getInt(Constants.Router.ROUTER_SSL_PORT),"String_Node_Str");
    services.put(cConf.getInt(Constants.Security.AuthenticationServer.SSL_PORT),"String_Node_Str");
  }
 else {
    services.put(cConf.getInt(Constants.Router.ROUTER_PORT),"String_Node_Str");
    services.put(cConf.getInt(Constants.Security.AUTH_SERVER_BIND_PORT),"String_Node_Str");
  }
  for (  Integer port : services.keySet()) {
    Collection<String> conflictingServices=services.get(port);
    if (conflictingServices.size() > 1) {
      LOG.warn("String_Node_Str",port,Joiner.on("String_Node_Str").join(conflictingServices));
    }
  }
}
Program: 5404
Project: 5404
Buggy source:
@Override public void run(){
  LOG.info("String_Node_Str");
  Set<String> problemKeys=new HashSet<>();
  checkServiceResources(problemKeys);
  checkBindAddresses();
  checkPotentialPortConflicts();
  checkKafkaTopic(problemKeys);
  checkMessagingTopics(problemKeys);
  checkLogPartitionKey(problemKeys);
  if (!problemKeys.isEmpty()) {
    throw new RuntimeException("String_Node_Str" + Joiner.on(',').join(problemKeys));
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str");
  Set<String> problemKeys=new HashSet<>();
  checkServiceResources(problemKeys);
  checkBindAddresses();
  checkPotentialPortConflicts(problemKeys);
  checkKafkaTopic(problemKeys);
  checkMessagingTopics(problemKeys);
  checkLogPartitionKey(problemKeys);
  if (!problemKeys.isEmpty()) {
    throw new RuntimeException("String_Node_Str" + Joiner.on(',').join(problemKeys));
  }
  LOG.info("String_Node_Str");
}
Program: 5405
Project: 5405
Buggy source:
private void checkServiceResources(Set<String> problemKeys){
  for (  ServiceResourceKeys serviceResourceKeys : systemServicesResourceKeys) {
    verifyResources(serviceResourceKeys,problemKeys);
    boolean instancesIsPositive=!problemKeys.contains(serviceResourceKeys.getInstancesKey());
    boolean maxInstancesIsPositive=!problemKeys.contains(serviceResourceKeys.getMaxInstancesKey());
    if (instancesIsPositive && maxInstancesIsPositive) {
      int instances=serviceResourceKeys.getInstances();
      int maxInstances=serviceResourceKeys.getMaxInstances();
      if (instances > maxInstances) {
        LOG.error("String_Node_Str",serviceResourceKeys.getInstancesKey(),instances,serviceResourceKeys.getMaxInstancesKey(),maxInstances);
        problemKeys.add(serviceResourceKeys.getInstancesKey());
      }
    }
  }
}

Fixed version (ground truth):
private void checkServiceResources(Set<String> problemKeys){
  for (  ServiceResourceKeys serviceResourceKeys : systemServicesResourceKeys) {
    validatePositiveInteger(serviceResourceKeys.getMemoryKey(),problemKeys);
    validatePositiveInteger(serviceResourceKeys.getVcoresKey(),problemKeys);
    Integer instances=validatePositiveInteger(serviceResourceKeys.getInstancesKey(),problemKeys);
    Integer maxInstances=validatePositiveInteger(serviceResourceKeys.getMaxInstancesKey(),problemKeys);
    if (instances != null && maxInstances != null && instances > maxInstances) {
      LOG.error("String_Node_Str",serviceResourceKeys.getInstancesKey(),instances,serviceResourceKeys.getMaxInstancesKey(),maxInstances);
      problemKeys.add(serviceResourceKeys.getInstancesKey());
    }
  }
}
Program: 5406
Project: 5406
Buggy source:
private void checkMessagingTopics(Set<String> problemKeys){
  if (!EntityId.isValidId(cConf.get(Constants.Audit.TOPIC))) {
    problemKeys.add(Constants.Audit.TOPIC);
  }
  if (!EntityId.isValidId(cConf.get(Constants.Notification.TOPIC))) {
    problemKeys.add(Constants.Notification.TOPIC);
  }
}

Fixed version (ground truth):
private void checkMessagingTopics(Set<String> problemKeys){
  validateMessagingTopic(Constants.Audit.TOPIC,problemKeys);
  validateMessagingTopic(Constants.Notification.TOPIC,problemKeys);
}
Program: 5407
Project: 5407
Buggy source:
private void checkBindAddresses(){
  Set<String> bindAddressKeys=ImmutableSet.of(Constants.Service.MASTER_SERVICES_BIND_ADDRESS,Constants.Router.ADDRESS);
  for (  String bindAddressKey : bindAddressKeys) {
    String bindAddress=cConf.get(bindAddressKey);
    try {
      if (InetAddress.getByName(bindAddress).isLoopbackAddress()) {
        LOG.warn("String_Node_Str",bindAddressKey,bindAddress);
      }
    }
 catch (    UnknownHostException e) {
      LOG.warn("String_Node_Str",bindAddressKey,e);
    }
  }
}

Fixed version (ground truth):
private void checkBindAddresses(){
  Set<String> bindAddressKeys=ImmutableSet.of(Constants.Service.MASTER_SERVICES_BIND_ADDRESS,Constants.Router.ADDRESS);
  for (  String bindAddressKey : bindAddressKeys) {
    String bindAddress=cConf.get(bindAddressKey);
    try {
      if (InetAddress.getByName(bindAddress).isLoopbackAddress()) {
        LOG.warn("String_Node_Str",bindAddressKey,bindAddress);
      }
    }
 catch (    UnknownHostException e) {
      LOG.warn("String_Node_Str",bindAddressKey,bindAddress,e);
    }
  }
}
Program: 5408
Project: 5408
Buggy source:
private void checkKafkaTopic(Set<String> problemKeys){
  if (!isValidKafkaTopic(Constants.Logging.KAFKA_TOPIC)) {
    problemKeys.add(Constants.Logging.KAFKA_TOPIC);
  }
}

Fixed version (ground truth):
private void checkKafkaTopic(Set<String> problemKeys){
  validateKafkaTopic(Constants.Logging.KAFKA_TOPIC,problemKeys);
}
Program: 5409
Project: 5409
Buggy source:
public boolean canStartMaster(){
  List<CheckRunner.Failure> failures=checkRunner.runChecks();
  if (!failures.isEmpty()) {
    for (    CheckRunner.Failure failure : failures) {
      LOG.error("String_Node_Str",failure.getName(),failure.getException().getClass().getSimpleName(),failure.getException().getMessage());
      if (failure.getException().getCause() != null) {
        LOG.error("String_Node_Str",ExceptionUtils.getRootCauseMessage(failure.getException().getCause()));
      }
    }
    LOG.error("String_Node_Str" + "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean canStartMaster(){
  List<CheckRunner.Failure> failures=checkRunner.runChecks();
  if (!failures.isEmpty()) {
    for (    CheckRunner.Failure failure : failures) {
      LOG.error("String_Node_Str",failure.getName(),failure.getException().getClass().getSimpleName(),failure.getException().getMessage(),failure.getException());
      if (failure.getException().getCause() != null) {
        LOG.error("String_Node_Str",ExceptionUtils.getRootCauseMessage(failure.getException().getCause()));
      }
    }
    LOG.error("String_Node_Str" + "String_Node_Str");
    return false;
  }
  return true;
}
Program: 5410
Project: 5410
Buggy source:
private boolean isValidPartitionKey(String key){
  try {
    LogPartitionType.valueOf(key);
  }
 catch (  IllegalArgumentException e) {
    LOG.error("String_Node_Str",key,e.getMessage());
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean isValidPartitionKey(String key){
  try {
    LogPartitionType.valueOf(key.toUpperCase());
  }
 catch (  IllegalArgumentException|NullPointerException e) {
    LOG.error("String_Node_Str",key,e.getMessage());
    return false;
  }
  return true;
}
Program: 5411
Project: 5411
Buggy source:
private void checkLogPartitionKey(Set<String> problemKeys){
  if (!isValidPartitionKey(cConf.get(Constants.Logging.LOG_PUBLISH_PARTITION_KEY).toUpperCase())) {
    problemKeys.add(Constants.Logging.LOG_PUBLISH_PARTITION_KEY);
  }
}

Fixed version (ground truth):
private void checkLogPartitionKey(Set<String> problemKeys){
  if (!isValidPartitionKey(cConf.get(Constants.Logging.LOG_PUBLISH_PARTITION_KEY))) {
    problemKeys.add(Constants.Logging.LOG_PUBLISH_PARTITION_KEY);
  }
}
Program: 5412
Project: 5412
Buggy source:
public boolean canStartMaster(){
  List<CheckRunner.Failure> failures=checkRunner.runChecks();
  if (!failures.isEmpty()) {
    for (    CheckRunner.Failure failure : failures) {
      LOG.error("String_Node_Str",failure.getName(),failure.getException().getMessage());
      if (failure.getException().getCause() != null) {
        LOG.error("String_Node_Str",ExceptionUtils.getRootCauseMessage(failure.getException().getCause()));
      }
    }
    LOG.error("String_Node_Str" + "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean canStartMaster(){
  List<CheckRunner.Failure> failures=checkRunner.runChecks();
  if (!failures.isEmpty()) {
    for (    CheckRunner.Failure failure : failures) {
      LOG.error("String_Node_Str",failure.getName(),failure.getException().getClass().getSimpleName(),failure.getException().getMessage());
      if (failure.getException().getCause() != null) {
        LOG.error("String_Node_Str",ExceptionUtils.getRootCauseMessage(failure.getException().getCause()));
      }
    }
    LOG.error("String_Node_Str" + "String_Node_Str");
    return false;
  }
  return true;
}
Program: 5413
Project: 5413
Buggy source:
private void rewriteHiveConfig(){
  URL resourceURL=getLocalResourceURL("String_Node_Str");
  if (resourceURL == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  try (InputStream is=new FileInputStream(new File(resourceURL.toURI()))){
    Configuration conf=new Configuration(false);
    conf.addResource(is);
    conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
    conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,UserGroupInformation.AuthenticationMethod.SIMPLE.name());
    String sparkHome=System.getenv(Constants.SPARK_HOME);
    if (sparkHome != null) {
      LOG.debug("String_Node_Str",sparkHome);
      conf.set("String_Node_Str",sparkHome);
    }
    File newConfFile=File.createTempFile("String_Node_Str","String_Node_Str");
    try (FileOutputStream os=new FileOutputStream(newConfFile)){
      conf.writeXml(os);
    }
     Files.move(newConfFile.toPath(),Paths.get(resourceURL.toURI()),StandardCopyOption.REPLACE_EXISTING);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",resourceURL,e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private void rewriteHiveConfig(){
  URL resourceURL=getLocalResourceURL("String_Node_Str");
  if (resourceURL == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  try (InputStream is=new FileInputStream(new File(resourceURL.toURI()))){
    Configuration conf=new Configuration(false);
    conf.addResource(is);
    conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
    conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
    String sparkHome=System.getenv(Constants.SPARK_HOME);
    if (sparkHome != null) {
      LOG.debug("String_Node_Str",sparkHome);
      conf.set("String_Node_Str",sparkHome);
    }
    File newConfFile=File.createTempFile("String_Node_Str","String_Node_Str");
    try (FileOutputStream os=new FileOutputStream(newConfFile)){
      conf.writeXml(os);
    }
     Files.move(newConfFile.toPath(),Paths.get(resourceURL.toURI()),StandardCopyOption.REPLACE_EXISTING);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",resourceURL,e);
    throw Throwables.propagate(e);
  }
}
Program: 5414
Project: 5414
Buggy source:
@Before public void setupTest() throws Exception {
  Assert.assertEquals(ImmutableSet.<Privilege>of(),getAuthorizer().listPrivileges(ALICE));
}

Fixed version (ground truth):
@Before public void setupTest() throws Exception {
  Assert.assertEquals(ImmutableSet.<Privilege>of(),getAuthorizer().listPrivileges(ALICE));
  SecurityRequestContext.setUserId(ALICE.getName());
}
Program: 5415
Project: 5415
Buggy source:
@BeforeClass public static void setup(){
  instance=new InstanceId(getConfiguration().get(Constants.INSTANCE_NAME));
  oldUser=SecurityRequestContext.getUserId();
  SecurityRequestContext.setUserId(ALICE.getName());
}

Fixed version (ground truth):
@BeforeClass public static void setup(){
  instance=new InstanceId(getConfiguration().get(Constants.INSTANCE_NAME));
  oldUser=SecurityRequestContext.getUserId();
}
Program: 5416
Project: 5416
Buggy source:
private void rewriteHiveConfig(){
  URL resourceURL=getLocalResourceURL("String_Node_Str");
  if (resourceURL == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  try (InputStream is=new FileInputStream(new File(resourceURL.toURI()))){
    Configuration conf=new Configuration(false);
    conf.addResource(is);
    conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
    conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,UserGroupInformation.AuthenticationMethod.SIMPLE.name());
    String sparkHome=System.getenv(Constants.SPARK_HOME);
    if (sparkHome != null) {
      LOG.debug("String_Node_Str",sparkHome);
      conf.set("String_Node_Str",sparkHome);
    }
    File newConfFile=File.createTempFile("String_Node_Str","String_Node_Str");
    try (FileOutputStream os=new FileOutputStream(newConfFile)){
      conf.writeXml(os);
    }
     Files.move(newConfFile.toPath(),Paths.get(resourceURL.toURI()),StandardCopyOption.REPLACE_EXISTING);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",resourceURL,e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private void rewriteHiveConfig(){
  URL resourceURL=getLocalResourceURL("String_Node_Str");
  if (resourceURL == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  try (InputStream is=new FileInputStream(new File(resourceURL.toURI()))){
    Configuration conf=new Configuration(false);
    conf.addResource(is);
    conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
    conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
    String sparkHome=System.getenv(Constants.SPARK_HOME);
    if (sparkHome != null) {
      LOG.debug("String_Node_Str",sparkHome);
      conf.set("String_Node_Str",sparkHome);
    }
    File newConfFile=File.createTempFile("String_Node_Str","String_Node_Str");
    try (FileOutputStream os=new FileOutputStream(newConfFile)){
      conf.writeXml(os);
    }
     Files.move(newConfFile.toPath(),Paths.get(resourceURL.toURI()),StandardCopyOption.REPLACE_EXISTING);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",resourceURL,e);
    throw Throwables.propagate(e);
  }
}
Program: 5417
Project: 5417
Buggy source:
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") List<String> targets,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String sort,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int offset,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int limit,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numCursors,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String cursor,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") boolean showHidden) throws Exception {
  Set<EntityTypeSimpleName> types=Collections.emptySet();
  if (targets != null) {
    types=ImmutableSet.copyOf(Iterables.transform(targets,STRING_TO_TARGET_TYPE));
  }
  SortInfo sortInfo=SortInfo.of(URLDecoder.decode(sort,"String_Node_Str"));
  if (SortInfo.DEFAULT.equals(sortInfo)) {
    if (!(cursor.isEmpty()) || 0 != numCursors) {
      throw new BadRequestException("String_Node_Str");
    }
  }
  MetadataSearchResponse response=metadataAdmin.search(namespaceId,URLDecoder.decode(searchQuery,"String_Node_Str"),types,sortInfo,offset,limit,numCursors,cursor,showHidden);
  responder.sendJson(HttpResponseStatus.OK,response,MetadataSearchResponse.class,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") List<String> targets,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String sort,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int offset,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int limit,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") int numCursors,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String cursor,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") boolean showHidden) throws Exception {
  Set<EntityTypeSimpleName> types=Collections.emptySet();
  if (targets != null) {
    types=ImmutableSet.copyOf(Iterables.transform(targets,STRING_TO_TARGET_TYPE));
  }
  SortInfo sortInfo=SortInfo.of(URLDecoder.decode(sort,"String_Node_Str"));
  if (SortInfo.DEFAULT.equals(sortInfo)) {
    if (!(cursor.isEmpty()) || 0 != numCursors) {
      throw new BadRequestException("String_Node_Str");
    }
  }
  try {
    MetadataSearchResponse response=metadataAdmin.search(namespaceId,URLDecoder.decode(searchQuery,"String_Node_Str"),types,sortInfo,offset,limit,numCursors,cursor,showHidden);
    responder.sendJson(HttpResponseStatus.OK,response,MetadataSearchResponse.class,GSON);
  }
 catch (  Exception e) {
    if (Throwables.getRootCause(e) instanceof IllegalArgumentException) {
      throw new BadRequestException(e.getMessage(),e);
    }
    throw e;
  }
}
Program: 5421
Project: 5421
Buggy source:
public Map<String,String> getSystemProperties(Id.Program id) throws Exception {
  Map<String,String> systemArgs=Maps.newHashMap();
  systemArgs.put(Constants.CLUSTER_NAME,cConf.get(Constants.CLUSTER_NAME,"String_Node_Str"));
  systemArgs.put(Constants.AppFabric.APP_SCHEDULER_QUEUE,queueResolver.getQueue(id.getNamespace()));
  if (SecurityUtil.isKerberosEnabled(cConf)) {
    ImpersonationInfo impersonationInfo;
    KerberosPrincipalId principalId=ownerAdmin.getEffectiveOwner(id.toEntityId());
    if (principalId == null) {
      impersonationInfo=ImpersonationInfo.getMasterImpersonationInfo(cConf);
    }
 else {
      impersonationInfo=new ImpersonationInfo(principalId.getPrincipal(),cConf);
    }
    systemArgs.put(ProgramOptionConstants.PRINCIPAL,impersonationInfo.getPrincipal());
    systemArgs.put(ProgramOptionConstants.KEYTAB_URI,impersonationInfo.getKeytabURI());
  }
  return systemArgs;
}

Fixed version (ground truth):
public Map<String,String> getSystemProperties(Id.Program id) throws Exception {
  Map<String,String> systemArgs=Maps.newHashMap();
  systemArgs.put(Constants.CLUSTER_NAME,cConf.get(Constants.CLUSTER_NAME,"String_Node_Str"));
  systemArgs.put(Constants.AppFabric.APP_SCHEDULER_QUEUE,queueResolver.getQueue(id.getNamespace()));
  if (SecurityUtil.isKerberosEnabled(cConf)) {
    ImpersonationInfo impersonationInfo=SecurityUtil.createImpersonationInfo(ownerAdmin,cConf,id.toEntityId());
    systemArgs.put(ProgramOptionConstants.PRINCIPAL,impersonationInfo.getPrincipal());
    systemArgs.put(ProgramOptionConstants.KEYTAB_URI,impersonationInfo.getKeytabURI());
  }
  return systemArgs;
}
Program: 5422
Project: 5422
Buggy source:
private Properties generateKafkaConfig(String kafkaZKConnect){
  int port=Networks.getRandomPort();
  Preconditions.checkState(port > 0,"String_Node_Str");
  Properties prop=new Properties();
  prop.setProperty("String_Node_Str",new File("String_Node_Str").getAbsolutePath());
  prop.setProperty("String_Node_Str",Integer.toString(port));
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str",kafkaZKConnect);
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  return prop;
}

Fixed version (ground truth):
private Properties generateKafkaConfig(String kafkaZKConnect){
  Properties prop=new Properties();
  prop.setProperty("String_Node_Str",new File("String_Node_Str").getAbsolutePath());
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str",kafkaZKConnect);
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  return prop;
}
Program: 5424
Project: 5424
Buggy source:
private Properties generateKafkaConfig(String kafkaZKConnect){
  int port=Networks.getRandomPort();
  Preconditions.checkState(port > 0,"String_Node_Str");
  Properties prop=new Properties();
  prop.setProperty("String_Node_Str",new File("String_Node_Str").getAbsolutePath());
  prop.setProperty("String_Node_Str",Integer.toString(port));
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str",kafkaZKConnect);
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  return prop;
}

Fixed version (ground truth):
private Properties generateKafkaConfig(String kafkaZKConnect){
  Properties prop=new Properties();
  prop.setProperty("String_Node_Str",new File("String_Node_Str").getAbsolutePath());
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str",kafkaZKConnect);
  prop.setProperty("String_Node_Str","String_Node_Str");
  prop.setProperty("String_Node_Str","String_Node_Str");
  return prop;
}
Program: 5425
Project: 5425
Buggy source:
private void rewriteHiveConfig(){
  URL resourceURL=getLocalResourceURL("String_Node_Str");
  if (resourceURL == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  try (InputStream is=new FileInputStream(new File(resourceURL.toURI()))){
    Configuration conf=new Configuration(false);
    conf.addResource(is);
    conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
    conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
    String sparkHome=System.getenv(Constants.SPARK_HOME);
    if (sparkHome != null) {
      LOG.debug("String_Node_Str",sparkHome);
      conf.set("String_Node_Str",sparkHome);
    }
    File newConfFile=File.createTempFile("String_Node_Str","String_Node_Str");
    try (FileOutputStream os=new FileOutputStream(newConfFile)){
      conf.writeXml(os);
    }
     Files.move(newConfFile.toPath(),Paths.get(resourceURL.toURI()),StandardCopyOption.REPLACE_EXISTING);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",resourceURL,e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private void rewriteHiveConfig(){
  URL resourceURL=getLocalResourceURL("String_Node_Str");
  if (resourceURL == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  try (InputStream is=new FileInputStream(new File(resourceURL.toURI()))){
    Configuration conf=new Configuration(false);
    conf.addResource(is);
    conf.setBoolean(Job.MAPREDUCE_JOB_USER_CLASSPATH_FIRST,false);
    conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_CLASSLOADER,false);
    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION,UserGroupInformation.AuthenticationMethod.SIMPLE.name());
    String sparkHome=System.getenv(Constants.SPARK_HOME);
    if (sparkHome != null) {
      LOG.debug("String_Node_Str",sparkHome);
      conf.set("String_Node_Str",sparkHome);
    }
    File newConfFile=File.createTempFile("String_Node_Str","String_Node_Str");
    try (FileOutputStream os=new FileOutputStream(newConfFile)){
      conf.writeXml(os);
    }
     Files.move(newConfFile.toPath(),Paths.get(resourceURL.toURI()),StandardCopyOption.REPLACE_EXISTING);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",resourceURL,e);
    throw Throwables.propagate(e);
  }
}
Program: 5428
Project: 5428
Buggy source:
/** 
 * Prepares search terms from the specified search query by <ol> <li>Splitting on   {@link #SPACE_SEPARATOR_PATTERN} and trimming</li><li>Handling  {@link #KEYVALUE_SEPARATOR}, so searches of the pattern key:value* can be supported</li> <li>Prepending the result with the specified namespaceId and   {@link NamespaceId#SYSTEM} so the search canbe restricted to entities in the specified namespace and  {@link NamespaceId#SYSTEM}.</li> </ol>t
 * @param namespaceId the namespaceId to search in
 * @param searchQuery the user specified search query. If {@code *}, returns a singleton list containing  {@code *} which matches everything.
 * @return formatted search query which is namespaced
 */
private Iterable<String> getSearchTerms(String namespaceId,String searchQuery){
  List<String> searchTerms=new ArrayList<>();
  for (  String term : Splitter.on(SPACE_SEPARATOR_PATTERN).omitEmptyStrings().trimResults().split(searchQuery)) {
    String formattedSearchTerm=term.toLowerCase();
    if (formattedSearchTerm.contains(KEYVALUE_SEPARATOR)) {
      String[] split=formattedSearchTerm.split(KEYVALUE_SEPARATOR,2);
      formattedSearchTerm=split[0].trim() + KEYVALUE_SEPARATOR + split[1].trim();
    }
    searchTerms.add(namespaceId + KEYVALUE_SEPARATOR + formattedSearchTerm);
    if (!NamespaceId.SYSTEM.getEntityName().equals(namespaceId)) {
      searchTerms.add(NamespaceId.SYSTEM.getEntityName() + KEYVALUE_SEPARATOR + formattedSearchTerm);
    }
  }
  return searchTerms;
}

Fixed version (ground truth):
/** 
 * Prepares search terms from the specified search query by <ol> <li>Splitting on   {@link #SPACE_SEPARATOR_PATTERN} and trimming</li><li>Handling  {@link #KEYVALUE_SEPARATOR}, so searches of the pattern key:value* can be supported</li> <li>Prepending the result with the specified namespaceId and   {@link NamespaceId#SYSTEM} so the search canbe restricted to entities in the specified namespace and  {@link NamespaceId#SYSTEM}.</li> </ol>t
 * @param namespaceId the namespaceId to search in
 * @param searchQuery the user specified search query. If {@code *}, returns a singleton list containing  {@code *} which matches everything.
 * @return formatted search query which is namespaced
 */
private Iterable<String> getSearchTerms(String namespaceId,String searchQuery){
  List<String> searchTerms=new LinkedList<>();
  for (  String term : Splitter.on(SPACE_SEPARATOR_PATTERN).omitEmptyStrings().trimResults().split(searchQuery)) {
    String formattedSearchTerm=term.toLowerCase();
    if (formattedSearchTerm.contains(KEYVALUE_SEPARATOR)) {
      String[] split=formattedSearchTerm.split(KEYVALUE_SEPARATOR,2);
      formattedSearchTerm=split[0].trim() + KEYVALUE_SEPARATOR + split[1].trim();
    }
    searchTerms.add(namespaceId + KEYVALUE_SEPARATOR + formattedSearchTerm);
    if (!NamespaceId.SYSTEM.getEntityName().equals(namespaceId)) {
      searchTerms.add(NamespaceId.SYSTEM.getEntityName() + KEYVALUE_SEPARATOR + formattedSearchTerm);
    }
  }
  return searchTerms;
}
Program: 5429
Project: 5429
Buggy source:
private SearchResults searchByDefaultIndex(String namespaceId,String searchQuery,Set<EntityTypeSimpleName> types,boolean showHidden){
  List<MetadataEntry> results=new ArrayList<>();
  for (  String searchTerm : getSearchTerms(namespaceId,searchQuery)) {
    Scanner scanner;
    if (searchTerm.endsWith("String_Node_Str")) {
      byte[] startKey=Bytes.toBytes(searchTerm.substring(0,searchTerm.lastIndexOf("String_Node_Str")));
      byte[] stopKey=Bytes.stopKeyForPrefix(startKey);
      scanner=indexedTable.scanByIndex(Bytes.toBytes(DEFAULT_INDEX_COLUMN),startKey,stopKey);
    }
 else {
      byte[] value=Bytes.toBytes(searchTerm);
      scanner=indexedTable.readByIndex(Bytes.toBytes(DEFAULT_INDEX_COLUMN),value);
    }
    try {
      Row next;
      while ((next=scanner.next()) != null) {
        Optional<MetadataEntry> metadataEntry=parseRow(next,DEFAULT_INDEX_COLUMN,types,showHidden);
        if (metadataEntry.isPresent()) {
          results.add(metadataEntry.get());
        }
      }
    }
  finally {
      scanner.close();
    }
  }
  return new SearchResults(results,Collections.<String>emptyList());
}

Fixed version (ground truth):
private SearchResults searchByDefaultIndex(String namespaceId,String searchQuery,Set<EntityTypeSimpleName> types,boolean showHidden){
  List<MetadataEntry> results=new LinkedList<>();
  for (  String searchTerm : getSearchTerms(namespaceId,searchQuery)) {
    Scanner scanner;
    if (searchTerm.endsWith("String_Node_Str")) {
      byte[] startKey=Bytes.toBytes(searchTerm.substring(0,searchTerm.lastIndexOf("String_Node_Str")));
      byte[] stopKey=Bytes.stopKeyForPrefix(startKey);
      scanner=indexedTable.scanByIndex(Bytes.toBytes(DEFAULT_INDEX_COLUMN),startKey,stopKey);
    }
 else {
      byte[] value=Bytes.toBytes(searchTerm);
      scanner=indexedTable.readByIndex(Bytes.toBytes(DEFAULT_INDEX_COLUMN),value);
    }
    try {
      Row next;
      while ((next=scanner.next()) != null) {
        Optional<MetadataEntry> metadataEntry=parseRow(next,DEFAULT_INDEX_COLUMN,types,showHidden);
        if (metadataEntry.isPresent()) {
          results.add(metadataEntry.get());
        }
      }
    }
  finally {
      scanner.close();
    }
  }
  return new SearchResults(results,Collections.<String>emptyList(),results);
}
Program: 5431
Project: 5431
Buggy source:
SearchResults(List<MetadataEntry> results,List<String> cursors){
  this.results=results;
  this.cursors=cursors;
}

Fixed version (ground truth):
SearchResults(List<MetadataEntry> results,List<String> cursors,List<MetadataEntry> allResults){
  this.results=results;
  this.cursors=cursors;
  this.allResults=allResults;
}