public static @Nullable BuildNumber fromString(@NotNull String version, @Nullable String pluginName, @Nullable String productCodeIfAbsentInVersion) {
    if (version.isEmpty()) {
      return null;
    }

    String code = version;
    int productSeparator = code.indexOf('-');
    String productCode;
    if (productSeparator > 0) {
      productCode = code.substring(0, productSeparator);
      code = code.substring(productSeparator + 1);
    }
    else {
      productCode = productCodeIfAbsentInVersion == null ? "" : productCodeIfAbsentInVersion;
    }

    if (SNAPSHOT.equals(code) || isPlaceholder(code)) {
      return new BuildNumber(productCode, currentVersion().myComponents);
    }

    int baselineVersionSeparator = code.indexOf('.');

    if (baselineVersionSeparator > 0) {
      String baselineVersionString = code.substring(0, baselineVersionSeparator);
      if (baselineVersionString.trim().isEmpty()) {
        return null;
      }

      String[] stringComponents = code.split("\\.");
      int[] intComponentList = new int[stringComponents.length];
      for (int i = 0, n = stringComponents.length; i < n; i++) {
        String stringComponent = stringComponents[i];
        int component = parseBuildNumber(version, stringComponent, pluginName);
        intComponentList[i] = component;
        if (component == SNAPSHOT_VALUE && (i + 1) != n) {
          intComponentList = Arrays.copyOf(intComponentList, i + 1);
          break;
        }
      }
      return new BuildNumber(productCode, intComponentList);
    }
    else {
      int buildNumber = parseBuildNumber(version, code, pluginName);
      if (buildNumber <= 2000) {
        // it's probably a baseline, not a build number
        return new BuildNumber(productCode, buildNumber, 0);
      }

      int baselineVersion = getBaseLineForHistoricBuilds(buildNumber);
      return new BuildNumber(productCode, baselineVersion, buildNumber);
    }
  }
public static @Nullable BuildNumber fromString(@NotNull String version, @Nullable String pluginName, @Nullable String productCodeIfAbsentInVersion)