HHH-13837 Initialize the Hibernate VERSION as a real constant

This commit is contained in:
Sanne Grinovero 2020-01-30 20:19:35 +00:00
parent 5f302c57a7
commit cc7c7d7ee3
1 changed files with 10 additions and 12 deletions

View File

@ -16,27 +16,25 @@ import org.jboss.logging.Logger;
*
* @author Steve Ebersole
*/
public class Version {
private static String version;
public final class Version {
private static final String VERSION = initVersion();
private static String initVersion() {
final String version = Version.class.getPackage().getImplementationVersion();
return version != null ? version : "[WORKING]";
}
private Version() {
}
/**
* Access to the Hibernate version.
*
* IMPL NOTE : Real value is injected by the build.
* Access to the Hibernate ORM version.
*
* @return The Hibernate version
*/
public static String getVersionString() {
if ( version == null ) {
version = Version.class.getPackage().getImplementationVersion();
if ( version == null ) {
version = "[WORKING]";
}
}
return version;
return VERSION;
}
/**