Program: 187290
Project: 187290
Buggy source:
/** 
 * Generates a name based on the following rules: once => prefix + state name + suffix 1st method => name$number 2nd..Nth method => name$letter$number Where 'letter' is for instance id and number is maxOccurs. The letter was added to address FLAPI-105, which identified a lack of support for two methods with the same name but different parameters.
 * @param prefix prefix for the name (eg 'Impl')
 * @param suffix suffix for the name (eg 'Builder')
 * @param state state to generate a name for
 * @return the generated name, which should be unique across the graph
 */
public String getGeneratedName(String prefix,String suffix,StateClass state){
  StringBuilder name=new StringBuilder();
  name.append(prefix).append(state.getName()).append(suffix);
  for (  Transition transition : state.getTransitions()) {
    if (transition.getType() == TransitionType.Terminal) {
      continue;
    }
    if (transition.getType() == TransitionType.Ascending && transition.getOwner().isTopLevel()) {
      continue;
    }
    MethodParser parsed=new MethodParser(transition.getMethodSignature());
    String methodName=parsed.methodName;
    String krazyKey=methodName;
    for (    Pair<JavaType,String> param : parsed.params) {
      krazyKey+="String_Node_Str" + param.first.typeName;
    }
    if (hashToSuffix.containsKey(krazyKey)) {
      methodName+=hashToSuffix.get(krazyKey);
    }
 else {
      CharacterGenerator characterGen;
      String methodSuffix;
      if (nameToGenerator.containsKey(methodName)) {
        characterGen=nameToGenerator.get(methodName);
        methodSuffix=characterGen.getAndIncrement();
      }
 else {
        characterGen=new CharacterGenerator("String_Node_Str");
        nameToGenerator.put(methodName,characterGen);
        methodSuffix="String_Node_Str";
      }
      methodName+=methodSuffix;
      hashToSuffix.put(krazyKey,methodSuffix);
    }
    name.append("String_Node_Str");
    if (condenseNames) {
      if (nameMap.containsKey(methodName)) {
        name.append(nameMap.get(methodName));
      }
 else {
        String gen="String_Node_Str" + (nameIdCounter++);
        name.append(gen);
        nameMap.put(methodName,gen);
      }
    }
 else {
      name.append(methodName);
    }
    if (transition.info().getMaxOccurrences() > 1) {
      name.append("String_Node_Str").append(transition.info().getMaxOccurrences());
    }
    name.append("String_Node_Str").append(transition.info().didTrigger() ? "String_Node_Str" : "String_Node_Str");
  }
  return name.toString();
}

Fixed version (ground truth):
/** 
 * Generates a name based on the following rules: once => prefix + state name + suffix 1st method => name$number 2nd..Nth method => name$letter$number Where 'letter' is for instance id and number is maxOccurs. The letter was added to address FLAPI-105, which identified a lack of support for two methods with the same name but different parameters.
 * @param prefix prefix for the name (eg 'Impl')
 * @param suffix suffix for the name (eg 'Builder')
 * @param state state to generate a name for
 * @return the generated name, which should be unique across the graph
 */
public String getGeneratedName(String prefix,String suffix,StateClass state){
  StringBuilder name=new StringBuilder();
  name.append(prefix).append(state.getName()).append(suffix);
  for (  Transition transition : state.getTransitions()) {
    final boolean isImplicit=transition.info().isImplicit();
    if (transition.getType() == TransitionType.Terminal && !isImplicit) {
      continue;
    }
    if (transition.getType() == TransitionType.Ascending && transition.getOwner().isTopLevel() && !isImplicit) {
      continue;
    }
    MethodParser parsed=new MethodParser(transition.getMethodSignature());
    String methodName=parsed.methodName;
    String krazyKey=methodName;
    for (    Pair<JavaType,String> param : parsed.params) {
      krazyKey+="String_Node_Str" + param.first.typeName;
    }
    if (hashToSuffix.containsKey(krazyKey)) {
      methodName+=hashToSuffix.get(krazyKey);
    }
 else {
      CharacterGenerator characterGen;
      String methodSuffix;
      if (nameToGenerator.containsKey(methodName)) {
        characterGen=nameToGenerator.get(methodName);
        methodSuffix=characterGen.getAndIncrement();
      }
 else {
        characterGen=new CharacterGenerator("String_Node_Str");
        nameToGenerator.put(methodName,characterGen);
        methodSuffix="String_Node_Str";
      }
      methodName+=methodSuffix;
      hashToSuffix.put(krazyKey,methodSuffix);
    }
    name.append("String_Node_Str");
    if (condenseNames) {
      if (nameMap.containsKey(methodName)) {
        name.append(nameMap.get(methodName));
      }
 else {
        String gen="String_Node_Str" + (nameIdCounter++);
        name.append(gen);
        nameMap.put(methodName,gen);
      }
    }
 else {
      name.append(methodName);
    }
    if (transition.info().getMaxOccurrences() > 1) {
      name.append("String_Node_Str").append(transition.info().getMaxOccurrences());
    }
    if (transition.info().didTrigger()) {
      name.append("String_Node_Str");
    }
    if (isImplicit) {
      name.append("String_Node_Str");
    }
  }
  return name.toString();
}