[ 
https://issues.apache.org/jira/browse/JENA-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17096701#comment-17096701
 ] 

Gilles Sérasset commented on JENA-1892:
---------------------------------------

I have : 
{code:java}
java.lang.StringIndexOutOfBoundsException: String index out of range: 71
 at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47) at 
java.base/java.lang.String.charAt(String.java:693) at 
org.apache.jena.atlas.lib.StrUtils.decodeHex(StrUtils.java:212) at 
org.apache.jena.tdb.store.nodetable.NodecSSE.decode(NodecSSE.java:121) at 
org.apache.jena.tdb.lib.NodeLib.decode(NodeLib.java:120) at 
org.apache.jena.tdb.lib.NodeLib.fetchDecode(NodeLib.java:97) at 
org.apache.jena.tdb.store.nodetable.NodeTableNative.readNodeFromTable(NodeTableNative.java:182)
 at 
org.apache.jena.tdb.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:108)
 at 
org.apache.jena.tdb.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:67)
 at 
org.apache.jena.tdb.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:128)
 at 
org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:82)
 at 
org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:50)
 at 
org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:67)
 at org.apache.jena.tdb.lib.TupleLib.quad(TupleLib.java:126) at 
org.apache.jena.tdb.lib.TupleLib.quad(TupleLib.java:120) at 
org.apache.jena.tdb.lib.TupleLib.lambda$convertToQuads$3(TupleLib.java:59) at 
org.apache.jena.atlas.iterator.Iter$2.next(Iter.java:352) at 
org.apache.jena.atlas.iterator.Iter$2.next(Iter.java:352) at 
org.apache.jena.atlas.iterator.Iter.next(Iter.java:1072) at 
org.apache.jena.util.iterator.WrappedIterator.next(WrappedIterator.java:94) at 
org.apache.jena.riot.writer.TurtleShell$ShellGraph.findBNodesSyntax1(TurtleShell.java:385)
 at 
org.apache.jena.riot.writer.TurtleShell$ShellGraph.<init>(TurtleShell.java:200) 
at 
org.apache.jena.riot.writer.TurtleShell$ShellGraph.<init>(TurtleShell.java:149) 
at org.apache.jena.riot.writer.TurtleShell.writeGraphTTL(TurtleShell.java:134) 
at 
org.apache.jena.riot.writer.TurtleWriter$TurtleWriter$.write(TurtleWriter.java:44)
 at 
org.apache.jena.riot.writer.TurtleWriter$TurtleWriter$.access$000(TurtleWriter.java:34)
 at org.apache.jena.riot.writer.TurtleWriter.output(TurtleWriter.java:31) at 
org.apache.jena.riot.writer.TurtleWriterBase.output$(TurtleWriterBase.java:54) 
at org.apache.jena.riot.writer.TurtleWriterBase.write(TurtleWriterBase.java:48) 
at org.apache.jena.riot.RDFWriter.write$(RDFWriter.java:202) at 
org.apache.jena.riot.RDFWriter.output(RDFWriter.java:161) at 
org.apache.jena.riot.RDFWriter.output(RDFWriter.java:112) at 
org.apache.jena.riot.RDFWriterBuilder.output(RDFWriterBuilder.java:205) at 
org.apache.jena.riot.adapters.RDFWriterRIOT.write(RDFWriterRIOT.java:86) at 
org.apache.jena.rdf.model.impl.ModelCom.write(ModelCom.java:379) at 
org.getalp.dbnary.JenaIRITest.insertIRIAndDump(JenaIRITest.java:41) at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566) at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
 at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
 at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
 at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at 
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at 
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at 
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at 
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at 
org.junit.runners.ParentRunner.run(ParentRunner.java:363) at 
org.junit.runner.JUnitCore.run(JUnitCore.java:137) at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
 at 
com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
 at 
com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
 at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58){code}

> Non ASCII chars in URIs leads to StringIndexOutOfBoundException
> ---------------------------------------------------------------
>
>                 Key: JENA-1892
>                 URL: https://issues.apache.org/jira/browse/JENA-1892
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Base, TDB
>    Affects Versions: Jena 3.14.0
>            Reporter: Gilles Sérasset
>            Priority: Major
>         Attachments: JenaIRITest.java
>
>
> When a URI uses a non ASCII char, the StrUtils.decodeHex() method will 
> incorrectly decode the URI when stored in TDB and eventually throw a 
> StringIndexOutOfBoundException.
> In the attached JUnit class is a method which will raise the exception.
> Note that if the dataset is not closed and reopened (forcing TDB to store the 
> data on disk and retrieve it), the code works correctly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to