<commit_before>package com.faforever.client.update;

import com.faforever.client.fx.PlatformService;
import com.faforever.client.i18n.I18n;
import com.faforever.client.notification.Action;
import com.faforever.client.notification.NotificationService;
import com.faforever.client.notification.PersistentNotification;
import com.faforever.client.task.TaskService;
import com.google.common.annotations.VisibleForTesting;
import org.apache.maven.artifact.versioning.ComparableVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import javax.annotation.Resource;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.util.Arrays;

import static com.faforever.client.io.Bytes.formatSize;
import static com.faforever.client.notification.Severity.INFO;
import static com.faforever.client.notification.Severity.WARN;
import static java.util.Collections.singletonList;
import static org.apache.commons.lang3.StringUtils.defaultString;

public class ClientUpdateServiceImpl implements ClientUpdateService {

  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
  private static final String DEVELOPMENT_VERSION_STRING = "dev";

  @Resource
  TaskService taskService;
  @Resource
  NotificationService notificationService;
  @Resource
  I18n i18n;
  @Resource
  PlatformService platformService;
  @Resource
  ApplicationContext applicationContext;

  @VisibleForTesting
  ComparableVersion currentVersion;

  public ClientUpdateServiceImpl() {
    currentVersion = new ComparableVersion(
        defaultString(getClass().getPackage().getImplementationVersion(), DEVELOPMENT_VERSION_STRING)
    );
  }

  @Override
  public void checkForUpdateInBackground() {
    CheckForUpdateTask task = applicationContext.getBean(CheckForUpdateTask.class);
    task.setCurrentVersion(currentVersion);<commit_msg>Fixes #340 Not the nicest way, but the quickest<commit_after>package com.faforever.client.update;

import com.faforever.client.fx.PlatformService;
import com.faforever.client.i18n.I18n;
import com.faforever.client.notification.Action;
import com.faforever.client.notification.NotificationService;
import com.faforever.client.notification.PersistentNotification;
import com.faforever.client.task.TaskService;
import com.google.common.annotations.VisibleForTesting;
import org.apache.maven.artifact.versioning.ComparableVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import javax.annotation.Resource;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.util.Arrays;

import static com.faforever.client.io.Bytes.formatSize;
import static com.faforever.client.notification.Severity.INFO;
import static com.faforever.client.notification.Severity.WARN;
import static java.util.Collections.singletonList;
import static org.apache.commons.lang3.StringUtils.defaultString;

public class ClientUpdateServiceImpl implements ClientUpdateService {

  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
  private static final String DEVELOPMENT_VERSION_STRING = "dev";

  @Resource
  TaskService taskService;
  @Resource
  NotificationService notificationService;
  @Resource
  I18n i18n;
  @Resource
  PlatformService platformService;
  @Resource
  ApplicationContext applicationContext;

  @VisibleForTesting
  ComparableVersion currentVersion;

  public ClientUpdateServiceImpl() {
    currentVersion = new ComparableVersion(
        defaultString(getClass().getPackage().getImplementationVersion(), DEVELOPMENT_VERSION_STRING)
    );
    logger.info("Current version: {}", currentVersion);
  }

  @Override
  public void checkForUpdateInBackground() {
    CheckForUpdateTask task = applicationContext.getBean(CheckForUpdateTask.class);
    task.setCurrentVersion(currentVersion);
{'fraction_non_alphanumeric': 0.08491508491508491, 'fraction_numerical': 0.006243756243756244, 'mean_word_length': 6.38929889298893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6721746', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1099, 'n_words': 208}