jaxp
  1. jaxp
  2. JAXP-51

XPath.compile() in std impl of Java5 throws XPathExpressionException with unhelpful null message

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: All

    • Issuezilla Id:
      51

      Description

      At this moment, this defect still needs some verification and qualification as
      to what versions it applies to.

      I noticed this using the latest Java 5 standard implementation of XPath capability.

      If you feed some garbage string to an XPath object's "compile()" method, it will
      throw (as expected) an XPathExpressionException. But when you call getMessage()
      on that exception, it returns null. What I would expect here is a message
      identifying what went wrong during the parsing or compiling, even if it is
      relatively generic.

      Generally speaking, exceptions with no message are reasonable only if the class
      name itself is all you need to know. In this case, anyone trying to craft an
      XPath expression will need more information than just that it doesn't compile.
      Where was the error? What type of error was it? What token was unexpected? Etc.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jaxp-issues
            Reporter:
            kwblackwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: