Program: 58828
Project: 58828
Buggy source:
/** 
 * Method takes a map that contains identifier codes and creates a new resolved codes. Resolving means mapping from code to internal ID.
 */
@Override @SuppressWarnings("String_Node_Str") public <KeyType,ValueType>void createCodeResolvedMap(EMappingType mappingType,EMappingType destMappingType){
  Map codeResolvedMap=null;
  int iMappingErrors=0;
  EIDType originKeyType=mappingType.getTypeOrigin();
  EIDType originValueType=mappingType.getTypeTarget();
  EIDType destKeyType=destMappingType.getTypeOrigin();
  EIDType destValueType=destMappingType.getTypeTarget();
  Map<KeyType,ValueType> srcMap=(Map<KeyType,ValueType>)hashType2Mapping.get(mappingType);
  if (mappingType != EMappingType.REFSEQ_MRNA_2_DAVID) {
    hashType2Mapping.remove(mappingType);
  }
  if (originKeyType == destKeyType) {
    if (originValueType != destValueType) {
      if (originKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.INT) {
        codeResolvedMap=new HashMap<Integer,Integer>();
        EMappingType conversionType=EMappingType.valueOf(originValueType + "String_Node_Str" + destValueType);
        if (!mappingType.isMultiMap()) {
          codeResolvedMap=new HashMap<Integer,Integer>();
          for (          KeyType key : srcMap.keySet()) {
            codeResolvedMap.put(key,generalManager.getIDMappingManager().getID(conversionType,srcMap.get(key)));
          }
        }
 else {
          codeResolvedMap=new MultiHashMap<Integer,Integer>();
          MultiHashMap<Integer,String> srcMultiMap=(MultiHashMap<Integer,String>)srcMap;
          Integer iID=0;
          for (          KeyType key : srcMap.keySet()) {
            for (            String sID : srcMultiMap.getAll(key)) {
              iID=generalManager.getIDMappingManager().getID(conversionType,sID);
              if (iID == null || iID == -1) {
                continue;
              }
              codeResolvedMap.put(key,iID);
            }
          }
        }
      }
 else       if (originKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<Integer,String>();
        throw new RuntimeException("String_Node_Str");
      }
 else       if (originKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<String,String>();
        throw new RuntimeException("String_Node_Str");
      }
 else       if (originKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.INT) {
        EMappingType conversionType=EMappingType.valueOf(originValueType + "String_Node_Str" + destValueType);
        if (!mappingType.isMultiMap()) {
          codeResolvedMap=new HashMap<String,Integer>();
          for (          KeyType key : srcMap.keySet()) {
            codeResolvedMap.put(key,generalManager.getIDMappingManager().getID(conversionType,srcMap.get(key)));
          }
        }
 else {
          codeResolvedMap=new MultiHashMap<String,Integer>();
          MultiHashMap<String,String> srcMultiMap=(MultiHashMap<String,String>)srcMap;
          Integer iID=0;
          for (          KeyType key : srcMap.keySet()) {
            for (            String sID : srcMultiMap.getAll(key)) {
              iID=generalManager.getIDMappingManager().getID(conversionType,sID);
              if (iID == null || iID == -1) {
                continue;
              }
              codeResolvedMap.put(key,iID);
            }
          }
        }
      }
    }
  }
 else {
    if (originValueType == destValueType) {
      if (destKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.INT) {
        codeResolvedMap=new HashMap<Integer,Integer>();
        EMappingType conversionType=EMappingType.valueOf(originKeyType + "String_Node_Str" + destKeyType);
        if (!mappingType.isMultiMap()) {
          codeResolvedMap=new HashMap<Integer,Integer>();
          for (          KeyType key : srcMap.keySet()) {
            codeResolvedMap.put(generalManager.getIDMappingManager().getID(conversionType,key),srcMap.get(key));
          }
        }
 else {
          codeResolvedMap=new MultiHashMap<Integer,Integer>();
          MultiHashMap<String,Integer> srcMultiMap=(MultiHashMap<String,Integer>)srcMap;
          Integer iResolvedID=0;
          for (          KeyType key : srcMap.keySet()) {
            iResolvedID=generalManager.getIDMappingManager().getID(conversionType,key);
            if (iResolvedID == null) {
              generalManager.getLogger().log(new Status(Status.WARNING,GeneralManager.PLUGIN_ID,iMappingErrors++ + "String_Node_Str" + key));
              continue;
            }
            for (            Integer iID : srcMultiMap.getAll(key)) {
              if (iID == null) {
                continue;
              }
              codeResolvedMap.put(iResolvedID,iID);
            }
          }
        }
      }
 else       if (destKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<Integer,String>();
        EMappingType conversionType=EMappingType.valueOf(originKeyType + "String_Node_Str" + destKeyType);
        for (        KeyType key : srcMap.keySet()) {
          codeResolvedMap.put(generalManager.getIDMappingManager().getID(conversionType,key),srcMap.get(key));
        }
      }
 else       if (destKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<String,String>();
        throw new RuntimeException("String_Node_Str");
      }
 else       if (destKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.INT) {
        codeResolvedMap=new HashMap<String,Integer>();
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  hashType2Mapping.put(destMappingType,codeResolvedMap);
}

Fixed version (ground truth):
/** 
 * Method takes a map that contains identifier codes and creates a new resolved codes. Resolving means mapping from code to internal ID.
 */
@Override @SuppressWarnings("String_Node_Str") public <KeyType,ValueType>void createCodeResolvedMap(EMappingType mappingType,EMappingType destMappingType){
  Map codeResolvedMap=null;
  EIDType originKeyType=mappingType.getTypeOrigin();
  EIDType originValueType=mappingType.getTypeTarget();
  EIDType destKeyType=destMappingType.getTypeOrigin();
  EIDType destValueType=destMappingType.getTypeTarget();
  Map<KeyType,ValueType> srcMap=(Map<KeyType,ValueType>)hashType2Mapping.get(mappingType);
  if (mappingType != EMappingType.REFSEQ_MRNA_2_DAVID) {
    hashType2Mapping.remove(mappingType);
  }
  if (originKeyType == destKeyType) {
    if (originValueType != destValueType) {
      if (originKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.INT) {
        codeResolvedMap=new HashMap<Integer,Integer>();
        EMappingType conversionType=EMappingType.valueOf(originValueType + "String_Node_Str" + destValueType);
        if (!mappingType.isMultiMap()) {
          codeResolvedMap=new HashMap<Integer,Integer>();
          for (          KeyType key : srcMap.keySet()) {
            codeResolvedMap.put(key,generalManager.getIDMappingManager().getID(conversionType,srcMap.get(key)));
          }
        }
 else {
          codeResolvedMap=new MultiHashMap<Integer,Integer>();
          MultiHashMap<Integer,String> srcMultiMap=(MultiHashMap<Integer,String>)srcMap;
          Integer iID=0;
          for (          KeyType key : srcMap.keySet()) {
            for (            String sID : srcMultiMap.getAll(key)) {
              iID=generalManager.getIDMappingManager().getID(conversionType,sID);
              if (iID == null || iID == -1) {
                continue;
              }
              codeResolvedMap.put(key,iID);
            }
          }
        }
      }
 else       if (originKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<Integer,String>();
        throw new RuntimeException("String_Node_Str");
      }
 else       if (originKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<String,String>();
        throw new RuntimeException("String_Node_Str");
      }
 else       if (originKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.INT) {
        EMappingType conversionType=EMappingType.valueOf(originValueType + "String_Node_Str" + destValueType);
        if (!mappingType.isMultiMap()) {
          codeResolvedMap=new HashMap<String,Integer>();
          for (          KeyType key : srcMap.keySet()) {
            codeResolvedMap.put(key,generalManager.getIDMappingManager().getID(conversionType,srcMap.get(key)));
          }
        }
 else {
          codeResolvedMap=new MultiHashMap<String,Integer>();
          MultiHashMap<String,String> srcMultiMap=(MultiHashMap<String,String>)srcMap;
          Integer iID=0;
          for (          KeyType key : srcMap.keySet()) {
            for (            String sID : srcMultiMap.getAll(key)) {
              iID=generalManager.getIDMappingManager().getID(conversionType,sID);
              if (iID == null || iID == -1) {
                continue;
              }
              codeResolvedMap.put(key,iID);
            }
          }
        }
      }
    }
  }
 else {
    if (originValueType == destValueType) {
      if (destKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.INT) {
        codeResolvedMap=new HashMap<Integer,Integer>();
        EMappingType conversionType=EMappingType.valueOf(originKeyType + "String_Node_Str" + destKeyType);
        if (!mappingType.isMultiMap()) {
          codeResolvedMap=new HashMap<Integer,Integer>();
          for (          KeyType key : srcMap.keySet()) {
            codeResolvedMap.put(generalManager.getIDMappingManager().getID(conversionType,key),srcMap.get(key));
          }
        }
 else {
          codeResolvedMap=new MultiHashMap<Integer,Integer>();
          MultiHashMap<String,Integer> srcMultiMap=(MultiHashMap<String,Integer>)srcMap;
          Integer iResolvedID=0;
          for (          KeyType key : srcMap.keySet()) {
            iResolvedID=generalManager.getIDMappingManager().getID(conversionType,key);
            if (iResolvedID == null) {
              continue;
            }
            for (            Integer iID : srcMultiMap.getAll(key)) {
              if (iID == null) {
                continue;
              }
              codeResolvedMap.put(iResolvedID,iID);
            }
          }
        }
      }
 else       if (destKeyType.getStorageType() == EStorageType.INT && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<Integer,String>();
        EMappingType conversionType=EMappingType.valueOf(originKeyType + "String_Node_Str" + destKeyType);
        for (        KeyType key : srcMap.keySet()) {
          codeResolvedMap.put(generalManager.getIDMappingManager().getID(conversionType,key),srcMap.get(key));
        }
      }
 else       if (destKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.STRING) {
        codeResolvedMap=new HashMap<String,String>();
        throw new RuntimeException("String_Node_Str");
      }
 else       if (destKeyType.getStorageType() == EStorageType.STRING && destValueType.getStorageType() == EStorageType.INT) {
        codeResolvedMap=new HashMap<String,Integer>();
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  hashType2Mapping.put(destMappingType,codeResolvedMap);
}