[
https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479039#comment-13479039
]
Hudson commented on JENA-335:
-----------------------------
Integrated in Jena__Development_Test #217 (See
[https://builds.apache.org/job/Jena__Development_Test/217/])
JENA-335 : Make getHashCode check the "wellformed" flag of the
LiteralLabel. (Revision 1399675)
Result = SUCCESS
andy :
Files :
*
/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/datatypes/BaseDatatype.java
*
/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/datatypes/xsd/XSDbase64Binary.java
*
/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/datatypes/xsd/XSDhexBinary.java
> Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.
> ---------------------------------------------------------------------------
>
> Key: JENA-335
> URL: https://issues.apache.org/jira/browse/JENA-335
> Project: Apache Jena
> Issue Type: Bug
> Components: Jena
> Affects Versions: Jena 2.7.3
> Reporter: Andy Seaborne
> Assignee: Andy Seaborne
> Priority: Minor
> Fix For: Jena 2.7.4
>
>
> To reproduce in Jena core:
> Node n = Node.createLiteral("AB CD", XSDDatatype.XSDhexBinary) ;
> n.hashCode() ;
> Effect
> A bad lexical form for hexBinary causes problems for TDB:
> Example data:
> ---- D.ttl
> {{
> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
> @prefix : <http://example/> .
> :s :p "AB CD"^^xsd:hexBinary .
> ## :s :p "AB CD"^^xsd:float .
> }}
> tdbloader --loc DB D.ttl ==>
> WARN [line: 4, col: 7 ] Lexical form 'AB CD' not valid for datatype
> http://www.w3.org/2001/XMLSchema#hexBinary
> http://example/s http://example/p "AB
> CD"^^http://www.w3.org/2001/XMLSchema#hexBinary
> com.hp.hpl.jena.datatypes.DatatypeFormatException: Lexical form 'AB CD' is
> not a legal instance of Datatype[http://www.w3.org/2001/XMLSchema#hexBinary]
> Lexical form 'AB CD' is not a legal instance of
> Datatype[http://www.w3.org/2001/XMLSchema#hexBinary] during parse
> -org.apache.xerces.impl.dv.InvalidDatatypeValueException:
> cvc-datatype-valid.1.2.1: 'AB CD' is not a valid value for 'hexBinary'.
> at
> com.hp.hpl.jena.graph.impl.LiteralLabelImpl.getValue(LiteralLabelImpl.java:326)
> at
> com.hp.hpl.jena.datatypes.xsd.XSDhexBinary.getHashCode(XSDhexBinary.java:81)
> at
> com.hp.hpl.jena.graph.impl.LiteralLabelImpl.hashCode(LiteralLabelImpl.java:448)
> at com.hp.hpl.jena.graph.Node.hashCode(Node.java:331)
> at java.util.HashMap.hash(HashMap.java:351)
> The WARN is right - the exception should not happen. Looks like Xerces is
> behaving differently because
> a bad float only causes a wanring (which is correct) and TDB continues.
--
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