Program: 57656
Project: 57656
Buggy source:
/** 
 * Tries to find the mapping from the source IDType to the destination IDType of the specified sourceID along a path of IDTypes where mappings exist. If no such path is found, null is returned. If the path includes multimappings, a Set of values is returned. Note that there will always be chosen a path that does not include multimappings over paths that include multimappings if more than one path exists.
 * @param < K > Type of the sourceID
 * @param < V > Type of the expected result of the mapping
 * @param source IDType of the source data
 * @param destination IDType of the destination data
 * @param sourceID ID for which the mapping shall be found
 * @return If no mapping is found, null, otherwise the corresponding ID, or Set of IDs.
 * @deprecated use {@link #getIDAsSet(IDType,IDType,Object)} instead
 */
@SuppressWarnings("String_Node_Str") @Deprecated public <K,V>V getID(IDType source,IDType destination,K sourceID){
  if (source.equals(destination))   return (V)sourceID;
  List<MappingType> path;
  try {
    path=DijkstraShortestPath.findPathBetween(mappingGraph,source,destination);
  }
 catch (  IllegalArgumentException e) {
    Logger.log(new Status(Status.ERROR,this.toString(),"String_Node_Str" + source + "String_Node_Str"+ destination+ "String_Node_Str"));
    return null;
  }
  if (path == null) {
    Logger.log(new Status(Status.ERROR,this.toString(),"String_Node_Str" + source + "String_Node_Str"+ destination));
    return null;
  }
  Object currentID=sourceID;
  Set<Object> keys=null;
  Collection<Object> values=new ArrayList<Object>();
  for (  MappingType edge : path) {
    Map<?,?> currentMap=hashMappingType2Map.get(edge);
    if (keys != null) {
      for (      Object key : keys) {
        if (edge.isMultiMap()) {
          Set<Object> temp=(Set<Object>)((MultiHashMap<?,?>)(currentMap)).getAll(key);
          if (temp != null)           values.addAll(temp);
        }
 else {
          Object value=currentMap.get(key);
          if (value != null)           values.add(value);
        }
      }
      if (values.isEmpty())       return null;
      keys=new HashSet<Object>();
      for (      Object value : values) {
        keys.add(value);
      }
      values.clear();
    }
 else {
      if (edge.isMultiMap()) {
        keys=(Set<Object>)((MultiHashMap<?,?>)(currentMap)).getAll(currentID);
        if ((keys == null) || (keys.isEmpty()))         return null;
      }
 else {
        currentID=currentMap.get(currentID);
        if (currentID == null)         return null;
      }
    }
  }
  if (keys != null)   return (V)keys;
  return (V)currentID;
}

Fixed version (ground truth):
/** 
 * Tries to find the mapping from the source IDType to the destination IDType of the specified sourceID along a path of IDTypes where mappings exist. If no such path is found, null is returned. If the path includes multimappings, a Set of values is returned. Note that there will always be chosen a path that does not include multimappings over paths that include multimappings if more than one path exists.
 * @param < K > Type of the sourceID
 * @param < V > Type of the expected result of the mapping
 * @param source IDType of the source data
 * @param destination IDType of the destination data
 * @param sourceID ID for which the mapping shall be found
 * @return If no mapping is found, null, otherwise the corresponding ID, or Set of IDs.
 * @deprecated use {@link #getIDAsSet(IDType,IDType,Object)} instead
 */
@SuppressWarnings("String_Node_Str") public <K,V>V getID(IDType source,IDType destination,K sourceID){
  if (source.equals(destination))   return (V)sourceID;
  List<MappingType> path;
  try {
    path=DijkstraShortestPath.findPathBetween(mappingGraph,source,destination);
  }
 catch (  IllegalArgumentException e) {
    Logger.log(new Status(Status.ERROR,this.toString(),"String_Node_Str" + source + "String_Node_Str"+ destination+ "String_Node_Str"));
    return null;
  }
  if (path == null) {
    Logger.log(new Status(Status.ERROR,this.toString(),"String_Node_Str" + source + "String_Node_Str"+ destination));
    return null;
  }
  Object currentID=sourceID;
  Set<Object> keys=null;
  Collection<Object> values=new ArrayList<Object>();
  for (  MappingType edge : path) {
    Map<?,?> currentMap=hashMappingType2Map.get(edge);
    if (keys != null) {
      for (      Object key : keys) {
        if (edge.isMultiMap()) {
          Set<Object> temp=(Set<Object>)((MultiHashMap<?,?>)(currentMap)).getAll(key);
          if (temp != null)           values.addAll(temp);
        }
 else {
          Object value=currentMap.get(key);
          if (value != null)           values.add(value);
        }
      }
      if (values.isEmpty())       return null;
      keys=new HashSet<Object>();
      for (      Object value : values) {
        keys.add(value);
      }
      values.clear();
    }
 else {
      if (edge.isMultiMap()) {
        keys=(Set<Object>)((MultiHashMap<?,?>)(currentMap)).getAll(currentID);
        if ((keys == null) || (keys.isEmpty()))         return null;
      }
 else {
        currentID=currentMap.get(currentID);
        if (currentID == null)         return null;
      }
    }
  }
  if (keys != null)   return (V)keys;
  return (V)currentID;
}