Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-48

Bug with Root.fetch ( Splay parent, QName name, QNameSet set, int n )

    XMLWordPrintableJSON

Details

    Description

      I've attached a simple example of an issue I am seeing. This is in the v1 codebase...Have not check v2 (assuming the same)

      Basically I cannot get the value of a child element via the generated getter:

      StateInformation resourceState = resState.getResourceState();
      //should return a string...
      String state = resourceState.getState();
      System.out.println("State: " + state);//null!

      What I see in the debugger is:

      Root.fetch ( ...)
      ...
      (line 3314)case BEGIN :
      if (nameHit( name, set, s.getName() ))

      { _child = s; _n = 0; break loop; }

      //This is the issue in this context...In this case it should continue in the loop, not set to "finish"
      s = s.getFinishSplay();
      break;
      ...

      So when we get the BEGIN case, the s.getName() is ResourceState and "name" is "State". The name I am looking for is State (child of ResourceState). Since the names do not match the call to "s = s.getFinishSplay()" sets the Splay to the end of the element. Then the loop moves on past that element....Maybe it thinks it's the child element and not the root??

      Had "s = s.getFinishSplay()" not been called, then the next time through the loop (Splay s = parent.nextSplay()) would get the Splay named "State" and the names would match and everything would be happy.....

      The example code and generated types can be used to produce the problem....

      Attachments

        1. xmltypes-muws.jar
          132 kB
          Sal Campana
        2. SplayTest.java
          0.9 kB
          Sal Campana
        3. MUWS.xsd
          3 kB
          Sal Campana
        4. MUWS.wsdl
          2 kB
          Sal Campana

        Activity

          People

            Unassigned Unassigned
            scampana Sal Campana
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: