Author: marius.bogoevici
Date: 2009-10-16 16:20:59 -0400 (Fri, 16 Oct 2009)
New Revision: 4158
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
Log:
Allow for Package.getPackageVersion() to return null.
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2009-10-16
19:34:39 UTC (rev 4157)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2009-10-16
20:20:59 UTC (rev 4158)
@@ -319,7 +319,13 @@
public static String getVersion()
{
Package pkg = WeldBootstrap.class.getPackage();
- return pkg != null ? Names.version(pkg.getImplementationVersion()) : null;
+ if (pkg != null)
+ {
+ //allow for the case when pkg.getImplementationVersion() == null
+ String pkgImplementationVersion = pkg.getImplementationVersion();
+ return pkgImplementationVersion != null ?
Names.version(pkgImplementationVersion) : null;
+ }
+ return null;
}
protected void initializeContexts()
Show replies by date