Message:

   The following issue has been closed.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/JIBX-11

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JIBX-11
    Summary: getNamedStructure returns null instead of throwing exception
       Type: Bug

     Status: Closed
   Priority: Minor
 Resolution: FIXED

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: JiBX
 Components: 
             core
   Fix Fors:
             CVS
   Versions:
             1.0-beta3a

   Assignee: Dennis Sosnoski
   Reporter: Cameron Taggart

    Created: Wed, 14 Apr 2004 12:27 PM
    Updated: Mon, 5 Jul 2004 6:45 PM

Description:
I think this mainly has to do with the using/label stuff which you are reworking.  I 
was trying to troubleshoot a couple of issues with the xsd2jibx servlet example, but 
the NullPointerException that the JiBX binding compiler was throwing wasn't very 
helpful.  

DefinitionContent.java can be modified like so:

From:

    public IComponent getNamedStructure(String name) throws JiBXException {

        // check for named component defined at this level
        if (m_namedStructureMap == null) {
            return m_context.getNamedStructure(name);
        } else {
            return (IComponent)m_namedStructureMap.get(name);
        }
    }

To:

    public IComponent getNamedStructure(String name) throws JiBXException {
        IComponent icomponent = null;
        // check for named component defined at this level
        if (m_namedStructureMap == null) {
          icomponent = m_context.getNamedStructure(name);
        } else {
          icomponent = (IComponent)m_namedStructureMap.get(name);
        }
        if( icomponent == null ){
          throw new JiBXException( "Unable to get structure named: " + name );
        }
        return icomponent;
    }

Actually knowing what "using" reference was causing the problem helped me track down 
an xsd2jibx bug and is usefull when troubleshooting the binding compiler.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
jibx-devs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to