[
https://issues.apache.org/jira/browse/JENA-791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14149157#comment-14149157
]
ASF subversion and git services commented on JENA-791:
------------------------------------------------------
Commit e657cf53861feb377f2289bb2caf53c2a1e5ee28 in jena's branch
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=e657cf5 ]
JENA-791 : check xsd:Long validity in nodeToLong
> 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)