Program: 160633
Project: 160633
Buggy source:
@Override public Integer checkin(final Long poid,final String comment,String deserializerName,Long fileSize,DataHandler dataHandler,Boolean merge,Boolean sync) throws ServerException, UserException {
  requireAuthenticationAndRunningServer();
  final BimDatabaseSession session=bimServer.getDatabase().createSession();
  try {
    File homeDirIncoming=new File(bimServer.getHomeDir(),"String_Node_Str");
    if (!homeDirIncoming.isDirectory()) {
      homeDirIncoming.mkdir();
    }
    File userDirIncoming=new File(homeDirIncoming,getCurrentUser().getUsername());
    if (!userDirIncoming.exists()) {
      userDirIncoming.mkdir();
    }
    InputStream inputStream=null;
    String fileName=dataHandler.getName();
    if (fileName == null || fileName.trim().equals("String_Node_Str")) {
      inputStream=dataHandler.getInputStream();
    }
 else {
      if (fileName.contains("String_Node_Str")) {
        fileName=fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
      }
      if (fileName.contains("String_Node_Str")) {
        fileName=fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
      }
      inputStream=new MultiplexingInputStream(dataHandler.getInputStream(),new FileOutputStream(new File(userDirIncoming,fileName)));
    }
    try {
      EmfDeserializer deserializer=bimServer.getEmfDeserializerFactory().createDeserializer(deserializerName);
      if (deserializer == null) {
        throw new UserException("String_Node_Str" + deserializerName + "String_Node_Str");
      }
      try {
        deserializer.init(bimServer.getPluginManager().requireSchemaDefinition());
      }
 catch (      PluginException e) {
        throw new UserException(e);
      }
      IfcModelInterface model=deserializer.read(inputStream,fileName,false,fileSize);
      User user=(User)session.get(StorePackage.eINSTANCE.getUser(),currentUoid,false,null);
      CheckinDatabaseAction checkinDatabaseAction=new CheckinDatabaseAction(bimServer,null,accessMethod,poid,currentUoid,model,comment,merge,true);
      LongCheckinAction longAction=new LongCheckinAction(bimServer,user,checkinDatabaseAction);
      bimServer.getLongActionManager().start(longAction);
      if (sync) {
        longAction.waitForCompletion();
      }
      return longAction.getId();
    }
 catch (    UserException e) {
      throw e;
    }
catch (    DeserializeException e) {
      throw new UserException(e);
    }
 finally {
      inputStream.close();
    }
  }
 catch (  UserException e) {
    throw e;
  }
catch (  Throwable e) {
    LOGGER.error("String_Node_Str",e);
    throw new ServerException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public Integer checkin(final Long poid,final String comment,String deserializerName,Long fileSize,DataHandler dataHandler,Boolean merge,Boolean sync) throws ServerException, UserException {
  requireAuthenticationAndRunningServer();
  final BimDatabaseSession session=bimServer.getDatabase().createSession();
  try {
    File homeDirIncoming=new File(bimServer.getHomeDir(),"String_Node_Str");
    if (!homeDirIncoming.isDirectory()) {
      homeDirIncoming.mkdir();
    }
    File userDirIncoming=new File(homeDirIncoming,getCurrentUser().getUsername());
    if (!userDirIncoming.exists()) {
      userDirIncoming.mkdir();
    }
    InputStream inputStream=null;
    String fileName=dataHandler.getName();
    if (fileName == null || fileName.trim().equals("String_Node_Str")) {
      inputStream=dataHandler.getInputStream();
    }
 else {
      if (fileName.contains("String_Node_Str")) {
        fileName=fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
      }
      if (fileName.contains("String_Node_Str")) {
        fileName=fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
      }
      inputStream=new MultiplexingInputStream(dataHandler.getInputStream(),new FileOutputStream(new File(userDirIncoming,fileName)));
    }
    try {
      EmfDeserializer deserializer=bimServer.getEmfDeserializerFactory().createDeserializer(deserializerName);
      if (deserializer == null) {
        throw new UserException("String_Node_Str" + deserializerName + "String_Node_Str");
      }
      try {
        deserializer.init(bimServer.getPluginManager().requireSchemaDefinition());
      }
 catch (      PluginException e) {
        throw new UserException(e);
      }
      IfcModelInterface model=deserializer.read(inputStream,fileName,false,fileSize);
      if (model.size() == 0) {
        throw new DeserializeException("String_Node_Str");
      }
      User user=(User)session.get(StorePackage.eINSTANCE.getUser(),currentUoid,false,null);
      CheckinDatabaseAction checkinDatabaseAction=new CheckinDatabaseAction(bimServer,null,accessMethod,poid,currentUoid,model,comment,merge,true);
      LongCheckinAction longAction=new LongCheckinAction(bimServer,user,checkinDatabaseAction);
      bimServer.getLongActionManager().start(longAction);
      if (sync) {
        longAction.waitForCompletion();
      }
      return longAction.getId();
    }
 catch (    UserException e) {
      throw e;
    }
catch (    DeserializeException e) {
      throw new UserException(e);
    }
 finally {
      inputStream.close();
    }
  }
 catch (  UserException e) {
    throw e;
  }
catch (  Throwable e) {
    LOGGER.error("String_Node_Str",e);
    throw new ServerException(e);
  }
 finally {
    session.close();
  }
}