public static boolean versionDiffers(@NotNull File buildDir, int expectedVersion) {
    Path versionFile = getIndexDir(buildDir).toPath().resolve(VERSION_FILE);
    try (DataInputStream is = new DataInputStream(Files.newInputStream(versionFile))) {
      int currentIndexVersion = is.readInt();
      boolean isDiffer = currentIndexVersion != expectedVersion;
      if (isDiffer) {
        LOG.info("backward reference index version differ, expected = " + expectedVersion + ", current = " + currentIndexVersion);
      }
      return isDiffer;
    }
    catch (NoSuchFileException ignore) {
      LOG.info("backward reference index version doesn't exist");
    }
    catch (IOException e) {
      LOG.info("backward reference index version differ due to: " + e.getClass());
    }
    return true;
  }
public static boolean versionDiffers(@NotNull File buildDir, int expectedVersion)