Eugene Tenkaev created JENA-791:
-----------------------------------
Summary: Wrong check in method nodeToLong of class
NodeFactoryExtra.
Key: JENA-791
URL: https://issues.apache.org/jira/browse/JENA-791
Project: Apache Jena
Issue Type: Bug
Components: ARQ
Environment: My current commit is:
913b2257e6e7a69294e8d64b5e0ec2f6d17347dc
Reporter: Eugene Tenkaev
Wrong check for long type in method nodeToLong of class NodeFactoryExtra
jena-arq/src/main/java/com/hp/hpl/jena/sparql/util/NodeFactoryExtra.java
{code:title=NodeFactoryExtra.java|borderStyle=solid}
public static long nodeToLong(Node node)
{
LiteralLabel lit = node.getLiteral() ;
if ( ! XSDDatatype.XSDinteger.isValidLiteral(lit) )
return Long.MIN_VALUE ;
long i = ((Number)lit.getValue()).longValue() ;
return i ;
}
{code}
I think more appropriate is:
{code:title=NodeFactoryExtra.java|borderStyle=solid}
public static long nodeToLong(Node node)
{
LiteralLabel lit = node.getLiteral() ;
if ( ! XSDDatatype.XSDlong.isValidLiteral(lit) )
return Long.MIN_VALUE ;
long i = ((Number)lit.getValue()).longValue() ;
return i ;
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)