geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r790779 - in /geronimo/specs/trunk: geronimo-jaxb_2.0_spec/src/main/java/javax/xml/bind/ContextFinder.java geronimo-jaxb_2.1_spec/src/main/java/javax/xml/bind/ContextFinder.java
Date Fri, 03 Jul 2009 02:39:49 GMT
Author: xuhaihong
Date: Fri Jul  3 02:39:49 2009
New Revision: 790779

URL: http://svn.apache.org/viewvc?rev=790779&view=rev
Log:
GERONIMO-4724 Empty string for contextPath should not be allowed

Modified:
    geronimo/specs/trunk/geronimo-jaxb_2.0_spec/src/main/java/javax/xml/bind/ContextFinder.java
    geronimo/specs/trunk/geronimo-jaxb_2.1_spec/src/main/java/javax/xml/bind/ContextFinder.java

Modified: geronimo/specs/trunk/geronimo-jaxb_2.0_spec/src/main/java/javax/xml/bind/ContextFinder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxb_2.0_spec/src/main/java/javax/xml/bind/ContextFinder.java?rev=790779&r1=790778&r2=790779&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxb_2.0_spec/src/main/java/javax/xml/bind/ContextFinder.java
(original)
+++ geronimo/specs/trunk/geronimo-jaxb_2.0_spec/src/main/java/javax/xml/bind/ContextFinder.java
Fri Jul  3 02:39:49 2009
@@ -31,11 +31,12 @@
     private static final String JAXB_CONTEXT_FACTORY = JAXBContext.JAXB_CONTEXT_FACTORY;
 
     public static JAXBContext find(String contextPath, ClassLoader classLoader, Map properties)
throws JAXBException {
-        String className = null;
-        String[] packages = contextPath.split(":");
-        if (packages == null || packages.length == 0) {
+        contextPath = contextPath.trim();
+        if (contextPath.length() == 0 || contextPath.equals(":")) {
             throw new JAXBException("Invalid contextPath");
         }
+        String className = null;
+        String[] packages = contextPath.split("[:]");
         for (String pkg : packages) {
             String url = pkg.replace('.', '/') + "/jaxb.properties";
             className = loadClassNameFromProperties(url, classLoader);

Modified: geronimo/specs/trunk/geronimo-jaxb_2.1_spec/src/main/java/javax/xml/bind/ContextFinder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxb_2.1_spec/src/main/java/javax/xml/bind/ContextFinder.java?rev=790779&r1=790778&r2=790779&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxb_2.1_spec/src/main/java/javax/xml/bind/ContextFinder.java
(original)
+++ geronimo/specs/trunk/geronimo-jaxb_2.1_spec/src/main/java/javax/xml/bind/ContextFinder.java
Fri Jul  3 02:39:49 2009
@@ -31,11 +31,12 @@
     private static final String JAXB_CONTEXT_FACTORY = JAXBContext.JAXB_CONTEXT_FACTORY;
 
     public static JAXBContext find(String contextPath, ClassLoader classLoader, Map properties)
throws JAXBException {
-        String className = null;
-        String[] packages = contextPath.split(":");
-        if (packages == null || packages.length == 0) {
+        contextPath = contextPath.trim();
+        if (contextPath.length() == 0 || contextPath.equals(":")) {
             throw new JAXBException("Invalid contextPath");
         }
+        String className = null;
+        String[] packages = contextPath.split("[:]");
         for (String pkg : packages) {
             String url = pkg.replace('.', '/') + "/jaxb.properties";
             className = loadClassNameFromProperties(url, classLoader);



Mime
View raw message