Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1611

XIncludeTextReader doesn't handle null Content Types properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • XInclude 1.0
    • None

    Description

      In XIncludeTextReader.getReader(), its gets the rawContentType for the URL connection (line 152) which is returning null in my environment. I'm running tests in an OSGI environment parsing an XML document that xincludes multiple small plain text files that are stored inside bundles. I guess this is the reason why the ContentType is coming back as null (And it works fine when files are on filesystem.) But URLConnection is allowed to return nulls from getContentType() so XIncludeTextReader should be able to handle it regardless.

      XIncludeTextReader checks if it's null correctly on line 155, but starting at line 184, it assumes rawContentType is not null and line 184 throws a NullPointerException.

      Older versions were affected by this too but still an issue with latest release and looks as in current trunk

      Attachments

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            sbuberl Steven Buberl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: