@Test public void testGetCurrentVersion_ExpectNullByDefault() { NewVersionCheckerGitHubImpl f = new NewVersionCheckerGitHubImpl(); assertEquals(f.getCurrentVersion(), NewVersionCheckerGitHubImpl.VERSION_UNRESOLVED); }
@Override public String getCurrentVersion() { try { if (configuredVersion != null) { return configuredVersion; } String ret = NewVersionCheckerGitHubImpl.class.getPackage().getImplementationVersion(); Preconditions.checkState(StringUtils.hasText(ret), "ImplementationVersion cannot be resolved. Perhaps we're in the DEV mode"); return ret; } catch (Throwable t) { log.warn("Failed to resolve current application version", t); return VERSION_UNRESOLVED; } }
NewVersionCheckerGitHubImpl implements NewVersionChecker { @Override public String getCurrentVersion() { try { if (configuredVersion != null) { return configuredVersion; } String ret = NewVersionCheckerGitHubImpl.class.getPackage().getImplementationVersion(); Preconditions.checkState(StringUtils.hasText(ret), "ImplementationVersion cannot be resolved. Perhaps we're in the DEV mode"); return ret; } catch (Throwable t) { log.warn("Failed to resolve current application version", t); return VERSION_UNRESOLVED; } } }
NewVersionCheckerGitHubImpl implements NewVersionChecker { @Override public String getCurrentVersion() { try { if (configuredVersion != null) { return configuredVersion; } String ret = NewVersionCheckerGitHubImpl.class.getPackage().getImplementationVersion(); Preconditions.checkState(StringUtils.hasText(ret), "ImplementationVersion cannot be resolved. Perhaps we're in the DEV mode"); return ret; } catch (Throwable t) { log.warn("Failed to resolve current application version", t); return VERSION_UNRESOLVED; } }  }
NewVersionCheckerGitHubImpl implements NewVersionChecker { @Override public String getCurrentVersion() { try { if (configuredVersion != null) { return configuredVersion; } String ret = NewVersionCheckerGitHubImpl.class.getPackage().getImplementationVersion(); Preconditions.checkState(StringUtils.hasText(ret), "ImplementationVersion cannot be resolved. Perhaps we're in the DEV mode"); return ret; } catch (Throwable t) { log.warn("Failed to resolve current application version", t); return VERSION_UNRESOLVED; } }  @Override UpdatePackageInfo findNewUpdateIfAvailable(); @Override String getCurrentVersion(); static String getVerisonsInfo(); String getConfiguredVersion(); void setConfiguredVersion(String version); }
NewVersionCheckerGitHubImpl implements NewVersionChecker { @Override public String getCurrentVersion() { try { if (configuredVersion != null) { return configuredVersion; } String ret = NewVersionCheckerGitHubImpl.class.getPackage().getImplementationVersion(); Preconditions.checkState(StringUtils.hasText(ret), "ImplementationVersion cannot be resolved. Perhaps we're in the DEV mode"); return ret; } catch (Throwable t) { log.warn("Failed to resolve current application version", t); return VERSION_UNRESOLVED; } }  @Override UpdatePackageInfo findNewUpdateIfAvailable(); @Override String getCurrentVersion(); static String getVerisonsInfo(); String getConfiguredVersion(); void setConfiguredVersion(String version); static final String DEV_VERSION; }