nus-yam/ex-repair huggingface dataset:
Program: 171117
Project: 171117
Buggy source:
/** 
 * Get the root logger file location under which the failed log messages will be written. Since this class is used in Hooks which run within JVMs of other components like Hive, we want to write the failed messages file under the same location as where logs from the host component are saved. This method attempts to get such a location from the root logger's appenders. It will work only if at least one of the appenders is a   {@link FileAppender}
 * @return directory under which host component's logs are stored.
 */
private String getRootLoggerDirectory(){
  String rootLoggerDirectory=null;
  org.apache.log4j.Logger rootLogger=org.apache.log4j.Logger.getRootLogger();
  Enumeration allAppenders=rootLogger.getAllAppenders();
  while (allAppenders.hasMoreElements()) {
    Appender appender=(Appender)allAppenders.nextElement();
    if (appender instanceof FileAppender) {
      FileAppender fileAppender=(FileAppender)appender;
      String rootLoggerFile=fileAppender.getFile();
      rootLoggerDirectory=new File(rootLoggerFile).getParent();
      break;
    }
  }
  return rootLoggerDirectory;
}

Fixed version (ground truth):
/** 
 * Get the root logger file location under which the failed log messages will be written. Since this class is used in Hooks which run within JVMs of other components like Hive, we want to write the failed messages file under the same location as where logs from the host component are saved. This method attempts to get such a location from the root logger's appenders. It will work only if at least one of the appenders is a   {@link FileAppender}
 * @return directory under which host component's logs are stored.
 */
private String getRootLoggerDirectory(){
  String rootLoggerDirectory=null;
  org.apache.log4j.Logger rootLogger=org.apache.log4j.Logger.getRootLogger();
  Enumeration allAppenders=rootLogger.getAllAppenders();
  if (allAppenders != null) {
    while (allAppenders.hasMoreElements()) {
      Appender appender=(Appender)allAppenders.nextElement();
      if (appender instanceof FileAppender) {
        FileAppender fileAppender=(FileAppender)appender;
        String rootLoggerFile=fileAppender.getFile();
        rootLoggerDirectory=new File(rootLoggerFile).getParent();
        break;
      }
    }
  }
  return rootLoggerDirectory;
}
Program: 171118
Project: 171118
Buggy source:
/** 
 * Checks if db is already registered, else creates and registers db entity
 * @param databaseName
 * @return
 * @throws Exception
 */
private Referenceable registerDatabase(String databaseName) throws Exception {
  Referenceable dbRef=getDatabaseReference(clusterName,databaseName);
  Database db=hiveClient.getDatabase(databaseName);
  if (dbRef == null) {
    dbRef=createDBInstance(db);
    dbRef=registerInstance(dbRef);
  }
 else {
    LOG.info("String_Node_Str",databaseName,dbRef.getId().id);
    dbRef=createOrUpdateDBInstance(db,dbRef);
    updateInstance(dbRef);
  }
  return dbRef;
}

Fixed version (ground truth):
/** 
 * Checks if db is already registered, else creates and registers db entity
 * @param databaseName
 * @return
 * @throws Exception
 */
private Referenceable registerDatabase(String databaseName) throws Exception {
  Referenceable dbRef=getDatabaseReference(clusterName,databaseName);
  Database db=hiveClient.getDatabase(databaseName);
  if (db != null) {
    if (dbRef == null) {
      dbRef=createDBInstance(db);
      dbRef=registerInstance(dbRef);
    }
 else {
      LOG.info("String_Node_Str",databaseName,dbRef.getId().id);
      dbRef=createOrUpdateDBInstance(db,dbRef);
      updateInstance(dbRef);
    }
  }
  return dbRef;
}
Program: 171119
Project: 171119
Buggy source:
private void importDatabases(boolean failOnError) throws Exception {
  List<String> databases=hiveClient.getAllDatabases();
  for (  String databaseName : databases) {
    Referenceable dbReference=registerDatabase(databaseName);
    importTables(dbReference,databaseName,failOnError);
  }
}

Fixed version (ground truth):
private void importDatabases(boolean failOnError) throws Exception {
  List<String> databases=hiveClient.getAllDatabases();
  for (  String databaseName : databases) {
    Referenceable dbReference=registerDatabase(databaseName);
    if (dbReference != null) {
      importTables(dbReference,databaseName,failOnError);
    }
  }
}
Program: 171120
Project: 171120
Buggy source:
@Test public void testAlterTableDropColumn() throws Exception {
  String tableName=createTable();
  final String colDropped="String_Node_Str";
  String query="String_Node_Str" + tableName + "String_Node_Str";
  runCommand(query);
  assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME,DEFAULT_DB,tableName),colDropped));
  final List<Referenceable> columns=getColumns(DEFAULT_DB,tableName);
  Assert.assertEquals(columns.size(),1);
}

Fixed version (ground truth):
@Test public void testAlterTableDropColumn() throws Exception {
  String tableName=createTable();
  final String colDropped="String_Node_Str";
  String query="String_Node_Str" + tableName + "String_Node_Str";
  runCommand(query);
  assertColumnIsNotRegistered(HiveMetaStoreBridge.getColumnQualifiedName(HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME,DEFAULT_DB,tableName),colDropped));
  final List<Referenceable> columns=getColumns(DEFAULT_DB,tableName);
  Assert.assertEquals(columns.size(),1);
  Assert.assertEquals(columns.get(0).get(HiveDataModelGenerator.NAME),"String_Node_Str");
}
Program: 171122
Project: 171122
Buggy source:
public String create(AEntityBean bean) throws MetadataException {
  ClassType type=TypeSystem.getInstance().getDataType(ClassType.class,bean.getClass().getSimpleName());
  ITypedReferenceableInstance refBean=null;
  try {
    refBean=type.convert(this.convertToReferencable(bean),Multiplicity.REQUIRED);
    String id=null;
    return id;
  }
 catch (  IllegalArgumentException|IllegalAccessException e) {
    e.printStackTrace();
  }
  throw new MetadataException("String_Node_Str");
}

Fixed version (ground truth):
public String create(AEntityBean bean) throws MetadataException {
  ClassType type=TypeSystem.getInstance().getDataType(ClassType.class,bean.getClass().getSimpleName());
  ITypedReferenceableInstance refBean=null;
  try {
    refBean=type.convert(this.convertToReferencable(bean),Multiplicity.REQUIRED);
    String id=repo.createEntity(refBean);
    return id;
  }
 catch (  IllegalArgumentException|IllegalAccessException e) {
    e.printStackTrace();
  }
  throw new MetadataException("String_Node_Str");
}
Program: 171123
Project: 171123
Buggy source:
/** 
 * Gets the list of trait type names registered in the type system.
 */
@GET @Produces(MediaType.APPLICATION_JSON) public Response getTypesByFilter(@Context HttpServletRequest request,@DefaultValue(TRAIT) @QueryParam("String_Node_Str") String type){
  try {
    Preconditions.checkNotNull(type,"String_Node_Str");
    List<String> result=null;
switch (type) {
case TRAIT:
      result=metadataService.getTraitNamesList();
case STRUCT:
case CLASS:
    throw new UnsupportedOperationException("String_Node_Str" + type);
}
JSONObject response=new JSONObject();
response.put(MetadataServiceClient.RESULTS,new JSONArray(result));
response.put(MetadataServiceClient.TOTAL_SIZE,result.size());
response.put(MetadataServiceClient.REQUEST_ID,Servlets.getRequestId());
return Response.ok(response).build();
}
 catch (Exception e) {
LOG.error("String_Node_Str",e);
throw new WebApplicationException(Servlets.getErrorResponse(e,Response.Status.BAD_REQUEST));
}
}

Fixed version (ground truth):
/** 
 * Gets the list of trait type names registered in the type system.
 */
@GET @Produces(MediaType.APPLICATION_JSON) public Response getTypesByFilter(@Context HttpServletRequest request,@DefaultValue(TYPE_ALL) @QueryParam("String_Node_Str") String type){
  try {
    List<String> result=null;
switch (type) {
case TYPE_ALL:
      result=metadataService.getTypeNamesList();
    break;
case TYPE_TRAIT:
  result=metadataService.getTraitNamesList();
break;
case TYPE_STRUCT:
case TYPE_CLASS:
default :
LOG.error("String_Node_Str",type);
throw new WebApplicationException(Servlets.getErrorResponse("String_Node_Str" + type,Response.Status.BAD_REQUEST));
}
JSONObject response=new JSONObject();
response.put(MetadataServiceClient.RESULTS,new JSONArray(result));
response.put(MetadataServiceClient.TOTAL_SIZE,result.size());
response.put(MetadataServiceClient.REQUEST_ID,Servlets.getRequestId());
return Response.ok(response).build();
}
 catch (Exception e) {
LOG.error("String_Node_Str",e);
throw new WebApplicationException(Servlets.getErrorResponse(e,Response.Status.BAD_REQUEST));
}
}
Program: 171124
Project: 171124
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testDeleteTrait() throws Exception {
  final String traitName="String_Node_Str";
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path("String_Node_Str").path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testDeleteTrait() throws Exception {
  final String traitName="String_Node_Str";
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(EntityResource.TRAIT).path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}
Program: 171125
Project: 171125
Buggy source:
@Test public void testAddTraitWithNoRegistration() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization$.MODULE$.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path("String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}

Fixed version (ground truth):
@Test public void testAddTraitWithNoRegistration() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization$.MODULE$.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path(EntityResource.TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}
Program: 171126
Project: 171126
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testAddTrait() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  createType(traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path("String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testAddTrait() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  createType(traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(EntityResource.TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}
Program: 171127
Project: 171127
Buggy source:
@Test public void testDeleteTraitNonExistent() throws Exception {
  final String traitName="String_Node_Str";
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path("String_Node_Str").path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}

Fixed version (ground truth):
@Test public void testDeleteTraitNonExistent() throws Exception {
  final String traitName="String_Node_Str";
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path(EntityResource.TRAIT).path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}
Program: 171128
Project: 171128
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testGetTraitNames() throws Exception {
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path("String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertEquals(list.length(),7);
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testGetTraitNames() throws Exception {
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(EntityResource.TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertEquals(list.length(),7);
}
Program: 171129
Project: 171129
Buggy source:
@Test public void testGetTraitNames() throws Exception {
  String[] traitsAdded=addTraits();
  WebResource resource=service.path("String_Node_Str");
  ClientResponse clientResponse=resource.queryParam("String_Node_Str",TypesResource.TRAIT).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(list);
  Assert.assertTrue(list.length() >= traitsAdded.length);
}

Fixed version (ground truth):
@Test public void testGetTraitNames() throws Exception {
  String[] traitsAdded=addTraits();
  WebResource resource=service.path("String_Node_Str");
  ClientResponse clientResponse=resource.queryParam("String_Node_Str",TypesResource.TYPE_TRAIT).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(list);
  Assert.assertTrue(list.length() >= traitsAdded.length);
}
Program: 171130
Project: 171130
Buggy source:
/** 
 * Gets the list of trait type names registered in the type system.
 */
@GET @Produces(MediaType.APPLICATION_JSON) public Response getTypesByFilter(@Context HttpServletRequest request,@DefaultValue(TYPE_ALL) @QueryParam("String_Node_Str") String type){
  try {
    List<String> result=null;
switch (type) {
case TYPE_ALL:
      result=metadataService.getTypeNamesList();
    break;
case TYPE_TRAIT:
  result=metadataService.getTraitNamesList();
break;
case TYPE_STRUCT:
case TYPE_CLASS:
default :
LOG.error("String_Node_Str",type);
throw new WebApplicationException(Servlets.getErrorResponse("String_Node_Str" + type,Response.Status.BAD_REQUEST));
}
JSONObject response=new JSONObject();
response.put(MetadataServiceClient.RESULTS,new JSONArray(result));
response.put(MetadataServiceClient.TOTAL_SIZE,result.size());
response.put(MetadataServiceClient.REQUEST_ID,Servlets.getRequestId());
return Response.ok(response).build();
}
 catch (Exception e) {
LOG.error("String_Node_Str",e);
throw new WebApplicationException(Servlets.getErrorResponse(e,Response.Status.BAD_REQUEST));
}
}

Fixed version (ground truth):
/** 
 * Gets the list of trait type names registered in the type system.
 */
@GET @Produces(MediaType.APPLICATION_JSON) public Response getTypesByFilter(@Context HttpServletRequest request,@DefaultValue(TYPE_ALL) @QueryParam("String_Node_Str") String type){
  try {
    List<String> result=null;
    if (TYPE_ALL.equals(type)) {
      result=metadataService.getTypeNamesList();
    }
 else {
      DataTypes.TypeCategory typeCategory=DataTypes.TypeCategory.valueOf(type);
      result=metadataService.getTypeNamesByCategory(typeCategory);
    }
    JSONObject response=new JSONObject();
    response.put(MetadataServiceClient.RESULTS,new JSONArray(result));
    response.put(MetadataServiceClient.TOTAL_SIZE,result.size());
    response.put(MetadataServiceClient.REQUEST_ID,Servlets.getRequestId());
    return Response.ok(response).build();
  }
 catch (  IllegalArgumentException ie) {
    LOG.error("String_Node_Str",type);
    throw new WebApplicationException(Servlets.getErrorResponse("String_Node_Str" + type,Response.Status.BAD_REQUEST));
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new WebApplicationException(Servlets.getErrorResponse(e,Response.Status.BAD_REQUEST));
  }
}
Program: 171131
Project: 171131
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testDeleteTrait() throws Exception {
  final String traitName="String_Node_Str";
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(EntityResource.TRAIT).path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testDeleteTrait() throws Exception {
  final String traitName="String_Node_Str";
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(TRAIT).path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}
Program: 171132
Project: 171132
Buggy source:
@Test public void testAddTraitWithNoRegistration() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization$.MODULE$.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path(EntityResource.TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}

Fixed version (ground truth):
@Test public void testAddTraitWithNoRegistration() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization$.MODULE$.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path(TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}
Program: 171133
Project: 171133
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testAddTrait() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  createType(traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(EntityResource.TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testAddTrait() throws Exception {
  final String traitName="String_Node_Str";
  HierarchicalTypeDefinition<TraitType> piiTrait=TypesUtil.createTraitTypeDef(traitName,ImmutableList.<String>of());
  String traitDefinitionAsJSON=TypesSerialization$.MODULE$.toJson(piiTrait,true);
  LOG.debug("String_Node_Str" + traitDefinitionAsJSON);
  createType(traitDefinitionAsJSON);
  Struct traitInstance=new Struct(traitName);
  String traitInstanceAsJSON=InstanceSerialization.toJson(traitInstance,true);
  LOG.debug("String_Node_Str" + traitInstanceAsJSON);
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.POST,ClientResponse.class,traitInstanceAsJSON);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  Assert.assertNotNull(response.get("String_Node_Str"));
}
Program: 171134
Project: 171134
Buggy source:
@Test public void testDeleteTraitNonExistent() throws Exception {
  final String traitName="String_Node_Str";
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path(EntityResource.TRAIT).path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}

Fixed version (ground truth):
@Test public void testDeleteTraitNonExistent() throws Exception {
  final String traitName="String_Node_Str";
  ClientResponse clientResponse=service.path("String_Node_Str").path("String_Node_Str").path(TRAIT).path(traitName).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.DELETE,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
}
Program: 171135
Project: 171135
Buggy source:
@Test(dependsOnMethods="String_Node_Str") public void testGetTraitNames() throws Exception {
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(EntityResource.TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertEquals(list.length(),7);
}

Fixed version (ground truth):
@Test(dependsOnMethods="String_Node_Str") public void testGetTraitNames() throws Exception {
  final String guid=tableId._getId();
  ClientResponse clientResponse=service.path("String_Node_Str").path(guid).path(TRAITS).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  Assert.assertNotNull(response.get("String_Node_Str"));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertEquals(list.length(),7);
}
Program: 171136
Project: 171136
Buggy source:
@Test public void testGetTraitNames() throws Exception {
  String[] traitsAdded=addTraits();
  WebResource resource=service.path("String_Node_Str");
  ClientResponse clientResponse=resource.queryParam("String_Node_Str",TypesResource.TYPE_TRAIT).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(list);
  Assert.assertTrue(list.length() >= traitsAdded.length);
}

Fixed version (ground truth):
@Test public void testGetTraitNames() throws Exception {
  String[] traitsAdded=addTraits();
  WebResource resource=service.path("String_Node_Str");
  ClientResponse clientResponse=resource.queryParam("String_Node_Str",DataTypes.TypeCategory.TRAIT.name()).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(list);
  Assert.assertTrue(list.length() >= traitsAdded.length);
}
Program: 171137
Project: 171137
Buggy source:
@Test public void testGetEntityListForNoInstances() throws Exception {
  addNewType();
  ClientResponse clientResponse=service.path("String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertEquals(list.length(),0);
}

Fixed version (ground truth):
@Test public void testGetEntityListForNoInstances() throws Exception {
  addNewType();
  ClientResponse clientResponse=service.path("String_Node_Str").queryParam("String_Node_Str","String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  final JSONArray list=response.getJSONArray(MetadataServiceClient.RESULTS);
  Assert.assertEquals(list.length(),0);
}
Program: 171138
Project: 171138
Buggy source:
@Test public void testGetEntityListForBadEntityType() throws Exception {
  ClientResponse clientResponse=service.path("String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
}

Fixed version (ground truth):
@Test public void testGetEntityListForBadEntityType() throws Exception {
  ClientResponse clientResponse=service.path("String_Node_Str").queryParam("String_Node_Str","String_Node_Str").accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.BAD_REQUEST.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
}
Program: 171139
Project: 171139
Buggy source:
@Test public void testSchema() throws Exception {
  WebResource resource=service.path("String_Node_Str").path("String_Node_Str");
  ClientResponse clientResponse=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  System.out.println("String_Node_Str" + responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  JSONObject results=response.getJSONObject(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(results);
  JSONArray rows=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(rows.length(),4);
  for (int index=0; index < rows.length(); index++) {
    final JSONObject row=rows.getJSONObject(index);
    Assert.assertNotNull(row.getString("String_Node_Str"));
    Assert.assertNotNull(row.getString("String_Node_Str"));
    Assert.assertNotNull(row.getString("String_Node_Str"));
    Assert.assertEquals(row.getString("String_Node_Str"),"String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void testSchema() throws Exception {
  WebResource resource=service.path(BASE_URI).path("String_Node_Str").path("String_Node_Str");
  ClientResponse clientResponse=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  System.out.println("String_Node_Str" + responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  JSONObject results=response.getJSONObject(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(results);
  JSONArray rows=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(rows.length(),4);
  for (int index=0; index < rows.length(); index++) {
    final JSONObject row=rows.getJSONObject(index);
    Assert.assertNotNull(row.getString("String_Node_Str"));
    Assert.assertNotNull(row.getString("String_Node_Str"));
    Assert.assertNotNull(row.getString("String_Node_Str"));
    Assert.assertEquals(row.getString("String_Node_Str"),"String_Node_Str");
  }
}
Program: 171140
Project: 171140
Buggy source:
@Test public void testOutputs() throws Exception {
  WebResource resource=service.path("String_Node_Str").path("String_Node_Str");
  ClientResponse clientResponse=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  System.out.println("String_Node_Str" + responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  JSONObject results=response.getJSONObject(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(results);
  JSONArray rows=results.getJSONArray("String_Node_Str");
  Assert.assertTrue(rows.length() > 0);
  final JSONObject row=rows.getJSONObject(0);
  JSONArray paths=row.getJSONArray("String_Node_Str");
  Assert.assertTrue(paths.length() > 0);
}

Fixed version (ground truth):
@Test public void testOutputs() throws Exception {
  WebResource resource=service.path(BASE_URI).path("String_Node_Str").path("String_Node_Str");
  ClientResponse clientResponse=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  System.out.println("String_Node_Str" + responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  JSONObject results=response.getJSONObject(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(results);
  JSONArray rows=results.getJSONArray("String_Node_Str");
  Assert.assertTrue(rows.length() > 0);
  final JSONObject row=rows.getJSONObject(0);
  JSONArray paths=row.getJSONArray("String_Node_Str");
  Assert.assertTrue(paths.length() > 0);
}
Program: 171141
Project: 171141
Buggy source:
@Test public void testInputs() throws Exception {
  WebResource resource=service.path("String_Node_Str").path("String_Node_Str");
  ClientResponse clientResponse=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  System.out.println("String_Node_Str" + responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  JSONObject results=response.getJSONObject(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(results);
  JSONArray rows=results.getJSONArray("String_Node_Str");
  Assert.assertTrue(rows.length() > 0);
  final JSONObject row=rows.getJSONObject(0);
  JSONArray paths=row.getJSONArray("String_Node_Str");
  Assert.assertTrue(paths.length() > 0);
}

Fixed version (ground truth):
@Test public void testInputs() throws Exception {
  WebResource resource=service.path(BASE_URI).path("String_Node_Str").path("String_Node_Str");
  ClientResponse clientResponse=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).method(HttpMethod.GET,ClientResponse.class);
  Assert.assertEquals(clientResponse.getStatus(),Response.Status.OK.getStatusCode());
  String responseAsString=clientResponse.getEntity(String.class);
  Assert.assertNotNull(responseAsString);
  System.out.println("String_Node_Str" + responseAsString);
  JSONObject response=new JSONObject(responseAsString);
  Assert.assertNotNull(response.get(MetadataServiceClient.REQUEST_ID));
  JSONObject results=response.getJSONObject(MetadataServiceClient.RESULTS);
  Assert.assertNotNull(results);
  JSONArray rows=results.getJSONArray("String_Node_Str");
  Assert.assertTrue(rows.length() > 0);
  final JSONObject row=rows.getJSONObject(0);
  JSONArray paths=row.getJSONArray("String_Node_Str");
  Assert.assertTrue(paths.length() > 0);
}
Program: 171142
Project: 171142
Buggy source:
@SuppressWarnings("String_Node_Str") private void mapVertexToMapInstance(Vertex instanceVertex,ITypedInstance typedInstance,AttributeInfo attributeInfo,String propertyName) throws MetadataException {
  LOG.debug("String_Node_Str",instanceVertex,attributeInfo.name);
  String keys=instanceVertex.getProperty(propertyName);
  if (keys == null || keys.length() == 0) {
    return;
  }
  DataTypes.MapType mapType=(DataTypes.MapType)attributeInfo.dataType();
  final IDataType elementType=mapType.getValueType();
  HashMap values=new HashMap();
  for (  String propertyNameWithSuffix : keys.split("String_Node_Str")) {
    final String key=propertyNameWithSuffix.substring(propertyNameWithSuffix.lastIndexOf("String_Node_Str") + 1,propertyNameWithSuffix.lastIndexOf("String_Node_Str"));
    values.put(key,mapVertexToCollectionEntry(instanceVertex,attributeInfo,elementType,propertyName,propertyNameWithSuffix));
  }
  typedInstance.set(attributeInfo.name,values);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void mapVertexToMapInstance(Vertex instanceVertex,ITypedInstance typedInstance,AttributeInfo attributeInfo,String propertyName) throws MetadataException {
  LOG.debug("String_Node_Str",instanceVertex,attributeInfo.name);
  String keys=instanceVertex.getProperty(propertyName);
  if (keys == null || keys.length() == 0) {
    return;
  }
  DataTypes.MapType mapType=(DataTypes.MapType)attributeInfo.dataType();
  final IDataType keyType=mapType.getKeyType();
  final IDataType valueType=mapType.getValueType();
  HashMap values=new HashMap();
  for (  String propertyNameWithSuffix : keys.split("String_Node_Str")) {
    final String key=extractKey(propertyNameWithSuffix,keyType);
    values.put(key,mapVertexToCollectionEntry(instanceVertex,attributeInfo,valueType,propertyName,propertyNameWithSuffix));
  }
  typedInstance.set(attributeInfo.name,values);
}
Program: 171143
Project: 171143
Buggy source:
/** 
 * Initializes the indices for the graph - create indices for Global Vertex Keys
 */
private void initialize(){
  TitanManagement management=titanGraph.getManagementSystem();
  if (management.containsPropertyKey(Constants.GUID_PROPERTY_KEY)) {
    LOG.info("String_Node_Str");
    return;
  }
  LOG.info("String_Node_Str");
  management.buildIndex(Constants.VERTEX_INDEX,Vertex.class).buildMixedIndex(Constants.BACKING_INDEX);
  management.buildIndex(Constants.EDGE_INDEX,Edge.class).buildMixedIndex(Constants.BACKING_INDEX);
  management.commit();
  createCompositeIndex(Constants.GUID_INDEX,Constants.GUID_PROPERTY_KEY,String.class,true,Cardinality.SINGLE);
  createCompositeAndMixedIndex(Constants.ENTITY_TYPE_INDEX,Constants.ENTITY_TYPE_PROPERTY_KEY,String.class,false,Cardinality.SINGLE);
  createCompositeAndMixedIndex(Constants.TRAIT_NAMES_INDEX,Constants.TRAIT_NAMES_PROPERTY_KEY,String.class,false,Cardinality.SET);
  createVertexMixedIndex(Constants.ENTITY_TEXT_PROPERTY_KEY,String.class,Cardinality.SINGLE);
  createTypeStoreIndexes();
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initializes the indices for the graph - create indices for Global Vertex Keys
 */
private void initialize(){
  TitanManagement management=titanGraph.getManagementSystem();
  if (management.containsPropertyKey(Constants.GUID_PROPERTY_KEY)) {
    LOG.info("String_Node_Str");
    return;
  }
  LOG.info("String_Node_Str");
  management.buildIndex(Constants.VERTEX_INDEX,Vertex.class).buildMixedIndex(Constants.BACKING_INDEX);
  management.buildIndex(Constants.EDGE_INDEX,Edge.class).buildMixedIndex(Constants.BACKING_INDEX);
  management.commit();
  createCompositeIndex(Constants.GUID_INDEX,Constants.GUID_PROPERTY_KEY,String.class,true,Cardinality.SINGLE);
  createCompositeAndMixedIndex(Constants.ENTITY_TYPE_INDEX,Constants.ENTITY_TYPE_PROPERTY_KEY,String.class,false,Cardinality.SINGLE);
  createCompositeAndMixedIndex(Constants.TRAIT_NAMES_INDEX,Constants.TRAIT_NAMES_PROPERTY_KEY,String.class,false,Cardinality.SET);
  createVertexMixedIndex(Constants.ENTITY_TEXT_PROPERTY_KEY,String.class);
  createTypeStoreIndexes();
  LOG.info("String_Node_Str");
}
Program: 171146
Project: 171146
Buggy source:
private void searchWalker(Vertex vtx,final int max,int counter,HashMap<String,Map<String,String>> e,HashMap<String,Map<String,String>> v){
  if (counter <= max) {
    Map<String,String> jsonVertexMap=new HashMap<String,String>();
    Iterator<Edge> edgeIterator=vtx.query().edges().iterator();
    jsonVertexMap.put("String_Node_Str",((Boolean)edgeIterator.hasNext()).toString());
    for (    String pKey : vtx.getPropertyKeys()) {
      jsonVertexMap.put(pKey,vtx.getProperty(pKey).toString());
    }
    v.put(vtx.getId().toString(),jsonVertexMap);
    while (edgeIterator.hasNext()) {
      Edge edge=edgeIterator.next();
      Map<String,String> jsonEdgeMap=new HashMap<String,String>();
      String tail=edge.getVertex(Direction.OUT).getId().toString();
      String head=edge.getVertex(Direction.IN).getId().toString();
      jsonEdgeMap.put("String_Node_Str",tail);
      jsonEdgeMap.put("String_Node_Str",head);
      jsonEdgeMap.put("String_Node_Str",edge.getLabel());
      Direction d=null;
      if (tail.equals(vtx.getId().toString())) {
        d=Direction.IN;
      }
 else {
        d=Direction.OUT;
      }
      e.put(edge.getId().toString(),jsonEdgeMap);
      counter++;
      searchWalker(edge.getVertex(d),max,counter,e,v);
    }
  }
}

Fixed version (ground truth):
private void searchWalker(Vertex vtx,final int max,int counter,HashMap<String,Map<String,String>> e,HashMap<String,Map<String,String>> v){
  counter++;
  if (counter <= max) {
    Map<String,String> jsonVertexMap=new HashMap<String,String>();
    Iterator<Edge> edgeIterator=vtx.query().edges().iterator();
    jsonVertexMap.put("String_Node_Str",((Boolean)edgeIterator.hasNext()).toString());
    for (    String pKey : vtx.getPropertyKeys()) {
      jsonVertexMap.put(pKey,vtx.getProperty(pKey).toString());
    }
    v.put(vtx.getId().toString(),jsonVertexMap);
    while (edgeIterator.hasNext()) {
      Edge edge=edgeIterator.next();
      Map<String,String> jsonEdgeMap=new HashMap<String,String>();
      String tail=edge.getVertex(Direction.OUT).getId().toString();
      String head=edge.getVertex(Direction.IN).getId().toString();
      jsonEdgeMap.put("String_Node_Str",tail);
      jsonEdgeMap.put("String_Node_Str",head);
      jsonEdgeMap.put("String_Node_Str",edge.getLabel());
      Direction d=null;
      if (tail.equals(vtx.getId().toString())) {
        d=Direction.IN;
      }
 else {
        d=Direction.OUT;
      }
      e.put(edge.getId().toString(),jsonEdgeMap);
      searchWalker(edge.getVertex(d),max,counter,e,v);
    }
  }
}