[weld-commits] Weld SVN: r5641 - core/trunk/impl/src/main/java/org/jboss/weld/util.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Jan 27 12:09:29 EST 2010


Author: pete.muir at jboss.org
Date: 2010-01-27 12:09:28 -0500 (Wed, 27 Jan 2010)
New Revision: 5641

Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java
Log:
always check we can split the string first

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	2010-01-27 17:02:07 UTC (rev 5640)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Names.java	2010-01-27 17:09:28 UTC (rev 5641)
@@ -223,10 +223,16 @@
       if (version != null)
       {
          StringBuilder builder = new StringBuilder();
-         builder.append(version.substring(0, version.indexOf("."))).append(".");
-         version = version.substring(version.indexOf(".") + 1);
-         builder.append(version.substring(0, version.indexOf("."))).append(".");
-         version = version.substring(version.indexOf(".") + 1);
+         if (version.indexOf(".") > 0)
+         {
+            builder.append(version.substring(0, version.indexOf("."))).append(".");
+            version = version.substring(version.indexOf(".") + 1);
+         }
+         if (version.indexOf(".") > 0)
+         {
+            builder.append(version.substring(0, version.indexOf("."))).append(".");
+            version = version.substring(version.indexOf(".") + 1);
+         }
          if (version.indexOf("-") > 0)
          {
             builder.append(version.substring(0, version.indexOf("-"))).append(" (");



More information about the weld-commits mailing list