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/10/17 19:56:02 UTC

[jira] [Created] (JENA-335) TDB handlign of hexBinary causes a Xerces-orinated exception.

Andy Seaborne created JENA-335:
----------------------------------

             Summary: TDB handlign of hexBinary causes a Xerces-orinated exception.
                 Key: JENA-335
                 URL: https://issues.apache.org/jira/browse/JENA-335
             Project: Apache Jena
          Issue Type: Bug
          Components: Jena, TDB
    Affects Versions: Jena 2.7.3, TDB 0.9.3
            Reporter: Andy Seaborne
            Assignee: Andy Seaborne


To reproduce in Jena core:

        Node n = Node.createLiteral("AB CD", XSDDatatype.XSDhexBinary) ;
        n.hashCode() ;



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 .
---- D.ttl
}

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 shoudl not happen.  Looks like Xerces is behaving differently because 
a bad float only causes a wanring (which is correct) and TDB continues.

The warning is right - the 




--
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

[jira] [Updated] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne updated JENA-335:
-------------------------------

          Component/s:     (was: TDB)
          Description: 
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 shoudl not happen.  Looks like Xerces is behaving differently because 
a bad float only causes a wanring (which is correct) and TDB continues.

The warning is right - the 




  was:
To reproduce in Jena core:

        Node n = Node.createLiteral("AB CD", XSDDatatype.XSDhexBinary) ;
        n.hashCode() ;



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 .
---- D.ttl
}

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 shoudl not happen.  Looks like Xerces is behaving differently because 
a bad float only causes a wanring (which is correct) and TDB continues.

The warning is right - the 




             Priority: Minor  (was: Major)
    Affects Version/s:     (was: TDB 0.9.3)
              Summary: Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.  (was: TDB handlign of hexBinary causes a Xerces-orinated exception.)
    
> 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
>
> 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 shoudl not happen.  Looks like Xerces is behaving differently because 
> a bad float only causes a wanring (which is correct) and TDB continues.
> The warning is right - the 

--
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

[jira] [Commented] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479060#comment-13479060 ] 

Hudson commented on JENA-335:
-----------------------------

Integrated in Jena__Development_Test #219 (See [https://builds.apache.org/job/Jena__Development_Test/219/])
    Tests to cover JENA-335 (Revision 1399689)

     Result = SUCCESS
andy : 
Files : 
* /jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/TestLiteralLabels.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

[jira] [Closed] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne closed JENA-335.
------------------------------

    
> 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

[jira] [Updated] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne updated JENA-335:
-------------------------------

    Description: 
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.





  was:
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 shoudl not happen.  Looks like Xerces is behaving differently because 
a bad float only causes a wanring (which is correct) and TDB continues.

The warning is right - the 




    
> 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
>
> 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

[jira] [Commented] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Commented] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481333#comment-13481333 ] 

Hudson commented on JENA-335:
-----------------------------

Integrated in Jena__Development_Test #235 (See [https://builds.apache.org/job/Jena__Development_Test/235/])
    JENA-335 : Make XSDbase64binary as registered handler for byte[] (this is the original behaviour, pre JENA-335).  Do not register XSDhexBinary. (Revision 1400849)

     Result = SUCCESS
andy : 
Files : 
* /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/XSDbinary.java
* /jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/datatypes/xsd/XSDhexBinary.java
* /jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/TestTypedLiterals.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

[jira] [Resolved] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne resolved JENA-335.
--------------------------------

       Resolution: Fixed
    Fix Version/s: Jena 2.7.4

hexBinary and base64Binary use a byte[] as their value.

The getHashCode function of the datatypes calls getValue()

    return getHashCode( (byte []) lit.getValue() )

They can not use the default implementation (in BaseDatatype) because that does value.hashCode when the literal is well-formed.  A Java byte[] is not value-equals - it's only object-identify-equals and different instances have different hashcodes.

Fix: 
Change each of hexBinary.getHashCode and base64Binary.getHashCode to be:

        if ( lit.isWellFormed() )
            return getHashCode( (byte []) lit.getValue() );
        else
            return lit.getLexicalForm().hashCode() ;

                
> 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

[jira] [Commented] (JENA-335) Node.hashCode of an illegal hexBinary causes a Xerces-originated exception.

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JENA-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492393#comment-13492393 ] 

Hudson commented on JENA-335:
-----------------------------

Integrated in Jena_Development_Test_Windows #6 (See [https://builds.apache.org/job/Jena_Development_Test_Windows/6/])
    JENA-335 : Make XSDbase64binary as registered handler for byte[] (this is the original behaviour, pre JENA-335).  Do not register XSDhexBinary. (Revision 1400849)

     Result = UNSTABLE
andy : 
Files : 
* /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/XSDbinary.java
* /jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/datatypes/xsd/XSDhexBinary.java
* /jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/TestTypedLiterals.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