From dev-return-9826-archive-asf-public=cust-asf.ponee.io@olingo.apache.org Thu Sep 20 13:08:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 20475180671 for ; Thu, 20 Sep 2018 13:08:04 +0200 (CEST) Received: (qmail 99552 invoked by uid 500); 20 Sep 2018 11:08:04 -0000 Mailing-List: contact dev-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list dev@olingo.apache.org Received: (qmail 99541 invoked by uid 99); 20 Sep 2018 11:08:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2018 11:08:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C46861A22A1 for ; Thu, 20 Sep 2018 11:08:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id cmxHb4NVGjn1 for ; Thu, 20 Sep 2018 11:08:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id F3BA05F56B for ; Thu, 20 Sep 2018 11:08:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3A6E3E2072 for ; Thu, 20 Sep 2018 11:08:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6ED6523FA2 for ; Thu, 20 Sep 2018 11:08:00 +0000 (UTC) Date: Thu, 20 Sep 2018 11:08:00 +0000 (UTC) From: "Mike Roberts (JIRA)" To: dev@olingo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (OLINGO-1290) Numeric values with more than 17 digits of precision cause error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Mike Roberts created OLINGO-1290: ------------------------------------ Summary: Numeric values with more than 17 digits of precision cause error Key: OLINGO-1290 URL: https://issues.apache.org/jira/browse/OLINGO-1290 Project: Olingo Issue Type: Bug Components: odata4-client, odata4-commons Affects Versions: (Java) V4 4.5.0 Reporter: Mike Roberts The IBM Cognos TM1 (OData compliant) REST API can return values such as this ... "@odata.context": "../$metadata#Cellsets('l8-ZO2wMAIABAAAg')/Cells(Value)", "value": [{ "Value": 70 }, { "Value": -0.043099999999995475 }] This causes the following error ... 2018-09-08 07:41:30,214 ERROR o.a.o.c.a.d.ClientEntitySetIterator [main] Error retrieving entities from EntitySet ... Caused by: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The literal '-0.043099999999995475' has illegal content. at org.apache.olingo.commons.core.edm.primitivetype.EdmDouble.internalValueOfString(EdmDouble.java:80) ~[org.apache.olingo-odata-commons-core-4.5.0.jar:?] I investigated further and noted that the code uses a pattern ... private static final Pattern PATTERN = Pattern.compile( "(?:\\+|-)?\\p\{Digit}{1,17}(?:\\.\\p\{Digit}{1,17})?(?:(?:E|e)(?:\\+|-)?\\p\{Digit}{1,3})?"); .. which is the cause of this error because we have 18 digits after the decimal point. The TM1 architect contacted [~RalfHandl] who said ... "Olingo is too restrictive here, OData does not add any restrictions on representation of numbers on top of the JSON RFC." -- This message was sent by Atlassian JIRA (v7.6.3#76005)