[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-30 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14982599#comment-14982599
 ] 

Ramesh Reddy commented on OLINGO-793:
-

{quote}
Either we take the data and format it according to the facets and accept data 
loss or we just take the value and put it in the payload without evaluation the 
facets. Here I am not sure which way to go.
{quote}

IMO, if facet values are default and configuration option is set, do not 
validate for facet restrictions, just send pass original values without any 
data loss.

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-30 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14982251#comment-14982251
 ] 

Christian Amend commented on OLINGO-793:


Yes I had the same hope.

As for the configuration option I think there are two parts we need to think 
about.

First is the deserialization of payloads which are send by a client. Currently 
we throw an exception if the data does not match the facets which will result 
in a 400 Bad Request. Here we could provide a switch which deserializes the 
data regardless of the facet validity. I would not go as far as allowing 
different type kinds here. So even if someone turns the switch on a int value 
still hast to be an int value and not a string. Default here would be the facet 
validation is happening until you set the switch manually. Frameworks of 
specific server implementations could change this default.

Second is the serialization of data which a server sends to a client. Again 
currently we throw an exception if the application provides data which does not 
conform to the facets. This is the default behaviour I would keep to make sure 
that services provide valid and complete data. Here we introduce a 
configuration option to change the behaviour as well.
Either we take the data and format it according to the facets and accept data 
loss or we just take the value and put it in the payload without evaluation the 
facets. Here I am not sure which way to go. WDYT?


>From a technical point of view the best place to introduce this swith is at 
>the Options class in the serializer methods in my opinion.

Best Regards,
Christian

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-30 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14982250#comment-14982250
 ] 

Christian Amend commented on OLINGO-793:


Yes I had the same hope.

As for the configuration option I think there are two parts we need to think 
about.

First is the deserialization of payloads which are send by a client. Currently 
we throw an exception if the data does not match the facets which will result 
in a 400 Bad Request. Here we could provide a switch which deserializes the 
data regardless of the facet validity. I would not go as far as allowing 
different type kinds here. So even if someone turns the switch on a int value 
still hast to be an int value and not a string. Default here would be the facet 
validation is happening until you set the switch manually. Frameworks of 
specific server implementations could change this default.

Second is the serialization of data which a server sends to a client. Again 
currently we throw an exception if the application provides data which does not 
conform to the facets. This is the default behaviour I would keep to make sure 
that services provide valid and complete data. Here we introduce a 
configuration option to change the behaviour as well.
Either we take the data and format it according to the facets and accept data 
loss or we just take the value and put it in the payload without evaluation the 
facets. Here I am not sure which way to go. WDYT?


>From a technical point of view the best place to introduce this swith is at 
>the Options class in the serializer methods in my opinion.

Best Regards,
Christian

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-28 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14979072#comment-14979072
 ] 

Ramesh Reddy commented on OLINGO-793:
-

Christian, I can settle for configuration option ;)

The OData spec specifies the "variable" keyword for "scale" to avoid this, but 
defaults to 0, and for precision also it defaults to 0. What is lacking from 
the links Ralf provided above is they do not define the behavior/restrictions 
when they are specified as defaults. I would have hoped the OData spec 
defaulted to "variable" in both situations to avoid the strict interpretation 
by frameworks.

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-28 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978572#comment-14978572
 ] 

Christian Amend commented on OLINGO-793:


Hi Ramesh,

if I understand your question correctly then your expected behaviour would be 
that data which does not conform with the facets will still result in a string 
with the precision cut off. So for example my data contains a date (format 
hh.mm.ss.msms) 12.12.12.42 the resulting string would be "12.12.12" since the 
default is 0 precision. There would be no exception involved.

This is a behaviour I do not think is good as we would change the data before 
sending it to a client. So the server thinks he wrote valid and complete data 
which is not the case as it lost precision.

So in my opinion we can make this configurable. Services which care about 
precision will have the current behaviour as it is to not lose data. Other 
serivces might not care about such strict guidelines and we could just print 
the string without an exception. If you see other options please let me know I 
would be very grateful. This topic has been nagging me since the beginning 
since for every other facet "null" just means unlimited in the specification. 
This also makes it very hard for users to know why there is an exception in 
this case.

Best Regards,
Christian




> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-28 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978517#comment-14978517
 ] 

Ramesh Reddy commented on OLINGO-793:
-

Christian, second method may confuse users IMO. What is your comment about my 
question from above
{quote}
However, the method "internalValueToString" should not throw an exception, as 
that used for marshaling the object to string from, as it should just format it 
according to the facets defined on the type, not try to enforce it.
{quote}

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-28 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978500#comment-14978500
 ] 

Christian Amend commented on OLINGO-793:


Hi Ramesh,

but not specified is equal to 0 as per specification.
Also a primitive type as such does not have facets, a property does. This is 
why the method at the type has these parameters. And if you put "null" as a 
facet we will take the default which would amount to 0 for temporal proerties.

Should we provide a second method which will jsut transform the value without 
validating any facets?

Best Regards,
Christian

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-22 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14969216#comment-14969216
 ] 

Ramesh Reddy commented on OLINGO-793:
-

Scale default I can understand, as per the enforcement of Precision default to 
0 does not make sense to me. It is easy enough to define some valid defaults in 
my case.

I think my real issue here is, when Precision is not specified on temporal 
values, I can understand EdmDateTimeOffset class's "internalValueOfString" 
throwing exception while checking for facet constrains. This typically being 
used for parsing input in the string from from user. However, the method 
"internalValueToString" should not throw an exception, as that used for 
marshaling the object to string from, as it should just format it according to 
the facets defined on the type, not try to enforce it.

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-22 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968833#comment-14968833
 ] 

Christian Amend commented on OLINGO-793:


Hi,

based on Ralfs input I would not like to deviate from the specification just 
for convenience sake. WDYT?

BEst Regards,
Christian

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Ralf Handl (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949948#comment-14949948
 ] 

Ralf Handl commented on OLINGO-793:
---

Hi Ramesh,

The definition of Scale for decimals originates from [Decimal-Scale], which 
defines the default scale to be 0.
Instead of breaking with this tradition we introduced Scale="variable" to 
indicate an unknown/variable number of fractional digits. If you combine this 
with unspecified Precision, you actually have no restriction on the decimal 
data that property can contain.

The Precision of temporal properties is similar to Scale for decimals, so for 
consistency we defined a default of 0, too.

Changing the default of Scale to variable/unspecified and doing the same for 
the Precision of temporal values would have been another option, and the next 
logical step would have been to use Precision consistently for the number of 
fractional digits across all data types, thus inverting its meaning for decimal 
values, and using MaxLength instead for the length of the decimal mantissa. But 
that seemed a rather radical change, although it would have been the most 
consistent approach :-)

Thanks!
--Ralf


[Decimal-Scale] https://msdn.microsoft.com/en-us/library/dd541612.aspx
[Decimal-Precision] https://msdn.microsoft.com/en-us/library/dd541430.aspx
[DateTimeOffset-Precision] 
https://msdn.microsoft.com/en-us/library/dd541481.aspx

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Ralf Handl (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949947#comment-14949947
 ] 

Ralf Handl commented on OLINGO-793:
---

Hi Ramesh,

The definition of Scale for decimals originates from [Decimal-Scale], which 
defines the default scale to be 0.
Instead of breaking with this tradition we introduced Scale="variable" to 
indicate an unknown/variable number of fractional digits. If you combine this 
with unspecified Precision, you actually have no restriction on the decimal 
data that property can contain.

The Precision of temporal properties is similar to Scale for decimals, so for 
consistency we defined a default of 0, too.

Changing the default of Scale to variable/unspecified and doing the same for 
the Precision of temporal values would have been another option, and the next 
logical step would have been to use Precision consistently for the number of 
fractional digits across all data types, thus inverting its meaning for decimal 
values, and using MaxLength instead for the length of the decimal mantissa. But 
that seemed a rather radical change, although it would have been the most 
consistent approach :-)

Thanks!
--Ralf


[Decimal-Scale] https://msdn.microsoft.com/en-us/library/dd541612.aspx
[Decimal-Precision] https://msdn.microsoft.com/en-us/library/dd541430.aspx
[DateTimeOffset-Precision] 
https://msdn.microsoft.com/en-us/library/dd541481.aspx

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949381#comment-14949381
 ] 

Ramesh Reddy commented on OLINGO-793:
-

Kind of confused ;) I keep reading [1] and I feel "precision" and "scale" 
attributes are setup to different standard of enforcement than, say MaxLength, 
just because they have default value of "0".  BTW this equally applies to 
Decimal. May be [~RalfHandl] can clarify bit.

from [1] 6.2.3 the text reads as
"For a decimal property the value of this attribute specifies the maximum 
number of digits allowed in the property’s value; it MUST be a positive 
integer. *If no value is specified, the decimal property has unspecified 
precision*.
For a temporal property the value of this attribute specifies the number of 
decimal places allowed in the seconds portion of the property’s value; it MUST 
be a non-negative integer between zero and twelve. *If no value is specified, 
the temporal property has a precision of zero.*"

IMO when no value is specified you should not restrict the data with 
constraints, rather allow the widest possible. The issue I am having is, I have 
no control over the data the coming in, that is another reason those properties 
are defined with no such facets to begin with.

[1] 
http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397954

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948816#comment-14948816
 ] 

Christian Amend commented on OLINGO-793:


Because if we ignore the fractional seconds from the data during serialization 
we lose precision. Basically the one calling the serialization should be sure 
to give us only data that fits the metadata he definied. I personally think 
that losing data precision is worth an exception. WDYT?

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948760#comment-14948760
 ] 

Ramesh Reddy commented on OLINGO-793:
-

Then that means before I pass in the timestamp instance for serialization, I 
would need to modify the "nanos" value to zero to avoid the 
IllegalArgumentException. Why not avoid calling "appendFractionalSeconds" when 
precision == null  or zero ?

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948683#comment-14948683
 ] 

Christian Amend commented on OLINGO-793:


Hi Ramesh,

that means that you tried to convert a value which had fractional seconds 
although the default precision does not allow any. What I meant is that the 
exception is correct in this case. See here: 
https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L244
 The evaluation is only called if your data does contain unallowed fractional 
seconds.

Best Regards,
Chrsitian

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Ramesh Reddy (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948649#comment-14948649
 ] 

Ramesh Reddy commented on OLINGO-793:
-

When I did not specify the precision, I was left with IllegalArgumentException, 
I guess that should be avoided when "precision == null"?


> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OLINGO-793) Precision on EdmDateTimeOffset should be optional

2015-10-08 Thread Christian Amend (JIRA)

[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948473#comment-14948473
 ] 

Christian Amend commented on OLINGO-793:


Hi Ramesh,

please be aware that although the precision is optional for temporal types the 
default is zero : ". If no value is specified, the temporal property has a 
precision of zero." 
(http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957)

So the expcetion here is correct as the code is only executed for fractional 
seconds bigger than 0. 

Best Regards,
Christian

> Precision on EdmDateTimeOffset should be optional
> -
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
>  Issue Type: Bug
>  Components: odata4-commons
>Affects Versions: (Java) V4 4.0.0
>Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional 
> facet that can be defined. However the code [2] fails with 
> IllegalArgumentException is it found to be null.
> [1] 
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2] 
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)