Author: richard.opalka(a)jboss.com
Date: 2010-09-15 08:02:22 -0400 (Wed, 15 Sep 2010)
New Revision: 12974
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java
Log:
[JBWS-2951] fixing NPE in JavaUtils - package retrieval
Modified: common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java 2010-09-15 10:32:31 UTC
(rev 12973)
+++ common/trunk/src/main/java/org/jboss/wsf/common/JavaUtils.java 2010-09-15 12:02:22 UTC
(rev 12974)
@@ -565,7 +565,8 @@
public static String getPackageName(Class<?> clazz)
{
String fullName = clazz.getName();
- return fullName.substring(0, fullName.lastIndexOf("."));
+ int dotIndex = fullName.lastIndexOf(".");
+ return dotIndex == -1 ? "" : fullName.substring(0, dotIndex);
}
public static boolean isReservedKeyword(String keyword)
Show replies by date