You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2012/11/17 18:52:12 UTC

[jira] [Resolved] (JENA-347) NodecSSE decode problem

     [ https://issues.apache.org/jira/browse/JENA-347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne resolved JENA-347.
--------------------------------

    Resolution: Not A Problem
      Assignee: Andy Seaborne
    
> 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, TDB 0.9.4
>         Environment: Confirmed in Scala 2.9.2 REPL
>            Reporter: Svatopluk Šperka
>            Assignee: Andy Seaborne
>            Priority: Minor
>         Attachments: NodecSSEProof.scala
>
>
> 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