Program: 160457
Project: 160457
Buggy source:
@Override public Long checkinFromUrl(Long poid,String comment,Long deserializerOid,String fileName,String urlString,Boolean merge,Boolean sync) throws ServerException, UserException {
  requireAuthenticationAndRunningServer();
  final DatabaseSession session=getBimServer().getDatabase().createSession();
  String username="String_Node_Str";
  String userUsername="String_Node_Str";
  try {
    User user=(User)session.get(StorePackage.eINSTANCE.getUser(),getAuthorization().getUoid(),Query.getDefault());
    username=user.getName();
    userUsername=user.getUsername();
    Path homeDirIncoming=getBimServer().getHomeDir().resolve("String_Node_Str");
    if (!Files.isDirectory(homeDirIncoming)) {
      Files.createDirectory(homeDirIncoming);
    }
    Path userDirIncoming=homeDirIncoming.resolve(userUsername);
    if (!Files.exists(userDirIncoming)) {
      Files.createDirectory(userDirIncoming);
    }
    URL url=new URL(urlString);
    URLConnection openConnection=url.openConnection();
    InputStream input=openConnection.getInputStream();
    DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
    if (fileName == null) {
      if (urlString.contains("String_Node_Str")) {
        fileName=urlString.substring(urlString.lastIndexOf("String_Node_Str") + 1);
      }
 else {
        fileName=urlString;
      }
      fileName=URLDecoder.decode(fileName,Charsets.UTF_8.name());
    }
 else {
      fileName=dateFormat.format(new Date()) + "String_Node_Str" + fileName;
    }
    Path file=userDirIncoming.resolve(fileName);
    DeserializerPluginConfiguration deserializerPluginConfiguration=session.get(StorePackage.eINSTANCE.getDeserializerPluginConfiguration(),deserializerOid,Query.getDefault());
    if (deserializerPluginConfiguration == null) {
      throw new UserException("String_Node_Str" + deserializerOid + "String_Node_Str");
    }
    OutputStream outputStream=Files.newOutputStream(file);
    InputStream inputStream=new MultiplexingInputStream(input,outputStream);
    DeserializerPlugin deserializerPlugin=(DeserializerPlugin)getBimServer().getPluginManager().getPlugin(deserializerPluginConfiguration.getPluginDescriptor().getPluginClassName(),true);
    ObjectType settings=deserializerPluginConfiguration.getSettings();
    Deserializer deserializer=deserializerPlugin.createDeserializer(new PluginConfiguration(settings));
    deserializer.init(getBimServer().getDatabase().getMetaDataManager().getPackageMetaData("String_Node_Str"));
    IfcModelInterface model=deserializer.read(inputStream,fileName,0,null);
    CheckinDatabaseAction checkinDatabaseAction=new CheckinDatabaseAction(getBimServer(),null,getInternalAccessMethod(),poid,getAuthorization(),model,comment,fileName,merge);
    LongCheckinAction longAction=new LongCheckinAction(getBimServer(),username,userUsername,getAuthorization(),checkinDatabaseAction);
    getBimServer().getLongActionManager().start(longAction);
    if (sync) {
      longAction.waitForCompletion();
    }
    return longAction.getProgressTopic().getKey().getId();
  }
 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 Long checkinFromUrl(Long poid,String comment,Long deserializerOid,String fileName,String urlString,Boolean merge,Boolean sync) throws ServerException, UserException {
  requireAuthenticationAndRunningServer();
  final DatabaseSession session=getBimServer().getDatabase().createSession();
  String username="String_Node_Str";
  String userUsername="String_Node_Str";
  try {
    User user=(User)session.get(StorePackage.eINSTANCE.getUser(),getAuthorization().getUoid(),Query.getDefault());
    username=user.getName();
    userUsername=user.getUsername();
    Path homeDirIncoming=getBimServer().getHomeDir().resolve("String_Node_Str");
    if (!Files.isDirectory(homeDirIncoming)) {
      Files.createDirectory(homeDirIncoming);
    }
    Path userDirIncoming=homeDirIncoming.resolve(userUsername);
    if (!Files.exists(userDirIncoming)) {
      Files.createDirectory(userDirIncoming);
    }
    URL url=new URL(urlString);
    URLConnection openConnection=url.openConnection();
    InputStream input=openConnection.getInputStream();
    DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
    if (fileName == null) {
      if (urlString.contains("String_Node_Str")) {
        fileName=urlString.substring(urlString.lastIndexOf("String_Node_Str") + 1);
      }
 else {
        fileName=urlString;
      }
      fileName=URLDecoder.decode(fileName,Charsets.UTF_8.name());
    }
 else {
      fileName=dateFormat.format(new Date()) + "String_Node_Str" + fileName;
    }
    Path file=userDirIncoming.resolve(fileName);
    DeserializerPluginConfiguration deserializerPluginConfiguration=session.get(StorePackage.eINSTANCE.getDeserializerPluginConfiguration(),deserializerOid,Query.getDefault());
    if (deserializerPluginConfiguration == null) {
      throw new UserException("String_Node_Str" + deserializerOid + "String_Node_Str");
    }
    OutputStream outputStream=Files.newOutputStream(file);
    InputStream inputStream=new MultiplexingInputStream(input,outputStream);
    DeserializerPlugin deserializerPlugin=(DeserializerPlugin)getBimServer().getPluginManager().getPlugin(deserializerPluginConfiguration.getPluginDescriptor().getPluginClassName(),true);
    ObjectType settings=deserializerPluginConfiguration.getSettings();
    Deserializer deserializer=deserializerPlugin.createDeserializer(new PluginConfiguration(settings));
    deserializer.init(getBimServer().getDatabase().getMetaDataManager().getPackageMetaData("String_Node_Str"));
    IfcModelInterface model=deserializer.read(inputStream,fileName,0,null);
    CheckinDatabaseAction checkinDatabaseAction=new CheckinDatabaseAction(getBimServer(),null,getInternalAccessMethod(),poid,getAuthorization(),model,comment,fileName,merge);
    LongCheckinAction longAction=new LongCheckinAction(-1L,getBimServer(),username,userUsername,getAuthorization(),checkinDatabaseAction);
    getBimServer().getLongActionManager().start(longAction);
    if (sync) {
      longAction.waitForCompletion();
    }
    return longAction.getProgressTopic().getKey().getId();
  }
 catch (  UserException e) {
    throw e;
  }
catch (  Throwable e) {
    LOGGER.error("String_Node_Str",e);
    throw new ServerException(e);
  }
 finally {
    session.close();
  }
}