Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-791

Wrong check in method nodeToLong of class NodeFactoryExtra.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • Jena 2.12.1
    • ARQ
    • None
    • My current commit is: 913b2257e6e7a69294e8d64b5e0ec2f6d17347dc

    Description

      Wrong check for long type in method nodeToLong of class NodeFactoryExtra jena-arq/src/main/java/com/hp/hpl/jena/sparql/util/NodeFactoryExtra.java

      NodeFactoryExtra.java
          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 ;
          }
      

      I think more appropriate is:

      NodeFactoryExtra.java
          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 ;
          }
      

      Attachments

        Activity

          People

            andy Andy Seaborne
            Hronom Yevhen Tienkaiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: