Program: 29674
Project: 29674
Buggy source:
public String processRefToExternalDefinition(String $ref,RefFormat refFormat){
  final Model model=cache.loadRef($ref,refFormat,Model.class);
  String newRef;
  Map<String,Model> definitions=swagger.getDefinitions();
  if (definitions == null) {
    definitions=new HashMap<>();
  }
  final String possiblyConflictingDefinitionName=computeDefinitionName($ref);
  final Model existingModel=definitions.get(possiblyConflictingDefinitionName);
  if (existingModel != null) {
    LOGGER.debug("String_Node_Str" + existingModel + "String_Node_Str");
  }
  newRef=possiblyConflictingDefinitionName;
  cache.putRenamedRef($ref,newRef);
  String file=$ref.split("String_Node_Str")[0];
  if (model instanceof RefModel) {
    RefModel refModel=(RefModel)model;
    if (isAnExternalRefFormat(refModel.getRefFormat())) {
      refModel.set$ref(processRefToExternalDefinition(refModel.get$ref(),refModel.getRefFormat()));
    }
 else {
      processRefToExternalDefinition(file + refModel.get$ref(),RefFormat.RELATIVE);
    }
  }
  Map<String,Property> subProps=model.getProperties();
  if (subProps != null) {
    for (    Map.Entry<String,Property> prop : subProps.entrySet()) {
      if (prop.getValue() instanceof RefProperty) {
        RefProperty subRef=(RefProperty)prop.getValue();
        if (isAnExternalRefFormat(subRef.getRefFormat())) {
          subRef.set$ref(processRefToExternalDefinition(subRef.get$ref(),subRef.getRefFormat()));
        }
 else {
          processRefToExternalDefinition(file + subRef.get$ref(),RefFormat.RELATIVE);
        }
      }
    }
  }
  if (existingModel == null) {
    swagger.addDefinition(newRef,model);
  }
  return newRef;
}

Fixed version (ground truth):
public String processRefToExternalDefinition(String $ref,RefFormat refFormat){
  final Model model=cache.loadRef($ref,refFormat,Model.class);
  String newRef;
  Map<String,Model> definitions=swagger.getDefinitions();
  if (definitions == null) {
    definitions=new HashMap<>();
  }
  final String possiblyConflictingDefinitionName=computeDefinitionName($ref);
  final Model existingModel=definitions.get(possiblyConflictingDefinitionName);
  if (existingModel != null) {
    LOGGER.debug("String_Node_Str" + existingModel + "String_Node_Str");
  }
  newRef=possiblyConflictingDefinitionName;
  cache.putRenamedRef($ref,newRef);
  String file=$ref.split("String_Node_Str")[0];
  if (model instanceof RefModel) {
    RefModel refModel=(RefModel)model;
    if (isAnExternalRefFormat(refModel.getRefFormat())) {
      refModel.set$ref(processRefToExternalDefinition(refModel.get$ref(),refModel.getRefFormat()));
    }
 else {
      processRefToExternalDefinition(file + refModel.get$ref(),RefFormat.RELATIVE);
    }
  }
  Map<String,Property> subProps=model.getProperties();
  if (subProps != null) {
    for (    Map.Entry<String,Property> prop : subProps.entrySet()) {
      if (prop.getValue() instanceof RefProperty) {
        RefProperty subRef=(RefProperty)prop.getValue();
        if (isAnExternalRefFormat(subRef.getRefFormat())) {
          subRef.set$ref(processRefToExternalDefinition(subRef.get$ref(),subRef.getRefFormat()));
        }
 else {
          processRefToExternalDefinition(file + subRef.get$ref(),RefFormat.RELATIVE);
        }
      }
 else       if (prop.getValue() instanceof ArrayProperty) {
        ArrayProperty arrayProp=(ArrayProperty)prop.getValue();
        if (arrayProp.getItems() instanceof RefProperty) {
          RefProperty subRef=(RefProperty)arrayProp.getItems();
          if (isAnExternalRefFormat(subRef.getRefFormat())) {
            subRef.set$ref(processRefToExternalDefinition(subRef.get$ref(),subRef.getRefFormat()));
          }
 else {
            processRefToExternalDefinition(file + subRef.get$ref(),RefFormat.RELATIVE);
          }
        }
      }
    }
  }
  if (existingModel == null) {
    swagger.addDefinition(newRef,model);
  }
  return newRef;
}