Author: pete.muir(a)jboss.org
Date: 2009-10-15 09:39:52 -0400 (Thu, 15 Oct 2009)
New Revision: 4107
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java
Log:
Nicer version string
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-15
06:46:13 UTC (rev 4106)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2009-10-15
13:39:52 UTC (rev 4107)
@@ -64,6 +64,7 @@
import org.jboss.weld.resources.spi.ResourceLoader;
import org.jboss.weld.servlet.ServletApiAbstraction;
import org.jboss.weld.transaction.spi.TransactionServices;
+import org.jboss.weld.util.Names;
import org.jboss.weld.util.serviceProvider.ServiceLoader;
import org.jboss.weld.ws.WSApiAbstraction;
@@ -318,7 +319,7 @@
public static String getVersion()
{
Package pkg = WeldBootstrap.class.getPackage();
- return pkg != null ? pkg.getImplementationVersion() : null;
+ return pkg != null ? Names.version(pkg.getImplementationVersion()) : null;
}
protected void initializeContexts()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java 2009-10-15 06:46:13 UTC
(rev 4106)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java 2009-10-15 13:39:52 UTC
(rev 4107)
@@ -332,5 +332,10 @@
buffer.append("]");
return buffer.toString();
}
+
+ public static String version(String version)
+ {
+ return new StringBuilder().append(version.substring(0,
version.lastIndexOf("-"))).append("
(").append(version.substring(version.lastIndexOf("-") +
1)).append(")").toString();
+ }
}
Show replies by date