@Test public void testGetDefaultVersion() { String defaultVersion = "1.0"; String version = VersionUtil.getVersion(defaultVersion); Assert.assertEquals(defaultVersion, version); }
public static String getVersion(String defaultVersion) { try { String version = VersionUtil.class.getPackage().getImplementationVersion(); return StringUtil.isBlank(version) ? defaultVersion : version; } catch (Throwable e) { RecordLog.warn("Using default version, ignore exception", e); return defaultVersion; } }
VersionUtil { public static String getVersion(String defaultVersion) { try { String version = VersionUtil.class.getPackage().getImplementationVersion(); return StringUtil.isBlank(version) ? defaultVersion : version; } catch (Throwable e) { RecordLog.warn("Using default version, ignore exception", e); return defaultVersion; } } }
VersionUtil { public static String getVersion(String defaultVersion) { try { String version = VersionUtil.class.getPackage().getImplementationVersion(); return StringUtil.isBlank(version) ? defaultVersion : version; } catch (Throwable e) { RecordLog.warn("Using default version, ignore exception", e); return defaultVersion; } } private  VersionUtil(); }
VersionUtil { public static String getVersion(String defaultVersion) { try { String version = VersionUtil.class.getPackage().getImplementationVersion(); return StringUtil.isBlank(version) ? defaultVersion : version; } catch (Throwable e) { RecordLog.warn("Using default version, ignore exception", e); return defaultVersion; } } private  VersionUtil(); static String getVersion(String defaultVersion); }
VersionUtil { public static String getVersion(String defaultVersion) { try { String version = VersionUtil.class.getPackage().getImplementationVersion(); return StringUtil.isBlank(version) ? defaultVersion : version; } catch (Throwable e) { RecordLog.warn("Using default version, ignore exception", e); return defaultVersion; } } private  VersionUtil(); static String getVersion(String defaultVersion);  }