Program: 109476
Project: 109476
Buggy source:
private void initializeTitanIndexes(TitanGraph titanGraph){
  Set<String> defaultIndexKeys=new HashSet<>();
  Set<String> searchIndexKeys=new HashSet<>();
  Set<String> listIndexKeys=new HashSet<>();
  Set<Class<? extends WindupVertexFrame>> modelTypes=graphTypeManager.getRegisteredTypes();
  for (  Class<? extends WindupVertexFrame> type : modelTypes) {
    for (    Method method : type.getDeclaredMethods()) {
      Indexed index=method.getAnnotation(Indexed.class);
      if (index != null) {
        Property property=Annotations.getAnnotation(method,Property.class);
        if (property != null) {
switch (index.value()) {
case DEFAULT:
            defaultIndexKeys.add(property.value());
          break;
case SEARCH:
        searchIndexKeys.add(property.value());
      break;
case LIST:
    listIndexKeys.add(property.value());
  break;
default :
break;
}
}
}
}
}
listIndexKeys.add(WindupVertexFrame.TYPE_PROP);
log.info("String_Node_Str" + defaultIndexKeys.size() + "String_Node_Str"+ defaultIndexKeys);
TitanManagement titan=titanGraph.getManagementSystem();
for (String key : defaultIndexKeys) {
PropertyKey propKey=titan.makePropertyKey(key).dataType(String.class).cardinality(Cardinality.SINGLE).make();
titan.buildIndex(key,Vertex.class).addKey(propKey).buildCompositeIndex();
}
for (String key : searchIndexKeys) {
PropertyKey propKey=titan.makePropertyKey(key).dataType(String.class).cardinality(Cardinality.SINGLE).make();
titan.buildIndex(key,Vertex.class).addKey(propKey).buildMixedIndex("String_Node_Str");
}
for (String key : listIndexKeys) {
PropertyKey propKey=titan.makePropertyKey(key).dataType(String.class).cardinality(Cardinality.LIST).make();
titan.buildIndex(key,Vertex.class).addKey(propKey).buildCompositeIndex();
}
titan.commit();
}

Fixed version (ground truth):
private void initializeTitanIndexes(TitanGraph titanGraph){
  Set<String> defaultIndexKeys=new HashSet<>();
  Set<String> searchIndexKeys=new HashSet<>();
  Set<String> listIndexKeys=new HashSet<>();
  Set<Class<? extends WindupVertexFrame>> modelTypes=graphTypeManager.getRegisteredTypes();
  for (  Class<? extends WindupVertexFrame> type : modelTypes) {
    for (    Method method : type.getDeclaredMethods()) {
      Indexed index=method.getAnnotation(Indexed.class);
      if (index != null) {
        Property property=Annotations.getAnnotation(method,Property.class);
        if (property != null) {
switch (index.value()) {
case DEFAULT:
            defaultIndexKeys.add(property.value());
          break;
case SEARCH:
        searchIndexKeys.add(property.value());
      break;
case LIST:
    listIndexKeys.add(property.value());
  break;
default :
break;
}
}
}
}
}
listIndexKeys.add(WindupVertexFrame.TYPE_PROP);
log.info("String_Node_Str" + defaultIndexKeys.size() + "String_Node_Str"+ defaultIndexKeys);
log.info("String_Node_Str" + searchIndexKeys.size() + "String_Node_Str"+ searchIndexKeys);
log.info("String_Node_Str" + listIndexKeys.size() + "String_Node_Str"+ listIndexKeys);
TitanManagement titan=titanGraph.getManagementSystem();
for (String key : defaultIndexKeys) {
PropertyKey propKey=titan.makePropertyKey(key).dataType(String.class).cardinality(Cardinality.SINGLE).make();
titan.buildIndex(key,Vertex.class).addKey(propKey).buildCompositeIndex();
}
for (String key : searchIndexKeys) {
PropertyKey propKey=titan.makePropertyKey(key).dataType(String.class).cardinality(Cardinality.SINGLE).make();
titan.buildIndex(key,Vertex.class).addKey(propKey,Mapping.STRING.getParameter()).buildMixedIndex("String_Node_Str");
}
for (String key : listIndexKeys) {
PropertyKey propKey=titan.makePropertyKey(key).dataType(String.class).cardinality(Cardinality.LIST).make();
titan.buildIndex(key,Vertex.class).addKey(propKey).buildCompositeIndex();
}
titan.commit();
}