Program: 160469
Project: 160469
Buggy source:
@Override public void process() throws BimserverDatabaseException, UserException, ServerException {
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    Project project=session.get(StorePackage.eINSTANCE.getProject(),poid,Query.getDefault());
    if (project == null) {
      LOGGER.error("String_Node_Str" + poid + "String_Node_Str");
      return;
    }
    Revision revision=session.get(StorePackage.eINSTANCE.getRevision(),roid,Query.getDefault());
    if (project.isSendEmailOnNewRevision() && sendEmail) {
      sendEmail(session,project,revision);
    }
    for (    Service service : project.getServices()) {
      if (soid == -1 || service.getOid() == soid) {
        triggerNewRevision(session,getBimServer().getNotificationsManager(),getBimServer(),getBimServer().getNotificationsManager().getSiteAddress(),project,roid,Trigger.NEW_REVISION,service);
      }
    }
    if (soid == -1) {
      NewRevisionTopic newRevisionTopic=getBimServer().getNotificationsManager().getNewRevisionTopic();
      if (newRevisionTopic != null) {
        newRevisionTopic.process(session,poid,roid,this);
      }
      NewRevisionOnSpecificProjectTopic newRevisionOnSpecificProjectTopic=getBimServer().getNotificationsManager().getNewRevisionOnSpecificProjectTopic(new NewRevisionOnSpecificProjectTopicKey(poid));
      if (newRevisionOnSpecificProjectTopic != null) {
        newRevisionOnSpecificProjectTopic.process(session,poid,roid,this);
      }
    }
  }
  finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void process() throws BimserverDatabaseException, UserException, ServerException {
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    Project project=session.get(StorePackage.eINSTANCE.getProject(),poid,Query.getDefault());
    if (project == null) {
      LOGGER.error("String_Node_Str" + poid + "String_Node_Str");
      return;
    }
    Revision revision=session.get(StorePackage.eINSTANCE.getRevision(),roid,Query.getDefault());
    if (revision == null) {
      LOGGER.error("String_Node_Str" + roid + "String_Node_Str");
      return;
    }
    if (project.isSendEmailOnNewRevision() && sendEmail) {
      sendEmail(session,project,revision);
    }
    for (    Service service : project.getServices()) {
      if (soid == -1 || service.getOid() == soid) {
        triggerNewRevision(session,getBimServer().getNotificationsManager(),getBimServer(),getBimServer().getNotificationsManager().getSiteAddress(),project,roid,Trigger.NEW_REVISION,service);
      }
    }
    if (soid == -1) {
      NewRevisionTopic newRevisionTopic=getBimServer().getNotificationsManager().getNewRevisionTopic();
      if (newRevisionTopic != null) {
        newRevisionTopic.process(session,poid,roid,this);
      }
      NewRevisionOnSpecificProjectTopic newRevisionOnSpecificProjectTopic=getBimServer().getNotificationsManager().getNewRevisionOnSpecificProjectTopic(new NewRevisionOnSpecificProjectTopicKey(poid));
      if (newRevisionOnSpecificProjectTopic != null) {
        newRevisionOnSpecificProjectTopic.process(session,poid,roid,this);
      }
    }
  }
  finally {
    session.close();
  }
}