sjsxp
  1. sjsxp
  2. SJSXP-21

IllegalStateException for XMLStreamReaderImpl.getLocalName() not thrown correctly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      21

      Description

      StAX specification states that an IllegalStateException should be thrown if
      XMLStreamReader.getLocalName() is called when not on START_ELEMENT,
      END_ELEMENT or ENTITY_REFERENCE.

      Current XMLStreamReaderImpl returns null.

      Unit test example using START_DOCUMENT:

      public void testGetLocalNameOnStartDocumentEvent() throws Exception

      { String xml = "<root></root>"; XMLInputFactory factory = XMLInputFactory.newInstance(); XMLStreamReader r = factory.createXMLStreamReader( new StringReader( xml ) ); r.require( XMLStreamReader.START_DOCUMENT, null, null); r.getLocalName(); fail("Expecting IllegalStateException"); }

        Activity

        Hide
        Santiago Pericas-Geertsen added a comment -

        Looks like a valid issue.

        Show
        Santiago Pericas-Geertsen added a comment - Looks like a valid issue.
        Hide
        Santiago Pericas-Geertsen added a comment -

        Fixed code to throw exception as explained in the issue's description.

        Show
        Santiago Pericas-Geertsen added a comment - Fixed code to throw exception as explained in the issue's description.

          People

          • Assignee:
            Santiago Pericas-Geertsen
            Reporter:
            jeffrey_sinclair
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: