This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libgcj/4859: java.util.Timer class throw IllegalStateException on cancel()
- To: gcc-gnats at gcc dot gnu dot org
- Subject: libgcj/4859: java.util.Timer class throw IllegalStateException on cancel()
- From: crxop at tiscalinet dot it
- Date: 12 Nov 2001 18:09:15 -0000
- Reply-to: crxop at tiscalinet dot it
[Get raw message]
>Number: 4859
>Category: libgcj
>Synopsis: java.util.Timer class throw IllegalStateException on cancel()
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Nov 12 10:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: crxop@tiscalinet.it
>Release: libgcj-3.0
>Organization:
>Environment:
Debian Gnu/Linux woody gcc-3.0
>Description:
Folliwing code come from http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
With a change this call Timer.schedule(TimerTask,long,long)
instead of Timer.schedule(TimerTask,long).
Sun's JVM-1.4b3 works with this code (no exception).
kaffe-1.0.6 works (no exception).
import java.util.Timer;
import java.util.TimerTask;
public class Reminder {
Timer timer;
public Reminder(int seconds){
timer = new Timer();
timer.schedule(new RemindTask(),seconds*1000,1000);
}
class RemindTask extends TimerTask {
public void run(){
System.out.println("Ohh!");
timer.cancel();
}
}
public static void main(String[] args){
System.out.println("About to schedule task.");
new Reminder(5);
System.out.println("Hello world! ...\n");
}
}
Error: .. try
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: