xml-xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campana Jr., Salvatore J" <sal.camp...@hp.com>
Subject [PATCH] QNameHelper.suggestPrefix NullPointerException
Date Thu, 29 Jul 2004 21:06:38 GMT
I've encountered a NullPointer in the QNameHelper.suggestPrefix
operation.  If the passed-in namespace is null, then the call to
.length() will throw a NullPointerException
 
The proposed fix is to check for null, and if namespace==null return
"ns" as is done at the bottom of the method as a last resort for
determining a prefix....
========================================
public static String suggestPrefix(String namespace)
    {
        if (namespace == null)
            return "ns"; 

        String result = (String)WELL_KNOWN_PREFIXES.get(namespace);
        if (result != null)
            return result;
 
        int len = namespace.length();
     ....
=========================================


The attached [patched] file is from the current V1 src tree...the
problem exists in both V1 and V2 src trees..
 
Can we get this patch applied?
 
Thank you,
 
Sal Campana
 
________________________________



Sal Campana
HP Software
856.638.6284
sal_campana@hp.com <mailto:sal_campana@hp.com>  

<mailto:sal_campana@hp.com>  

 

Mime
View raw message