public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/7786: TimeZone.getDSTSavings() from JDK1.4 not implemented
@ 2002-08-30 21:06 jmr
  0 siblings, 0 replies; 2+ messages in thread
From: jmr @ 2002-08-30 21:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7786
>Category:       libgcj
>Synopsis:       TimeZone.getDSTSavings() from JDK1.4 not implemented
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 30 20:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jesse Rosenstock
>Release:        3.3 20020828 (experimental)
>Organization:
>Environment:
System: Linux churchill 2.4.3-12 #1 Fri Jun 8 15:05:56 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/home/user/jmr/app/gcc --enable-langs=c++,java --enable-shared --enable-threads=posix --with-as=/home/user/jmr/app/binutils/bin/as --with-ld=/home/user/jmr/app/binutils/bin/ld : (reconfigured) 
>Description:
	TimeZone.getDSTSavings() was added in JDK1.4 and isn't implemented.
>How-To-Repeat:
; cat DSTTest.java
import java.util.Date;
import java.util.TimeZone;

public class DSTTest extends TimeZone {

    private final boolean useDST;

    public DSTTest(boolean useDST) {
        this.useDST = useDST;
    }

    public int getOffset
        (int era, int year, int month,
         int day, int dayOfWeek, int milliseconds) { throw new Error(); }
    public int getRawOffset() { throw new Error(); }
    public void setRawOffset(int offsetMillis) { throw new Error(); }
    public boolean useDaylightTime() { return useDST; }
    public boolean inDaylightTime(Date date) { throw new Error(); }

    public static void main(String[] args) {
        System.err.println(new DSTTest(true).getDSTSavings());
        System.err.println(new DSTTest(false).getDSTSavings());
    }
}

; javac DSTTest.java && java DSTTest
3600000
0

; gcj DSTTest.java --main=DSTTest
DSTTest.java: In class `DSTTest':
DSTTest.java: In method `DSTTest.main(java.lang.String[])':
DSTTest.java:21: error: Can't find method `getDSTSavings()' in type `DSTTest'.
           System.err.println(new DSTTest(true).getDSTSavings());
                                                ^
DSTTest.java:22: error: Can't find method `getDSTSavings()' in type `DSTTest'.
           System.err.println(new DSTTest(false).getDSTSavings());
                                                 ^
2 errors

But after the below patch:
; gcj DSTTest.java --main=DSTTest && ./a.out
3600000
0

>Fix:
*** TimeZone.java       13 May 2002 20:10:36 -0000      1.14
--- TimeZone.java       31 Aug 2002 03:29:28 -0000
***************
*** 961,966 ****
--- 961,982 ----
    public abstract boolean inDaylightTime(Date date);
  
    /**
+    * Gets the daylight savings offset.  This is a positive offset in
+    * milliseconds with respect to standard time.  Typically this
+    * is one hour, but for some time zones this may be half an our.
+    * <p>The default implementation returns 3600000 milliseconds
+    * (one hour) if the time zone uses daylight savings time
+    * (as specified by {@link #useDaylightTime()}), otherwise
+    * it returns 0.
+    * @return the daylight savings offset in milliseconds.
+    * @since 1.4
+    */
+   public int getDSTSavings ()
+   {
+     return useDaylightTime () ? 3600000 : 0;
+   }
+ 
+   /**
     * Gets the TimeZone for the given ID.
     * @param ID the time zone identifier.
     * @return The time zone for the identifier or GMT, if no such time

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libgcj/7786: TimeZone.getDSTSavings() from JDK1.4 not implemented
@ 2002-09-25 14:10 tromey
  0 siblings, 0 replies; 2+ messages in thread
From: tromey @ 2002-09-25 14:10 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, java-prs, jmr, nobody, tromey

Synopsis: TimeZone.getDSTSavings() from JDK1.4 not implemented

Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Wed Sep 25 14:10:56 2002
Responsible-Changed-Why:
    I'm handling the adminstrivia
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Wed Sep 25 14:10:56 2002
State-Changed-Why:
    This looks fine.  I checked it in.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7786


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-25 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-30 21:06 libgcj/7786: TimeZone.getDSTSavings() from JDK1.4 not implemented jmr
2002-09-25 14:10 tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).