You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Campana Jr., Salvatore J" <sa...@hp.com> on 2004/07/29 23:06:38 UTC

[PATCH] QNameHelper.suggestPrefix NullPointerException

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 <ma...@hp.com>  

<ma...@hp.com>