Program: 160640
Project: 160640
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Set<T> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Map<Long,Revision> oidToRoidMap=new HashMap<Long,Revision>();
  Set<EidClash> clashDetections=bimServer.getClashDetectionCache().getClashDetection(clashDetectionSettings);
  if (clashDetections != null) {
    return (Set<T>)clashDetections;
  }
  Project project=null;
  IfcModelSet ifcModelSet=new IfcModelSet();
  for (  Revision revision : clashDetectionSettings.getRevisions()) {
    project=revision.getProject();
    for (    ConcreteRevision concreteRevision : revision.getConcreteRevisions()) {
      IfcModel source=new IfcModel();
      getDatabaseSession().getMap(source,concreteRevision.getProject().getId(),concreteRevision.getId(),true,null);
      source.setDate(concreteRevision.getDate());
      ifcModelSet.add(source);
      for (      Long oid : source.keySet()) {
        oidToRoidMap.put(oid,revision);
      }
    }
  }
  IfcModelInterface ifcModel=bimServer.getMergerFactory().createMerger().merge(project,ifcModelSet,false);
  IfcModel newModel=new IfcModel();
  Map<IdEObject,IdEObject> converted=new HashMap<IdEObject,IdEObject>();
  for (  IdEObject idEObject : ifcModel.getValues()) {
    if (!clashDetectionSettings.getIgnoredClasses().contains(idEObject.eClass().getName())) {
      cleanupModel(idEObject.eClass(),idEObject,newModel,ifcModel,converted);
    }
  }
  Collection<SerializerPlugin> allSerializerPlugins=bimServer.getPluginManager().getAllSerializerPlugins("String_Node_Str",true);
  if (!allSerializerPlugins.isEmpty()) {
    SerializerPlugin serializerPlugin=allSerializerPlugins.iterator().next();
    EmfSerializer ifcSerializer=serializerPlugin.createSerializer();
    try {
      ifcSerializer.init(newModel,null,bimServer.getPluginManager(),bimServer.getPluginManager().requireIfcEngine().createIfcEngine());
      byte[] bytes=ifcSerializer.getBytes();
      IfcEngine ifcEngine=bimServer.getPluginManager().requireIfcEngine().createIfcEngine();
      ifcEngine.init();
      try {
        IfcEngineModel ifcEngineModel=ifcEngine.openModel(bytes);
        try {
          Set<IfcEngineClash> clashes=ifcEngineModel.findClashesWithEids(clashDetectionSettings.getMargin());
          Set<EidClash> eidClashes=new HashSet<EidClash>();
          for (          IfcEngineClash clash : clashes) {
            EidClash eidClash=StoreFactory.eINSTANCE.createEidClash();
            eidClash.setEid1(clash.getEid1());
            eidClash.setEid2(clash.getEid2());
            eidClash.setName1(clash.getName1());
            eidClash.setName2(clash.getName2());
            eidClash.setType1(clash.getType1());
            eidClash.setType2(clash.getType2());
            eidClashes.add(eidClash);
          }
          bimServer.getClashDetectionCache().storeClashDetection(clashDetectionSettings,eidClashes);
          for (          EidClash clash : eidClashes) {
            IfcRoot object1=(IfcRoot)newModel.get(clash.getEid1());
            clash.setName1(object1.getName());
            clash.setType1(object1.eClass().getName());
            clash.setRevision1(oidToRoidMap.get(clash.getEid1()));
            IfcRoot object2=(IfcRoot)newModel.get(clash.getEid2());
            clash.setName2(object2.getName());
            clash.setType2(object2.eClass().getName());
            clash.setRevision2(oidToRoidMap.get(clash.getEid2()));
          }
          return (Set<T>)eidClashes;
        }
  finally {
          ifcEngineModel.close();
        }
      }
 catch (      PluginException e) {
        LOGGER.error("String_Node_Str",e);
      }
 finally {
        ifcEngine.close();
      }
    }
 catch (    PluginException e) {
      LOGGER.error("String_Node_Str",e);
    }
catch (    SerializerException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Set<T> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Map<Long,Revision> oidToRoidMap=new HashMap<Long,Revision>();
  Set<EidClash> clashDetections=bimServer.getClashDetectionCache().getClashDetection(clashDetectionSettings);
  if (clashDetections != null) {
    return (Set<T>)clashDetections;
  }
  Project project=null;
  IfcModelSet ifcModelSet=new IfcModelSet();
  for (  Revision revision : clashDetectionSettings.getRevisions()) {
    project=revision.getProject();
    for (    ConcreteRevision concreteRevision : revision.getConcreteRevisions()) {
      IfcModel source=new IfcModel();
      getDatabaseSession().getMap(source,concreteRevision.getProject().getId(),concreteRevision.getId(),true,null);
      source.setDate(concreteRevision.getDate());
      ifcModelSet.add(source);
      for (      Long oid : source.keySet()) {
        oidToRoidMap.put(oid,revision);
      }
    }
  }
  IfcModelInterface ifcModel=bimServer.getMergerFactory().createMerger().merge(project,ifcModelSet,false);
  IfcModel newModel=new IfcModel();
  Map<IdEObject,IdEObject> converted=new HashMap<IdEObject,IdEObject>();
  for (  IdEObject idEObject : ifcModel.getValues()) {
    if (!clashDetectionSettings.getIgnoredClasses().contains(idEObject.eClass().getName())) {
      cleanupModel(idEObject.eClass(),idEObject,newModel,ifcModel,converted);
    }
  }
  Collection<SerializerPlugin> allSerializerPlugins=bimServer.getPluginManager().getAllSerializerPlugins("String_Node_Str",true);
  if (!allSerializerPlugins.isEmpty()) {
    SerializerPlugin serializerPlugin=allSerializerPlugins.iterator().next();
    EmfSerializer ifcSerializer=serializerPlugin.createSerializer();
    try {
      try {
        ifcSerializer.init(newModel,null,bimServer.getPluginManager(),bimServer.getPluginManager().requireIfcEngine().createIfcEngine());
        byte[] bytes=ifcSerializer.getBytes();
        Plugin plugin=bimServer.getPluginManager().getPlugin("String_Node_Str",true);
        if (plugin != null && plugin instanceof IfcEnginePlugin) {
          IfcEnginePlugin ifcEnginePlugin=(IfcEnginePlugin)plugin;
          IfcEngine ifcEngine=ifcEnginePlugin.createIfcEngine();
          ifcEngine.init();
          IfcEngineModel ifcEngineModel=ifcEngine.openModel(bytes);
          try {
            Set<IfcEngineClash> clashes=ifcEngineModel.findClashesWithEids(clashDetectionSettings.getMargin());
            Set<EidClash> eidClashes=new HashSet<EidClash>();
            for (            IfcEngineClash clash : clashes) {
              EidClash eidClash=StoreFactory.eINSTANCE.createEidClash();
              eidClash.setEid1(clash.getEid1());
              eidClash.setEid2(clash.getEid2());
              eidClash.setName1(clash.getName1());
              eidClash.setName2(clash.getName2());
              eidClash.setType1(clash.getType1());
              eidClash.setType2(clash.getType2());
              eidClashes.add(eidClash);
            }
            bimServer.getClashDetectionCache().storeClashDetection(clashDetectionSettings,eidClashes);
            for (            EidClash clash : eidClashes) {
              IfcRoot object1=(IfcRoot)newModel.get(clash.getEid1());
              clash.setName1(object1.getName());
              clash.setType1(object1.eClass().getName());
              clash.setRevision1(oidToRoidMap.get(clash.getEid1()));
              IfcRoot object2=(IfcRoot)newModel.get(clash.getEid2());
              clash.setName2(object2.getName());
              clash.setType2(object2.eClass().getName());
              clash.setRevision2(oidToRoidMap.get(clash.getEid2()));
            }
            return (Set<T>)eidClashes;
          }
  finally {
            ifcEngineModel.close();
            ifcEngine.close();
          }
        }
      }
 catch (      PluginException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
 catch (    SerializerException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  return null;
}