nus-yam/ex-repair huggingface dataset:
Program: 93688
Project: 93688
Buggy source:
/** 
 * Create a new OpenAPI3RouterFactory from an url
 * @param vertx
 * @param url
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromURL(Vertx vertx,String url,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    try {
      URL urlObj=new URL(url);
      SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(urlObj.toString(),null,OpenApi3Utils.getParseOptions());
      if (swaggerParseResult.getMessages().isEmpty())       future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
        if (swaggerParseResult.getMessages().size() == 1 && swaggerParseResult.getMessages().get(0).startsWith("String_Node_Str"))         future.fail(RouterFactoryException.createSpecNotExistsException(url));
 else         future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
      }
    }
 catch (    IOException e) {
      future.fail(RouterFactoryException.createSpecNotExistsException(url));
    }
  }
,handler);
}

Fixed version (ground truth):
/** 
 * Create a new OpenAPI3RouterFactory from an url
 * @param vertx
 * @param url
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromURL(Vertx vertx,String url,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    try {
      URL urlObj=new URL(url);
      SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(urlObj.toString(),null,OpenApi3Utils.getParseOptions());
      if (swaggerParseResult.getMessages().isEmpty())       future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
        if (swaggerParseResult.getMessages().size() == 1 && swaggerParseResult.getMessages().get(0).startsWith("String_Node_Str" + url))         future.fail(RouterFactoryException.createSpecNotExistsException(url));
 else         future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
      }
    }
 catch (    IOException e) {
      future.fail(RouterFactoryException.createSpecNotExistsException(url));
    }
  }
,handler);
}
Program: 93689
Project: 93689
Buggy source:
@Override protected RequestParameter validate(Map<String,String> values) throws ValidationException {
  Map<String,RequestParameter> parsedParams=new HashMap<>();
  for (  Map.Entry<String,ObjectField> field : fieldsMap.entrySet()) {
    String valueToValidate=values.get(field.getKey());
    if (valueToValidate == null) {
      if (field.getValue().required)       throw ValidationException.ValidationExceptionFactory.generateObjectFieldNotFound(field.getKey());
 else       if (field.getValue().validator.getDefault() != null)       parsedParams.put(field.getKey(),RequestParameter.create(field.getKey(),field.getValue().validator.getDefault()));
    }
 else {
      RequestParameter param=field.getValue().validator.isValid(valueToValidate);
      param.setName(field.getKey());
      parsedParams.put(field.getKey(),param);
    }
  }
  return RequestParameter.create(parsedParams);
}

Fixed version (ground truth):
@Override protected RequestParameter validate(Map<String,String> values) throws ValidationException {
  Map<String,RequestParameter> parsedParams=new HashMap<>();
  for (  Map.Entry<String,ObjectField> field : fieldsMap.entrySet()) {
    if (!values.containsKey(field.getKey())) {
      if (field.getValue().required)       throw ValidationException.ValidationExceptionFactory.generateObjectFieldNotFound(field.getKey());
 else       if (field.getValue().validator.getDefault() != null)       parsedParams.put(field.getKey(),RequestParameter.create(field.getKey(),field.getValue().validator.getDefault()));
    }
 else {
      RequestParameter param=field.getValue().validator.isValid(values.get(field.getKey()));
      param.setName(field.getKey());
      parsedParams.put(field.getKey(),param);
    }
  }
  return RequestParameter.create(parsedParams);
}
Program: 93690
Project: 93690
Buggy source:
public ParameterValidationRuleImpl(String name,ParameterTypeValidator validator,boolean isOptional,boolean allowEmptyValue,ParameterLocation location){
  if (name == null)   throw new NullPointerException("String_Node_Str");
  this.name=name;
  if (validator == null)   throw new NullPointerException("String_Node_Str");
  this.validator=validator;
  this.isOptional=isOptional;
  this.allowEmptyValue=allowEmptyValue;
  this.location=location;
}

Fixed version (ground truth):
public ParameterValidationRuleImpl(String name,ParameterTypeValidator validator,boolean isOptional,boolean allowEmptyValue,ParameterLocation location){
  if (name == null)   throw new IllegalArgumentException("String_Node_Str");
  this.name=name;
  if (validator == null)   throw new IllegalArgumentException("String_Node_Str");
  this.validator=validator;
  this.isOptional=isOptional;
  this.allowEmptyValue=allowEmptyValue;
  this.location=location;
}
Program: 93691
Project: 93691
Buggy source:
@Override public Map<String,String> deserializeObject(String serialized) throws ValidationException {
  Map<String,String> result=new HashMap<>();
  String[] values=serialized.split(separator,-1);
  if (values.length % 2 != 0)   throw ValidationException.ValidationExceptionFactory.generateDeserializationError("String_Node_Str" + "String_Node_Str");
  for (int i=0; i < values.length; i+=2) {
    if (values[i].length() == 0) {
      throw ValidationException.ValidationExceptionFactory.generateDeserializationError("String_Node_Str" + "String_Node_Str");
    }
 else {
      result.put(values[i],values[i + 1]);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<String,String> deserializeObject(String serialized) throws ValidationException {
  Map<String,String> result=new HashMap<>();
  String[] values=serialized.split(separator,-1);
  if (values.length % 2 != 0)   throw ValidationException.ValidationExceptionFactory.generateDeserializationError("String_Node_Str" + "String_Node_Str");
  for (int i=0; i < values.length; i+=2) {
    if (values[i].length() == 0) {
      throw ValidationException.ValidationExceptionFactory.generateDeserializationError("String_Node_Str" + "String_Node_Str");
    }
 else {
      result.put(values[i],this.nullateValue(values[i + 1]));
    }
  }
  return result;
}
Program: 93692
Project: 93692
Buggy source:
@Override public List<String> deserializeArray(String serialized) throws ValidationException {
  List<String> values=new ArrayList<>();
  for (  String v : serialized.split(separator,-1)) {
    values.add(v);
  }
  return values;
}

Fixed version (ground truth):
@Override public List<String> deserializeArray(String serialized) throws ValidationException {
  List<String> values=new ArrayList<>();
  for (  String v : serialized.split(separator,-1)) {
    values.add(this.nullateValue(v));
  }
  return values;
}
Program: 93693
Project: 93693
Buggy source:
/** 
 * Test: query_form_explode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testQueryFormExplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_query=params.queryParameter("String_Node_Str");
    assertNotNull(color_query);
    assertTrue(color_query.isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_query;
  color_query="String_Node_Str";
  startServer();
  apiClient.queryFormExplodeEmpty(color_query,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}

Fixed version (ground truth):
/** 
 * Test: query_form_explode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testQueryFormExplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_query=params.queryParameter("String_Node_Str");
    assertNotNull(color_query.getString());
    assertTrue(color_query.getString().isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_query;
  color_query="String_Node_Str";
  startServer();
  apiClient.queryFormExplodeEmpty(color_query,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}
Program: 93694
Project: 93694
Buggy source:
/** 
 * Test: query_form_noexplode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testQueryFormNoexplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_query=params.queryParameter("String_Node_Str");
    assertNotNull(color_query);
    assertTrue(color_query.isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_query;
  color_query="String_Node_Str";
  startServer();
  apiClient.queryFormNoexplodeEmpty(color_query,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}

Fixed version (ground truth):
/** 
 * Test: query_form_noexplode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testQueryFormNoexplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_query=params.queryParameter("String_Node_Str");
    assertNotNull(color_query.getString());
    assertTrue(color_query.getString().isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_query;
  color_query="String_Node_Str";
  startServer();
  apiClient.queryFormNoexplodeEmpty(color_query,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}
Program: 93695
Project: 93695
Buggy source:
/** 
 * Test: cookie_form_explode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testCookieFormExplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_cookie=params.cookieParameter("String_Node_Str");
    assertNotNull(color_cookie);
    assertTrue(color_cookie.isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_cookie;
  color_cookie="String_Node_Str";
  startServer();
  apiClient.cookieFormExplodeEmpty(color_cookie,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}

Fixed version (ground truth):
/** 
 * Test: cookie_form_explode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testCookieFormExplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_cookie=params.cookieParameter("String_Node_Str");
    assertNotNull(color_cookie.getString());
    assertTrue(color_cookie.getString().isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_cookie;
  color_cookie="String_Node_Str";
  startServer();
  apiClient.cookieFormExplodeEmpty(color_cookie,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}
Program: 93696
Project: 93696
Buggy source:
/** 
 * Test: cookie_form_noexplode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testCookieFormNoexplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_cookie=params.cookieParameter("String_Node_Str");
    assertNotNull(color_cookie);
    assertTrue(color_cookie.isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_cookie;
  color_cookie="String_Node_Str";
  startServer();
  apiClient.cookieFormNoexplodeEmpty(color_cookie,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}

Fixed version (ground truth):
/** 
 * Test: cookie_form_noexplode_empty Expected parameters sent: color: color= Expected response: {"color":null}
 * @throws Exception
 */
@Test public void testCookieFormNoexplodeEmpty() throws Exception {
  routerFactory.addHandlerByOperationId("String_Node_Str",routingContext -> {
    RequestParameters params=routingContext.get("String_Node_Str");
    JsonObject res=new JsonObject();
    RequestParameter color_cookie=params.cookieParameter("String_Node_Str");
    assertNotNull(color_cookie.getString());
    assertTrue(color_cookie.getString().isEmpty());
    res.putNull("String_Node_Str");
    routingContext.response().setStatusCode(200).setStatusMessage("String_Node_Str").putHeader("String_Node_Str","String_Node_Str").end(res.encode());
  }
);
  CountDownLatch latch=new CountDownLatch(1);
  String color_cookie;
  color_cookie="String_Node_Str";
  startServer();
  apiClient.cookieFormNoexplodeEmpty(color_cookie,(  AsyncResult<HttpResponse> ar) -> {
    if (ar.succeeded()) {
      assertEquals(200,ar.result().statusCode());
      assertTrue("String_Node_Str" + new JsonObject("String_Node_Str").encode() + "String_Node_Str"+ ar.result().bodyAsJsonObject().encode(),new JsonObject("String_Node_Str").equals(ar.result().bodyAsJsonObject()));
    }
 else {
      assertTrue(ar.cause().getMessage(),false);
    }
    latch.countDown();
  }
);
  awaitLatch(latch);
}
Program: 93697
Project: 93697
Buggy source:
/** 
 * Create a new OpenAPI3RouterFactory from an url
 * @param vertx
 * @param url
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromURL(Vertx vertx,String url,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    try {
      URL urlObj=new URL(url);
      SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(urlObj.toString(),null,OpenApi3Utils.getParseOptions());
      if (swaggerParseResult.getMessages().isEmpty())       future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
        if (swaggerParseResult.getMessages().size() == 1 && swaggerParseResult.getMessages().get(0).startsWith("String_Node_Str" + url))         future.fail(RouterFactoryException.createSpecNotExistsException(url));
 else         future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
      }
    }
 catch (    IOException e) {
      future.fail(RouterFactoryException.createSpecNotExistsException(url));
    }
  }
,handler);
}

Fixed version (ground truth):
/** 
 * Create a new OpenAPI3RouterFactory from an url
 * @param vertx
 * @param url
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromURL(Vertx vertx,String url,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    try {
      URL urlObj=new URL(url);
      SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(urlObj.toString(),null,OpenApi3Utils.getParseOptions());
      if (swaggerParseResult.getMessages().isEmpty())       future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
        if (swaggerParseResult.getMessages().size() == 1 && swaggerParseResult.getMessages().get(0).matches("String_Node_Str" + url + "String_Node_Str"))         future.fail(RouterFactoryException.createSpecNotExistsException(url));
 else         future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
      }
    }
 catch (    IOException e) {
      future.fail(RouterFactoryException.createSpecNotExistsException(url));
    }
  }
,handler);
}
Program: 93698
Project: 93698
Buggy source:
@Override public HTTPRequestValidationHandler addFormParamsArrayWithPattern(String parameterName,String pattern,boolean required){
  this.addFormParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createArrayTypeValidator(ParameterTypeValidator.createStringTypeValidator(pattern)),!required,false,ParameterLocation.BODY_FORM));
  return this;
}

Fixed version (ground truth):
@Override public HTTPRequestValidationHandler addFormParamsArrayWithPattern(String parameterName,String pattern,boolean required){
  this.addFormParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createArrayTypeValidator(ParameterTypeValidator.createStringTypeValidator(pattern,null)),!required,false,ParameterLocation.BODY_FORM));
  return this;
}
Program: 93699
Project: 93699
Buggy source:
@Override public HTTPRequestValidationHandler addQueryParamWithPattern(String parameterName,String pattern,boolean required){
  this.addQueryParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createStringTypeValidator(pattern),!required,false,ParameterLocation.QUERY));
  return this;
}

Fixed version (ground truth):
@Override public HTTPRequestValidationHandler addQueryParamWithPattern(String parameterName,String pattern,boolean required){
  this.addQueryParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createStringTypeValidator(pattern,null),!required,false,ParameterLocation.QUERY));
  return this;
}
Program: 93700
Project: 93700
Buggy source:
@Override public HTTPRequestValidationHandler addPathParamWithPattern(String parameterName,String pattern){
  this.addPathParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createStringTypeValidator(pattern),false,false,ParameterLocation.PATH));
  return this;
}

Fixed version (ground truth):
@Override public HTTPRequestValidationHandler addPathParamWithPattern(String parameterName,String pattern){
  this.addPathParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createStringTypeValidator(pattern,null),false,false,ParameterLocation.PATH));
  return this;
}
Program: 93701
Project: 93701
Buggy source:
@Override public HTTPRequestValidationHandler addHeaderParamWithPattern(String headerName,String pattern,boolean required){
  this.addHeaderParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(headerName,ParameterTypeValidator.createStringTypeValidator(pattern),!required,false,ParameterLocation.HEADER));
  return this;
}

Fixed version (ground truth):
@Override public HTTPRequestValidationHandler addHeaderParamWithPattern(String headerName,String pattern,boolean required){
  this.addHeaderParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(headerName,ParameterTypeValidator.createStringTypeValidator(pattern,null),!required,false,ParameterLocation.HEADER));
  return this;
}
Program: 93702
Project: 93702
Buggy source:
@Override public HTTPRequestValidationHandler addQueryParamsArrayWithPattern(String arrayName,String pattern,boolean required){
  this.addQueryParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(arrayName,ParameterTypeValidator.createArrayTypeValidator(ParameterTypeValidator.createStringTypeValidator(pattern)),!required,false,ParameterLocation.QUERY));
  return this;
}

Fixed version (ground truth):
@Override public HTTPRequestValidationHandler addQueryParamsArrayWithPattern(String arrayName,String pattern,boolean required){
  this.addQueryParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(arrayName,ParameterTypeValidator.createArrayTypeValidator(ParameterTypeValidator.createStringTypeValidator(pattern,null)),!required,false,ParameterLocation.QUERY));
  return this;
}
Program: 93703
Project: 93703
Buggy source:
@Override public HTTPRequestValidationHandler addFormParamWithPattern(String parameterName,String pattern,boolean required){
  this.addFormParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createStringTypeValidator(pattern),!required,false,ParameterLocation.BODY_FORM));
  return this;
}

Fixed version (ground truth):
@Override public HTTPRequestValidationHandler addFormParamWithPattern(String parameterName,String pattern,boolean required){
  this.addFormParamRule(ParameterValidationRuleImpl.ParameterValidationRuleFactory.createValidationRuleWithCustomTypeValidator(parameterName,ParameterTypeValidator.createStringTypeValidator(pattern,null),!required,false,ParameterLocation.BODY_FORM));
  return this;
}
Program: 93704
Project: 93704
Buggy source:
/** 
 * Create a new OpenAPI3RouterFactory from a filename
 * @param vertx
 * @param filename
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromFile(Vertx vertx,String filename,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    File spec=new File(filename);
    if (!spec.exists())     future.fail(RouterFactoryException.createSpecNotExistsException(filename));
    SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(spec.getAbsolutePath(),null,null);
    if (swaggerParseResult.getMessages().isEmpty())     future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
      future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
    }
  }
,handler);
}

Fixed version (ground truth):
/** 
 * Create a new OpenAPI3RouterFactory from a filename
 * @param vertx
 * @param filename
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromFile(Vertx vertx,String filename,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    File spec=new File(filename);
    if (!spec.exists()) {
      future.fail(RouterFactoryException.createSpecNotExistsException(filename));
    }
 else {
      SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(spec.getAbsolutePath(),null,null);
      if (swaggerParseResult.getMessages().isEmpty())       future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
        future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
      }
    }
  }
,handler);
}
Program: 93705
Project: 93705
Buggy source:
/** 
 * Create a new OpenAPI3RouterFactory from a filename
 * @param vertx
 * @param filename
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromFile(Vertx vertx,String filename,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    File spec=new File(filename);
    if (!spec.exists()) {
      future.fail(RouterFactoryException.createSpecNotExistsException(filename));
    }
 else {
      SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(spec.getAbsolutePath(),null,null);
      if (swaggerParseResult.getMessages().isEmpty())       future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
        future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
      }
    }
  }
,handler);
}

Fixed version (ground truth):
/** 
 * Create a new OpenAPI3RouterFactory from a filename
 * @param vertx
 * @param filename
 * @param handler  When specification is loaded, this handler will be called with AsyncResult<OpenAPI3RouterFactory>
 */
static void createRouterFactoryFromFile(Vertx vertx,String filename,Handler<AsyncResult<OpenAPI3RouterFactory>> handler){
  vertx.executeBlocking((  Future<OpenAPI3RouterFactory> future) -> {
    File spec=new File(filename);
    if (!spec.exists())     future.fail(RouterFactoryException.createSpecNotExistsException(filename));
    SwaggerParseResult swaggerParseResult=new OpenAPIV3Parser().readLocation(spec.getAbsolutePath(),null,null);
    if (swaggerParseResult.getMessages().isEmpty())     future.complete(new OpenAPI3RouterFactoryImpl(vertx,swaggerParseResult.getOpenAPI()));
 else {
      future.fail(RouterFactoryException.createSpecInvalidException(StringUtils.join(swaggerParseResult.getMessages(),"String_Node_Str")));
    }
  }
,handler);
}
Program: 93707
Project: 93707
Buggy source:
private void testTLS(boolean clientSSL,boolean serverSSL,Function<WebClient,HttpRequest<Buffer>> requestProvider) throws Exception {
  WebClient sslClient=WebClient.create(vertx,new WebClientOptions().setSsl(clientSSL).setTrustAll(true).setDefaultHost(DEFAULT_HTTPS_HOST).setDefaultPort(DEFAULT_HTTPS_PORT));
  HttpServer sslServer=vertx.createHttpServer(new HttpServerOptions().setSsl(serverSSL).setKeyStoreOptions(Cert.CLIENT_JKS.get()).setPort(DEFAULT_HTTPS_PORT).setHost(DEFAULT_HTTPS_HOST));
  sslServer.requestHandler(req -> {
    assertEquals(serverSSL,req.isSSL());
    req.response().end();
  }
);
  try {
    startServer(sslServer);
    HttpRequest<Buffer> builder=requestProvider.apply(sslClient);
    builder.send(onSuccess(resp -> {
      testComplete();
    }
));
    await();
  }
  finally {
    sslClient.close();
    sslServer.close();
  }
}

Fixed version (ground truth):
private void testTLS(boolean clientSSL,boolean serverSSL,Function<WebClient,HttpRequest<Buffer>> requestProvider,Consumer<HttpServerRequest> serverAssertions) throws Exception {
  WebClient sslClient=WebClient.create(vertx,new WebClientOptions().setSsl(clientSSL).setTrustAll(true).setDefaultHost(DEFAULT_HTTPS_HOST).setDefaultPort(DEFAULT_HTTPS_PORT));
  HttpServer sslServer=vertx.createHttpServer(new HttpServerOptions().setSsl(serverSSL).setKeyStoreOptions(Cert.CLIENT_JKS.get()).setPort(DEFAULT_HTTPS_PORT).setHost(DEFAULT_HTTPS_HOST));
  sslServer.requestHandler(req -> {
    assertEquals(serverSSL,req.isSSL());
    if (serverAssertions != null) {
      serverAssertions.accept(req);
    }
    req.response().end();
  }
);
  try {
    startServer(sslServer);
    HttpRequest<Buffer> builder=requestProvider.apply(sslClient);
    builder.send(onSuccess(resp -> {
      testComplete();
    }
));
    await();
  }
  finally {
    sslClient.close();
    sslServer.close();
  }
}
Program: 93708
Project: 93708
Buggy source:
@Test public void testTemplateJsonArrayResolverError() throws Exception {
  TemplateEngine engine=HandlebarsTemplateEngine.create();
  JsonArray jsonArray=new JsonArray();
  jsonArray.add("String_Node_Str").add("String_Node_Str").add(new JsonObject().put("String_Node_Str","String_Node_Str"));
  AtomicReference<RoutingContext> contextRef=new AtomicReference<>();
  router.route().handler(context -> {
    context.put("String_Node_Str",jsonArray);
    context.next();
    contextRef.set(context);
  }
);
  router.route().handler(TemplateHandler.create(engine,"String_Node_Str","String_Node_Str"));
  testRequest(HttpMethod.GET,"String_Node_Str" + "String_Node_Str",500,"String_Node_Str");
  if (contextRef.get().failure() instanceof HandlebarsException) {
    HandlebarsException exception=((HandlebarsException)contextRef.get().failure());
    assertTrue(exception.getMessage().contains("String_Node_Str"));
  }
 else {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void testTemplateJsonArrayResolverError() throws Exception {
  TemplateEngine engine=HandlebarsTemplateEngine.create();
  JsonArray jsonArray=new JsonArray();
  jsonArray.add("String_Node_Str").add("String_Node_Str").add(new JsonObject().put("String_Node_Str","String_Node_Str"));
  AtomicReference<RoutingContext> contextRef=new AtomicReference<>();
  router.route().handler(context -> {
    contextRef.set(context);
    context.put("String_Node_Str",jsonArray);
    context.next();
  }
);
  router.route().handler(TemplateHandler.create(engine,"String_Node_Str","String_Node_Str"));
  testRequest(HttpMethod.GET,"String_Node_Str" + "String_Node_Str",500,"String_Node_Str");
  if (contextRef.get().failure() instanceof HandlebarsException) {
    HandlebarsException exception=((HandlebarsException)contextRef.get().failure());
    assertTrue(exception.getMessage().contains("String_Node_Str"));
  }
 else {
    fail("String_Node_Str");
  }
}
Program: 93709
Project: 93709
Buggy source:
@Override public void handle(RoutingContext ctx){
  if (nagHttps) {
    String uri=ctx.request().absoluteURI();
    if (!uri.startsWith("String_Node_Str")) {
      log.warn("String_Node_Str" + uri);
    }
  }
  HttpMethod method=ctx.request().method();
switch (method) {
case GET:
    final String token=generateToken();
  ctx.put(headerName,token);
ctx.addCookie(Cookie.cookie(cookieName,token));
ctx.next();
break;
case POST:
case PUT:
case DELETE:
case PATCH:
final String header=ctx.request().getHeader(headerName);
if (validateToken(header == null ? ctx.request().getFormAttribute(headerName) : header)) {
ctx.next();
}
 else {
ctx.fail(403);
}
break;
default :
ctx.next();
break;
}
}

Fixed version (ground truth):
@Override public void handle(RoutingContext ctx){
  if (nagHttps) {
    String uri=ctx.request().absoluteURI();
    if (!uri.startsWith("String_Node_Str")) {
      log.warn("String_Node_Str" + uri);
    }
  }
  HttpMethod method=ctx.request().method();
switch (method) {
case GET:
    final String token=generateToken();
  ctx.put(headerName,token);
ctx.addCookie(Cookie.cookie(cookieName,token));
ctx.next();
break;
case POST:
case PUT:
case DELETE:
case PATCH:
final String header=ctx.request().getHeader(headerName);
if (validateToken(header == null ? ctx.request().getFormAttribute(headerName) : header)) {
ctx.next();
}
 else {
forbidden(ctx);
}
break;
default :
ctx.next();
break;
}
}
Program: 93711
Project: 93711
Buggy source:
@Override public void render(RoutingContext context,String templateFileName,Handler<AsyncResult<Buffer>> handler){
  try {
    Template template=cache.get(templateFileName);
    if (template == null) {
synchronized (this) {
        loader.setVertx(context.vertx());
        template=handlebars.compile(templateFileName);
        cache.put(templateFileName,template);
      }
    }
    handler.handle(Future.succeededFuture(Buffer.buffer(template.apply(context.data()))));
  }
 catch (  Exception ex) {
    handler.handle(Future.failedFuture(ex));
  }
}

Fixed version (ground truth):
@Override public void render(RoutingContext context,String templateFileName,Handler<AsyncResult<Buffer>> handler){
  try {
    Template template=cache.get(templateFileName);
    if (template == null) {
synchronized (this) {
        loader.setVertx(context.vertx());
        template=handlebars.compile(templateFileName);
        cache.put(templateFileName,template);
      }
    }
    Context engineContext=Context.newBuilder(context.data()).resolver(getResolvers()).build();
    handler.handle(Future.succeededFuture(Buffer.buffer(template.apply(engineContext))));
  }
 catch (  Exception ex) {
    handler.handle(Future.failedFuture(ex));
  }
}
Program: 93712
Project: 93712
Buggy source:
@Override public Reader getReader(String s) throws LoaderException {
  try {
    final char[] buffer=vertx.fileSystem().readFileBlocking(s).toString(charset).toCharArray();
    final int[] pos={0};
    return new Reader(){
      @Override public int read(      char[] cbuf,      int off,      int len) throws IOException {
        if (pos[0] == buffer.length) {
          return -1;
        }
        final int end=Math.min(buffer.length,pos[0] + len);
        System.arraycopy(buffer,pos[0],cbuf,off,end);
        final int read=end - pos[0];
        pos[0]=end;
        return read;
      }
      @Override public void close() throws IOException {
      }
    }
;
  }
 catch (  RuntimeException e) {
    throw new LoaderException(e,e.getMessage());
  }
}

Fixed version (ground truth):
@Override public Reader getReader(String s) throws LoaderException {
  try {
    final String buffer=vertx.fileSystem().readFileBlocking(s).toString(charset);
    return new StringReader(buffer);
  }
 catch (  RuntimeException e) {
    throw new LoaderException(e,e.getMessage());
  }
}
Program: 93713
Project: 93713
Buggy source:
@Override public Reader getReader(String s) throws LoaderException {
  try {
    final char[] buffer=vertx.fileSystem().readFileBlocking(s).toString(charset).toCharArray();
    final int[] pos={0};
    return new Reader(){
      @Override public int read(      char[] cbuf,      int off,      int len) throws IOException {
        if (pos[0] == buffer.length) {
          return -1;
        }
        final int end=Math.min(buffer.length,pos[0] + len);
        System.arraycopy(buffer,pos[0],cbuf,off,end);
        final int read=end - pos[0];
        pos[0]=end;
        return read;
      }
      @Override public void close() throws IOException {
      }
    }
;
  }
 catch (  RuntimeException e) {
    throw new LoaderException(e,e.getMessage());
  }
}

Fixed version (ground truth):
@Override public Reader getReader(String s) throws LoaderException {
  try {
    final String buffer=vertx.fileSystem().readFileBlocking(s).toString(charset);
    return new StringReader(buffer);
  }
 catch (  RuntimeException e) {
    throw new LoaderException(e,e.getMessage());
  }
}
Program: 93714
Project: 93714
Buggy source:
private <R>void perform2(String contentType,Object body,BodyCodec<R> unmarshaller,Handler<AsyncResult<HttpResponse<R>>> handler){
  perform(contentType,body,ar -> {
    if (ar.succeeded()) {
      HttpClientResponse resp=ar.result();
      Future<HttpResponse<R>> fut=Future.future();
      fut.setHandler(handler);
      resp.exceptionHandler(err -> {
        if (!fut.isComplete()) {
          fut.fail(err);
        }
      }
);
      resp.bodyHandler(buff -> {
        if (!fut.isComplete()) {
          BodyStream<R> state=unmarshaller.stream();
          state.write(buff);
          state.end();
          fut.complete(new HttpResponseImpl<>(resp,buff,state.state().result()));
        }
      }
);
    }
 else {
      handler.handle(Future.failedFuture(ar.cause()));
    }
  }
);
}

Fixed version (ground truth):
private <R>void perform2(String contentType,Object body,BodyCodec<R> unmarshaller,Handler<AsyncResult<HttpResponse<R>>> handler){
  perform(contentType,body,ar -> {
    if (ar.succeeded()) {
      HttpClientResponse resp=ar.result();
      Future<HttpResponse<R>> fut=Future.future();
      fut.setHandler(handler);
      resp.exceptionHandler(err -> {
        if (!fut.isComplete()) {
          fut.fail(err);
        }
      }
);
      resp.bodyHandler(buff -> {
        if (!fut.isComplete()) {
          BodyStream<R> state=unmarshaller.stream();
          state.write(buff);
          state.end();
          if (state.state().succeeded()) {
            fut.complete(new HttpResponseImpl<>(resp,buff,state.state().result()));
          }
 else {
            fut.fail(state.state().cause());
          }
        }
      }
);
    }
 else {
      handler.handle(Future.failedFuture(ar.cause()));
    }
  }
);
}
Program: 93715
Project: 93715
Buggy source:
protected boolean isMatchedBy2(ParsableHeaderValue matchTry){
  if (matchTry.parameter == null) {
    return true;
  }
  if (parameter == null) {
    return false;
  }
  for (  Entry<String,String> requiredParameter : matchTry.parameter.entrySet()) {
    String parameterValueToTest=parameter.get(requiredParameter.getKey());
    String requiredParamVal=requiredParameter.getValue();
    if (parameterValueToTest == null || (requiredParamVal != null && !requiredParamVal.equals(parameterValueToTest))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean isMatchedBy2(ParsableHeaderValue matchTry){
  ensureHeaderProcessed();
  if (matchTry.parameter == null) {
    return true;
  }
  if (parameter == null) {
    return false;
  }
  for (  Entry<String,String> requiredParameter : matchTry.parameter.entrySet()) {
    String parameterValueToTest=parameter.get(requiredParameter.getKey());
    String requiredParamVal=requiredParameter.getValue();
    if (parameterValueToTest == null || (requiredParamVal != EMPTY && !requiredParamVal.equals(parameterValueToTest))) {
      return false;
    }
  }
  return true;
}
Program: 93716
Project: 93716
Buggy source:
/** 
 * Parses a header value
 * @param headerContent 
 * @param valueCallback
 * @param weightCallback
 * @param parameterCallback
 */
public static void parseHeaderValue(String headerContent,Consumer<String> valueCallback,Consumer<Float> weightCallback,BiConsumer<String,String> parameterCallback){
  int paramIndex=headerContent.indexOf(';');
  if (paramIndex < 0) {
    valueCallback.accept(headerContent);
  }
 else {
    valueCallback.accept(headerContent.substring(0,paramIndex));
    Matcher paramFindings=PARAMETER_FINDER.matcher(headerContent);
    while (paramFindings.find()) {
      String key=paramFindings.group("String_Node_Str");
      String value=matchedSelector(paramFindings.group("String_Node_Str"),paramFindings.group("String_Node_Str"));
      if ("String_Node_Str".equalsIgnoreCase(key)) {
        try {
          weightCallback.accept(Float.parseFloat(value));
        }
 catch (        NumberFormatException e) {
          log.info("String_Node_Str",value);
        }
      }
 else {
        parameterCallback.accept(key,value);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Parses a header value
 * @param headerContent 
 * @param valueCallback
 * @param weightCallback
 * @param parameterCallback
 */
public static void parseHeaderValue(String headerContent,Consumer<String> valueCallback,Consumer<Float> weightCallback,BiConsumer<String,String> parameterCallback){
  int paramIndex=headerContent.indexOf(';');
  if (paramIndex < 0) {
    valueCallback.accept(headerContent);
  }
 else {
    valueCallback.accept(headerContent.substring(0,paramIndex));
    Matcher paramFindings=PARAMETER_FINDER.matcher(headerContent);
    while (paramFindings.find()) {
      String key=paramFindings.group("String_Node_Str");
      String value=matchedSelector(paramFindings.group("String_Node_Str"),paramFindings.group("String_Node_Str"));
      if ("String_Node_Str".equalsIgnoreCase(key)) {
        try {
          if (value != null) {
            weightCallback.accept(Float.parseFloat(value));
          }
        }
 catch (        NumberFormatException e) {
          log.info("String_Node_Str",value);
        }
      }
 else {
        parameterCallback.accept(key,value);
      }
    }
  }
}
Program: 93717
Project: 93717
Buggy source:
protected boolean isMatchedBy2(ParsableHeaderValue matchTry){
  ensureHeaderProcessed();
  if (matchTry.parameter == null) {
    return true;
  }
  if (parameter == null) {
    return false;
  }
  for (  Entry<String,String> requiredParameter : matchTry.parameter.entrySet()) {
    String parameterValueToTest=parameter.get(requiredParameter.getKey());
    String requiredParamVal=requiredParameter.getValue();
    if (parameterValueToTest == null || (requiredParamVal != EMPTY && !requiredParamVal.equals(parameterValueToTest))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean isMatchedBy2(ParsableHeaderValue matchTry){
  ensureHeaderProcessed();
  if (matchTry.parameter.isEmpty()) {
    return true;
  }
  if (parameter.isEmpty()) {
    return false;
  }
  for (  Entry<String,String> requiredParameter : matchTry.parameter.entrySet()) {
    String parameterValueToTest=parameter.get(requiredParameter.getKey());
    String requiredParamVal=requiredParameter.getValue();
    if (parameterValueToTest == null || (requiredParamVal != EMPTY && !requiredParamVal.equals(parameterValueToTest))) {
      return false;
    }
  }
  return true;
}
Program: 93718
Project: 93718
Buggy source:
@Override public void handle(RoutingContext context){
  User user=context.user();
  if (user != null) {
    authorise(user,context);
  }
 else {
    HttpServerRequest request=context.request();
    String authorization=request.headers().get(HttpHeaders.AUTHORIZATION);
    if (authorization == null) {
      handle401(context);
    }
 else {
      String suser;
      String spass;
      String sscheme;
      try {
        String[] parts=authorization.split("String_Node_Str");
        sscheme=parts[0];
        String[] credentials=new String(Base64.getDecoder().decode(parts[1])).split("String_Node_Str");
        suser=credentials[0];
        spass=credentials.length > 1 ? credentials[1] : null;
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        handle401(context);
        return;
      }
catch (      IllegalArgumentException|NullPointerException e) {
        context.fail(e);
        return;
      }
      if (!"String_Node_Str".equals(sscheme)) {
        context.fail(400);
      }
 else {
        JsonObject authInfo=new JsonObject().put("String_Node_Str",suser).put("String_Node_Str",spass);
        authProvider.authenticate(authInfo,res -> {
          if (res.succeeded()) {
            User authenticated=res.result();
            context.setUser(authenticated);
            authorise(authenticated,context);
          }
 else {
            handle401(context);
          }
        }
);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handle(RoutingContext context){
  User user=context.user();
  if (user != null) {
    authorise(user,context);
  }
 else {
    HttpServerRequest request=context.request();
    String authorization=request.headers().get(HttpHeaders.AUTHORIZATION);
    if (authorization == null) {
      handle401(context);
    }
 else {
      String suser;
      String spass;
      String sscheme;
      try {
        String[] parts=authorization.split("String_Node_Str");
        sscheme=parts[0];
        String[] credentials=new String(Base64.getDecoder().decode(parts[1])).split("String_Node_Str");
        suser=credentials[0];
        if (credentials.length == 2)         spass=credentials[1];
 else         if (credentials.length > 2) {
          spass=joinCredentials(credentials);
        }
 else {
          spass=null;
        }
      }
 catch (      ArrayIndexOutOfBoundsException e) {
        handle401(context);
        return;
      }
catch (      IllegalArgumentException|NullPointerException e) {
        context.fail(e);
        return;
      }
      if (!"String_Node_Str".equals(sscheme)) {
        context.fail(400);
      }
 else {
        JsonObject authInfo=new JsonObject().put("String_Node_Str",suser).put("String_Node_Str",spass);
        authProvider.authenticate(authInfo,res -> {
          if (res.succeeded()) {
            User authenticated=res.result();
            context.setUser(authenticated);
            authorise(authenticated,context);
          }
 else {
            handle401(context);
          }
        }
);
      }
    }
  }
}