Program: 160592
Project: 160592
Buggy source:
@Override public void registerInternalNewRevisionHandler(ServiceDescriptor serviceDescriptor,final NewRevisionHandler newRevisionHandler){
  register(serviceDescriptor,new Bimsie1RemoteServiceInterfaceAdaptor(){
    @Override public void newRevision(    final Long poid,    final Long roid,    Long soid,    String serviceIdentifier,    String profileIdentifier,    String token,    String apiUrl) throws UserException, ServerException {
      ServiceMapInterface serviceMapInterface=new ServiceMap(bimServer,null,AccessMethod.JSON);
      serviceMapInterface.add(Bimsie1RemoteServiceInterface.class,internalRemoteServiceInterfaces.get(serviceIdentifier));
      final InternalChannel internalChannel=new InternalChannel(bimServer.getServiceFactory(),bimServer.getServicesMap());
      try {
        internalChannel.connect(new SimpleTokenHolder());
      }
 catch (      ChannelConnectionException e2) {
        e2.printStackTrace();
      }
      try {
        final ServiceInterface serviceInterface=bimServer.getService(ServiceInterface.class);
        final SService service=serviceInterface.getService(Long.parseLong(profileIdentifier));
        final SObjectType settings=internalChannel.getPluginInterface().getPluginSettings(service.getInternalServiceId());
        final BimServerClient bimServerClient=bimServer.getBimServerClientFactory().create(new TokenAuthentication(token));
        new Thread(){
          @Override public void run(){
            try {
              newRevisionHandler.newRevision(bimServerClient,poid,roid,service.getOid(),settings);
            }
 catch (            ServerException e) {
              LOGGER.error("String_Node_Str",e);
            }
catch (            UserException e) {
              LOGGER.error("String_Node_Str",e);
            }
          }
        }
.start();
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void registerInternalNewRevisionHandler(ServiceDescriptor serviceDescriptor,final NewRevisionHandler newRevisionHandler){
  register(serviceDescriptor,new Bimsie1RemoteServiceInterfaceAdaptor(){
    @Override public void newRevision(    final Long poid,    final Long roid,    Long soid,    String serviceIdentifier,    String profileIdentifier,    String token,    String apiUrl) throws UserException, ServerException {
      ServiceMapInterface serviceMapInterface=new ServiceMap(bimServer,null,AccessMethod.JSON);
      serviceMapInterface.add(Bimsie1RemoteServiceInterface.class,internalRemoteServiceInterfaces.get(serviceIdentifier));
      final InternalChannel internalChannel=new InternalChannel(bimServer.getServiceFactory(),bimServer.getServicesMap());
      try {
        internalChannel.connect(new SimpleTokenHolder());
      }
 catch (      ChannelConnectionException e2) {
        e2.printStackTrace();
      }
      try {
        DatabaseSession session=bimServer.getDatabase().createSession();
        try {
          final InternalServicePluginConfiguration internalServicePluginConfiguration=session.get(Long.parseLong(profileIdentifier),Query.getDefault());
          final SObjectType settings=bimServer.getSConverter().convertToSObject(internalServicePluginConfiguration.getSettings());
          final BimServerClient bimServerClient=bimServer.getBimServerClientFactory().create(new TokenAuthentication(token));
          new Thread(){
            @Override public void run(){
              try {
                newRevisionHandler.newRevision(bimServerClient,poid,roid,internalServicePluginConfiguration.getOid(),settings);
              }
 catch (              ServerException e) {
                LOGGER.error("String_Node_Str",e);
              }
catch (              UserException e) {
                LOGGER.error("String_Node_Str",e);
              }
            }
          }
.start();
        }
  finally {
          session.close();
        }
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
);
}