nus-yam/ex-repair huggingface dataset:
Program: 93719
Project: 93719
Buggy source:
public void end(Buffer t){
  this.delegate.end((io.vertx.core.buffer.Buffer)t.getDelegate());
}

Fixed version (ground truth):
/** 
 * Call   {@link io.vertx.ext.web.handler.sockjs.SockJSSocket}.
 */
public void end(){
  ((io.vertx.ext.web.handler.sockjs.SockJSSocket)delegate).end();
}
Program: 93720
Project: 93720
Buggy source:
private void checkHandleNoMatch(){
  if (failed()) {
    unhandledFailure(statusCode,failure,router);
  }
 else {
    response().setStatusCode(404);
    response().end(DEFAULT_404);
  }
}

Fixed version (ground truth):
private void checkHandleNoMatch(){
  if (failed()) {
    unhandledFailure(statusCode,failure,router);
  }
 else {
    response().setStatusCode(404);
    if (request().method() == HttpMethod.HEAD) {
      response().end();
    }
 else {
      response().end(DEFAULT_404);
    }
  }
}
Program: 93721
Project: 93721
Buggy source:
/** 
 * Specify a blocking request handler for the route. This method works just like   {@link #handler(Handler)} excepted that it will run the blocking handler on a worker threadso that it won't block the event loop. Note that it's safe to call context.next() from the blocking handler as it will be executed on the event loop context (and not on the worker thread. If the blocking handler is ordered it means that any blocking handlers for the same context are never executed concurrently but always in the order they were called. The default value of ordered is true. If you do not want this behaviour and don't mind if your blocking handlers are executed in parallel you can set ordered to false.
 * @param requestHandler  the blocking request handler
 * @param ordered
 * @return a reference to this, so the API can be used fluently
 */
@Fluent Route blockingHandler(Handler<RoutingContext> requestHandler,boolean ordered);

Fixed version (ground truth):
/** 
 * Specify a blocking request handler for the route. This method works just like   {@link #handler(Handler)} excepted that it will run the blocking handler on a worker threadso that it won't block the event loop. Note that it's safe to call context.next() from the blocking handler as it will be executed on the event loop context (and not on the worker thread. If the blocking handler is ordered it means that any blocking handlers for the same context are never executed concurrently but always in the order they were called. The default value of ordered is true. If you do not want this behaviour and don't mind if your blocking handlers are executed in parallel you can set ordered to false.
 * @param requestHandler  the blocking request handler
 * @param ordered if true handlers are executed in sequence, otherwise are run in parallel
 * @return a reference to this, so the API can be used fluently
 */
@Fluent Route blockingHandler(Handler<RoutingContext> requestHandler,boolean ordered);
Program: 93722
Project: 93722
Buggy source:
/** 
 * Create all required header so content can be cache by Caching servers or Browsers
 * @param request
 * @param props
 */
private void writeCacheHeaders(HttpServerRequest request,FileProps props){
  MultiMap headers=request.response().headers();
  if (cachingEnabled) {
    headers.set("String_Node_Str","String_Node_Str" + maxAgeSeconds);
    headers.set("String_Node_Str",dateTimeFormatter.format(props.lastModifiedTime()));
  }
  headers.set("String_Node_Str",dateTimeFormatter.format(new Date()));
}

Fixed version (ground truth):
/** 
 * Create all required header so content can be cache by Caching servers or Browsers
 * @param request base HttpServerRequest
 * @param props file properties
 */
private void writeCacheHeaders(HttpServerRequest request,FileProps props){
  MultiMap headers=request.response().headers();
  if (cachingEnabled) {
    headers.set("String_Node_Str","String_Node_Str" + maxAgeSeconds);
    headers.set("String_Node_Str",dateTimeFormatter.format(props.lastModifiedTime()));
  }
  headers.set("String_Node_Str",dateTimeFormatter.format(new Date()));
}
Program: 93723
Project: 93723
Buggy source:
private BHandler(RoutingContext context){
  this.context=context;
  Set<FileUpload> fileUploads=context.fileUploads();
  context.request().setExpectMultipart(true);
  context.request().exceptionHandler(context::fail);
  context.request().uploadHandler(upload -> {
    String uploadedFileName=new File(uploadsDir,UUID.randomUUID().toString()).getPath();
    upload.streamToFileSystem(uploadedFileName);
    FileUploadImpl fileUpload=new FileUploadImpl(uploadedFileName,upload);
    fileUploads.add(fileUpload);
    upload.exceptionHandler(context::fail);
  }
);
}

Fixed version (ground truth):
private BHandler(RoutingContext context){
  this.context=context;
  Set<FileUpload> fileUploads=context.fileUploads();
  context.request().setExpectMultipart(true);
  context.request().exceptionHandler(context::fail);
  context.request().uploadHandler(upload -> {
    uploadCount.incrementAndGet();
    String uploadedFileName=new File(uploadsDir,UUID.randomUUID().toString()).getPath();
    upload.streamToFileSystem(uploadedFileName);
    FileUploadImpl fileUpload=new FileUploadImpl(uploadedFileName,upload);
    fileUploads.add(fileUpload);
    upload.exceptionHandler(context::fail);
    upload.endHandler(v -> uploadEnded());
  }
);
}
Program: 93724
Project: 93724
Buggy source:
void end(){
  if (failed) {
    return;
  }
  HttpServerRequest req=context.request();
  if (mergeFormAttributes && req.isExpectMultipart()) {
    req.params().addAll(req.formAttributes());
  }
  context.setBody(body);
  context.next();
}

Fixed version (ground truth):
void end(){
  if (uploadCount.get() == 0) {
    doEnd();
  }
}
Program: 93725
Project: 93725
Buggy source:
private void testFileUpload(String uploadsDir,int size) throws Exception {
  String name="String_Node_Str";
  String fileName="String_Node_Str";
  String contentType="String_Node_Str";
  Buffer fileData=TestUtils.randomBuffer(size);
  router.route().handler(rc -> {
    Set<FileUpload> fileUploads=rc.fileUploads();
    assertNotNull(fileUploads);
    assertEquals(1,fileUploads.size());
    FileUpload upload=fileUploads.iterator().next();
    assertEquals(name,upload.name());
    assertEquals(fileName,upload.fileName());
    assertEquals(contentType,upload.contentType());
    assertEquals("String_Node_Str",upload.contentTransferEncoding());
    assertEquals(fileData.length(),upload.size());
    String uploadedFileName=upload.uploadedFileName();
    assertTrue(uploadedFileName.startsWith(uploadsDir + File.separator));
    Buffer uploaded=vertx.fileSystem().readFileBlocking(uploadedFileName);
    assertEquals(fileData,uploaded);
    Buffer rawBody=rc.getBody();
    assertNotNull(rawBody);
    assertTrue(rawBody.length() > fileData.length());
    rc.response().end();
  }
);
  sendFileUploadRequest(fileData,200,"String_Node_Str");
}

Fixed version (ground truth):
private void testFileUpload(String uploadsDir,int size) throws Exception {
  String name="String_Node_Str";
  String fileName="String_Node_Str";
  String contentType="String_Node_Str";
  System.out.println("String_Node_Str" + size);
  Buffer fileData=TestUtils.randomBuffer(size);
  router.route().handler(rc -> {
    Set<FileUpload> fileUploads=rc.fileUploads();
    assertNotNull(fileUploads);
    assertEquals(1,fileUploads.size());
    FileUpload upload=fileUploads.iterator().next();
    assertEquals(name,upload.name());
    assertEquals(fileName,upload.fileName());
    assertEquals(contentType,upload.contentType());
    assertEquals("String_Node_Str",upload.contentTransferEncoding());
    assertEquals(fileData.length(),upload.size());
    String uploadedFileName=upload.uploadedFileName();
    assertTrue(uploadedFileName.startsWith(uploadsDir + File.separator));
    Buffer uploaded=vertx.fileSystem().readFileBlocking(uploadedFileName);
    System.out.println("String_Node_Str" + uploaded.length());
    assertEquals(fileData,uploaded);
    Buffer rawBody=rc.getBody();
    assertNotNull(rawBody);
    assertTrue(rawBody.length() > fileData.length());
    rc.response().end();
  }
);
  sendFileUploadRequest(fileData,200,"String_Node_Str");
}
Program: 93726
Project: 93726
Buggy source:
private boolean pathMatches(String mountPoint,RoutingContext ctx){
  String thePath=mountPoint == null ? path : mountPoint + path;
  String requestPath=useNormalisedPath ? ctx.normalisedPath() : ctx.request().path();
  if (exactPath) {
    return pathMatchesExact(requestPath,thePath);
  }
 else {
    return requestPath.startsWith(removeTrailing(thePath));
  }
}

Fixed version (ground truth):
private boolean pathMatches(String mountPoint,RoutingContext ctx){
  String thePath=mountPoint == null ? path : mountPoint + path;
  String requestPath=useNormalisedPath ? ctx.normalisedPath() : ctx.request().path();
  if (exactPath) {
    return pathMatchesExact(requestPath,thePath);
  }
 else {
    if (thePath.endsWith("String_Node_Str") && requestPath.equals(removeTrailing(thePath))) {
      return true;
    }
    return requestPath.startsWith(thePath);
  }
}
Program: 93727
Project: 93727
Buggy source:
private void testPathBegin(HttpMethod method,String path) throws Exception {
  testRequest(method,path,200,path);
  testRequest(method,path + "String_Node_Str",200,path + "String_Node_Str");
  testRequest(method,path + "String_Node_Str",200,path + "String_Node_Str");
  testRequest(method,path + "String_Node_Str",200,path + "String_Node_Str");
  testRequest(method,path.substring(0,path.length() - 1),404,"String_Node_Str");
  testRequest(method,"String_Node_Str",404,"String_Node_Str");
  testRequest(method,"String_Node_Str" + UUID.randomUUID().toString(),404,"String_Node_Str");
}

Fixed version (ground truth):
private void testPathBegin(HttpMethod method,String path) throws Exception {
  testRequest(method,path,200,path);
  testRequest(method,path + "String_Node_Str",200,path + "String_Node_Str");
  if (path.endsWith("String_Node_Str")) {
    testRequest(method,path.substring(0,path.length() - 1) + "String_Node_Str",404,"String_Node_Str");
    testRequest(method,path.substring(0,path.length() - 1) + "String_Node_Str",200,path.substring(0,path.length() - 1) + "String_Node_Str");
  }
 else {
    testRequest(method,path + "String_Node_Str",200,path + "String_Node_Str");
    testRequest(method,path + "String_Node_Str",200,path + "String_Node_Str");
    testRequest(method,path.substring(0,path.length() - 1),404,"String_Node_Str");
  }
  testRequest(method,"String_Node_Str",404,"String_Node_Str");
  testRequest(method,"String_Node_Str" + UUID.randomUUID().toString(),404,"String_Node_Str");
}
Program: 93728
Project: 93728
Buggy source:
private void checkAddAccceptedReplyAddress(final String replyAddress){
  if (replyAddress != null) {
    acceptedReplyAddresses.add(replyAddress);
    vertx.setTimer(replyTimeout,id -> acceptedReplyAddresses.remove(replyAddress));
  }
}

Fixed version (ground truth):
private void checkAddAccceptedReplyAddress(Message message){
  String replyAddress=message.replyAddress();
  if (replyAddress != null) {
    messagesAwaitingReply.put(replyAddress,message);
    vertx.setTimer(replyTimeout,tid -> messagesAwaitingReply.remove(replyAddress));
  }
}
Program: 93730
Project: 93730
Buggy source:
private Match checkMatches(boolean inbound,String address,Object body){
  if (inbound && acceptedReplyAddresses.remove(address)) {
    return new Match(true);
  }
  List<PermittedOptions> matches=inbound ? inboundPermitted : outboundPermitted;
  for (  PermittedOptions matchHolder : matches) {
    String matchAddress=matchHolder.getAddress();
    String matchRegex;
    if (matchAddress == null) {
      matchRegex=matchHolder.getAddressRegex();
    }
 else {
      matchRegex=null;
    }
    boolean addressOK;
    if (matchAddress == null) {
      if (matchRegex == null) {
        addressOK=true;
      }
 else {
        addressOK=regexMatches(matchRegex,address);
      }
    }
 else {
      addressOK=matchAddress.equals(address);
    }
    if (addressOK) {
      boolean matched=structureMatches(matchHolder.getMatch(),body);
      if (matched) {
        String requiredRole=matchHolder.getRequiredRole();
        String requiredPermission=matchHolder.getRequiredPermission();
        return new Match(true,requiredRole,requiredPermission);
      }
    }
  }
  return new Match(false);
}

Fixed version (ground truth):
private Match checkMatches(boolean inbound,String address,Object body){
  List<PermittedOptions> matches=inbound ? inboundPermitted : outboundPermitted;
  for (  PermittedOptions matchHolder : matches) {
    String matchAddress=matchHolder.getAddress();
    String matchRegex;
    if (matchAddress == null) {
      matchRegex=matchHolder.getAddressRegex();
    }
 else {
      matchRegex=null;
    }
    boolean addressOK;
    if (matchAddress == null) {
      if (matchRegex == null) {
        addressOK=true;
      }
 else {
        addressOK=regexMatches(matchRegex,address);
      }
    }
 else {
      addressOK=matchAddress.equals(address);
    }
    if (addressOK) {
      boolean matched=structureMatches(matchHolder.getMatch(),body);
      if (matched) {
        String requiredRole=matchHolder.getRequiredRole();
        String requiredPermission=matchHolder.getRequiredPermission();
        return new Match(true,requiredRole,requiredPermission);
      }
    }
  }
  return new Match(false);
}
Program: 93731
Project: 93731
Buggy source:
private void checkAndSend(boolean send,String address,Object body,SockJSSocket sock,String replyAddress){
  final SockInfo info=sockInfos.get(sock);
  if (replyAddress != null && !checkMaxHandlers(sock,info)) {
    return;
  }
  final Handler<AsyncResult<Message<Object>>> replyHandler;
  if (replyAddress != null) {
    replyHandler=result -> {
      if (result.succeeded()) {
        Message message=result.result();
        checkAddAccceptedReplyAddress(message.replyAddress());
        deliverMessage(sock,replyAddress,message);
      }
 else {
        ReplyException cause=(ReplyException)result.cause();
        JsonObject envelope=new JsonObject().put("String_Node_Str",replyAddress).put("String_Node_Str",cause.failureCode()).put("String_Node_Str",cause.failureType().name()).put("String_Node_Str",cause.getMessage());
        sock.write(buffer(envelope.encode()));
      }
      info.handlerCount--;
    }
;
  }
 else {
    replyHandler=null;
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + address + "String_Node_Str");
  }
  if (send) {
    eb.send(address,body,new DeliveryOptions().setSendTimeout(replyTimeout),replyHandler);
    if (replyAddress != null) {
      info.handlerCount++;
    }
  }
 else {
    eb.publish(address,body);
  }
}

Fixed version (ground truth):
private void checkAndSend(boolean send,String address,Object body,SockJSSocket sock,String replyAddress,Message awaitingReply){
  final SockInfo info=sockInfos.get(sock);
  if (replyAddress != null && !checkMaxHandlers(sock,info)) {
    return;
  }
  final Handler<AsyncResult<Message<Object>>> replyHandler;
  if (replyAddress != null) {
    replyHandler=result -> {
      if (result.succeeded()) {
        Message message=result.result();
        checkAddAccceptedReplyAddress(message);
        deliverMessage(sock,replyAddress,message);
      }
 else {
        ReplyException cause=(ReplyException)result.cause();
        JsonObject envelope=new JsonObject().put("String_Node_Str",replyAddress).put("String_Node_Str",cause.failureCode()).put("String_Node_Str",cause.failureType().name()).put("String_Node_Str",cause.getMessage());
        sock.write(buffer(envelope.encode()));
      }
      info.handlerCount--;
    }
;
  }
 else {
    replyHandler=null;
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + address + "String_Node_Str");
  }
  if (send) {
    if (awaitingReply != null) {
      awaitingReply.reply(body,replyHandler);
    }
 else {
      eb.send(address,body,new DeliveryOptions().setSendTimeout(replyTimeout),replyHandler);
    }
    if (replyAddress != null) {
      info.handlerCount++;
    }
  }
 else {
    eb.publish(address,body);
  }
}
Program: 93733
Project: 93733
Buggy source:
@Override public void handle(Buffer buff){
  if (failed) {
    return;
  }
  if (bodyLimit != -1 && body.length() > bodyLimit) {
    failed=true;
    context.fail(413);
  }
 else {
    body.appendBuffer(buff);
  }
}

Fixed version (ground truth):
@Override public void handle(Buffer buff){
  if (failed) {
    return;
  }
  if (bodyLimit != -1 && (body.length() + buff.length()) > bodyLimit) {
    failed=true;
    context.fail(413);
  }
 else {
    body.appendBuffer(buff);
  }
}
Program: 93734
Project: 93734
Buggy source:
boolean shouldUseCached(HttpServerRequest request){
  String ifModifiedSince=request.headers().get("String_Node_Str");
  if (ifModifiedSince == null) {
    return false;
  }
  Date ifModifiedSinceDate=parseDate(ifModifiedSince);
  boolean modifiedSince=props.lastModifiedTime() > ifModifiedSinceDate.getTime();
  return !modifiedSince;
}

Fixed version (ground truth):
boolean shouldUseCached(HttpServerRequest request){
  String ifModifiedSince=request.headers().get("String_Node_Str");
  if (ifModifiedSince == null) {
    return false;
  }
  Date ifModifiedSinceDate=parseDate(ifModifiedSince);
  boolean modifiedSince=Utils.secondsFactor(props.lastModifiedTime()) > ifModifiedSinceDate.getTime();
  return !modifiedSince;
}
Program: 93736
Project: 93736
Buggy source:
private void testFileUpload(String uploadsDir,int size) throws Exception {
  String name="String_Node_Str";
  String fileName="String_Node_Str";
  String contentType="String_Node_Str";
  Buffer fileData=TestUtils.randomBuffer(size);
  router.route().handler(rc -> {
    Set<FileUpload> fileUploads=rc.fileUploads();
    assertNotNull(fileUploads);
    assertEquals(1,fileUploads.size());
    FileUpload upload=fileUploads.iterator().next();
    assertEquals(name,upload.name());
    assertEquals(fileName,upload.fileName());
    assertEquals(contentType,upload.contentType());
    assertEquals("String_Node_Str",upload.contentTransferEncoding());
    assertEquals(fileData.length(),upload.size());
    String uploadedFileName=upload.uploadedFileName();
    assertTrue(uploadedFileName.startsWith(uploadsDir + "String_Node_Str"));
    Buffer uploaded=vertx.fileSystem().readFileBlocking(uploadedFileName);
    assertEquals(fileData,uploaded);
    Buffer rawBody=rc.getBody();
    assertNotNull(rawBody);
    assertTrue(rawBody.length() > fileData.length());
    rc.response().end();
  }
);
  sendFileUploadRequest(fileData,200,"String_Node_Str");
}

Fixed version (ground truth):
private void testFileUpload(String uploadsDir,int size) throws Exception {
  String name="String_Node_Str";
  String fileName="String_Node_Str";
  String contentType="String_Node_Str";
  Buffer fileData=TestUtils.randomBuffer(size);
  router.route().handler(rc -> {
    Set<FileUpload> fileUploads=rc.fileUploads();
    assertNotNull(fileUploads);
    assertEquals(1,fileUploads.size());
    FileUpload upload=fileUploads.iterator().next();
    assertEquals(name,upload.name());
    assertEquals(fileName,upload.fileName());
    assertEquals(contentType,upload.contentType());
    assertEquals("String_Node_Str",upload.contentTransferEncoding());
    assertEquals(fileData.length(),upload.size());
    String uploadedFileName=upload.uploadedFileName();
    assertTrue(uploadedFileName.startsWith(uploadsDir + File.separator));
    Buffer uploaded=vertx.fileSystem().readFileBlocking(uploadedFileName);
    assertEquals(fileData,uploaded);
    Buffer rawBody=rc.getBody();
    assertNotNull(rawBody);
    assertTrue(rawBody.length() > fileData.length());
    rc.response().end();
  }
);
  sendFileUploadRequest(fileData,200,"String_Node_Str");
}
Program: 93737
Project: 93737
Buggy source:
@Test public void testContentHeadersSet() throws Exception {
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String contentType=res.headers().get("String_Node_Str");
    String contentLength=res.headers().get("String_Node_Str");
    assertEquals("String_Node_Str",contentType);
    assertEquals(36,Integer.valueOf(contentLength).intValue());
  }
,200,"String_Node_Str",null);
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String contentType=res.headers().get("String_Node_Str");
    String contentLength=res.headers().get("String_Node_Str");
    assertEquals("String_Node_Str",contentType);
    assertEquals(18,Integer.valueOf(contentLength).intValue());
  }
,200,"String_Node_Str",null);
}

Fixed version (ground truth):
@Test public void testContentHeadersSet() throws Exception {
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String contentType=res.headers().get("String_Node_Str");
    String contentLength=res.headers().get("String_Node_Str");
    assertEquals("String_Node_Str",contentType);
    assertEquals(36,Integer.valueOf(contentLength).intValue());
  }
,200,"String_Node_Str",null);
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String contentType=res.headers().get("String_Node_Str");
    String contentLength=res.headers().get("String_Node_Str");
    assertEquals("String_Node_Str",contentType);
    int contentLengthInt=Integer.valueOf(contentLength);
    assertTrue(18 == contentLengthInt || 20 == contentLengthInt);
  }
,200,"String_Node_Str",null);
}
Program: 93738
Project: 93738
Buggy source:
@Test public void testCacheFilesNotReadOnly() throws Exception {
  stat.setFilesReadOnly(false);
  stat.setWebRoot("String_Node_Str");
  long modified=new File("String_Node_Str","String_Node_Str").lastModified();
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String lastModified=res.headers().get("String_Node_Str");
    assertEquals(modified,toDateTime(lastModified));
  }
,200,"String_Node_Str","String_Node_Str");
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",dateTimeFormatter.format(modified));
  }
,null,304,"String_Node_Str",null);
}

Fixed version (ground truth):
@Test public void testCacheFilesNotReadOnly() throws Exception {
  stat.setFilesReadOnly(false);
  stat.setWebRoot("String_Node_Str");
  long modified=Utils.secondsFactor(new File("String_Node_Str","String_Node_Str").lastModified());
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String lastModified=res.headers().get("String_Node_Str");
    assertEquals(modified,toDateTime(lastModified));
  }
,200,"String_Node_Str","String_Node_Str");
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",dateTimeFormatter.format(modified));
  }
,null,304,"String_Node_Str",null);
}
Program: 93739
Project: 93739
Buggy source:
@Test public void testCacheReturnFromCache() throws Exception {
  AtomicReference<String> lastModifiedRef=new AtomicReference<>();
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String cacheControl=res.headers().get("String_Node_Str");
    String lastModified=res.headers().get("String_Node_Str");
    lastModifiedRef.set(lastModified);
    assertNotNull(cacheControl);
    assertNotNull(lastModified);
    long diff=System.currentTimeMillis() - toDateTime(lastModified);
    assertTrue(diff > 0 && diff < 2000);
    assertEquals("String_Node_Str" + StaticHandler.DEFAULT_MAX_AGE_SECONDS,cacheControl);
  }
,200,"String_Node_Str","String_Node_Str");
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",lastModifiedRef.get());
  }
,null,304,"String_Node_Str",null);
}

Fixed version (ground truth):
@Test public void testCacheReturnFromCache() throws Exception {
  AtomicReference<String> lastModifiedRef=new AtomicReference<>();
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String cacheControl=res.headers().get("String_Node_Str");
    String lastModified=res.headers().get("String_Node_Str");
    lastModifiedRef.set(lastModified);
    assertNotNull(cacheControl);
    assertNotNull(lastModified);
    assertEquals("String_Node_Str" + StaticHandler.DEFAULT_MAX_AGE_SECONDS,cacheControl);
  }
,200,"String_Node_Str","String_Node_Str");
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",lastModifiedRef.get());
  }
,null,304,"String_Node_Str",null);
}
Program: 93740
Project: 93740
Buggy source:
@Test public void testCacheFilesEntryOld() throws Exception {
  stat.setFilesReadOnly(false);
  stat.setWebRoot("String_Node_Str");
  stat.setCacheEntryTimeout(2000);
  File resource=new File("String_Node_Str","String_Node_Str");
  long modified=resource.lastModified();
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String lastModified=res.headers().get("String_Node_Str");
    assertEquals(modified,toDateTime(lastModified));
    resource.setLastModified(modified + 1000);
  }
,200,"String_Node_Str","String_Node_Str");
  Thread.sleep(2001);
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",dateTimeFormatter.format(modified));
  }
,res -> {
    String lastModified=res.headers().get("String_Node_Str");
    assertEquals(modified + 1000,toDateTime(lastModified));
  }
,200,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testCacheFilesEntryOld() throws Exception {
  stat.setFilesReadOnly(false);
  stat.setWebRoot("String_Node_Str");
  stat.setCacheEntryTimeout(2000);
  File resource=new File("String_Node_Str","String_Node_Str");
  long modified=Utils.secondsFactor(resource.lastModified());
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String lastModified=res.headers().get("String_Node_Str");
    assertEquals(modified,toDateTime(lastModified));
    resource.setLastModified(modified + 1000);
  }
,200,"String_Node_Str","String_Node_Str");
  Thread.sleep(2001);
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",dateTimeFormatter.format(modified));
  }
,res -> {
    String lastModified=res.headers().get("String_Node_Str");
    assertEquals(modified + 1000,toDateTime(lastModified));
  }
,200,"String_Node_Str","String_Node_Str");
}
Program: 93741
Project: 93741
Buggy source:
@Test public void testCacheGetNew() throws Exception {
  AtomicReference<String> lastModifiedRef=new AtomicReference<>();
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String cacheControl=res.headers().get("String_Node_Str");
    String lastModified=res.headers().get("String_Node_Str");
    lastModifiedRef.set(lastModified);
    assertNotNull(cacheControl);
    assertNotNull(lastModified);
    long diff=System.currentTimeMillis() - toDateTime(lastModified);
    assertTrue(diff > 0 && diff < 2000);
    assertEquals("String_Node_Str" + StaticHandler.DEFAULT_MAX_AGE_SECONDS,cacheControl);
  }
,200,"String_Node_Str","String_Node_Str");
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",dateTimeFormatter.format(toDateTime(lastModifiedRef.get()) - 1));
  }
,res -> {
  }
,200,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testCacheGetNew() throws Exception {
  AtomicReference<String> lastModifiedRef=new AtomicReference<>();
  testRequest(HttpMethod.GET,"String_Node_Str",null,res -> {
    String cacheControl=res.headers().get("String_Node_Str");
    String lastModified=res.headers().get("String_Node_Str");
    lastModifiedRef.set(lastModified);
    assertNotNull(cacheControl);
    assertNotNull(lastModified);
    assertEquals("String_Node_Str" + StaticHandler.DEFAULT_MAX_AGE_SECONDS,cacheControl);
  }
,200,"String_Node_Str","String_Node_Str");
  testRequest(HttpMethod.GET,"String_Node_Str",req -> {
    req.putHeader("String_Node_Str",dateTimeFormatter.format(toDateTime(lastModifiedRef.get()) - 1));
  }
,res -> {
  }
,200,"String_Node_Str","String_Node_Str");
}
Program: 93742
Project: 93742
Buggy source:
@Test public void testTemplateHandlerNoExtension() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create();
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTemplateHandlerNoExtension() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create();
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str");
}
Program: 93743
Project: 93743
Buggy source:
@Test public void testTemplateHandlerOnFileSystem() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create();
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTemplateHandlerOnFileSystem() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create();
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str");
}
Program: 93744
Project: 93744
Buggy source:
@Test public void testTemplateHandlerChangeExtension() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create().setExtension("String_Node_Str");
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTemplateHandlerChangeExtension() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create().setExtension("String_Node_Str");
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str");
}
Program: 93745
Project: 93745
Buggy source:
@Test public void testTemplateHandlerOnClasspath() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create();
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTemplateHandlerOnClasspath() throws Exception {
  TemplateEngine engine=MVELTemplateEngine.create();
  testTemplateHandler(engine,"String_Node_Str","String_Node_Str","String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str");
}
Program: 93746
Project: 93746
Buggy source:
@Test public void testRenderToBuffer() throws Exception {
  TemplateEngine engine=new TestEngine(false);
  String expected="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  router.route().handler(context -> {
    context.put("String_Node_Str","String_Node_Str");
    context.put("String_Node_Str","String_Node_Str");
    engine.render(context,"String_Node_Str",onSuccess(res -> {
      String rendered=res.toString();
      assertEquals(expected,rendered);
      context.response().putHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str");
      context.response().end(rendered);
      testComplete();
    }
));
  }
);
  testRequest(HttpMethod.GET,"String_Node_Str",200,"String_Node_Str",expected);
  await();
}

Fixed version (ground truth):
@Test public void testRenderToBuffer() throws Exception {
  TemplateEngine engine=new TestEngine(false);
  String expected="String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str";
  router.route().handler(context -> {
    context.put("String_Node_Str","String_Node_Str");
    context.put("String_Node_Str","String_Node_Str");
    engine.render(context,"String_Node_Str",onSuccess(res -> {
      String rendered=res.toString();
      assertEquals(expected,rendered);
      context.response().putHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str");
      context.response().end(rendered);
      testComplete();
    }
));
  }
);
  testRequest(HttpMethod.GET,"String_Node_Str",200,"String_Node_Str",expected);
  await();
}
Program: 93747
Project: 93747
Buggy source:
private void testRelativeToRoutePath(String pathPrefix) throws Exception {
  TemplateEngine engine=new TestEngine(false);
  router.route().handler(context -> {
    context.put("String_Node_Str","String_Node_Str");
    context.put("String_Node_Str","String_Node_Str");
    context.next();
  }
);
  Route route=router.route();
  if (pathPrefix != null) {
    route.path(pathPrefix);
  }
  route.handler(TemplateHandler.create(engine,"String_Node_Str","String_Node_Str"));
  String expected="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  testRequest(HttpMethod.GET,pathPrefix != null ? pathPrefix + "String_Node_Str" : "String_Node_Str",200,"String_Node_Str",expected);
}

Fixed version (ground truth):
private void testRelativeToRoutePath(String pathPrefix) throws Exception {
  TemplateEngine engine=new TestEngine(false);
  router.route().handler(context -> {
    context.put("String_Node_Str","String_Node_Str");
    context.put("String_Node_Str","String_Node_Str");
    context.next();
  }
);
  Route route=router.route();
  if (pathPrefix != null) {
    route.path(pathPrefix);
  }
  route.handler(TemplateHandler.create(engine,"String_Node_Str","String_Node_Str"));
  String expected="String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str";
  testRequest(HttpMethod.GET,pathPrefix != null ? pathPrefix + "String_Node_Str" : "String_Node_Str",200,"String_Node_Str",expected);
}
Program: 93748
Project: 93748
Buggy source:
@Test public void testRenderDirectly() throws Exception {
  TemplateEngine engine=new TestEngine(false);
  router.route().handler(context -> {
    context.put("String_Node_Str","String_Node_Str");
    context.put("String_Node_Str","String_Node_Str");
    engine.render(context,"String_Node_Str",res -> {
      if (res.succeeded()) {
        context.response().putHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str").end(res.result());
      }
 else {
        context.fail(res.cause());
      }
    }
);
  }
);
  String expected="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  testRequest(HttpMethod.GET,"String_Node_Str",200,"String_Node_Str",expected);
}

Fixed version (ground truth):
@Test public void testRenderDirectly() throws Exception {
  TemplateEngine engine=new TestEngine(false);
  router.route().handler(context -> {
    context.put("String_Node_Str","String_Node_Str");
    context.put("String_Node_Str","String_Node_Str");
    engine.render(context,"String_Node_Str",res -> {
      if (res.succeeded()) {
        context.response().putHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str").end(res.result());
      }
 else {
        context.fail(res.cause());
      }
    }
);
  }
);
  String expected="String_Node_Str" + Utils.LINE_SEPARATOR + "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str"+ Utils.LINE_SEPARATOR+ "String_Node_Str";
  testRequest(HttpMethod.GET,"String_Node_Str",200,"String_Node_Str",expected);
}
Program: 93750
Project: 93750
Buggy source:
@Override public void onContactsLoadSuccess(){
  ContactsHelper.getInstance().parseQwertyInputSearchContacts(null);
  mContactsOperationView.contactsLoadSuccess();
  ContactsHelper.getInstance().showContactsInfo();
  ContactsIndexHelper.getInstance().praseContacts(ContactsHelper.getInstance().getBaseContacts());
}

Fixed version (ground truth):
@Override public void onContactsLoadSuccess(){
  ContactsHelper.getInstance().parseQwertyInputSearchContacts(null);
  mContactsOperationView.contactsLoadSuccess();
  ContactsIndexHelper.getInstance().praseContacts(ContactsHelper.getInstance().getBaseContacts());
}
Program: 93752
Project: 93752
Buggy source:
public Contacts(String id,String name,String phoneNumber,String sortKey){
  super();
  setId(id);
  setName(name);
  setPhoneNumber(phoneNumber);
  setSortKey(sortKey);
  setNamePinyinUnits(new ArrayList<PinyinUnit>());
  setSearchByType(SearchByType.SearchByNull);
  setMatchKeywords(new StringBuffer());
  getMatchKeywords().delete(0,getMatchKeywords().length());
  setMatchStartIndex(-1);
  setMatchLength(0);
  setNextContacts(null);
  setSelected(false);
  setHideMultipleContacts(false);
  setHideOperationView(true);
  setBelongMultipleContactsPhone(false);
}

Fixed version (ground truth):
public Contacts(String id,String name,String phoneNumber,String sortKey){
  super();
  setId(id);
  setName(name);
  setPhoneNumber(phoneNumber);
  setSortKey(sortKey);
  setNamePinyinUnits(new ArrayList<PinyinUnit>());
  setSearchByType(SearchByType.SearchByNull);
  setMatchKeywords(new StringBuffer());
  getMatchKeywords().delete(0,getMatchKeywords().length());
  setMatchStartIndex(-1);
  setMatchLength(0);
  setNextContacts(null);
  setSelected(false);
  setFirstMultipleContacts(true);
  setHideMultipleContacts(false);
  setHideOperationView(true);
  setBelongMultipleContactsPhone(false);
}
Program: 93753
Project: 93753
Buggy source:
/** 
 * @description match Pinyin Units
 * @param pinyinUnits
 * @param baseData the original string which be parsed to PinyinUnit
 * @param search search key words
 * @param chineseKeyWord the sub string of base data
 * @return true if match success,false otherwise.
 */
@SuppressLint("String_Node_Str") public static boolean matchPinyinUnits(final List<PinyinUnit> pinyinUnits,final String baseData,String search,StringBuffer chineseKeyWord){
  if ((null == pinyinUnits) || (null == search) || (null == chineseKeyWord)) {
    return false;
  }
  StringBuffer matchSearch=new StringBuffer();
  matchSearch.delete(0,matchSearch.length());
  chineseKeyWord.delete(0,chineseKeyWord.length());
  String searchLowerCase=search.toLowerCase();
  int index=baseData.toLowerCase().indexOf(searchLowerCase);
  if (index > -1) {
    chineseKeyWord.append(baseData.substring(index,index + searchLowerCase.length()));
    return true;
  }
  int pinyinUnitsLength=pinyinUnits.size();
  StringBuffer searchBuffer=new StringBuffer();
  for (int i=0; i < pinyinUnitsLength; i++) {
    int j=0;
    chineseKeyWord.delete(0,chineseKeyWord.length());
    searchBuffer.delete(0,searchBuffer.length());
    searchBuffer.append(searchLowerCase);
    boolean found=findPinyinUnits(pinyinUnits,i,j,baseData,searchBuffer,chineseKeyWord);
    if (true == found) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @description match Pinyin Units
 * @param pinyinUnits
 * @param baseData			the original string which be parsed to PinyinUnit
 * @param search			search key words
 * @param chineseKeyWord	the sub string of base data
 * @return true if match success,false otherwise.
 */
@SuppressLint("String_Node_Str") public static boolean matchPinyinUnits(final List<PinyinUnit> pinyinUnits,final String baseData,String search,StringBuffer chineseKeyWord){
  if ((null == pinyinUnits) || (null == search) || (null == chineseKeyWord)) {
    return false;
  }
  StringBuffer matchSearch=new StringBuffer();
  matchSearch.delete(0,matchSearch.length());
  chineseKeyWord.delete(0,chineseKeyWord.length());
  String searchLowerCase=search.toLowerCase();
  int index=baseData.toLowerCase().indexOf(searchLowerCase);
  if (index > -1) {
    chineseKeyWord.append(baseData.substring(index,index + searchLowerCase.length()));
    return true;
  }
  int pinyinUnitsLength=pinyinUnits.size();
  StringBuffer searchBuffer=new StringBuffer();
  for (int i=0; i < pinyinUnitsLength; i++) {
    int j=0;
    chineseKeyWord.delete(0,chineseKeyWord.length());
    searchBuffer.delete(0,searchBuffer.length());
    searchBuffer.append(searchLowerCase);
    boolean found=findPinyinUnits(pinyinUnits,i,j,baseData,searchBuffer,chineseKeyWord);
    if (true == found) {
      return true;
    }
  }
  return false;
}
Program: 93756
Project: 93756
Buggy source:
@Override public void onContactsLoadSuccess(){
  mContactsOperationView.contactsLoadSuccess();
  ContactsIndexHelper.getInstance().praseContacts(ContactsHelper.getInstance().getBaseContacts());
}

Fixed version (ground truth):
@Override public void onContactsLoadSuccess(){
  mContactsOperationView.contactsLoadSuccess();
  ContactsIndexHelper.getInstance().praseContacts(ContactsHelper.getInstance().getBaseContacts());
  ContactsIndexHelper.getInstance().showContactsInfo();
}
Program: 93757
Project: 93757
Buggy source:
private String getAlphabet(String str){
  if ((null == str) || (str.length() <= 0)) {
    return PINYIN_FIRST_LETTER_DEFAULT_VALUE;
  }
  String alphabet=null;
  char chr=str.charAt(0);
  if (chr >= 'A' && chr <= 'Z') {
    alphabet=String.valueOf(chr);
  }
 else   if (chr >= 'a' && chr <= 'z') {
    alphabet=String.valueOf((char)('A' + chr - 'a'));
  }
 else {
    alphabet=PINYIN_FIRST_LETTER_DEFAULT_VALUE;
  }
  return alphabet;
}

Fixed version (ground truth):
private String getAlphabet(String str){
  if ((null == str) || (str.length() <= 0)) {
    return String.valueOf(QuickAlphabeticBar.DEFAULT_INDEX_CHARACTER);
  }
  String alphabet=null;
  char chr=str.charAt(0);
  if (chr >= 'A' && chr <= 'Z') {
    alphabet=String.valueOf(chr);
  }
 else   if (chr >= 'a' && chr <= 'z') {
    alphabet=String.valueOf((char)('A' + chr - 'a'));
  }
 else {
    alphabet=String.valueOf(QuickAlphabeticBar.DEFAULT_INDEX_CHARACTER);
  }
  return alphabet;
}
Program: 93758
Project: 93758
Buggy source:
public void showContactsInfo(){
  if (null == mContactsIndexs) {
    return;
  }
  int contactsIndexsSize=mContactsIndexs.size();
  for (int i=0; i < contactsIndexsSize; i++) {
    Log.i("String_Node_Str","String_Node_Str" + mContactsIndexs.get(i).getIndexKey() + "String_Node_Str");
    int contactsCount=mContactsIndexs.get(i).getContacts().size();
    for (int j=0; j < contactsCount; j++) {
      mContactsIndexs.get(i).getContacts().get(j).showContacts();
    }
  }
}

Fixed version (ground truth):
public void showContactsInfo(){
  if (null == mContactsIndexs) {
    return;
  }
  int contactsIndexsSize=mContactsIndexs.size();
  for (int i=0; i < contactsIndexsSize; i++) {
    int contactsCount=mContactsIndexs.get(i).getContacts().size();
    for (int j=0; j < contactsCount; j++) {
      mContactsIndexs.get(i).getContacts().get(j).showContacts();
    }
  }
}
Program: 93759
Project: 93759
Buggy source:
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  Adapter adapter=mContactsLv.getAdapter();
  if ((null != adapter) && adapter.getCount() > 0) {
    Contacts contacts=(Contacts)adapter.getItem(firstVisibleItem);
    char firstChar=contacts.getSortKey().charAt(0);
    mQuickAlphabeticBar.setCurrentSelectChar(firstChar);
  }
}

Fixed version (ground truth):
@Override public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  Adapter adapter=mContactsLv.getAdapter();
  int currentIndex=0;
  if ((null != adapter) && adapter.getCount() > 0) {
    currentIndex=((firstVisibleItem + visibleItemCount) < totalItemCount) ? (firstVisibleItem) : (totalItemCount - 1);
    Contacts contacts=(Contacts)adapter.getItem(currentIndex);
    char currentSelectChar=contacts.getSortKey().charAt(0);
    mQuickAlphabeticBar.setCurrentSelectChar(currentSelectChar);
  }
}
Program: 93760
Project: 93760
Buggy source:
private void initListener(){
  mContactsLv.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      Contacts contacts=ContactsHelper.getInstance().getSearchContacts().get(position);
      String uri="String_Node_Str" + contacts.getPhoneNumber();
      Intent intent=new Intent(Intent.ACTION_DIAL,Uri.parse(uri));
      mContext.startActivity(intent);
    }
  }
);
  mContactsLv.setOnScrollListener(new OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      Adapter adapter=mContactsLv.getAdapter();
      if ((null != adapter) && adapter.getCount() > 0) {
        Contacts contacts=(Contacts)adapter.getItem(firstVisibleItem);
        char firstChar=contacts.getSortKey().charAt(0);
        mQuickAlphabeticBar.setCurrentSelectChar(firstChar);
      }
    }
  }
);
  mQuickAlphabeticBar.setSectionIndexer(mContactsAdapter);
  mQuickAlphabeticBar.setQuickAlphabeticLv(mContactsLv);
  mQuickAlphabeticBar.setSelectCharTv(mSelectCharTv);
}

Fixed version (ground truth):
private void initListener(){
  mContactsLv.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      Contacts contacts=ContactsHelper.getInstance().getSearchContacts().get(position);
      String uri="String_Node_Str" + contacts.getPhoneNumber();
      Intent intent=new Intent(Intent.ACTION_DIAL,Uri.parse(uri));
      mContext.startActivity(intent);
    }
  }
);
  mContactsLv.setOnScrollListener(new OnScrollListener(){
    @Override public void onScrollStateChanged(    AbsListView view,    int scrollState){
    }
    @Override public void onScroll(    AbsListView view,    int firstVisibleItem,    int visibleItemCount,    int totalItemCount){
      Adapter adapter=mContactsLv.getAdapter();
      int currentIndex=0;
      if ((null != adapter) && adapter.getCount() > 0) {
        currentIndex=((firstVisibleItem + visibleItemCount) < totalItemCount) ? (firstVisibleItem) : (totalItemCount - 1);
        Contacts contacts=(Contacts)adapter.getItem(currentIndex);
        char currentSelectChar=contacts.getSortKey().charAt(0);
        mQuickAlphabeticBar.setCurrentSelectChar(currentSelectChar);
      }
    }
  }
);
  mQuickAlphabeticBar.setSectionIndexer(mContactsAdapter);
  mQuickAlphabeticBar.setQuickAlphabeticLv(mContactsLv);
  mQuickAlphabeticBar.setSelectCharTv(mSelectCharTv);
}
Program: 93761
Project: 93761
Buggy source:
/** 
 * Preset based on Nexus 4 camera recording with 720p quality. This preset is ensured to work on any Android &gt;=4.3 devices by Android CTS (if codec is available). <p/> Note: audio transcoding is experimental feature.
 * @param bitrate       Preferred bitrate for video encoding.
 * @param audioBitrate  Preferred bitrate for audio encoding.
 * @param audioChannels Output audio channels.
 */
public static MediaFormatStrategy createAndroid720pStrategy(int bitrate,int audioBitrate,int audioChannels){
  return new Android720pFormatStrategy(bitrate,audioBitrate,audioChannels);
}

Fixed version (ground truth):
/** 
 * Preset based on Nexus 4 camera recording with 720p quality. This preset is ensured to work on any Android &gt;=4.3 devices by Android CTS (if codec is available). <br> Note: audio transcoding is experimental feature.
 * @param bitrate       Preferred bitrate for video encoding.
 * @param audioBitrate  Preferred bitrate for audio encoding.
 * @param audioChannels Output audio channels.
 */
public static MediaFormatStrategy createAndroid720pStrategy(int bitrate,int audioBitrate,int audioChannels){
  return new Android720pFormatStrategy(bitrate,audioBitrate,audioChannels);
}
Program: 93762
Project: 93762
Buggy source:
/** 
 * Preset based on Nexus 4 camera recording with 720p quality. This preset is ensured to work on any Android >=4.3 devices by Android CTS (if codec is available).
 * @param bitRate Preferred bit rate for encoding.
 */
public static MediaFormatStrategy createAndroid720pStrategy(int bitRate){
  return new Android720pFormatStrategy(bitRate);
}

Fixed version (ground truth):
/** 
 * Preset based on Nexus 4 camera recording with 720p quality. This preset is ensured to work on any Android &gt;=4.3 devices by Android CTS (if codec is available).
 * @param bitRate Preferred bit rate for encoding.
 */
public static MediaFormatStrategy createAndroid720pStrategy(int bitRate){
  return new Android720pFormatStrategy(bitRate);
}