You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/12/05 18:04:28 UTC

[jira] Updated: (HARMONY-2422) [classlib][luni] Can not set negative value to java.util.GregorianCalendar.ZONE_OFFSET

     [ http://issues.apache.org/jira/browse/HARMONY-2422?page=all ]

Paulex Yang updated HARMONY-2422:
---------------------------------

    Summary: [classlib][luni] Can not set negative value to java.util.GregorianCalendar.ZONE_OFFSET  (was: [luni] Can not set negative value to java.util.GregorianCalendar.ZONE_OFFSET)

> [classlib][luni] Can not set negative value to java.util.GregorianCalendar.ZONE_OFFSET
> --------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2422
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2422
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Artem Aliev
>
> If try to set negative value to ZONE_OFFSET field, it will be changed
> to some positive value. RI doesn't have such behavior.
> Probably compatibility issue.
> Test to reproduce:
> import junit.framework.TestCase;
> import java.util.GregorianCalendar;
> public class Test extends TestCase {
>         public void testcase() {
>                 GregorianCalendar gc = new GregorianCalendar(1, 1, 1);
>         System.out.println("gc = " + gc);
>         gc.set(GregorianCalendar.ZONE_OFFSET, -1);
>         System.out.println("gc.get(" + GregorianCalendar.ZONE_OFFSET + ") = " +
> gc.get(GregorianCalendar.ZONE_OFFSET));
>         assertTrue("gc.get(" + GregorianCalendar.ZONE_OFFSET + ") == -1",
> (gc.get(GregorianCalendar.ZONE_OFFSET) == -1));
>     }
> }
> Output on Harmony:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software
> Foundation or its licensors, as applicable.
> java version "1.5.0" 
> pre-alpha : not complete or compatible
> svn = rsvn: '.' is not a working copy, (Sep 20 2006), Windows/ia32/msvc 1310,
> release build
> http://incubator.apache.org/harmony
> .gc =
> java.util.GregorianCalendar[time=?,areFieldsSet=false,lenient=true,zone=java.util.SimpleTimeZone[id=Asia/Novosibirsk,offset=21600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=7200000,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA==?,YEAR==1,MONTH==1,WEEK_OF_YEAR==?,WEEK_OF_MONTH==?,DAY_OF_MONTH==1,DAY_OF_YEAR==?,DAY_OF_WEEK==?,DAY_OF_WEEK_IN_MONTH==?,AM_PM==?,HOUR==?,HOUR_OF_DAY=?,MINUTE==?,SECOND==?,MILLISECOND==?,ZONE_OFFSET==?,DST_OFFSET==?]
> gc.get(15) = 21600000
> F
> Time: 0.078
> There was 1 failure:
> 1) testcase(Test)junit.framework.AssertionFailedError: gc.get(15) == -1
>         at Test.testcase(Test.java:12)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> FAILURES!!!
> Tests run: 1,  Failures: 1,  Errors: 0
> res = 1
> Output on RI:
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> .gc =
> java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Novosibirsk",offset=21600000,dstSavings=3600000,useDaylight=true,transitions=119,lastRule=java.util.SimpleTimeZone[id=Asia/Novosibirsk,offset=21600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=7200000,startTimeMode=1,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=7200000,endTimeMode=1]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=1,MONTH=1,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=1,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=?,ZONE_OFFSET=?,DST_OFFSET=?]
> gc.get(15) = -1
> Time: 0.016
> OK (1 test)
> res = 0

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira