Program: 160754
Project: 160754
Buggy source:
/** 
 * Adds a new known function definition.
 * @param functionDef A PHP function definition. If a function definition with the samename was previously added, then the new function definition will be used for that name and the old function definition will be returned.
 * @return If there already exists a PHP function definition with the same name,then returns that function definition. Otherwise, returns null.
 */
public static PHPFunctionDef addFunctionDef(PHPFunctionDef functionDef){
  if (functionDef instanceof TopLevelFunctionDef)   return null;
 else   if (functionDef instanceof Closure)   return null;
 else   if (functionDef instanceof Method && functionDef.getFlags().contains(PHPCSVNodeTypes.FLAG_MODIFIER_STATIC)) {
    String staticMethodKey=((Method)functionDef).getEnclosingClass() + "String_Node_Str" + functionDef.getName();
    if (!functionDef.getEnclosingNamespace().isEmpty())     staticMethodKey=functionDef.getEnclosingNamespace() + "String_Node_Str" + staticMethodKey;
    if (staticMethodDefs.containsKey(staticMethodKey)) {
      System.err.println("String_Node_Str" + staticMethodKey + "String_Node_Str"+ "String_Node_Str"+ staticMethodDefs.get(staticMethodKey).getNodeId()+ "String_Node_Str"+ functionDef.getNodeId()+ "String_Node_Str");
    }
    return staticMethodDefs.put(staticMethodKey,(Method)functionDef);
  }
 else   if (functionDef instanceof Method && (functionDef.getName().equals("String_Node_Str") || functionDef.getName().equals(((Method)functionDef).getEnclosingClass()))) {
    String constructorKey=((Method)functionDef).getEnclosingClass();
    if (!functionDef.getEnclosingNamespace().isEmpty())     constructorKey=functionDef.getEnclosingNamespace() + "String_Node_Str" + constructorKey;
    if (constructorDefs.containsKey(constructorKey)) {
      System.err.println("String_Node_Str" + constructorKey + "String_Node_Str"+ "String_Node_Str"+ staticMethodDefs.get(constructorKey).getNodeId()+ "String_Node_Str"+ functionDef.getNodeId()+ "String_Node_Str");
    }
    return constructorDefs.put(constructorKey,(Method)functionDef);
  }
 else   if (functionDef instanceof Method) {
    String methodKey=((Method)functionDef).getName();
    if (nonStaticMethodDefs.containsKey(methodKey) || blacklistedMethodNames.contains(methodKey)) {
      blacklistedMethodNames.add(methodKey);
      return nonStaticMethodDefs.remove(methodKey);
    }
    return nonStaticMethodDefs.put(methodKey,(Method)functionDef);
  }
 else {
    String functionKey=functionDef.getName();
    if (!functionDef.getEnclosingNamespace().isEmpty())     functionKey=functionDef.getEnclosingNamespace() + "String_Node_Str" + functionKey;
    if (functionDefs.containsKey(functionKey)) {
      System.err.println("String_Node_Str" + functionKey + "String_Node_Str"+ "String_Node_Str"+ functionDefs.get(functionKey).getNodeId()+ "String_Node_Str"+ functionDef.getNodeId()+ "String_Node_Str");
    }
    return functionDefs.put(functionKey,functionDef);
  }
}

Fixed version (ground truth):
/** 
 * Adds a new known function definition.
 * @param functionDef A PHP function definition. If a function definition with the samename was previously added, then the new function definition will be used for that name and the old function definition will be returned.
 * @return If there already exists a PHP function definition with the same name,then returns that function definition. Otherwise, returns null.
 */
public static PHPFunctionDef addFunctionDef(PHPFunctionDef functionDef){
  if (functionDef instanceof TopLevelFunctionDef)   return null;
 else   if (functionDef instanceof Closure)   return null;
 else   if (functionDef instanceof Method && functionDef.getFlags().contains(PHPCSVNodeTypes.FLAG_MODIFIER_STATIC)) {
    String staticMethodKey=((Method)functionDef).getEnclosingClass() + "String_Node_Str" + functionDef.getName();
    if (!functionDef.getEnclosingNamespace().isEmpty())     staticMethodKey=functionDef.getEnclosingNamespace() + "String_Node_Str" + staticMethodKey;
    if (staticMethodDefs.containsKey(staticMethodKey)) {
      System.err.println("String_Node_Str" + staticMethodKey + "String_Node_Str"+ "String_Node_Str"+ staticMethodDefs.get(staticMethodKey).getNodeId()+ "String_Node_Str"+ functionDef.getNodeId()+ "String_Node_Str");
    }
    return staticMethodDefs.put(staticMethodKey,(Method)functionDef);
  }
 else   if (functionDef instanceof Method && (functionDef.getName().equals("String_Node_Str") || functionDef.getName().equals(((Method)functionDef).getEnclosingClass()))) {
    String constructorKey=((Method)functionDef).getEnclosingClass();
    if (!functionDef.getEnclosingNamespace().isEmpty())     constructorKey=functionDef.getEnclosingNamespace() + "String_Node_Str" + constructorKey;
    if (constructorDefs.containsKey(constructorKey)) {
      System.err.println("String_Node_Str" + constructorKey + "String_Node_Str"+ "String_Node_Str"+ constructorDefs.get(constructorKey).getNodeId()+ "String_Node_Str"+ functionDef.getNodeId()+ "String_Node_Str");
    }
    return constructorDefs.put(constructorKey,(Method)functionDef);
  }
 else   if (functionDef instanceof Method) {
    String methodKey=((Method)functionDef).getName();
    if (nonStaticMethodDefs.containsKey(methodKey) || blacklistedMethodNames.contains(methodKey)) {
      blacklistedMethodNames.add(methodKey);
      return nonStaticMethodDefs.remove(methodKey);
    }
    return nonStaticMethodDefs.put(methodKey,(Method)functionDef);
  }
 else {
    String functionKey=functionDef.getName();
    if (!functionDef.getEnclosingNamespace().isEmpty())     functionKey=functionDef.getEnclosingNamespace() + "String_Node_Str" + functionKey;
    if (functionDefs.containsKey(functionKey)) {
      System.err.println("String_Node_Str" + functionKey + "String_Node_Str"+ "String_Node_Str"+ functionDefs.get(functionKey).getNodeId()+ "String_Node_Str"+ functionDef.getNodeId()+ "String_Node_Str");
    }
    return functionDefs.put(functionKey,functionDef);
  }
}