Program: 161146
Project: 161146
Buggy source:
@Nullable public String getReferencedType(final AttributeType attributeType,final CIString value){
  final Set<ObjectType> references=attributeType.getReferences();
switch (references.size()) {
case 0:
    if (AttributeType.MEMBERS.equals(attributeType)) {
      if (AttributeType.AUT_NUM.isValidValue(ObjectType.AUT_NUM,value)) {
        return ObjectType.AUT_NUM.getName();
      }
      if (AttributeType.AS_SET.isValidValue(ObjectType.AS_SET,value)) {
        return ObjectType.AS_SET.getName();
      }
      if (AttributeType.ROUTE_SET.isValidValue(ObjectType.ROUTE_SET,value)) {
        return ObjectType.ROUTE_SET.getName();
      }
      if (AttributeType.RTR_SET.isValidValue(ObjectType.RTR_SET,value)) {
        return ObjectType.RTR_SET.getName();
      }
    }
  return null;
case 1:
if (AttributeType.AUTH.equals(attributeType)) {
  if (value.toLowerCase().startsWith("String_Node_Str") || value.toLowerCase().startsWith("String_Node_Str")) {
    return null;
  }
}
if (AttributeType.MBRS_BY_REF.equals(attributeType)) {
if (value.toLowerCase().equals("String_Node_Str")) {
  return null;
}
}
if (AttributeType.MNT_ROUTES.equals(attributeType)) {
if (MNT_ROUTES_NO_REFERENCE.matcher(value).matches()) {
return null;
}
}
return references.iterator().next().getName();
default :
if (references.contains(ObjectType.PERSON) || references.contains(ObjectType.ROLE)) {
for (ObjectType objectType : references) {
if (attributeType.isValidValue(objectType,value)) {
try {
return rpslObjectDao.findByKey(objectType,value.toString()).getObjectType().getName();
}
 catch (EmptyResultDataAccessException ignored) {
}
}
}
}
 else {
for (ObjectType objectType : references) {
for (AttributeType lookupAttribute : ObjectTemplate.getTemplate(objectType).getLookupAttributes()) {
if (lookupAttribute.isValidValue(objectType,value)) {
return objectType.getName();
}
}
}
}
return null;
}
}

Fixed version (ground truth):
@Nullable public String getReferencedType(final AttributeType attributeType,final CIString value){
  final Set<ObjectType> references=attributeType.getReferences();
switch (references.size()) {
case 0:
    if (AttributeType.MEMBERS.equals(attributeType)) {
      if (AttributeType.AUT_NUM.isValidValue(ObjectType.AUT_NUM,value)) {
        return ObjectType.AUT_NUM.getName();
      }
      if (AttributeType.AS_SET.isValidValue(ObjectType.AS_SET,value)) {
        return ObjectType.AS_SET.getName();
      }
      if (AttributeType.ROUTE_SET.isValidValue(ObjectType.ROUTE_SET,value)) {
        return ObjectType.ROUTE_SET.getName();
      }
      if (AttributeType.RTR_SET.isValidValue(ObjectType.RTR_SET,value)) {
        return ObjectType.RTR_SET.getName();
      }
    }
  return null;
case 1:
if (AttributeType.AUTH.equals(attributeType)) {
  String authType=SPACE_SPLITTER.split(value).iterator().next().toUpperCase();
  if (authType.endsWith("String_Node_Str") || authType.equals("String_Node_Str")) {
    return null;
  }
}
if (AttributeType.MBRS_BY_REF.equals(attributeType)) {
if (value.toLowerCase().equals("String_Node_Str")) {
  return null;
}
}
if (AttributeType.MNT_ROUTES.equals(attributeType)) {
if (MNT_ROUTES_NO_REFERENCE.matcher(value).matches()) {
return null;
}
}
return references.iterator().next().getName();
default :
if (references.contains(ObjectType.PERSON) || references.contains(ObjectType.ROLE)) {
for (ObjectType objectType : references) {
if (attributeType.isValidValue(objectType,value)) {
try {
return rpslObjectDao.findByKey(objectType,value.toString()).getObjectType().getName();
}
 catch (EmptyResultDataAccessException ignored) {
}
}
}
}
 else {
for (ObjectType objectType : references) {
for (AttributeType lookupAttribute : ObjectTemplate.getTemplate(objectType).getLookupAttributes()) {
if (lookupAttribute.isValidValue(objectType,value)) {
return objectType.getName();
}
}
}
}
return null;
}
}