Menu

truncated URI in QName.fromClarkName

David Lee
2009-11-03
2012-10-08
  • David Lee

    David Lee - 2009-11-03

    The S9API function QName.fromClarkName truncates the URI by 1 letter.
    Version 9.1.0.5 of S9API
    Stepping through QName.fromClarkName()
    Passing the following string
    {http://demo.com/demo}test

    This code (line 144 in QName.java)
    namespaceURI = expandedName.substring(1, closeBrace - 1);

    Produces this for the URL (truncated by 1 character)
    "http://demo.com/dem"

    Changing the full clarkname to
    {http://demo.com/demoX}test

    works fine (it removes the "X") ...

    Since this function is public, and uses a public constructor under the hood it
    can be worked around by rewriting a fixed version of the function.

     
  • Michael Kay

    Michael Kay - 2009-11-06

    Thanks for reporting this, it is now logged on the bug tracker, and a fix is
    in Subversion for both the 9.1 and 9.2 branches.