Svatopluk Šperka created JENA-347:
-------------------------------------

             Summary: NodecSSE decode problem
                 Key: JENA-347
                 URL: https://issues.apache.org/jira/browse/JENA-347
             Project: Apache Jena
          Issue Type: Bug
          Components: TDB
    Affects Versions: TDB 0.9.1
         Environment: Confirmed in Scala REPL
            Reporter: Svatopluk Šperka
            Priority: Minor


Decode method of NodecSSE should be the inverse function of encode but it's 
not. In case of URI, decode create NodeURI from the string obtained from the 
whole ByteBuffer passed to decode. This results in URL that is not equal to the 
original URI (it's longer as it contains nonsensical suffix). I've temporarily 
fixed that by trimming the decoded string before creating URI:
if ( str.startsWith("<") )
        {
            // Do directly.
            // (is it quicker?)
            str = str.trim(); // !!!!!!!!!!! this line inserted
            str = str.substring(1,str.length()-1) ;
            str = StrUtils.unescapeString(str) ;
            str = StrUtils.decodeHex(str, MarkerChar) ;
            return Node.createURI(str) ;
        }

I'm using NodecSSE to encode Nodes in order to transfer them through network.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to