[SMX4-329]jaxb-api bundle should throw JAXBException when contextPath is empty string

git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx4/specs/trunk@801051 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java b/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java
index 2fc1537..3c8f29c 100644
--- a/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java
+++ b/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java
@@ -32,6 +32,9 @@
 
     public static JAXBContext find(String contextPath, ClassLoader classLoader, Map properties) throws JAXBException {
         String className = null;
+        if (contextPath == null || contextPath.length() == 0) {
+            throw new JAXBException("Invalid contextPath");
+        }
         String[] packages = contextPath.split(":");
         if (packages == null || packages.length == 0) {
             throw new JAXBException("Invalid contextPath");
diff --git a/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java b/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java
index 2fc1537..3c8f29c 100644
--- a/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java
+++ b/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java
@@ -32,6 +32,9 @@
 
     public static JAXBContext find(String contextPath, ClassLoader classLoader, Map properties) throws JAXBException {
         String className = null;
+        if (contextPath == null || contextPath.length() == 0) {
+            throw new JAXBException("Invalid contextPath");
+        }
         String[] packages = contextPath.split(":");
         if (packages == null || packages.length == 0) {
             throw new JAXBException("Invalid contextPath");