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

NodeId does not handle BigDecimal correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 2.11.2
    • Jena 2.12.0
    • TDB
    • None

    Description

      There is an bug in NodeId. extract(NodeId nodeId)

      case DECIMAL:
                   {
                       BigDecimal d = DecimalNode.unpackAsBigDecimal(v) ;
                      String x = d.toEngineeringString() ;
                       return NodeFactory.createLiteral(x, null, XSDDatatype.XSDdecimal) ;
                   }
      

      NodeFactory.createLiteral is expecting that x will be valid lexical form, while d.toEngineeringString() is not.

      It should be:

      case DECIMAL:
                  {
                      BigDecimal d = DecimalNode.unpackAsBigDecimal(v) ;
                      String x = d.toPlainString() ;
                      return NodeFactory.createLiteral(x, null, XSDDatatype.XSDdecimal) ;
                  }
      

      Attachments

        1. JENA-720.patch
          1 kB
          Marek Kowalczyk

        Activity

          People

            andy Andy Seaborne
            mortern Marek Kowalczyk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: