Re: Possible bug in PGInterval class

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Possible bug in PGInterval class
Дата
Msg-id alpine.BSO.2.00.0909011954290.14550@leary.csoft.net
обсуждение исходный текст
Ответ на Possible bug in PGInterval class  (Ľubomír Varga <luvar@plaintext.sk>)
Ответы Re: Possible bug in PGInterval class  (Oliver Jowett <oliver@opencloud.com>)
Re: Possible bug in PGInterval class  (Ľubomír Varga <luvar@plaintext.sk>)
Список pgsql-jdbc

On Mon, 31 Aug 2009, ?ubom?r Varga wrote:

> I have noticed imho bad behaviour of add methods for PGInterval class.
> (org.postgresql.util.PGInterval)
>
> First is unlogical adding sum to parameter and not to object on which is
> method invoked. (this is also writen in javadoc, so I accept it)

This is to be similar to the add(Date) and add(Calendar) functions.  For
them you wan't to add the interval to the passed object.

> Second, critical for me, is to not using modulo in addition. So if you
> add 55 minutes to 55 minutes, you get 110 minutes instead of 1 hour and
> 50 minutes.

For minutes and hours, it would be OK, but when rolling hours into days or
days into months, context is needed to know if you are near a daylight
saving time change or how many days are in the month.  For this reason we
don't manipulate the values and leave them as is.

Kris Jurka

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Ľubomír Varga
Дата:
Сообщение: Possible bug in PGInterval class
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Possible bug in PGInterval class