Josef Bodnár created WICKET-6003:
------------------------------------

             Summary: ClientProperties.getTimeZone() is not correctly 
calculated from client's time zone offset
                 Key: WICKET-6003
                 URL: https://issues.apache.org/jira/browse/WICKET-6003
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.5.0
         Environment: Java 8, Tomcat 8
            Reporter: Josef Bodnár
            Priority: Minor


Hello, my first issue here, so I apologize for any false alarms.

In org.apache.wicket.protocol.http.ClientProperties.getTimeZone() a timeZone is 
calculated from getUtcOffset() method.

The getUtcOffset() method in javadoc specifies, that the returned offset is in 
minutes. In my case, it returns "120" which corresponds to 2hrs shift from UTC 
(CET).

The getTimeZone() then calculates the timeZone in two ways, based on the offset 
containing a dot.

The "else" branch applies in my case since the offset does not contains a dot.

There the timeZone is calculated on this line:

timeZone = TimeZone.getTimeZone("GMT" + ((offset > 0) ? "+" : "-") + utc);
In my case it creates: "GMT+120".
Which creates a following timeZone object:
sun.util.calendar.ZoneInfo[id="GMT+01:20",offset=4800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]

This is obviously wrong, since it should be GMT+2:00, offset=7200000.

I think the code in both cases of the "if" block does not correspond to the 
contract of getUtcOffset().

I checked later versions of wicket for fix, but did not find any change in 
versions 6.20 and 7.

Is this observation correct?

Thank you for a great framework.



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

Reply via email to